新匹配接口上线

This commit is contained in:
zhaojixiang@fangjia.com
2023-07-31 20:02:07 +08:00
parent e63591f289
commit efef6bfa9a
@@ -179,7 +179,7 @@ public class AddrSvcController {
/**
* 地址匹配
*/
public Object matchAction(AddesssMatchModel model) {
public Object matchAction(AddesssMatchModel model) throws Exception {
RestfulModelAndView mav = new RestfulModelAndView();
if (StringUtils.isBlank(model.getAddress())) {
@@ -195,16 +195,13 @@ public class AddrSvcController {
params.put("category", model.getCategory());
params.put("district", model.getSuggestDistrict());
try {
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/match", params, "UTF-8");
if (json != null) {
int code = json.getInt("status");
String msg = json.getString("msg");
BasicModel basicModel = new BasicModel(code, msg);
if (json.containsKey("result")) {
basicModel.setResult(CommonDtoUtils.transformV(MatchedBuildingDto.class, json.get("result")));
}
//新匹配接口
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaNlpService/match", params, "UTF-8");
if (json != null && json.size()>0) {
BasicModel basicModel = new BasicModel(0, "ok");
basicModel.setResult(CommonDtoUtils.transformV(MatchedBuildingDto.class, json));
mav.setModel(basicModel);
} else {
}else {
mav.setModel(BasicModel.buildServerErrorModel().setMsg("服务升级中..."));
}
} catch (Exception e) {