This commit is contained in:
新亮
2021-02-03 20:43:02 +08:00
parent e5ea279f2e
commit a4701309cb
8 changed files with 213 additions and 5 deletions

View File

@@ -9,6 +9,7 @@ import (
"github.com/xinliangnote/go-gin-api/internal/pkg/cache"
"github.com/xinliangnote/go-gin-api/internal/pkg/core"
"github.com/xinliangnote/go-gin-api/internal/pkg/db"
"github.com/xinliangnote/go-gin-api/pkg/ddm"
"go.uber.org/zap"
)
@@ -169,7 +170,7 @@ func (u *userDemo) Detail() core.HandlerFunc {
res.Id = user.Id
res.UserName = user.UserName
res.NickName = user.NickName
res.Mobile = user.Mobile
res.Mobile = ddm.Mobile(user.Mobile)
c.Payload(code.OK.WithData(res))
}
}

View File

@@ -2,6 +2,8 @@ package user_model
import (
"time"
"github.com/xinliangnote/go-gin-api/pkg/ddm"
)
// 用户Demo表
@@ -54,8 +56,8 @@ type DetailRequest struct {
// user_handler Detail Response
type DetailResponse struct {
Id uint `json:"id"` // 用户主键ID
UserName string `json:"user_name"` // 用户名
NickName string `json:"nick_name"` // 昵称
Mobile string `json:"mobile"` // 手机号
Id uint `json:"id"` // 用户主键ID
UserName string `json:"user_name"` // 用户名
NickName string `json:"nick_name"` // 昵称
Mobile ddm.Mobile `json:"mobile"` // 手机号(脱敏)
}