location #135

Merged
trunglam merged 2 commits from refactor-location-1701 into master 2023-01-18 02:27:49 +00:00
2 changed files with 40 additions and 40 deletions
Showing only changes of commit 5a47acc373 - Show all commits

View File

@ -19,7 +19,7 @@ func GetLocation() Location {
// GetLocationByCode ... // GetLocationByCode ...
func (l Location) GetLocationByCode(payload model.LocationRequestPayload) (*model.ResponseLocationAddress, error) { func (l Location) GetLocationByCode(payload model.LocationRequestPayload) (*model.ResponseLocationAddress, error) {
msg, err := natsio.GetServer().Request(subject.Location.GetLocationByCodeNew, toBytes(payload)) msg, err := natsio.GetServer().Request(subject.Location.GetLocationByCodeFromLocationService, toBytes(payload))
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -40,7 +40,7 @@ func (l Location) GetLocationByCode(payload model.LocationRequestPayload) (*mode
// GetProvincesByCodes ... // GetProvincesByCodes ...
func (l Location) GetProvincesByCodes(p model.ProvinceRequestPayload) (*model.LocationProvinceResponse, error) { func (l Location) GetProvincesByCodes(p model.ProvinceRequestPayload) (*model.LocationProvinceResponse, error) {
msg, err := natsio.GetServer().Request(subject.Location.GetProvincesByCodesNew, toBytes(p)) msg, err := natsio.GetServer().Request(subject.Location.GetProvincesByCodesFromLocationService, toBytes(p))
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -62,7 +62,7 @@ func (l Location) GetProvincesByCodes(p model.ProvinceRequestPayload) (*model.Lo
// GetDistrictsByCodes ... // GetDistrictsByCodes ...
func (l Location) GetDistrictsByCodes(p model.DistrictRequestPayload) (*model.LocationDistrictResponse, error) { func (l Location) GetDistrictsByCodes(p model.DistrictRequestPayload) (*model.LocationDistrictResponse, error) {
msg, err := natsio.GetServer().Request(subject.Location.GetDistrictsByCodesNew, toBytes(p)) msg, err := natsio.GetServer().Request(subject.Location.GetDistrictsByCodesFromLocationService, toBytes(p))
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -84,7 +84,7 @@ func (l Location) GetDistrictsByCodes(p model.DistrictRequestPayload) (*model.Lo
// GetWardsByCodes ... // GetWardsByCodes ...
func (l Location) GetWardsByCodes(p model.WardRequestPayload) (*model.LocationWardResponse, error) { func (l Location) GetWardsByCodes(p model.WardRequestPayload) (*model.LocationWardResponse, error) {
msg, err := natsio.GetServer().Request(subject.Location.GetWardsByCodesNew, toBytes(p)) msg, err := natsio.GetServer().Request(subject.Location.GetWardsByCodesFromLocationService, toBytes(p))
if err != nil { if err != nil {
return nil, err return nil, err
} }

View File

@ -7,41 +7,41 @@ func getLocationValue(val string) string {
} }
var Location = struct { var Location = struct {
GetLocationByCode string GetLocationByCode string
GetLocationByCodeNew string GetLocationByCodeFromLocationService string
GetProvincesByCodes string GetProvincesByCodes string
GetProvincesByCodesNew string GetProvincesByCodesFromLocationService string
GetDistrictsByCodes string GetDistrictsByCodes string
GetDistrictsByCodesNew string GetDistrictsByCodesFromLocationService string
GetWardsByCodes string GetWardsByCodes string
GetWardsByCodesNew string GetWardsByCodesFromLocationService string
GetProvinceByCondition string GetProvinceByCondition string
GetProvincesByCondition string GetProvincesByCondition string
GetDistrictByCondition string GetDistrictByCondition string
GetDistrictsByCondition string GetDistrictsByCondition string
GetWardByCondition string GetWardByCondition string
GetWardsByCondition string GetWardsByCondition string
CountProvinceByCondition string CountProvinceByCondition string
CountDistrictByCondition string CountDistrictByCondition string
CountWardByCondition string CountWardByCondition string
ProvinceDistinctWithField string ProvinceDistinctWithField string
}{ }{
GetLocationByCode: getLocationValue("get_location_warehouse"), GetLocationByCode: getLocationValue("get_location_warehouse"),
GetLocationByCodeNew: getLocationValue("get_location_warehouse_new"), GetLocationByCodeFromLocationService: getLocationValue("get_location_warehouse_from_location_service"),
GetProvincesByCodes: getLocationValue("get_provinces_by_codes"), GetProvincesByCodes: getLocationValue("get_provinces_by_codes"),
GetProvincesByCodesNew: getLocationValue("get_provinces_by_codes_new"), GetProvincesByCodesFromLocationService: getLocationValue("get_provinces_by_codes_from_location_service"),
GetDistrictsByCodes: getLocationValue("get_districts_by_codes"), GetDistrictsByCodes: getLocationValue("get_districts_by_codes"),
GetDistrictsByCodesNew: getLocationValue("get_districts_by_codes_new"), GetDistrictsByCodesFromLocationService: getLocationValue("get_districts_by_codes_from_location_service"),
GetWardsByCodes: getLocationValue("get_wards_by_codes"), GetWardsByCodes: getLocationValue("get_wards_by_codes"),
GetWardsByCodesNew: getLocationValue("get_wards_by_codes_new"), GetWardsByCodesFromLocationService: getLocationValue("get_wards_by_codes_from_location_service"),
GetProvinceByCondition: getLocationValue("get_province_by_condition"), GetProvinceByCondition: getLocationValue("get_province_by_condition"),
GetProvincesByCondition: getLocationValue("get_provinces_by_condition"), GetProvincesByCondition: getLocationValue("get_provinces_by_condition"),
GetDistrictByCondition: getLocationValue("get_district_by_condition"), GetDistrictByCondition: getLocationValue("get_district_by_condition"),
GetDistrictsByCondition: getLocationValue("get_districts_byCondition"), GetDistrictsByCondition: getLocationValue("get_districts_byCondition"),
GetWardByCondition: getLocationValue("get_ward_by_condition"), GetWardByCondition: getLocationValue("get_ward_by_condition"),
GetWardsByCondition: getLocationValue("get_wards_by_condition"), GetWardsByCondition: getLocationValue("get_wards_by_condition"),
CountProvinceByCondition: getLocationValue("count_province_by_condition"), CountProvinceByCondition: getLocationValue("count_province_by_condition"),
CountDistrictByCondition: getLocationValue("count_district_by_condition"), CountDistrictByCondition: getLocationValue("count_district_by_condition"),
CountWardByCondition: getLocationValue("count_ward_by_condition"), CountWardByCondition: getLocationValue("count_ward_by_condition"),
ProvinceDistinctWithField: getLocationValue("province_distinct_with_field"), ProvinceDistinctWithField: getLocationValue("province_distinct_with_field"),
} }