solve error

This commit is contained in:
withchao
2023-03-03 18:59:28 +08:00
parent ebd1de919d
commit b74e6b52f3
11 changed files with 100 additions and 20 deletions
+5 -5
View File
@@ -1,18 +1,18 @@
package apiresp
type ApiResponse struct {
type apiResponse struct {
ErrCode int `json:"errCode"`
ErrMsg string `json:"errMsg"`
ErrDlt string `json:"errDlt"`
Data any `json:"data"`
}
func apiSuccess(data any) *ApiResponse {
return &ApiResponse{
func apiSuccess(data any) *apiResponse {
return &apiResponse{
Data: data,
}
}
func apiError(err error) *ApiResponse {
return &ApiResponse{ErrCode: 10000, ErrMsg: err.Error()}
func apiError(err error) *apiResponse {
return &apiResponse{ErrCode: 10000, ErrMsg: err.Error()}
}