新增部分接口合同授权码

This commit is contained in:
2025-08-04 22:02:09 +08:00
parent f482f0a6e8
commit 3f4c3086f3
6 changed files with 57 additions and 21 deletions

View File

@@ -147,10 +147,10 @@ func registerAllProcessors(combService *comb.CombService) {
var RequestProcessors map[string]processors.ProcessorFunc
// PreprocessRequestApi 调用指定的请求处理函数
func (a *ApiRequestService) PreprocessRequestApi(ctx context.Context, apiCode string, params []byte, options *commands.ApiCallOptions) ([]byte, error) {
func (a *ApiRequestService) PreprocessRequestApi(ctx context.Context, apiCode string, params []byte, options *commands.ApiCallOptions, callContext *processors.CallContext) ([]byte, error) {
if processor, exists := RequestProcessors[apiCode]; exists {
// 设置Options到依赖容器
deps := a.processorDeps.WithOptions(options)
// 设置Options和CallContext到依赖容器
deps := a.processorDeps.WithOptions(options).WithCallContext(callContext)
return processor(ctx, params, deps)
}
return nil, fmt.Errorf("%s: 未找到处理器: %s", ErrSystem, apiCode)