Merge branch 'develop' of gitee.com:fusenpack/fusenapi into develop
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
"fusenapi/utils/fssql"
|
||||
"time"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
@@ -152,14 +153,21 @@ type SubscriptionStatus struct {
|
||||
} `json:"item_map"`
|
||||
}
|
||||
|
||||
// UserProfile 个人信息
|
||||
type UserAddress struct {
|
||||
}
|
||||
|
||||
type UserProfile struct {
|
||||
FirstName string `json:"first_name"`
|
||||
LastName string `json:"last_name"`
|
||||
Resetaurant string `json:"resetaurant"`
|
||||
ProfileBase UserProfileBase `json:"base"`
|
||||
SubStatus SubscriptionStatus `json:"sub_status"`
|
||||
}
|
||||
|
||||
// UserProfileBase 个人信息
|
||||
type UserProfileBase struct {
|
||||
FirstName string `json:"first_name"`
|
||||
LastName string `json:"last_name"`
|
||||
Resetaurant string `json:"resetaurant"`
|
||||
}
|
||||
|
||||
// 自平台的注册流程
|
||||
func (u *FsUserModel) RegisterByFusen(ctx context.Context, token *auth.RegisterToken) (user *FsUser, err error) {
|
||||
|
||||
@@ -189,11 +197,16 @@ func (u *FsUserModel) RegisterByFusen(ctx context.Context, token *auth.RegisterT
|
||||
|
||||
// 继承guest_id的资源表
|
||||
err = InheritGuestIdResource(tx, user.Id, token.GuestId, func(txResouce, txUserMaterial, txUserInfo *gorm.DB) error {
|
||||
userProfile := &UserProfile{
|
||||
userProfileBase := UserProfileBase{
|
||||
FirstName: FirstName,
|
||||
LastName: LastName,
|
||||
Resetaurant: Resetaurant,
|
||||
}
|
||||
|
||||
userProfile := &UserProfile{
|
||||
ProfileBase: userProfileBase,
|
||||
}
|
||||
|
||||
metadata, err := json.Marshal(userProfile)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -209,6 +222,8 @@ func (u *FsUserModel) RegisterByFusen(ctx context.Context, token *auth.RegisterT
|
||||
Utime: &now,
|
||||
}
|
||||
|
||||
logx.Error(metadata)
|
||||
|
||||
err = txUserInfo.Where("module = 'profile' and user_id = ?", *uinfo.UserId).Take(nil).Error
|
||||
if err != nil {
|
||||
if err == gorm.ErrRecordNotFound {
|
||||
|
||||
Reference in New Issue
Block a user