mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-18 07:49:01 +08:00
api resp
This commit is contained in:
@@ -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{}
|
||||
}
|
||||
Reference in New Issue
Block a user