更新logic response等使用方法
This commit is contained in:
@@ -19,8 +19,7 @@ func New{{.logic}}(ctx context.Context, svcCtx *svc.ServiceContext) *{{.logic}}
|
||||
}
|
||||
|
||||
func (l *{{.logic}}) {{.function}}({{.request}}) (resp *types.Response) {
|
||||
// 必须返回response, 前端需要的是内部约定的Code码, 处理相关的逻辑. 例子(eg): resp.Set(501, "error")
|
||||
resp = &types.Response{}
|
||||
// 返回值必须调用Set重新返回, resp可以空指针调用 resp.SetStatus(basic.CodeOK, data)
|
||||
|
||||
{{.returnString}} resp
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user