Merge branch 'develop' of https://gitee.com/fusenpack/fusenapi into develop

This commit is contained in:
eson
2023-10-07 16:59:56 +08:00
35 changed files with 293 additions and 671 deletions

View File

@@ -1,15 +1,14 @@
package gmodel
import (
"time"
"gorm.io/gorm"
"time"
)
// 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
UserId *int64 `gorm:"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"` // 手机号码
@@ -21,8 +20,8 @@ type FsAddress struct {
ZipCode *string `gorm:"default:'';" json:"zip_code"` //
Status *int64 `gorm:"default:0;" json:"status"` // 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"` // 上次被使用的时间
Utime *time.Time `gorm:"index;default:'0000-00-00 00:00:00';" json:"utime"` // 更新时间
Ltime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"ltime"` // 上次被使用的时间
}
type FsAddressModel struct {
db *gorm.DB

View File

@@ -23,6 +23,7 @@ type FsAdminRole struct {
DeleteUid *int64 `gorm:"default:0;" json:"delete_uid"` // 删除人
IsDel *int64 `gorm:"default:0;" json:"is_del"` // 是否删除1=是 0=否
MenuAuth *[]byte `gorm:"default:'';" json:"menu_auth"` //
ApiAuth *[]byte `gorm:"default:'';" json:"api_auth"` //
}
type FsAdminRoleModel struct {
db *gorm.DB

View File

@@ -73,14 +73,14 @@ type PayStatus struct {
// 订单信息
type OrderInfo struct {
UserId int64 `json:"user_id"` // 物流类型
Ctime *time.Time `json:"ctime"` // 创建日期
DeliveryMethod int64 `json:"delivery_method"` // 物流类型
Metadata map[string]interface{} `json:"metadata"` // 额外参数
OrderSn string `json:"order_sn"` // 订单编号
Status OrderStatus `json:"status"` // 当前状态
StatusLink []OrderStatus `json:"status_link"` // 状态链路
Utime *time.Time `json:"utime"` // 更新时间
UserId int64 `json:"user_id"` // 物流类型
Ctime *time.Time `json:"ctime"` // 创建日期
DeliveryMethod int64 `json:"delivery_method"` // 物流类型
Metadata OrderMetadata `json:"metadata"` // 额外参数
OrderSn string `json:"order_sn"` // 订单编号
Status OrderStatus `json:"status"` // 当前状态
StatusLink []OrderStatus `json:"status_link"` // 状态链路
Utime *time.Time `json:"utime"` // 更新时间
}
// 订单状态--用户
@@ -112,6 +112,7 @@ type OrderProduct struct {
SizeInfo *OrderProductSizeInfo `json:"size_info"`
FittingInfo *OrderProductFittingInfo `json:"fitting_info"`
IsHighlyCustomized int64 `json:"is_highly_customized"`
RenderImage string `json:"render_image"`
}
type PurchaseQuantity struct {
Current interface{} `json:"current"`
@@ -140,9 +141,9 @@ type ExpectedDelivery struct {
}
type OrderProductInter struct {
CartId int64 `json:"cart_id"` // 购物车ID
TotalPrice AmountInfo `json:"total_price"` // 商品总价
ItemPrice AmountInfo `json:"item_price"` // 商品单价
ExpectedDelivery *ExpectedDelivery `json:"expected_delivery"` // 预计到货
PurchaseQuantity *PurchaseQuantity `json:"purchase_quantity"` // 购买数量
ProductId int64 `json:"product_id"` // 商品ID
ProductName string `json:"product_name"` // 商品名称
@@ -153,4 +154,8 @@ type OrderProductInter struct {
SizeInfo *OrderProductSizeInfo `json:"size_info"`
FittingInfo *OrderProductFittingInfo `json:"fitting_info"`
IsHighlyCustomized int64 `json:"is_highly_customized"`
RenderImage string `json:"render_image"`
}
type OrderMetadata struct {
ExpectedDeliveryTime ExpectedDelivery `json:"expected_delivery_time"` // 预计到货时间
}

View File

@@ -0,0 +1,27 @@
package gmodel
import (
"gorm.io/gorm"
"time"
)
// fs_product_collection 产品收藏表
type FsProductCollection struct {
Id int64 `gorm:"primary_key;default:0;auto_increment;" json:"id"` // id
UserId *int64 `gorm:"default:0;" json:"user_id"` // 用户id
GuestId *int64 `gorm:"default:0;" json:"guest_id"` // 游客id
ProductId *int64 `gorm:"default:0;" json:"product_id"` // 产品id
TemplateTag *string `gorm:"default:'';" json:"template_tag"` //
SelectColorIndex *int64 `gorm:"default:0;" json:"select_color_index"` // 选择的颜色索引
Logo *string `gorm:"default:'';" json:"logo"` // logo地址
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"` //
}
type FsProductCollectionModel struct {
db *gorm.DB
name string
}
func NewFsProductCollectionModel(db *gorm.DB) *FsProductCollectionModel {
return &FsProductCollectionModel{db: db, name: "fs_product_collection"}
}

View File

@@ -0,0 +1,2 @@
package gmodel
// TODO: 使用model的属性做你想做的

View File

@@ -67,6 +67,7 @@ type AllModelsGen struct {
FsPay *FsPayModel // fs_pay 支付记录
FsPayEvent *FsPayEventModel // fs_pay_event 支付回调事件日志
FsProduct *FsProductModel // fs_product 产品表
FsProductCollection *FsProductCollectionModel // fs_product_collection 产品收藏表
FsProductCopy1 *FsProductCopy1Model // fs_product_copy1 产品表
FsProductDesign *FsProductDesignModel // fs_product_design 产品设计表
FsProductDesignGather *FsProductDesignGatherModel // fs_product_design_gather
@@ -178,6 +179,7 @@ func NewAllModels(gdb *gorm.DB) *AllModelsGen {
FsPay: NewFsPayModel(gdb),
FsPayEvent: NewFsPayEventModel(gdb),
FsProduct: NewFsProductModel(gdb),
FsProductCollection: NewFsProductCollectionModel(gdb),
FsProductCopy1: NewFsProductCopy1Model(gdb),
FsProductDesign: NewFsProductDesignModel(gdb),
FsProductDesignGather: NewFsProductDesignGatherModel(gdb),