|
- package enum
-
- // MallGoodsType 商品类型
- type MallGoodsType int
-
- const MallGoodsReal MallGoodsType = 1
-
- func (em MallGoodsType) String() struct {
- Name string
- Desc string
- } {
- switch em {
- case MallGoodsReal:
- return struct {
- Name string
- Desc string
- }{Name: "实物商品", Desc: "物流发货"}
- default:
- return struct {
- Name string
- Desc string
- }{Name: "未知类型", Desc: ""}
- }
- }
-
- // MallVipDiscountType 商品VIP折扣类型
- type MallVipDiscountType int
-
- const (
- MallDiscountTypeDiscount MallVipDiscountType = iota + 1
- MallDiscountTypeMinus
- MallDiscountTypeSpecify
- )
-
- func (em MallVipDiscountType) String() string {
- switch em {
- case MallDiscountTypeDiscount:
- return "打折"
- case MallDiscountTypeMinus:
- return "减价"
- case MallDiscountTypeSpecify:
- return "指定价格"
- default:
- return "未知类型"
- }
- }
-
- // MallShippingType 配送方式
- type MallShippingType int
-
- const MallShippingTypeExpress = 1
-
- func (em MallShippingType) String() string {
- switch em {
- case MallShippingTypeExpress:
- return "快递"
- default:
- return "未知类型"
- }
- }
-
- type MallShippingFeeType int
-
- const (
- MallShippingFeeTypeUnify MallShippingFeeType = iota + 1
- MallShippingFeeTypeTpl
- )
-
- func (em MallShippingFeeType) String() string {
- switch em {
- case MallShippingFeeTypeUnify:
- return "统一运费"
- case MallShippingFeeTypeTpl:
- return "运费模板"
- default:
- return "未知类型"
- }
- }
-
- type ShippingTemplateCalculateType int
-
- const (
- ShippingTemplateCalculateWeight ShippingTemplateCalculateType = iota + 1 // 重量计算
- ShippingTemplateCalculatePiece // 件计算
- )
-
- func (st ShippingTemplateCalculateType) String() string {
- switch st {
- case ShippingTemplateCalculatePiece:
- return "按件计算"
- case ShippingTemplateCalculateWeight:
- return "按重量计算"
- default:
- return "unkonwn"
- }
- }
-
- // MallGoodsSaleState 商品上架状态
- type MallGoodsSaleState int
-
- const (
- MallGoodsSaleStateOnShelf MallGoodsSaleState = iota + 1
- MallGoodsSaleStateTiming
- MallGoodsSaleStateOffShelf
- )
-
- func (em MallGoodsSaleState) String() string {
- switch em {
- case MallGoodsSaleStateOnShelf:
- return "立即开售"
- case MallGoodsSaleStateTiming:
- return "定时开售"
- case MallGoodsSaleStateOffShelf:
- return "放入仓库"
- default:
- return "未知类型"
- }
- }
-
- type MallGoodsActivityType int
-
- const (
- MallGoodsActivityGroup MallGoodsActivityType = iota + 1
- MallGoodsActivitySecKill
- MallGoodsActivityBargain
- MallGoodsActivitySuperGroup
- MallGoodsActivityUpdateLv
- )
-
- func (em MallGoodsActivityType) String() string {
- switch em {
- case MallGoodsActivityGroup:
- return "拼团活动"
- case MallGoodsActivitySecKill:
- return "秒杀活动"
- case MallGoodsActivityBargain:
- return "砍价活动"
- case MallGoodsActivitySuperGroup:
- return "超级拼团"
- case MallGoodsActivityUpdateLv:
- return "升级礼包"
- default:
- return "未参加活动"
- }
- }
-
- type MallGoodsServiceType int
-
- const (
- MallGoodsServiceShippingByManufacturer MallGoodsServiceType = iota + 1
- MallGoodsServiceSevenDayReturn
- MallGoodsServiceOfficialReal
- )
-
- func (em MallGoodsServiceType) String() string {
- switch em {
- case MallGoodsServiceShippingByManufacturer:
- return "厂家配送"
- case MallGoodsServiceSevenDayReturn:
- return "七天无理由退换"
- case MallGoodsServiceOfficialReal:
- return "官方保真"
- default:
- return "其他服务"
- }
- }
|