Files
jx-callback/business/model/new_config.go
2019-12-30 18:35:49 +08:00

68 lines
1.5 KiB
Go

package model
import "reflect"
const (
ConfigTypeSys = "Sys"
ConfigTypePricePack = "PricePack"
ConfigTypeFreightPack = "FreightPack"
ConfigTypeBank = "Bank"
ConfigTypeRole = "Role"
)
const (
ConfigSysFakeOrderMobiles = "FakeOrderMobiles" // 假订单手机
ConfigSysEbaiBoxFee = "EbaiBoxFee" // 饿百打包费
ConfigSysMtwmBoxFee = "MtwmBoxFee" // 美团外卖打包费
ConfigSysMtwmSkuBoxFee = "MtwmSkuBoxFee" // 美团外卖单商品打包费
)
type SysConfigLimit struct {
ValueType reflect.Kind
MinValue int64
MaxValue int64
}
var (
ConfigTypeName = map[string]string{
ConfigTypeSys: "系统",
ConfigTypePricePack: "价格包",
ConfigTypeFreightPack: "免运包",
ConfigTypeBank: "银行",
ConfigTypeRole: "角色",
}
SysConfigLimitMap = map[string]*SysConfigLimit{
ConfigSysEbaiBoxFee: &SysConfigLimit{
ValueType: reflect.Int,
MinValue: 0,
MaxValue: 500,
},
ConfigSysMtwmBoxFee: &SysConfigLimit{
ValueType: reflect.Int,
MinValue: 0,
MaxValue: 500,
},
ConfigSysMtwmSkuBoxFee: &SysConfigLimit{
ValueType: reflect.Int,
MinValue: 0,
MaxValue: 50,
},
}
)
type NewConfig struct {
ModelIDCULD
Type string `orm:"size(16)" json:"type"`
Key string `orm:"size(32)" json:"key"`
Value string `orm:"size(4096)" json:"value"`
}
func (*NewConfig) TableUnique() [][]string {
return [][]string{
[]string{"Key", "Type", "DeletedAt"},
[]string{"Type", "Key", "DeletedAt"},
}
}