将model从pak包中移出到根目录
All checks were successful
continuous-integration/drone Build is passing

This commit is contained in:
2022-04-05 18:16:20 +08:00
parent 795028c4bb
commit 513b563728
11 changed files with 54 additions and 21 deletions

View File

@@ -31,7 +31,7 @@ func (r *Response) Success(data interface{}) {
}
// 失败 统一处理
func (r *Response) Error(code int32, msg string) {
func (r *Response) Error(code int, msg string) {
res := serializer.Response{
Code: code,
Msg: msg,
@@ -45,15 +45,11 @@ func (r *Response) Error(code int32, msg string) {
}
// 参数类型错误
func (r *Response) ErrInvalidParamType() (err error) {
res := serializer.Response{
Code: http.StatusBadRequest,
Msg: "参数类型错误",
Data: nil,
}
_, err = r.Ctx.JSON(res)
if err != nil {
return err
}
return nil
func (r *Response) ErrBadRequest() {
r.Error(http.StatusBadRequest, "请求参数错误")
}
// 未登录/未授权错误
func (r *Response) ErrUnauthorized() {
r.Error(http.StatusUnauthorized, "未登录")
}

View File

@@ -1,7 +1,7 @@
package dto
import (
"drive-linked/pkg/model"
"drive-linked/model"
"github.com/jinzhu/copier"
)
@@ -15,7 +15,7 @@ type UserProfile struct {
Roles string `json:"roles"`
}
type QueryUser struct {
type QueryUserParams struct {
Method string `json:"method"`
Value string `json:"value"`
}