You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Open-IM-Server/internal/apiresp/resp.go

19 lines
356 B

package apiresp
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{
Data: data,
}
}
func apiError(err error) *apiResponse {
return &apiResponse{ErrCode: 10000, ErrMsg: err.Error()}
}