This commit is contained in:
withchao
2023-02-27 18:21:41 +08:00
parent 4cf29ad565
commit cae6c53b01
2 changed files with 31 additions and 19 deletions
+18
View File
@@ -0,0 +1,18 @@
package apiresp
type ApiResponse struct {
ErrCode int `json:"errCode"`
ErrMsg string `json:"errMsg"`
ErrDlt string `json:"errDlt"`
Data any `json:"data"`
}
func Success(data any) *ApiResponse {
return &ApiResponse{
Data: data,
}
}
func Error(err error) *ApiResponse {
return &ApiResponse{}
}