框架基本搭建完成

This commit is contained in:
2022-04-03 12:30:50 +08:00
commit ec4c957b25
31 changed files with 1353 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
package serializer
import "net/http"
type Response struct {
Code int32 `json:"code"`
Msg string `json:"msg"`
Data interface{} `json:"data"`
}
/*
自定义错误码
10000 用户操作
*/
const (
ErrNoUser = 10001
)
func Success(data interface{}) Response {
r := Response{
Code: http.StatusOK,
Msg: "",
Data: data,
}
return r
}