1 Star 0 Fork 21

yuexudong / go-admin-core

forked from go-admin-team / go-admin-core 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
model.go 1.00 KB
一键复制 编辑 原始数据 按行查看 历史
lwnmengjing 提交于 2021-06-10 17:07 . feature :sparkles:支持config加载闭包
package response
type Response struct {
// 数据集
RequestId string `protobuf:"bytes,1,opt,name=requestId,proto3" json:"requestId,omitempty"`
Code int32 `protobuf:"varint,2,opt,name=code,proto3" json:"code,omitempty"`
Msg string `protobuf:"bytes,3,opt,name=msg,proto3" json:"msg,omitempty"`
Status string `protobuf:"bytes,4,opt,name=status,proto3" json:"status,omitempty"`
}
type response struct {
Response
Data interface{} `json:"data"`
}
type Page struct {
Count int `json:"count"`
PageIndex int `json:"pageIndex"`
PageSize int `json:"pageSize"`
}
type page struct {
Page
List interface{} `json:"list"`
}
func (e *response) SetData(data interface{}) {
e.Data = data
}
func (e response) Clone() Responses {
return &e
}
func (e *response) SetTraceID(id string) {
e.RequestId = id
}
func (e *response) SetMsg(s string) {
e.Msg = s
}
func (e *response) SetCode(code int32) {
e.Code = code
}
func (e *response) SetSuccess(success bool) {
if !success {
e.Status = "error"
}
}
Go
1
https://gitee.com/yuexudong/go-admin-core.git
git@gitee.com:yuexudong/go-admin-core.git
yuexudong
go-admin-core
go-admin-core
sdk/v1.4.6

搜索帮助