regions

package
v0.5.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 28, 2022 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RegionCityStateEnabled  = 1 // 已启用
	RegionCityStateDisabled = 0 // 已禁用
)
View Source
const (
	RegionCountryStateEnabled  = 1 // 已启用
	RegionCountryStateDisabled = 0 // 已禁用
)
View Source
const (
	RegionProviderStateEnabled  = 1 // 已启用
	RegionProviderStateDisabled = 0 // 已禁用
)
View Source
const (
	RegionProvinceStateEnabled  = 1 // 已启用
	RegionProvinceStateDisabled = 0 // 已禁用
)
View Source
const (
	RegionTownStateEnabled  = 1 // 已启用
	RegionTownStateDisabled = 0 // 已禁用
)
View Source
const (
	CountryChinaId = 1
)

Variables

View Source
var SharedCacheLocker = sync.RWMutex{}

Functions

This section is empty.

Types

type RegionCity

type RegionCity struct {
	Id          uint32   `field:"id"`          // ID
	ProvinceId  uint32   `field:"provinceId"`  // 省份ID
	Name        string   `field:"name"`        // 名称
	Codes       dbs.JSON `field:"codes"`       // 代号
	CustomName  string   `field:"customName"`  // 自定义名称
	CustomCodes dbs.JSON `field:"customCodes"` // 自定义代号
	State       uint8    `field:"state"`       // 状态
	DataId      string   `field:"dataId"`      // 原始数据ID
}

RegionCity 区域-城市

func (*RegionCity) AllCodes added in v0.5.0

func (this *RegionCity) AllCodes() []string

func (*RegionCity) DecodeCodes

func (this *RegionCity) DecodeCodes() []string

func (*RegionCity) DecodeCustomCodes added in v0.5.0

func (this *RegionCity) DecodeCustomCodes() []string

func (*RegionCity) DisplayName added in v0.5.0

func (this *RegionCity) DisplayName() string

type RegionCityDAO

type RegionCityDAO dbs.DAO
var SharedRegionCityDAO *RegionCityDAO

func NewRegionCityDAO

func NewRegionCityDAO() *RegionCityDAO

func (*RegionCityDAO) CreateCity

func (this *RegionCityDAO) CreateCity(tx *dbs.Tx, provinceId int64, name string, dataId string) (int64, error)

CreateCity 创建城市

func (*RegionCityDAO) DisableRegionCity

func (this *RegionCityDAO) DisableRegionCity(tx *dbs.Tx, id uint32) error

DisableRegionCity 禁用条目

func (*RegionCityDAO) EnableRegionCity

func (this *RegionCityDAO) EnableRegionCity(tx *dbs.Tx, id uint32) error

EnableRegionCity 启用条目

func (*RegionCityDAO) FindAllEnabledCities

func (this *RegionCityDAO) FindAllEnabledCities(tx *dbs.Tx) (result []*RegionCity, err error)

FindAllEnabledCities 获取所有城市信息

func (*RegionCityDAO) FindAllEnabledCitiesWithProvinceId added in v0.5.0

func (this *RegionCityDAO) FindAllEnabledCitiesWithProvinceId(tx *dbs.Tx, provinceId int64) (result []*RegionCity, err error)

FindAllEnabledCitiesWithProvinceId 获取某个省份下的所有城市

func (*RegionCityDAO) FindCityIdWithName added in v0.5.0

func (this *RegionCityDAO) FindCityIdWithName(tx *dbs.Tx, provinceId int64, cityName string) (int64, error)

FindCityIdWithName 根据城市名查找城市ID

func (*RegionCityDAO) FindCityIdWithNameCacheable

func (this *RegionCityDAO) FindCityIdWithNameCacheable(tx *dbs.Tx, provinceId int64, cityName string) (int64, error)

FindCityIdWithNameCacheable 根据城市名查找城市ID,并加入缓存

func (*RegionCityDAO) FindCityWithDataId

