mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-12-25 22:46:35 +08:00
智能DNS中国家/地区线路下支持省/州的细分
This commit is contained in:
@@ -98,6 +98,14 @@ func (this *RegionCountryDAO) FindRegionCountryName(tx *dbs.Tx, id int64) (strin
|
||||
return name, nil
|
||||
}
|
||||
|
||||
// FindRegionCountryRouteCode 查找国家|地区线路代号
|
||||
func (this *RegionCountryDAO) FindRegionCountryRouteCode(tx *dbs.Tx, countryId int64) (string, error) {
|
||||
return this.Query(tx).
|
||||
Attr("valueId", countryId).
|
||||
Result("routeCode").
|
||||
FindStringCol("")
|
||||
}
|
||||
|
||||
// FindCountryIdWithDataId 根据数据ID查找国家
|
||||
func (this *RegionCountryDAO) FindCountryIdWithDataId(tx *dbs.Tx, dataId string) (int64, error) {
|
||||
return this.Query(tx).
|
||||
|
||||
@@ -77,6 +77,14 @@ func (this *RegionProvinceDAO) FindRegionProvinceName(tx *dbs.Tx, id int64) (str
|
||||
FindStringCol("")
|
||||
}
|
||||
|
||||
// FindRegionCountryId 获取省份对应的国家|地区
|
||||
func (this *RegionProvinceDAO) FindRegionCountryId(tx *dbs.Tx, provinceId int64) (int64, error) {
|
||||
return this.Query(tx).
|
||||
Attr("valueId", provinceId).
|
||||
Result("countryId").
|
||||
FindInt64Col(0)
|
||||
}
|
||||
|
||||
// FindProvinceIdWithDataId 根据数据ID查找省份
|
||||
func (this *RegionProvinceDAO) FindProvinceIdWithDataId(tx *dbs.Tx, dataId string) (int64, error) {
|
||||
return this.Query(tx).
|
||||
|
||||
Reference in New Issue
Block a user