| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- // Code generated by excel export. DO NOT EDIT.
- package data
- var Charge = &chargeConfig{}
- func init() {
- _allList = append(_allList, Charge)
- }
- type (
- ChargeRow struct {
- ID int32 `json:"ID"` // ID
- ChargeType int32 `json:"ChargeType"` // 充值类型
- Amount int32 `json:"Amount"` // 金额
- ChargePoints int32 `json:"ChargePoints"` // 充值积分
- }
- chargeConfig struct {
- baseConfig
- list []*ChargeRow // all list
- idUniMaps map[int32]*ChargeRow // key:id
- }
- )
- func (p *chargeConfig) Name() string {
- return "charge"
- }
- func (p *chargeConfig) Init() {
- p.idUniMaps = map[int32]*ChargeRow{}
- }
- func (p *chargeConfig) OnLoad(maps interface{}, reload bool) (int, error) {
- if reload && p.denyLoad {
- return 0, nil
- }
- var list []*ChargeRow
- if err := DecodeData(maps, &list); err != nil {
- return 0, err
- }
- p.list = list
- idUniMaps := map[int32]*ChargeRow{}
- for _, row := range list {
- idUniMaps[row.ID] = row
- }
- p.idUniMaps = idUniMaps
- return len(list), nil
- }
- // func (p *chargeConfig) OnAfterLoad(_ bool) {
- // }
- func (p *chargeConfig) List() []*ChargeRow {
- return p.list
- }
- func (p *chargeConfig) GetByID(id int32) (*ChargeRow, bool) {
- value, found := p.idUniMaps[id]
- return value, found
- }
- func (p *chargeConfig) ContainID(id int32) bool {
- _, found := p.idUniMaps[id]
- return found
- }
|