mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-12-28 05:16:34 +08:00
优化代码
This commit is contained in:
@@ -13,7 +13,7 @@ type CityOptionsAction struct {
|
||||
}
|
||||
|
||||
func (this *CityOptionsAction) RunPost(params struct{}) {
|
||||
citiesResp, err := this.RPC().RegionCityRPC().FindAllEnabledRegionCities(this.AdminContext(), &pb.FindAllEnabledRegionCitiesRequest{
|
||||
citiesResp, err := this.RPC().RegionCityRPC().FindAllRegionCities(this.AdminContext(), &pb.FindAllRegionCitiesRequest{
|
||||
IncludeRegionProvince: true,
|
||||
})
|
||||
if err != nil {
|
||||
|
||||
@@ -14,7 +14,7 @@ type CountryOptionsAction struct {
|
||||
}
|
||||
|
||||
func (this *CountryOptionsAction) RunPost(params struct{}) {
|
||||
countriesResp, err := this.RPC().RegionCountryRPC().FindAllEnabledRegionCountries(this.AdminContext(), &pb.FindAllEnabledRegionCountriesRequest{})
|
||||
countriesResp, err := this.RPC().RegionCountryRPC().FindAllRegionCountries(this.AdminContext(), &pb.FindAllRegionCountriesRequest{})
|
||||
if err != nil {
|
||||
this.ErrorPage(err)
|
||||
return
|
||||
|
||||
@@ -13,7 +13,7 @@ type ProviderOptionsAction struct {
|
||||
}
|
||||
|
||||
func (this *ProviderOptionsAction) RunPost(params struct{}) {
|
||||
providersResp, err := this.RPC().RegionProviderRPC().FindAllEnabledRegionProviders(this.AdminContext(), &pb.FindAllEnabledRegionProvidersRequest{})
|
||||
providersResp, err := this.RPC().RegionProviderRPC().FindAllRegionProviders(this.AdminContext(), &pb.FindAllRegionProvidersRequest{})
|
||||
if err != nil {
|
||||
this.ErrorPage(err)
|
||||
return
|
||||
|
||||
@@ -13,7 +13,7 @@ type ProvinceOptionsAction struct {
|
||||
}
|
||||
|
||||
func (this *ProvinceOptionsAction) RunPost(params struct{}) {
|
||||
provincesResp, err := this.RPC().RegionProvinceRPC().FindAllEnabledRegionProvincesWithCountryId(this.AdminContext(), &pb.FindAllEnabledRegionProvincesWithCountryIdRequest{RegionCountryId: ChinaCountryId})
|
||||
provincesResp, err := this.RPC().RegionProvinceRPC().FindAllRegionProvincesWithCountryId(this.AdminContext(), &pb.FindAllRegionProvincesWithCountryIdRequest{RegionCountryId: ChinaCountryId})
|
||||
if err != nil {
|
||||
this.ErrorPage(err)
|
||||
return
|
||||
|
||||
@@ -23,7 +23,7 @@ func (this *SelectCountriesPopupAction) RunGet(params struct {
|
||||
}) {
|
||||
var selectedCountryIds = utils.SplitNumbers(params.CountryIds)
|
||||
|
||||
countriesResp, err := this.RPC().RegionCountryRPC().FindAllEnabledRegionCountries(this.AdminContext(), &pb.FindAllEnabledRegionCountriesRequest{})
|
||||
countriesResp, err := this.RPC().RegionCountryRPC().FindAllRegionCountries(this.AdminContext(), &pb.FindAllRegionCountriesRequest{})
|
||||
if err != nil {
|
||||
this.ErrorPage(err)
|
||||
return
|
||||
@@ -50,7 +50,7 @@ func (this *SelectCountriesPopupAction) RunPost(params struct {
|
||||
}) {
|
||||
var countryMaps = []maps.Map{}
|
||||
for _, countryId := range params.CountryIds {
|
||||
countryResp, err := this.RPC().RegionCountryRPC().FindEnabledRegionCountry(this.AdminContext(), &pb.FindEnabledRegionCountryRequest{RegionCountryId: countryId})
|
||||
countryResp, err := this.RPC().RegionCountryRPC().FindRegionCountry(this.AdminContext(), &pb.FindRegionCountryRequest{RegionCountryId: countryId})
|
||||
if err != nil {
|
||||
this.ErrorPage(err)
|
||||
return
|
||||
|
||||
@@ -24,7 +24,7 @@ func (this *SelectProvincesPopupAction) RunGet(params struct {
|
||||
}) {
|
||||
var selectedProvinceIds = utils.SplitNumbers(params.ProvinceIds)
|
||||
|
||||
provincesResp, err := this.RPC().RegionProvinceRPC().FindAllEnabledRegionProvincesWithCountryId(this.AdminContext(), &pb.FindAllEnabledRegionProvincesWithCountryIdRequest{RegionCountryId: ChinaCountryId})
|
||||
provincesResp, err := this.RPC().RegionProvinceRPC().FindAllRegionProvincesWithCountryId(this.AdminContext(), &pb.FindAllRegionProvincesWithCountryIdRequest{RegionCountryId: ChinaCountryId})
|
||||
if err != nil {
|
||||
this.ErrorPage(err)
|
||||
return
|
||||
@@ -50,7 +50,7 @@ func (this *SelectProvincesPopupAction) RunPost(params struct {
|
||||
}) {
|
||||
var provinceMaps = []maps.Map{}
|
||||
for _, provinceId := range params.ProvinceIds {
|
||||
provinceResp, err := this.RPC().RegionProvinceRPC().FindEnabledRegionProvince(this.AdminContext(), &pb.FindEnabledRegionProvinceRequest{RegionProvinceId: provinceId})
|
||||
provinceResp, err := this.RPC().RegionProvinceRPC().FindRegionProvince(this.AdminContext(), &pb.FindRegionProvinceRequest{RegionProvinceId: provinceId})
|
||||
if err != nil {
|
||||
this.ErrorPage(err)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user