move radius miles to broker level
parent
d38555a555
commit
a41ea7d501
|
|
@ -179,7 +179,7 @@ func (fe FastExact) newRequestWithState(state config.State) (*http.Request, erro
|
|||
func (fe FastExact) newRequest(zip string) (*http.Request, error) {
|
||||
req, err := http.NewRequest(
|
||||
http.MethodGet,
|
||||
"https://www.fastexact.com/secure/index.php?page=ajaxListJobs&action=ajax&zipcode="+zip+"&records_per_page=50&distance="+strconv.Itoa(config.Get().Brokers.FastExact.RadiusMiles)+"&st_loc_zip=8",
|
||||
"https://www.fastexact.com/secure/index.php?page=ajaxListJobs&action=ajax&zipcode="+zip+"&records_per_page=50&distance="+strconv.Itoa(config.Get().Brokers.RadiusMiles)+"&st_loc_zip=8",
|
||||
nil,
|
||||
)
|
||||
if err != nil {
|
||||
|
|
@ -292,7 +292,7 @@ func (mock mockFastExactDoer) doRequest(req *http.Request) (*http.Response, erro
|
|||
if req.URL.Query().Get("records_per_page") != "50" {
|
||||
return nil, errors.New("bad query: records_per_page should be 50")
|
||||
}
|
||||
if req.URL.Query().Get("distance") != strconv.Itoa(config.Get().Brokers.FastExact.RadiusMiles) {
|
||||
if req.URL.Query().Get("distance") != strconv.Itoa(config.Get().Brokers.RadiusMiles) {
|
||||
return nil, errors.New("bad query: distance should be as configured")
|
||||
}
|
||||
if req.URL.Query().Get("zipcode") == "" {
|
||||
|
|
|
|||
|
|
@ -75,8 +75,8 @@
|
|||
"Once": false,
|
||||
"Brokers": {
|
||||
"UseZips": true,
|
||||
"RadiusMiles": 100,
|
||||
"FastExact": {
|
||||
"RadiusMiles": 100,
|
||||
"Enabled": true,
|
||||
"Mock": true,
|
||||
"Username": "birdman",
|
||||
|
|
|
|||
|
|
@ -75,8 +75,8 @@
|
|||
"Once": true,
|
||||
"Brokers": {
|
||||
"UseZips": true,
|
||||
"RadiusMiles": 100,
|
||||
"FastExact": {
|
||||
"RadiusMiles": 100,
|
||||
"Enabled": true,
|
||||
"Mock": true,
|
||||
"Username": "u",
|
||||
|
|
|
|||
|
|
@ -64,8 +64,9 @@ type Config struct {
|
|||
}
|
||||
Once bool
|
||||
Brokers struct {
|
||||
UseZips bool
|
||||
NTG struct {
|
||||
UseZips bool
|
||||
RadiusMiles int
|
||||
NTG struct {
|
||||
Enabled bool
|
||||
JobInfo bool
|
||||
Mock bool
|
||||
|
|
@ -75,11 +76,10 @@ type Config struct {
|
|||
Password string
|
||||
}
|
||||
FastExact struct {
|
||||
Enabled bool
|
||||
RadiusMiles int
|
||||
Mock bool
|
||||
Username string
|
||||
Password string
|
||||
Enabled bool
|
||||
Mock bool
|
||||
Username string
|
||||
Password string
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue