打包费参数有效性检查

This commit is contained in:
gazebo
2019-12-30 18:35:49 +08:00
parent 3ee2e72a5e
commit d3a02ef958
3 changed files with 48 additions and 3 deletions

View File

@@ -1,5 +1,7 @@
package model
import "reflect"
const (
ConfigTypeSys = "Sys"
ConfigTypePricePack = "PricePack"
@@ -15,6 +17,12 @@ const (
ConfigSysMtwmSkuBoxFee = "MtwmSkuBoxFee" // 美团外卖单商品打包费
)
type SysConfigLimit struct {
ValueType reflect.Kind
MinValue int64
MaxValue int64
}
var (
ConfigTypeName = map[string]string{
ConfigTypeSys: "系统",
@@ -23,6 +31,24 @@ var (
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 {