mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-15 14:35:57 +08:00
19 lines
315 B
Go
19 lines
315 B
Go
|
|
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{}
|
||
|
|
}
|