func (this *RegionCityDAO) FindCityWithDataId(tx *dbs.Tx, dataId string) (int64, error)

FindCityWithDataId 根据数据ID查找城市

func (*RegionCityDAO) FindEnabledRegionCity

func (this *RegionCityDAO) FindEnabledRegionCity(tx *dbs.Tx, id int64) (*RegionCity, error)

FindEnabledRegionCity 查找启用中的条目

func (*RegionCityDAO) FindRegionCityName

func (this *RegionCityDAO) FindRegionCityName(tx *dbs.Tx, id uint32) (string, error)

FindRegionCityName 根据主键查找名称

func (*RegionCityDAO) FindSimilarCities added in v0.5.0

func (this *RegionCityDAO) FindSimilarCities(cities []*RegionCity, cityName string, size int) (result []*RegionCity)

FindSimilarCities 查找类似城市名

func (*RegionCityDAO) UpdateCityCustom added in v0.5.0

func (this *RegionCityDAO) UpdateCityCustom(tx *dbs.Tx, cityId int64, customName string, customCodes []string) error

UpdateCityCustom 自定义城市信息

type RegionCityOperator

type RegionCityOperator struct {
	Id          interface{} // ID
	ProvinceId  interface{} // 省份ID
	Name        interface{} // 名称
	Codes       interface{} // 代号
	CustomName  interface{} // 自定义名称
	CustomCodes interface{} // 自定义代号
	State       interface{} // 状态
	DataId      interface{} // 原始数据ID
}

func NewRegionCityOperator

func NewRegionCityOperator() *RegionCityOperator

type RegionCountry

type RegionCountry struct {
	Id          uint32   `field:"id"`          // ID
	Name        string   `field:"name"`        // 名称
	Codes       dbs.JSON `field:"codes"`       // 代号
	CustomName  string   `field:"customName"`  // 自定义名称
	CustomCodes dbs.JSON `field:"customCodes"` // 自定义代号
	State       uint8    `field:"state"`       // 状态
	DataId      string   `field:"dataId"`      // 原始数据ID
	Pinyin      dbs.JSON `field:"pinyin"`      // 拼音
}

RegionCountry 区域-国家/地区

func (*RegionCountry) AllCodes added in v0.5.0

func (this *RegionCountry) AllCodes() []string

func (*RegionCountry) DecodeCodes

func (this *RegionCountry) DecodeCodes() []string

func (*RegionCountry) DecodeCustomCodes added in v0.5.0

func (this *RegionCountry) DecodeCustomCodes() []string

func (*RegionCountry) DisplayName added in v0.5.0

func (this *RegionCountry) DisplayName() string

type RegionCountryDAO

type RegionCountryDAO dbs.DAO
var SharedRegionCountryDAO *RegionCountryDAO

func NewRegionCountryDAO

func NewRegionCountryDAO() *RegionCountryDAO

func (*RegionCountryDAO) CreateCountry

func (this *RegionCountryDAO) CreateCountry(tx *dbs.Tx, name string, dataId string) (int64, error)

CreateCountry 根据数据ID创建国家

func (*RegionCountryDAO) DisableRegionCountry

func (this *RegionCountryDAO) DisableRegionCountry(tx *dbs.Tx, id int64) error

DisableRegionCountry 禁用条目

func (*RegionCountryDAO) EnableRegionCountry

func (this *RegionCountryDAO) EnableRegionCountry(tx *dbs.Tx, id uint32) error

EnableRegionCountry 启用条目

func (*RegionCountryDAO) FindAllCountries added in v0.5.0

func (this *RegionCountryDAO) FindAllCountries(tx *dbs.Tx) (result []*RegionCountry, err error)

FindAllCountries 查找所有可用的国家

func (*RegionCountryDAO) FindAllEnabledCountriesOrderByPinyin

