Files
go-admin/tools/app/model.go
T
2021-01-20 00:31:52 +08:00

29 lines
514 B
Go

package app
import (
pbErrors "github.com/go-admin-team/go-admin-core/errors"
)
type Response struct {
pbErrors.Error
// 数据集
Data interface{} `json:"data"`
}
type Page struct {
List interface{} `json:"list"`
Count int `json:"count"`
PageIndex int `json:"pageIndex"`
PageSize int `json:"pageSize"`
}
func (res *Response) ReturnOK() *Response {
res.Code = 200
return res
}
func (res *Response) ReturnError(code int32) *Response {
res.Code = code
return res
}