大面积重构
Response部分 usersController部分 中间件部分
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
package serializer
|
||||
|
||||
import "net/http"
|
||||
|
||||
type Response struct {
|
||||
type ResponseSerial struct {
|
||||
Code int `json:"code"`
|
||||
Msg string `json:"msg"`
|
||||
Data interface{} `json:"data"`
|
||||
@@ -10,17 +8,9 @@ type Response struct {
|
||||
|
||||
/*
|
||||
自定义错误码
|
||||
10000 用户操作
|
||||
40000 业务逻辑错误
|
||||
50000 服务器操作
|
||||
*/
|
||||
const (
|
||||
ErrNoUser = 10001
|
||||
ErrNoUser = 40001
|
||||
)
|
||||
|
||||
func Success(data interface{}) Response {
|
||||
r := Response{
|
||||
Code: http.StatusOK,
|
||||
Msg: "",
|
||||
Data: data,
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user