func (this *RegionCountryDAO) FindAllEnabledCountriesOrderByPinyin(tx *dbs.Tx) (result []*RegionCountry, err error)

FindAllEnabledCountriesOrderByPinyin 查找所有可用的国家并按拼音排序

func (*RegionCountryDAO) FindCountryIdWithDataId

func (this *RegionCountryDAO) FindCountryIdWithDataId(tx *dbs.Tx, dataId string) (int64, error)

FindCountryIdWithDataId 根据数据ID查找国家

func (*RegionCountryDAO) FindCountryIdWithName

func (this *RegionCountryDAO) FindCountryIdWithName(tx *dbs.Tx, countryName string) (int64, error)

FindCountryIdWithName 根据国家名查找国家ID

func (*RegionCountryDAO) FindCountryIdWithNameCacheable

func (this *RegionCountryDAO) FindCountryIdWithNameCacheable(tx *dbs.Tx, countryName string) (int64, error)

FindCountryIdWithNameCacheable 根据国家名查找国家ID,并可使用缓存

func (*RegionCountryDAO) FindEnabledRegionCountry

func (this *RegionCountryDAO) FindEnabledRegionCountry(tx *dbs.Tx, id int64) (*RegionCountry, error)

FindEnabledRegionCountry 查找启用中的条目

func (*RegionCountryDAO) FindRegionCountryName

func (this *RegionCountryDAO) FindRegionCountryName(tx *dbs.Tx, id int64) (string, error)

FindRegionCountryName 根据主键查找名称

func (*RegionCountryDAO) FindSimilarCountries added in v0.5.0

func (this *RegionCountryDAO) FindSimilarCountries(countries []*RegionCountry, countryName string, size int) (result []*RegionCountry)

FindSimilarCountries 查找类似国家/地区名

func (*RegionCountryDAO) UpdateCountryCustom added in v0.5.0

func (this *RegionCountryDAO) UpdateCountryCustom(tx *dbs.Tx, countryId int64, customName string, customCodes []string) error

UpdateCountryCustom 修改国家/地区自定义

type RegionCountryOperator

type RegionCountryOperator struct {
	Id          interface{} // ID
	Name        interface{} // 名称
	Codes       interface{} // 代号
	CustomName  interface{} // 自定义名称
	CustomCodes interface{} // 自定义代号
	State       interface{} // 状态
	DataId      interface{} // 原始数据ID
	Pinyin      interface{} // 拼音
}

func NewRegionCountryOperator

func NewRegionCountryOperator() *RegionCountryOperator

type RegionProvider

type RegionProvider struct {
	Id          uint32   `field:"id"`          // ID
	Name        string   `field:"name"`        // 名称
	Codes       dbs.JSON `field:"codes"`       // 代号
	CustomName  string   `field:"customName"`  // 自定义名称
	CustomCodes dbs.JSON `field:"customCodes"` // 自定义代号
	State       uint8    `field:"state"`       // 状态
}

RegionProvider 区域-运营商

func (*RegionProvider) AllCodes added in v0.5.0

func (this *RegionProvider) AllCodes() []string

func (*RegionProvider) DecodeCodes

func (this *RegionProvider) DecodeCodes() []string

func (*RegionProvider) DecodeCustomCodes added in v0.5.0

func (this *RegionProvider) DecodeCustomCodes() []string

func (*RegionProvider) DisplayName added in v0.5.0

func (this *RegionProvider) DisplayName() string

type RegionProviderDAO

type RegionProviderDAO dbs.DAO
var SharedRegionProviderDAO *RegionProviderDAO

func NewRegionProviderDAO

func NewRegionProviderDAO() *RegionProviderDAO

func (*RegionProviderDAO) CreateProvider

func (this *RegionProviderDAO) CreateProvider(tx *dbs.Tx, name string) (int64, error)

CreateProvider 创建Provider

func (*RegionProviderDAO) DisableRegionProvider

func (this *RegionProviderDAO) DisableRegionProvider(tx *dbs.Tx, id uint32) error

