Merge branch 'develop' of gitee.com:fusenpack/fusenapi into develop
This commit is contained in:
commit
d6134a7407
|
@ -155,14 +155,16 @@ type SubscriptionStatus struct {
|
||||||
type UserAddress struct {
|
type UserAddress struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type UserProfile struct {
|
||||||
|
ProfileBase UserProfileBase `json:"base"`
|
||||||
|
SubStatus SubscriptionStatus `json:"sub_status"`
|
||||||
|
}
|
||||||
|
|
||||||
// UserProfileBase 个人信息
|
// UserProfileBase 个人信息
|
||||||
type UserProfileBase struct {
|
type UserProfileBase struct {
|
||||||
Base struct {
|
FirstName string `json:"first_name"`
|
||||||
FirstName string `json:"first_name"`
|
LastName string `json:"last_name"`
|
||||||
LastName string `json:"last_name"`
|
Resetaurant string `json:"resetaurant"`
|
||||||
Resetaurant string `json:"resetaurant"`
|
|
||||||
} `json:"base"`
|
|
||||||
SubStatus SubscriptionStatus `json:"sub_status"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 自平台的注册流程
|
// 自平台的注册流程
|
||||||
|
@ -194,17 +196,16 @@ func (u *FsUserModel) RegisterByFusen(ctx context.Context, token *auth.RegisterT
|
||||||
|
|
||||||
// 继承guest_id的资源表
|
// 继承guest_id的资源表
|
||||||
err = InheritGuestIdResource(tx, user.Id, token.GuestId, func(txResouce, txUserMaterial, txUserInfo *gorm.DB) error {
|
err = InheritGuestIdResource(tx, user.Id, token.GuestId, func(txResouce, txUserMaterial, txUserInfo *gorm.DB) error {
|
||||||
userProfile := &UserProfileBase{
|
userProfileBase := UserProfileBase{
|
||||||
Base: struct {
|
FirstName: FirstName,
|
||||||
FirstName string "json:\"first_name\""
|
LastName: LastName,
|
||||||
LastName string "json:\"last_name\""
|
Resetaurant: Resetaurant,
|
||||||
Resetaurant string "json:\"resetaurant\""
|
|
||||||
}{
|
|
||||||
FirstName: FirstName,
|
|
||||||
LastName: LastName,
|
|
||||||
Resetaurant: Resetaurant,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
userProfile := &UserProfile{
|
||||||
|
ProfileBase: userProfileBase,
|
||||||
|
}
|
||||||
|
|
||||||
metadata, err := json.Marshal(userProfile)
|
metadata, err := json.Marshal(userProfile)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
|
@ -157,17 +157,7 @@ func TestMain(t *testing.T) {
|
||||||
|
|
||||||
func TestCaseJSON_EXTRACT(t *testing.T) {
|
func TestCaseJSON_EXTRACT(t *testing.T) {
|
||||||
|
|
||||||
userProfile := &gmodel.UserProfileBase{
|
userProfile := &gmodel.UserProfile{}
|
||||||
Base: struct {
|
|
||||||
FirstName string "json:\"first_name\""
|
|
||||||
LastName string "json:\"last_name\""
|
|
||||||
Resetaurant string "json:\"resetaurant\""
|
|
||||||
}{
|
|
||||||
FirstName: "FirstName",
|
|
||||||
LastName: "LastName",
|
|
||||||
Resetaurant: "Resetaurant",
|
|
||||||
},
|
|
||||||
}
|
|
||||||
metadata, err := json.Marshal(userProfile)
|
metadata, err := json.Marshal(userProfile)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
|
|
|
@ -8,13 +8,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestCase1(t *testing.T) {
|
func TestCase1(t *testing.T) {
|
||||||
u := gmodel.UserProfileBase{
|
u := gmodel.UserProfile{}
|
||||||
Base: struct {
|
|
||||||
FirstName string "json:\"first_name\""
|
|
||||||
LastName string "json:\"last_name\""
|
|
||||||
Resetaurant string "json:\"resetaurant\""
|
|
||||||
}{},
|
|
||||||
}
|
|
||||||
|
|
||||||
conn := initalize.InitMysql("fsreaderwriter:XErSYmLELKMnf3Dh@tcp(fusen.cdmigcvz3rle.us-east-2.rds.amazonaws.com:3306)/fusen")
|
conn := initalize.InitMysql("fsreaderwriter:XErSYmLELKMnf3Dh@tcp(fusen.cdmigcvz3rle.us-east-2.rds.amazonaws.com:3306)/fusen")
|
||||||
err := fssql.MetadataModulePATCH(conn, "profile", gmodel.FsUserInfo{}, u, "id = ?", 90)
|
err := fssql.MetadataModulePATCH(conn, "profile", gmodel.FsUserInfo{}, u, "id = ?", 90)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user