goProject/.svn/pristine/61/618fd6a64917cdc9be9a1c4e95d8be9514c251bc.svn-base
2025-01-06 16:21:36 +08:00

29 lines
623 B
Plaintext

package model
// CommonResponse 公共请求结果对象
type CommonResponse struct {
// 错误码
Code ResultStatus `json:"code"`
// 错误提示信息
Message string `json:"message"`
// 服务器生成的请求Id
RequestId string `json:"requestId"`
}
// IsSuccess 请求结果是否成功
func (this *CommonResponse) IsSuccess() bool {
return this.Code == Success
}
// IsFailure 请求结果是否失败
func (this *CommonResponse) IsFailure() bool {
return this.Code != Success
}
// HasMessage 请求结果是否有信息
func (this *CommonResponse) HaveNoMessage() bool {
return this.Code == NoMessage
}