tydata-server/common/result/responseBean.go

22 lines
471 B
Go
Raw Permalink Normal View History

2025-01-10 00:09:25 +08:00
package result
type ResponseSuccessBean struct {
Code uint32 `json:"code"`
Msg string `json:"msg"`
Data interface{} `json:"data"`
}
type NullJson struct{}
func Success(data interface{}) *ResponseSuccessBean {
return &ResponseSuccessBean{200, "OK", data}
}
type ResponseErrorBean struct {
Code uint32 `json:"code"`
Msg string `json:"msg"`
}
func Error(errCode uint32, errMsg string) *ResponseErrorBean {
return &ResponseErrorBean{errCode, errMsg}
}