Replies: 1 comment
-
|
我现在的做法是,暂时不使用 type AppResponse struct {
Success bool `json:"success"`
Message string `json:"message"`
Total int `json:"total"`
Data any `json:"data"`
Params map[string]any `json:"params,omitempty"`
}func NewAppResponse(data any) *AppResponse {
return &AppResponse{
Success: true,
Data: data,
}
}
func NewAppFailResponse(message string, args ...any) *AppResponse {
....................
....................
return &AppResponse{
Success: false,
Message: message,
Params: params,
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Error calling method:前缀Error calling method:,只保留错误本身的信息Beta Was this translation helpful? Give feedback.
All reactions