DisableRegionProvider 禁用条目

func (*RegionProviderDAO) EnableRegionProvider

func (this *RegionProviderDAO) EnableRegionProvider(tx *dbs.Tx, id uint32) error

EnableRegionProvider 启用条目

func (*RegionProviderDAO) FindAllEnabledProviders

func (this *RegionProviderDAO) FindAllEnabledProviders(tx *dbs.Tx) (result []*RegionProvider, err error)

FindAllEnabledProviders 查找所有服务商

func (*RegionProviderDAO) FindEnabledRegionProvider

func (this *RegionProviderDAO) FindEnabledRegionProvider(tx *dbs.Tx, id int64) (*RegionProvider, error)

FindEnabledRegionProvider 查找启用中的条目

func (*RegionProviderDAO) FindProviderIdWithName added in v0.5.0

func (this *RegionProviderDAO) FindProviderIdWithName(tx *dbs.Tx, providerName string) (int64, error)

FindProviderIdWithName 根据服务商名称查找服务商ID

func (*RegionProviderDAO) FindProviderIdWithNameCacheable

func (this *RegionProviderDAO) FindProviderIdWithNameCacheable(tx *dbs.Tx, providerName string) (int64, error)

FindProviderIdWithNameCacheable 根据服务商名称查找服务商ID,并保存进缓存

func (*RegionProviderDAO) FindRegionProviderName

func (this *RegionProviderDAO) FindRegionProviderName(tx *dbs.Tx, id uint32) (string, error)

FindRegionProviderName 根据主键查找名称

func (*RegionProviderDAO) FindSimilarProviders added in v0.5.0

func (this *RegionProviderDAO) FindSimilarProviders(providers []*RegionProvider, providerName string, size int) (result []*RegionProvider)

FindSimilarProviders 查找类似ISP运营商

func (*RegionProviderDAO) UpdateProviderCustom added in v0.5.0

func (this *RegionProviderDAO) UpdateProviderCustom(tx *dbs.Tx, providerId int64, customName string, customCodes []string) error

UpdateProviderCustom 修改ISP自定义信息

type RegionProviderOperator

type RegionProviderOperator struct {
	Id          interface{} // ID
	Name        interface{} // 名称
	Codes       interface{} // 代号
	CustomName  interface{} // 自定义名称
	CustomCodes interface{} // 自定义代号
	State       interface{} // 状态
}

func NewRegionProviderOperator

func NewRegionProviderOperator() *RegionProviderOperator

type RegionProvince

type RegionProvince struct {
	Id          uint32   `field:"id"`          // ID
	CountryId   uint32   `field:"countryId"`   // 国家ID
	Name        string   `field:"name"`        // 名称
	Codes       dbs.JSON `field:"codes"`       // 代号
	CustomName  string   `field:"customName"`  // 自定义名称
	CustomCodes dbs.JSON `field:"customCodes"` // 自定义代号
	State       uint8    `field:"state"`       // 状态
	DataId      string   `field:"dataId"`      // 原始数据ID
}

RegionProvince 区域-省份

func (*RegionProvince) AllCodes added in v0.5.0

func (this *RegionProvince) AllCodes() []string

func (*RegionProvince) DecodeCodes

func (this *RegionProvince) DecodeCodes() []string

func (*RegionProvince) DecodeCustomCodes added in v0.5.0

func (this *RegionProvince) DecodeCustomCodes() []string

func (*RegionProvince) DisplayName added in v0.5.0

func (this *RegionProvince) DisplayName() string

type RegionProvinceDAO

type RegionProvinceDAO dbs.DAO
var SharedRegionProvinceDAO *RegionProvinceDAO

func NewRegionProvinceDAO

func NewRegionProvinceDAO() *RegionProvinceDAO

func (*RegionProvinceDAO) CreateProvince

