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