Merge branch 'FSHJOB1.2' of 192.168.0.27:dev0/fangjia-job into FSHJOB1.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
-4
@@ -1,12 +1,16 @@
|
||||
package com.fangjia.job.youfang.job;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.data.mongodb.core.MongoTemplate;
|
||||
|
||||
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;
|
||||
import com.mongodb.BasicDBObject;
|
||||
import com.mongodb.Bytes;
|
||||
@@ -20,14 +24,22 @@ public class DistrictInfoJob implements SimpleJob{
|
||||
@Value("${FANGJIA_API_TOKEN}")
|
||||
private String token;
|
||||
|
||||
@Value("${fsh.url}")
|
||||
private String fshApiUrl;
|
||||
@Value("${open.url}")
|
||||
private String openApiUrl;
|
||||
@Autowired
|
||||
private MongoTemplate mongoTemplate;
|
||||
@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("ÉϺ£");
|
||||
Mongo mongo = mongoTemplate.getDb().getMongo();
|
||||
DBCollection collection = mongo.getDB("fangjia").getCollection("seaweed");
|
||||
DBCursor cursor = collection.find(new BasicDBObject("cat", "district").append("status", 0),
|
||||
@@ -37,6 +49,9 @@ public class DistrictInfoJob implements SimpleJob{
|
||||
System.out.println(data.toString());
|
||||
}
|
||||
|
||||
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