func (this *RegionProvinceDAO) CreateProvince(tx *dbs.Tx, countryId int64, name string, dataId string) (int64, error)

CreateProvince 创建省份

func (*RegionProvinceDAO) DisableRegionProvince

func (this *RegionProvinceDAO) DisableRegionProvince(tx *dbs.Tx, id int64) error

DisableRegionProvince 禁用条目

func (*RegionProvinceDAO) EnableRegionProvince

func (this *RegionProvinceDAO) EnableRegionProvince(tx *dbs.Tx, id int64) error

EnableRegionProvince 启用条目

func (*RegionProvinceDAO) FindAllEnabledProvinces added in v0.5.0

func (this *RegionProvinceDAO) FindAllEnabledProvinces(tx *dbs.Tx) (result []*RegionProvince, err error)

FindAllEnabledProvinces 查找所有省份

func (*RegionProvinceDAO) FindAllEnabledProvincesWithCountryId

func (this *RegionProvinceDAO) FindAllEnabledProvincesWithCountryId(tx *dbs.Tx, countryId int64) (result []*RegionProvince, err error)

FindAllEnabledProvincesWithCountryId 查找某个国家/地区的所有省份

func (*RegionProvinceDAO) FindEnabledRegionProvince

func (this *RegionProvinceDAO) FindEnabledRegionProvince(tx *dbs.Tx, id int64) (*RegionProvince, error)

FindEnabledRegionProvince 查找启用中的条目

func (*RegionProvinceDAO) FindProvinceIdWithDataId

func (this *RegionProvinceDAO) FindProvinceIdWithDataId(tx *dbs.Tx, dataId string) (int64, error)

FindProvinceIdWithDataId 根据数据ID查找省份

func (*RegionProvinceDAO) FindProvinceIdWithName

func (this *RegionProvinceDAO) FindProvinceIdWithName(tx *dbs.Tx, countryId int64, provinceName string) (int64, error)

FindProvinceIdWithName 根据省份名查找省份ID

func (*RegionProvinceDAO) FindProvinceIdWithNameCacheable

func (this *RegionProvinceDAO) FindProvinceIdWithNameCacheable(tx *dbs.Tx, countryId int64, provinceName string) (int64, error)

FindProvinceIdWithNameCacheable 根据省份名查找省份ID,并可使用缓存

func (*RegionProvinceDAO) FindRegionProvinceName

func (this *RegionProvinceDAO) FindRegionProvinceName(tx *dbs.Tx, id int64) (string, error)

FindRegionProvinceName 根据主键查找名称

func (*RegionProvinceDAO) FindSimilarProvinces added in v0.5.0

func (this *RegionProvinceDAO) FindSimilarProvinces(provinces []*RegionProvince, provinceName string, size int) (result []*RegionProvince)

FindSimilarProvinces 查找类似省份名

func (*RegionProvinceDAO) UpdateProvinceCustom added in v0.5.0

func (this *RegionProvinceDAO) UpdateProvinceCustom(tx *dbs.Tx, provinceId int64, customName string, customCodes []string) error

UpdateProvinceCustom 修改自定义省份信息

type RegionProvinceOperator

type RegionProvinceOperator struct {
	Id          interface{} // ID
	CountryId   interface{} // 国家ID
	Name        interface{} // 名称
	Codes       interface{} // 代号
	CustomName  interface{} // 自定义名称
	CustomCodes interface{} // 自定义代号
	State       interface{} // 状态
	DataId      interface{} // 原始数据ID
}

func NewRegionProvinceOperator

func NewRegionProvinceOperator() *RegionProvinceOperator

type RegionTown added in v0.5.0

type RegionTown struct {
	Id          uint32   `field:"id"`          // ID
	CityId      uint32   `field:"cityId"`      // 城市ID
	Name        string   `field:"name"`        // 名称
	Codes       dbs.JSON `field:"codes"`       // 代号
	CustomName  string   `field:"customName"`  // 自定义名称
	CustomCodes dbs.JSON `field:"customCodes"` // 自定义代号
	State       uint8    `field:"state"`       // 状态
	DataId      string   `field:"dataId"`      // 原始数据ID
}

