Files
full/module/ec/mall/internal/models/mall_freight.go

33 lines
1.7 KiB
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package models
import (
"git.apinb.com/bsm-sdk/core/database"
"git.apinb.com/bsm-sdk/core/types"
"gorm.io/gorm"
)
// MallFreight 运费模板/*
type MallFreight struct {
gorm.Model
types.Std_Identity
types.Std_Status // 1 正常
OwnerId uint `gorm:"column:owner_id;Index;"` // 所属机构id
OwnerIdentity string `gorm:"column:owner_identity;type:varchar(255);not null;" json:"owner_identity"` // 所属机构唯一码
CreatedIdentity string `gorm:"column:created_identity;type:varchar(36);Index;"` // 创建者一标识24位NanoID,36位为UUID
Title string `gorm:"column:title;type:varchar(255);not null;" json:"title"` // 名称
PostType int32 `gorm:"column:post_type;default:1;" json:"post_type"` // 是否包邮1包邮2不包邮
Quota int64 `gorm:"column:quota;default:0;" json:"quota"` // 当types=1时满额包邮
CostType int32 `gorm:"column:cost_type;default:1;" json:"cost_type"` // 计费类型1计件收费2按重收费
RegionType int32 `gorm:"column:region_type;default:2;" json:"region_type"` // 区域限售:1限制2不限制
Rules []MallFreightAttr `gorm:"foreignKey:FreightIdentity;references:Identity;" json:"rules"` // 计费规则
}
func init() {
database.AppendMigrate(&MallFreight{})
}
// TableName .
func (table *MallFreight) TableName() string {
return "mall_freight" //对应数据库表名
}