feat: 升级hook处理逻辑

This commit is contained in:
2025-11-01 17:16:11 +08:00
parent 954f6fef8a
commit d4052bcc4f
8 changed files with 95 additions and 42 deletions

View File

@ -109,6 +109,8 @@ func (c controller) methodConfig(reflectMethod reflect.Method) (cfg UriConfig, n
cfg.TagList = strings.Split(metaField.Tag.Get(TagNameUriTag), ",")
// 解析第一个返回值, 要求必须是结构体或者是map
outputStrictModel := metaField.Tag.Get(TagNameOutputStrict)
hookSync := strings.ToLower(metaField.Tag.Get(TagNameHookSync))
cfg.HookSync = hookSync == "1" || hookSync == "true" // 同步执行判断
cfg.OutputStrict = outputStrictModel == "1" || outputStrictModel == "true"
if cfg.OutputStrict {
// 开启输出严格模式校验