info get profile

This commit is contained in:
eson
2023-09-28 13:25:06 +08:00
parent 31b712784f
commit d92c77766c
11 changed files with 81 additions and 278 deletions

View File

@@ -14,7 +14,7 @@ import (
func UpdateProfileBaseHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.ProfileBaseRequest
var req types.ProfileRequest
userinfo, err := basic.RequestParse(w, r, svcCtx, &req)
if err != nil {
return

View File

@@ -30,7 +30,7 @@ func NewUpdateProfileBaseLogic(ctx context.Context, svcCtx *svc.ServiceContext)
// func (l *UpdateProfileBaseLogic) BeforeLogic(w http.ResponseWriter, r *http.Request) {
// }
func (l *UpdateProfileBaseLogic) UpdateProfileBase(req *types.ProfileBaseRequest, userinfo *auth.UserInfo) (resp *basic.Response) {
func (l *UpdateProfileBaseLogic) UpdateProfileBase(req *types.ProfileRequest, userinfo *auth.UserInfo) (resp *basic.Response) {
// 返回值必须调用Set重新返回, resp可以空指针调用 resp.SetStatus(basic.CodeOK, data)
// userinfo 传入值时, 一定不为null
if !userinfo.IsUser() {

View File

@@ -31,13 +31,31 @@ type AddressRequest struct {
State string `json:"state"` //州
}
type ProfileBaseRequest struct {
FirstName *string `json:"first_name,optional,omitempty"` // 首名
LastName *string `json:"last_name,optional,omitempty"` // 后名
UserName *string `json:"user_name,optional,omitempty"` // 用户名
Mobile *string `json:"mobile,optional,omitempty"` // 电话
Resetaurant *string `json:"resetaurant,optional,omitempty"` // 不知道干什么
Company *string `json:"company,optional,omitempty"` // 公司
type ProfileRequest struct {
ProfileBase *ProfileBase `json:"base,optional,omitempty"` // 基础的个人消息, 姓名 公司等
SubscriptionStatus *SubscriptionStatus `json:"sub_status,optional,omitempty"` // 订阅的通知状态
}
type ProfileBase struct {
FirstName *string `json:"first_name,optional,omitempty"` // 首名
LastName *string `json:"last_name,optional,omitempty"` // 后名
Mobile *string `json:"mobile,optional,omitempty"` // 电话
Company *string `json:"company,optional,omitempty"` // 公司
}
type SubscriptionStatus struct {
NotificationEmail NotificationEmail `json:"notification_email,optional,omitempty"`
NotificationPhone NotificationPhone `json:"notification_phone,optional,omitempty"`
}
type NotificationEmail struct {
OrderUpdate bool `json:"order_update,optional,omitempty"`
Newseleter bool `json:"newseleter,optional,omitempty"`
}
type NotificationPhone struct {
OrderUpdate bool `json:"order_update,optional,omitempty"`
Newseleter bool `json:"newseleter,optional,omitempty"`
}
type QueryProfileRequest struct {