81 lines
2.8 KiB
Go
81 lines
2.8 KiB
Go
package entity
|
||
|
||
import (
|
||
marketConsts "shop-user-trade/consts/market"
|
||
|
||
"gitea.redpowerfuture.com/red-future/common/beans"
|
||
)
|
||
|
||
type marketCol struct {
|
||
beans.SQLBaseCol
|
||
KnapsackID string
|
||
UserID string
|
||
AssetID string
|
||
AssetName string
|
||
SkuID string
|
||
SkuName string
|
||
ImageURL string
|
||
Type string
|
||
StockDetailID string
|
||
BatchID string
|
||
BatchNo string
|
||
StockMode string
|
||
Price string
|
||
OriginalPrice string
|
||
Description string
|
||
Status string
|
||
ListExpireAt string
|
||
}
|
||
|
||
var MarketCol = marketCol{
|
||
SQLBaseCol: beans.DefSQLBaseCol,
|
||
KnapsackID: "knapsack_id",
|
||
UserID: "user_id",
|
||
AssetID: "asset_id",
|
||
AssetName: "asset_name",
|
||
SkuID: "sku_id",
|
||
SkuName: "sku_name",
|
||
ImageURL: "image_url",
|
||
Type: "type",
|
||
StockDetailID: "stock_detail_id",
|
||
BatchID: "batch_id",
|
||
BatchNo: "batch_no",
|
||
StockMode: "stock_mode",
|
||
Price: "price",
|
||
OriginalPrice: "original_price",
|
||
Description: "description",
|
||
Status: "status",
|
||
ListExpireAt: "list_expire_at",
|
||
}
|
||
|
||
// Market 市场实体
|
||
type Market struct {
|
||
beans.SQLBaseDO `orm:",inherit"`
|
||
|
||
KnapsackID int64 `orm:"knapsack_id" json:"knapsackId,string" description:"背包项ID"`
|
||
UserID int64 `orm:"user_id" json:"userId,string" description:"卖家用户ID"`
|
||
AssetID int64 `orm:"asset_id" json:"assetId,string" description:"资产ID"`
|
||
AssetName string `orm:"asset_name" json:"assetName" description:"资产名称"`
|
||
SkuID int64 `orm:"sku_id" json:"skuId,string" description:"SKU ID"`
|
||
SkuName string `orm:"sku_name" json:"skuName" description:"SKU名称"`
|
||
ImageURL string `orm:"image_url" json:"imageUrl" description:"资产图片URL"`
|
||
Type string `orm:"type" json:"type" description:"资产类型:physical/virtual/service"`
|
||
|
||
// 库存相关字段
|
||
StockDetailID int64 `orm:"stock_detail_id" json:"stockDetailId,string" description:"库存明细ID(明细模式)"`
|
||
BatchID int64 `orm:"batch_id" json:"batchId,string" description:"批次ID(批次模式)"`
|
||
BatchNo string `orm:"batch_no" json:"batchNo" description:"批次号(批次模式)"`
|
||
StockMode int `orm:"stock_mode" json:"stockMode" description:"库存管理模式:1-明细模式,2-批次模式"`
|
||
|
||
// 交易相关字段
|
||
Price int64 `orm:"price" json:"price" description:"售价(分)"`
|
||
OriginalPrice int64 `orm:"original_price" json:"originalPrice" description:"原价(分)"`
|
||
Description string `orm:"description" json:"description" description:"描述信息"`
|
||
|
||
// 状态字段
|
||
Status marketConsts.MarketStatus `orm:"status" json:"status" description:"状态:1活跃/2已售/3下架/4过期"`
|
||
|
||
// 上架过期时间
|
||
ListExpireAt *int64 `orm:"list_expire_at" json:"listExpireAt,omitempty" description:"上架过期时间(时间戳)"`
|
||
}
|