fangjia-job 1.2
This commit is contained in:
+15
@@ -0,0 +1,15 @@
|
||||
package com.fangjia.job.youfang.document;
|
||||
|
||||
import com.fangjia.job.common.base.ReponseData;
|
||||
|
||||
public class DistrictEvaluateSingleDto extends ReponseData {
|
||||
private DistrictEvaluateDto result;
|
||||
|
||||
public DistrictEvaluateDto getResult() {
|
||||
return result;
|
||||
}
|
||||
|
||||
public void setResult(DistrictEvaluateDto result) {
|
||||
this.result = result;
|
||||
}
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package com.fangjia.job.youfang.document;
|
||||
|
||||
import com.fangjia.job.common.base.ReponseData;
|
||||
|
||||
public class DistrictInfoDto extends ReponseData{
|
||||
private DistrictBaseInfoDto result;
|
||||
|
||||
public DistrictBaseInfoDto getResult() {
|
||||
return result;
|
||||
}
|
||||
|
||||
public void setResult(DistrictBaseInfoDto result) {
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
}
|
||||
+19
-3
@@ -1,10 +1,15 @@
|
||||
package com.fangjia.job.youfang.job;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
|
||||
import com.dangdang.ddframe.job.api.ShardingContext;
|
||||
import com.dangdang.ddframe.job.api.simple.SimpleJob;
|
||||
import com.fangjia.job.common.util.RestApiCallUtils;
|
||||
import com.fangjia.job.youfang.document.DistrictDetail;
|
||||
import com.fangjia.job.youfang.document.DistrictEvaluateSingleDto;
|
||||
import com.fangjia.job.youfang.remote.FshApiRemoteService;
|
||||
|
||||
public class DistrictInfoJob implements SimpleJob{
|
||||
@@ -12,13 +17,24 @@ public class DistrictInfoJob implements SimpleJob{
|
||||
@Value("${FANGJIA_API_TOKEN}")
|
||||
private String token;
|
||||
|
||||
@Value("${fsh.url}")
|
||||
private String fshApiUrl;
|
||||
@Value("${open.url}")
|
||||
private String openApiUrl;
|
||||
|
||||
@Override
|
||||
public void execute(ShardingContext shardingContext) {
|
||||
System.out.println("111");
|
||||
FshApiRemoteService fshApiRemoteService = RestApiCallUtils.getRestClient(FshApiRemoteService.class, fshApiUrl);
|
||||
FshApiRemoteService fshApiRemoteService = RestApiCallUtils.getRestClient(FshApiRemoteService.class, openApiUrl);
|
||||
Map<String, Object> params = new HashMap<String,Object>();
|
||||
params.put("city", "上海");
|
||||
params.put("district", "长宁");
|
||||
params.put("name", "安西路658弄");
|
||||
params.put("type", 4);
|
||||
params.put("token", token);
|
||||
DistrictDetail districtDetail = new DistrictDetail();
|
||||
districtDetail.setCity("上海");
|
||||
|
||||
DistrictEvaluateSingleDto dto = fshApiRemoteService.getDistrictNewPriceInfo(params);
|
||||
System.out.println(dto);
|
||||
|
||||
}
|
||||
|
||||
|
||||
+22
@@ -1,7 +1,13 @@
|
||||
package com.fangjia.job.youfang.remote;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import com.fangjia.job.common.base.Response;
|
||||
import com.fangjia.job.youfang.document.DistrictEvaluateSingleDto;
|
||||
import com.fangjia.job.youfang.document.DistrictInfoDto;
|
||||
|
||||
import feign.Param;
|
||||
import feign.QueryMap;
|
||||
import feign.RequestLine;
|
||||
|
||||
/**
|
||||
@@ -34,4 +40,20 @@ public interface FshApiRemoteService {
|
||||
@RequestLine("GET /rest/houses/eval?token={token}")
|
||||
public Response evalAllHousePrice(@Param("token")String token);
|
||||
|
||||
@RequestLine("GET /fsh/getAgencyInfo")
|
||||
public Map<String,Object> getAgencyInfo(@QueryMap Map<String, Object> queryMap);
|
||||
|
||||
/**
|
||||
* 获取小区综合信息district_new_price
|
||||
* @param queryMap
|
||||
* @return
|
||||
*/
|
||||
@RequestLine("GET /fsh/getDistrictNewPriceInfo")
|
||||
public DistrictEvaluateSingleDto getDistrictNewPriceInfo(@QueryMap Map<String, Object> queryMap);
|
||||
|
||||
/**
|
||||
* 小区详情
|
||||
*/
|
||||
@RequestLine("GET /fsh/detail")
|
||||
public DistrictInfoDto detail(@QueryMap Map<String, Object> queryMap);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user