44 lines
2.6 KiB
Go
44 lines
2.6 KiB
Go
package entity
|
||
|
||
import (
|
||
consts "assets/consts/asset"
|
||
"assets/consts/stock"
|
||
|
||
"gitea.com/red-future/common/beans"
|
||
|
||
"github.com/gogf/gf/v2/encoding/gjson"
|
||
"github.com/gogf/gf/v2/os/gtime"
|
||
)
|
||
|
||
// Asset 资产实体
|
||
type Asset struct {
|
||
beans.SQLBaseDO `orm:",inherit"` // 嵌入基础字段:Id, Creator, CreatedAt, Updater, UpdatedAt, IsDeleted
|
||
// 基础信息
|
||
Name string `orm:"name" json:"name" description:"资产名称"`
|
||
Description string `orm:"description" json:"description" description:"资产描述"`
|
||
Type consts.AssetType `orm:"type" json:"type" description:"资产类型:physical实物/virtual虚拟/service服务"`
|
||
CategoryId uint64 `orm:"category_id" json:"categoryId" description:"分类ID"`
|
||
CategoryPath string `orm:"category_path" json:"categoryPath" description:"分类路径"`
|
||
ImageURL string `orm:"image_url" json:"imageUrl" description:"主图URL"`
|
||
Images []string `orm:"images" json:"images" description:"图片列表(JSONB)"`
|
||
Status *consts.AssetStatus `orm:"status" json:"status" description:"资产状态:1启用/0停用"`
|
||
BasePrice int `orm:"base_price" json:"basePrice" description:"基础价格(分为单位)"`
|
||
Currency string `orm:"currency" json:"currency" description:"货币单位,默认CNY"`
|
||
UnlimitedStock bool `orm:"unlimited_stock" json:"unlimitedStock" description:"是否无库存限制"`
|
||
StockMode stock.StockMode `orm:"stock_mode" json:"stockMode" description:"库存管理模式:1-明细模式 2-批次模式"`
|
||
// 上线和下线时间配置(由定时任务处理资产状态)
|
||
OnlineTime *gtime.Time `orm:"online_time" json:"onlineTime,omitempty" description:"上线时间"`
|
||
OfflineTime *gtime.Time `orm:"offline_time" json:"offlineTime,omitempty" description:"下线时间"`
|
||
|
||
// 类型专用配置 - 实物资产配置(JSONB)
|
||
PhysicalAssetConfig *gjson.Json `orm:"physical_asset_config" json:"physicalAssetConfig" description:"实物资产配置(JSONB)"`
|
||
// 类型专用配置 - 服务资产配置(JSONB)
|
||
ServiceAssetConfig *gjson.Json `orm:"service_asset_config" json:"serviceAssetConfig" description:"服务资产配置(JSONB)"`
|
||
// 类型专用配置 - 虚拟资产配置(JSONB)
|
||
VirtualAssetConfig *gjson.Json `orm:"virtual_asset_config" json:"virtualAssetConfig" description:"虚拟资产配置(JSONB)"`
|
||
// 扩展字段(JSONB)
|
||
Metadata *gjson.Json `orm:"metadata" json:"metadata" description:"动态元数据(JSONB)"`
|
||
|
||
TenantModuleType string `orm:"tenant_module_type" json:"tenantModuleType" description:"租户模块类型"`
|
||
}
|