info get profile
This commit is contained in:
parent
91c1c580f9
commit
2eadff7876
|
@ -7,23 +7,22 @@ import (
|
|||
|
||||
// fs_address 用户地址表
|
||||
type FsAddress struct {
|
||||
AddressId int64 `gorm:"primary_key;default:0;auto_increment;" json:"address_id"` //
|
||||
UserId *int64 `gorm:"index;default:0;" json:"user_id"` // 用户ID
|
||||
AddressName *string `gorm:"default:'';" json:"address_name"` //
|
||||
FirstName *string `gorm:"default:'';" json:"first_name"` // FirstName
|
||||
LastName *string `gorm:"default:'';" json:"last_name"` // LastName
|
||||
Mobile *string `gorm:"default:'';" json:"mobile"` // 手机号码
|
||||
Street *string `gorm:"default:'';" json:"street"` // 街道
|
||||
Suite *string `gorm:"default:'';" json:"suite"` // 房号
|
||||
City *string `gorm:"default:'';" json:"city"` // 城市
|
||||
State *string `gorm:"default:'';" json:"state"` //
|
||||
Country *string `gorm:"default:'';" json:"country"` //
|
||||
ZipCode *string `gorm:"default:'';" json:"zip_code"` //
|
||||
Status *int64 `gorm:"default:0;" json:"status"` // 1正常 0异常
|
||||
IsDefault *int64 `gorm:"index;default:0;" json:"is_default"` // 1默认地址,0非默认地址
|
||||
Ctime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"ctime"` // 创建时间
|
||||
Utime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"utime"` // 更新时间
|
||||
Ltime *time.Time `gorm:"index;default:'0000-00-00 00:00:00';" json:"ltime"` // 上次被使用的时间
|
||||
AddressId int64 `gorm:"primary_key;default:0;auto_increment;" json:"address_id"` //
|
||||
UserId *int64 `gorm:"index;default:0;" json:"user_id"` // 用户ID
|
||||
FirstName *string `gorm:"default:'';" json:"first_name"` // FirstName
|
||||
LastName *string `gorm:"default:'';" json:"last_name"` // LastName
|
||||
Mobile *string `gorm:"default:'';" json:"mobile"` // 手机号码
|
||||
Street *string `gorm:"default:'';" json:"street"` // 街道
|
||||
Suite *string `gorm:"default:'';" json:"suite"` // 房号
|
||||
City *string `gorm:"default:'';" json:"city"` // 城市
|
||||
State *string `gorm:"default:'';" json:"state"` //
|
||||
Country *string `gorm:"default:'';" json:"country"` //
|
||||
ZipCode *string `gorm:"default:'';" json:"zip_code"` //
|
||||
Status *int64 `gorm:"default:0;" json:"status"` // 1正常 0异常
|
||||
IsDefault *int64 `gorm:"index;default:0;" json:"is_default"` // 1默认地址,0非默认地址
|
||||
Ctime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"ctime"` // 创建时间
|
||||
Utime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"utime"` // 更新时间
|
||||
Ltime *time.Time `gorm:"index;default:'0000-00-00 00:00:00';" json:"ltime"` // 上次被使用的时间
|
||||
}
|
||||
type FsAddressModel struct {
|
||||
db *gorm.DB
|
||||
|
|
|
@ -7,17 +7,24 @@ import (
|
|||
|
||||
// fs_order 订单表
|
||||
type FsOrder struct {
|
||||
Id int64 `gorm:"primary_key;default:0;auto_increment;" json:"id"` // 订单ID
|
||||
UserId *int64 `gorm:"index;default:0;" json:"user_id"` // 用户ID
|
||||
DeliveryMethod *int64 `gorm:"index;default:0;" json:"delivery_method"` // 物流类型
|
||||
OrderSn *string `gorm:"unique_key;default:'';" json:"order_sn"` //
|
||||
OrderSource *string `gorm:"default:'';" json:"order_source"` //
|
||||
Status *int64 `gorm:"index;default:0;" json:"status"` // 订单状态
|
||||
Metadata *[]byte `gorm:"default:'';" json:"metadata"` //
|
||||
Ctime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"ctime"` //
|
||||
Utime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"utime"` //
|
||||
IsDel *int64 `gorm:"default:0;" json:"is_del"` // 是否删除:0=否,1=是
|
||||
PayStatus *int64 `gorm:"default:0;" json:"pay_status"` // 支付状态
|
||||
Id int64 `gorm:"primary_key;default:0;auto_increment;" json:"id"` // 订单ID
|
||||
UserId *int64 `gorm:"index;default:0;" json:"user_id"` // 用户ID
|
||||
DeliveryMethod *int64 `gorm:"index;default:0;" json:"delivery_method"` // 物流类型
|
||||
OrderSn *string `gorm:"unique_key;default:'';" json:"order_sn"` //
|
||||
OrderSource *string `gorm:"default:'';" json:"order_source"` //
|
||||
Status *int64 `gorm:"index;default:0;" json:"status"` // 订单状态
|
||||
Metadata *[]byte `gorm:"default:'';" json:"metadata"` //
|
||||
Ctime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"ctime"` //
|
||||
Utime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"utime"` //
|
||||
IsDel *int64 `gorm:"default:0;" json:"is_del"` // 是否删除:0=否,1=是
|
||||
PayStatus *int64 `gorm:"default:0;" json:"pay_status"` // 支付状态
|
||||
StatusLink *[]byte `gorm:"default:'';" json:"status_link"` //
|
||||
OrderProduct *[]byte `gorm:"default:'';" json:"order_product"` //
|
||||
OrderAddress *[]byte `gorm:"default:'';" json:"order_address"` //
|
||||
OrderAmount *[]byte `gorm:"default:'';" json:"order_amount"` //
|
||||
PayStatusLink *[]byte `gorm:"default:'';" json:"pay_status_link"` //
|
||||
ShoppingCartSnapshot *[]byte `gorm:"default:'';" json:"shopping_cart_snapshot"` //
|
||||
ShoppingProductSnapshot *[]byte `gorm:"default:'';" json:"shopping_product_snapshot"` //
|
||||
}
|
||||
type FsOrderModel struct {
|
||||
db *gorm.DB
|
||||
|
|
|
@ -23,7 +23,7 @@ type FsProductModel3d struct {
|
|||
Status *int64 `gorm:"default:0;" json:"status"` // 状态位 显示 删除
|
||||
Ctime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"ctime"` //
|
||||
OptionTemplate *int64 `gorm:"default:0;" json:"option_template"` // 配件绑定的公共模板
|
||||
Price *int64 `gorm:"default:0;" json:"price"` //
|
||||
Price *int64 `gorm:"default:0;" json:"price"` // 仅配件用,配件的价格, 单位:0.1美分
|
||||
Sku *string `gorm:"default:'';" json:"sku"` // sku
|
||||
IsHot *int64 `gorm:"default:0;" json:"is_hot"` // 是否热门
|
||||
IsCloudRender *int64 `gorm:"default:0;" json:"is_cloud_render"` // 是否设置为云渲染模型
|
||||
|
|
|
@ -55,19 +55,18 @@ func (l *AddressAddLogic) AddressAdd(req *types.AddressRequest, userinfo *auth.U
|
|||
)
|
||||
|
||||
createOne := &gmodel.FsAddress{ // 构建FsAddress结构体
|
||||
AddressName: &req.AddressName,
|
||||
FirstName: &req.FirstName,
|
||||
LastName: &req.LastName,
|
||||
Mobile: &req.Mobile,
|
||||
Street: &req.Street,
|
||||
Suite: &req.Suite,
|
||||
City: &req.City,
|
||||
State: &req.State,
|
||||
Country: &country,
|
||||
Status: &status,
|
||||
UserId: &userinfo.UserId,
|
||||
ZipCode: &req.ZipCode,
|
||||
IsDefault: &isDefautl,
|
||||
FirstName: &req.FirstName,
|
||||
LastName: &req.LastName,
|
||||
Mobile: &req.Mobile,
|
||||
Street: &req.Street,
|
||||
Suite: &req.Suite,
|
||||
City: &req.City,
|
||||
State: &req.State,
|
||||
Country: &country,
|
||||
Status: &status,
|
||||
UserId: &userinfo.UserId,
|
||||
ZipCode: &req.ZipCode,
|
||||
IsDefault: &isDefautl,
|
||||
}
|
||||
_, err := m.CreateOne(l.ctx, createOne) // 新增地址
|
||||
if err != nil {
|
||||
|
|
|
@ -47,19 +47,18 @@ func (l *AddressUpdateLogic) AddressUpdate(req *types.AddressRequest, userinfo *
|
|||
}
|
||||
|
||||
address := gmodel.FsAddress{
|
||||
AddressId: req.AddressId,
|
||||
UserId: &userinfo.UserId,
|
||||
IsDefault: &req.IsDefault,
|
||||
AddressName: &req.AddressName,
|
||||
FirstName: &req.FirstName,
|
||||
LastName: &req.LastName,
|
||||
Mobile: &req.Mobile,
|
||||
ZipCode: &req.ZipCode,
|
||||
Street: &req.Street,
|
||||
Suite: &req.Suite,
|
||||
City: &req.City,
|
||||
State: &req.State,
|
||||
Utime: &now,
|
||||
AddressId: req.AddressId,
|
||||
UserId: &userinfo.UserId,
|
||||
IsDefault: &req.IsDefault,
|
||||
FirstName: &req.FirstName,
|
||||
LastName: &req.LastName,
|
||||
Mobile: &req.Mobile,
|
||||
ZipCode: &req.ZipCode,
|
||||
Street: &req.Street,
|
||||
Suite: &req.Suite,
|
||||
City: &req.City,
|
||||
State: &req.State,
|
||||
Utime: &now,
|
||||
}
|
||||
|
||||
err := l.svcCtx.AllModels.FsAddress.UpdateAddress(l.ctx, &address)
|
||||
|
|
|
@ -18,22 +18,17 @@ type AddressIdRequest struct {
|
|||
AddressId int64 `json:"address_id"` // 地址id
|
||||
}
|
||||
|
||||
type AddressNameRequest struct {
|
||||
AddressName string `json:"address_name"` // 地址
|
||||
}
|
||||
|
||||
type AddressRequest struct {
|
||||
AddressId int64 `json:"address_id,optional"`
|
||||
IsDefault int64 `json:"is_default"` //是否默认
|
||||
AddressName string `json:"address_name"` //收货人
|
||||
FirstName string `json:"first_name"` //first_name
|
||||
LastName string `json:"last_name"` //last_name
|
||||
Mobile string `json:"mobile"` //手机
|
||||
ZipCode string `json:"zip_code"` //邮编
|
||||
Street string `json:"street"` //街道
|
||||
Suite string `json:"suite"` //房号
|
||||
City string `json:"city"` //城市
|
||||
State string `json:"state"` //州
|
||||
AddressId int64 `json:"address_id,optional"`
|
||||
IsDefault int64 `json:"is_default"` //是否默认
|
||||
FirstName string `json:"first_name"` //first_name
|
||||
LastName string `json:"last_name"` //last_name
|
||||
Mobile string `json:"mobile"` //手机
|
||||
ZipCode string `json:"zip_code"` //邮编
|
||||
Street string `json:"street"` //街道
|
||||
Suite string `json:"suite"` //房号
|
||||
City string `json:"city"` //城市
|
||||
State string `json:"state"` //州
|
||||
}
|
||||
|
||||
type ProfileBaseRequest struct {
|
||||
|
|
|
@ -49,22 +49,17 @@ type (
|
|||
AddressId int64 `json:"address_id"` // 地址id
|
||||
}
|
||||
|
||||
AddressNameRequest {
|
||||
AddressName string `json:"address_name"` // 地址
|
||||
}
|
||||
|
||||
AddressRequest {
|
||||
AddressId int64 `json:"address_id,optional"`
|
||||
IsDefault int64 `json:"is_default"` //是否默认
|
||||
AddressName string `json:"address_name"` //收货人
|
||||
FirstName string `json:"first_name"` //first_name
|
||||
LastName string `json:"last_name"` //last_name
|
||||
Mobile string `json:"mobile"` //手机
|
||||
ZipCode string `json:"zip_code"` //邮编
|
||||
Street string `json:"street"` //街道
|
||||
Suite string `json:"suite"` //房号
|
||||
City string `json:"city"` //城市
|
||||
State string `json:"state"` //州
|
||||
AddressId int64 `json:"address_id,optional"`
|
||||
IsDefault int64 `json:"is_default"` //是否默认
|
||||
FirstName string `json:"first_name"` //first_name
|
||||
LastName string `json:"last_name"` //last_name
|
||||
Mobile string `json:"mobile"` //手机
|
||||
ZipCode string `json:"zip_code"` //邮编
|
||||
Street string `json:"street"` //街道
|
||||
Suite string `json:"suite"` //房号
|
||||
City string `json:"city"` //城市
|
||||
State string `json:"state"` //州
|
||||
}
|
||||
|
||||
ProfileBaseRequest {
|
||||
|
|
Loading…
Reference in New Issue
Block a user