大面积重构

Response部分

usersController部分

中间件部分
This commit is contained in:
2022-04-06 13:54:48 +08:00
parent 513b563728
commit 0df2aaa82f
13 changed files with 114 additions and 119 deletions

View File

@@ -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
}