RegionTown 区域-省份

func (*RegionTown) AllCodes added in v0.5.0

func (this *RegionTown) AllCodes() []string

func (*RegionTown) DecodeCodes added in v0.5.0

func (this *RegionTown) DecodeCodes() []string

func (*RegionTown) DecodeCustomCodes added in v0.5.0

func (this *RegionTown) DecodeCustomCodes() []string

func (*RegionTown) DisplayName added in v0.5.0

func (this *RegionTown) DisplayName() string

type RegionTownDAO added in v0.5.0

type RegionTownDAO dbs.DAO
var SharedRegionTownDAO *RegionTownDAO

func NewRegionTownDAO added in v0.5.0

func NewRegionTownDAO() *RegionTownDAO

func (*RegionTownDAO) CreateTown added in v0.5.2

func (this *RegionTownDAO) CreateTown(tx *dbs.Tx, cityId int64, townName string) (int64, error)

CreateTown 创建区县

func (*RegionTownDAO) DisableRegionTown added in v0.5.0

func (this *RegionTownDAO) DisableRegionTown(tx *dbs.Tx, id uint32) error

DisableRegionTown 禁用条目

func (*RegionTownDAO) EnableRegionTown added in v0.5.0

func (this *RegionTownDAO) EnableRegionTown(tx *dbs.Tx, id uint32) error

EnableRegionTown 启用条目

func (*RegionTownDAO) FindAllRegionTowns added in v0.5.0

func (this *RegionTownDAO) FindAllRegionTowns(tx *dbs.Tx) (result []*RegionTown, err error)

FindAllRegionTowns 获取所有的区县

func (*RegionTownDAO) FindAllRegionTownsWithCityId added in v0.5.0

func (this *RegionTownDAO) FindAllRegionTownsWithCityId(tx *dbs.Tx, cityId int64) (result []*RegionTown, err error)

FindAllRegionTownsWithCityId 根据城市查找区县

func (*RegionTownDAO) FindEnabledRegionTown added in v0.5.0

func (this *RegionTownDAO) FindEnabledRegionTown(tx *dbs.Tx, id int64) (*RegionTown, error)

FindEnabledRegionTown 查找启用中的区县

func (*RegionTownDAO) FindRegionTownName added in v0.5.0

func (this *RegionTownDAO) FindRegionTownName(tx *dbs.Tx, id uint32) (string, error)

FindRegionTownName 根据主键查找名称

func (*RegionTownDAO) FindSimilarTowns added in v0.5.0

func (this *RegionTownDAO) FindSimilarTowns(towns []*RegionTown, townName string, size int) (result []*RegionTown)

FindSimilarTowns 查找类似区县

func (*RegionTownDAO) FindTownIdWithName added in v0.5.0

func (this *RegionTownDAO) FindTownIdWithName(tx *dbs.Tx, cityId int64, townName string) (int64, error)

FindTownIdWithName 根据区县名查找区县ID

func (*RegionTownDAO) UpdateTownCustom added in v0.5.0

func (this *RegionTownDAO) UpdateTownCustom(tx *dbs.Tx, townId int64, customName string, customCodes []string) error

UpdateTownCustom 修改自定义县级信息

type RegionTownOperator added in v0.5.0

type RegionTownOperator struct {
	Id          interface{} // ID
	CityId      interface{} // 城市ID
	Name        interface{} // 名称
	Codes       interface{} // 代号
	CustomName  interface{} // 自定义名称
	CustomCodes interface{} // 自定义代号
	State       interface{} // 状态
	DataId      interface{} // 原始数据ID
}

func NewRegionTownOperator added in v0.5.0

func NewRegionTownOperator() *RegionTownOperator

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL