初步完成新版IP库

This commit is contained in:
刘祥超
2022-08-21 20:38:34 +08:00
parent a15a630265
commit 756cf4a9ae
21 changed files with 173 additions and 4318 deletions

View File

@@ -162,3 +162,19 @@ func (this *RegionTownDAO) FindSimilarTowns(towns []*RegionTown, townName string
return
}
// CreateTown 创建区县
func (this *RegionTownDAO) CreateTown(tx *dbs.Tx, cityId int64, townName string) (int64, error) {
var op = NewRegionTownOperator()
op.CityId = cityId
op.Name = townName
codes, err := json.Marshal([]string{townName})
if err != nil {
return 0, err
}
op.Codes = codes
op.State = RegionTownStateEnabled
return this.SaveInt64(tx, op)
}