feat(phase1): core/ 基础设施迁移,旧路径改垫片

- core/: database/redis_client/jwt/password/response/exceptions/security/logger/deps/middleware/app
- create_app 迁移到 core/app.py,中间件注册顺序与异常处理器原样保留
- extensions/ utils/ apps/ 旧文件全部改为 re-export 垫片,import 路径保持兼容
- 新增 core 单元测试(jwt/password/response/request 共 12 个)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Claude
2026-08-07 10:02:01 +08:00
co-authored by Claude
parent fe1d191e55
commit db4ee85db5
22 changed files with 1476 additions and 364 deletions
+27
View File
@@ -0,0 +1,27 @@
# +======================================================================
# | DjangoAdmin 企业数字化开发平台 [ 赋能开发者,助力企业发展 ]
# +----------------------------------------------------------------------
# | Copyright (c) 2021-2026 一米阳光团队 版权所有
# | 开源协议: Apache-2.0
# +======================================================================
# 由 extensions/exception.py 迁移而来。
"""统一异常类型:登录认证异常 + 业务异常。"""
class AuthorizationException(Exception):
"""登录认证异常,由 login_required 中间件抛出。"""
def __init__(self, code: int, msg: str):
super().__init__(msg)
self.code = code
self.msg = msg
class BusinessException(Exception):
"""业务异常,业务代码可主动抛出。"""
def __init__(self, code: int = 1, msg: str = ""):
super().__init__(msg)
self.code = code
self.msg = msg