| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- // Code generated by excel export. DO NOT EDIT.
- package data
- var MapAreaCounty = &mapAreaCountyConfig{}
- func init() {
- _allList = append(_allList, MapAreaCounty)
- }
- type (
- MapAreaCountyRow struct {
- CountyID int32 `json:"CountyID"` // 县ID
- }
- mapAreaCountyConfig struct {
- baseConfig
- list []*MapAreaCountyRow // all list
- countyIDUniMaps map[int32]*MapAreaCountyRow // key:countyID
- }
- )
- func (p *mapAreaCountyConfig) Name() string {
- return "map_area_county"
- }
- func (p *mapAreaCountyConfig) Init() {
- p.countyIDUniMaps = map[int32]*MapAreaCountyRow{}
- }
- func (p *mapAreaCountyConfig) OnLoad(maps interface{}, reload bool) (int, error) {
- if reload && p.denyLoad {
- return 0, nil
- }
- var list []*MapAreaCountyRow
- if err := DecodeData(maps, &list); err != nil {
- return 0, err
- }
- p.list = list
- countyIDUniMaps := map[int32]*MapAreaCountyRow{}
- for _, row := range list {
- countyIDUniMaps[row.CountyID] = row
- }
- p.countyIDUniMaps = countyIDUniMaps
- return len(list), nil
- }
- // func (p *mapAreaCountyConfig) OnAfterLoad(_ bool) {
- // }
- func (p *mapAreaCountyConfig) List() []*MapAreaCountyRow {
- return p.list
- }
- func (p *mapAreaCountyConfig) GetByCountyID(countyID int32) (*MapAreaCountyRow, bool) {
- value, found := p.countyIDUniMaps[countyID]
- return value, found
- }
- func (p *mapAreaCountyConfig) ContainCountyID(countyID int32) bool {
- _, found := p.countyIDUniMaps[countyID]
- return found
- }
|