feat: 优化 form value
This commit is contained in:
@@ -47,6 +47,10 @@ func (s *server) getFormInitValue(ctx *gin.Context, uriCfg UriConfig) (any, erro
|
||||
}).ToFieldList()...)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// 非必传参数设置默认值
|
||||
defaults.SetDefaults(formValue)
|
||||
|
||||
return formValue, nil
|
||||
}
|
||||
|
||||
@@ -82,9 +86,6 @@ func (s *server) RequestHandler(uriCfg UriConfig) gin.HandlerFunc {
|
||||
return
|
||||
}
|
||||
|
||||
// 非必传参数设置默认值
|
||||
defaults.SetDefaults(formValue)
|
||||
|
||||
// 默认请求失败
|
||||
ctx.Set(consts.GinRequestSuccess, false)
|
||||
// 初始化响应之后 logic
|
||||
@@ -156,10 +157,6 @@ func (s *server) SseHandler(uriCfg UriConfig) gin.HandlerFunc {
|
||||
return
|
||||
}
|
||||
|
||||
// 非必传参数设置默认值
|
||||
defaults.SetDefaults(formValue)
|
||||
|
||||
// 默认请求失败
|
||||
ctx.Set(consts.GinRequestSuccess, false)
|
||||
// 初始化响应之后 logic
|
||||
logicAfterResponse := &define.LogicAfterResponse{
|
||||
|
||||
Reference in New Issue
Block a user