// Code generated by excel export. DO NOT EDIT. package data var VipDailyExp = &vipDailyExpConfig{} func init() { _allList = append(_allList, VipDailyExp) } type ( VipDailyExpRow struct { Day int32 `json:"Day"` // 天数 Exp int64 `json:"Exp"` // 点数 } vipDailyExpConfig struct { baseConfig list []*VipDailyExpRow // all list dayUniMaps map[int32]*VipDailyExpRow // key:day } ) func (p *vipDailyExpConfig) Name() string { return "vip_daily_exp" } func (p *vipDailyExpConfig) Init() { p.dayUniMaps = map[int32]*VipDailyExpRow{} } func (p *vipDailyExpConfig) OnLoad(maps interface{}, reload bool) (int, error) { if reload && p.denyLoad { return 0, nil } var list []*VipDailyExpRow if err := DecodeData(maps, &list); err != nil { return 0, err } p.list = list dayUniMaps := map[int32]*VipDailyExpRow{} for _, row := range list { dayUniMaps[row.Day] = row } p.dayUniMaps = dayUniMaps return len(list), nil } // func (p *vipDailyExpConfig) OnAfterLoad(_ bool) { // } func (p *vipDailyExpConfig) List() []*VipDailyExpRow { return p.list } func (p *vipDailyExpConfig) GetByDay(day int32) (*VipDailyExpRow, bool) { value, found := p.dayUniMaps[day] return value, found } func (p *vipDailyExpConfig) ContainDay(day int32) bool { _, found := p.dayUniMaps[day] return found }