refactor: SimApiRequestDelegateFactory/SimApiResultWriter 从 extensions 移到 helpers
- 包 simapi.extensions → simapi.helpers - 新增 interfaces/IBindRequestContext 接口切断 helpers↔controllers 循环依赖 (工厂只依赖接口,不再依赖 SimApiBaseController) - SimApiAuth 注解类与 helpers.SimApiAuth 同名冲突,用 import 别名 SimApiAuthAttribute 解决
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Copyright (c) 2025 SimcuTeam. All rights reserved.
|
||||
* 移植自 C# 项目 SimApi(E:\simcu\simapi-net),遵循 MIT 许可证。
|
||||
* Interfaces/IBindRequestContext:请求上下文绑定接口。
|
||||
*
|
||||
* 说明:SimApiBaseController 实现本接口,由 SimApiRequestDelegateFactory(simapi.helpers)
|
||||
* 在创建控制器后注入当前 HttpContext。放在 interfaces 包是为了避免
|
||||
* simapi.helpers → simapi.controllers 的循环依赖(controllers 依赖 helpers 的 SimApiError/SimApiAuth/SimApiUtil)。
|
||||
*/
|
||||
|
||||
package simapi.interfaces
|
||||
|
||||
import soulsoft_web_http.*
|
||||
|
||||
/**
|
||||
* 请求上下文绑定接口:控制器实现后,框架在派发请求时把当前 HttpContext 注入。
|
||||
*/
|
||||
public interface IBindRequestContext {
|
||||
/**
|
||||
* 绑定当前请求上下文。
|
||||
* @param context 当前请求的 HttpContext。
|
||||
*/
|
||||
func bindRequestContext(context: HttpContext): Unit
|
||||
}
|
||||
Reference in New Issue
Block a user