clear:formatting code
This commit is contained in:
1 parent
426cec1b62
commit
8c554d7ee7
52 files changed
+486
-502
No files matched your search
+4
-9
@@ -10,10 +10,10 @@ type Response struct {
|
||||
}
|
||||
|
||||
type Page struct {
|
||||
List interface{} `json:"list"`
|
||||
Count int `json:"count"`
|
||||
PageIndex int `json:"pageIndex"`
|
||||
PageSize int `json:"pageSize"`
|
||||
List interface{} `json:"list"`
|
||||
Count int `json:"count"`
|
||||
PageIndex int `json:"pageIndex"`
|
||||
PageSize int `json:"pageSize"`
|
||||
}
|
||||
|
||||
type PageResponse struct {
|
||||
@@ -25,7 +25,6 @@ type PageResponse struct {
|
||||
Msg string `json:"msg"`
|
||||
}
|
||||
|
||||
|
||||
func (res *Response) ReturnOK() *Response {
|
||||
res.Code = 200
|
||||
return res
|
||||
@@ -36,11 +35,7 @@ func (res *Response) ReturnError(code int) *Response {
|
||||
return res
|
||||
}
|
||||
|
||||
|
||||
func (res *PageResponse) ReturnOK() *PageResponse {
|
||||
res.Code = 200
|
||||
return res
|
||||
}
|
||||
|
||||
|
||||
|
||||
+2
-2
@@ -26,7 +26,7 @@ func OK(c *gin.Context, data interface{}, msg string) {
|
||||
}
|
||||
|
||||
// 分页数据处理
|
||||
func PageOK(c *gin.Context, result interface{},count int,pageIndex int,pageSize int, msg string) {
|
||||
func PageOK(c *gin.Context, result interface{}, count int, pageIndex int, pageSize int, msg string) {
|
||||
var res PageResponse
|
||||
res.Data.List = result
|
||||
res.Data.Count = count
|
||||
@@ -40,5 +40,5 @@ func PageOK(c *gin.Context, result interface{},count int,pageIndex int,pageSize
|
||||
|
||||
// 兼容函数
|
||||
func Custum(c *gin.Context, data gin.H) {
|
||||
c.JSON(http.StatusOK,data)
|
||||
c.JSON(http.StatusOK, data)
|
||||
}
|
||||
Reference in new issue
Block a user