3 Star 3 Fork 1

三三物联网 / ssiot-core

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
model.go 1.00 KB
一键复制 编辑 原始数据 按行查看 历史
三三物联网 提交于 2022-12-29 09:28 . up
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"
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/sansaniot/ssiot-core.git
git@gitee.com:sansaniot/ssiot-core.git
sansaniot
ssiot-core
ssiot-core
v1.5.0

搜索帮助

344bd9b3 5694891 D2dac590 5694891