Ai
1 Star 0 Fork 0

GoAdmin/sdk

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
model.go 1.00 KB
一键复制 编辑 原始数据 按行查看 历史
GoAdmin 提交于 2022-06-08 16:52 +08:00 . test
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"
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/GoAdminCore/sdk.git
git@gitee.com:GoAdminCore/sdk.git
GoAdminCore
sdk
sdk
v1.0.2

搜索帮助