新版本地址标准化上线
This commit is contained in:
@@ -38,6 +38,7 @@ public class OpenConfig extends Configuration {
|
||||
|
||||
private final String ipdatfile;
|
||||
private final String baiduAk;
|
||||
private final String defaultCity;
|
||||
|
||||
private final boolean isOpenAllAuthority;
|
||||
|
||||
@@ -54,6 +55,7 @@ public class OpenConfig extends Configuration {
|
||||
baiduAk = configuration.get("fangjia.baidu.ak");
|
||||
isOpenAllAuthority = configuration.getBoolean("fangjia.isOpenAllAuthority", false);
|
||||
enabledAddressMatch = configuration.getBoolean("fangjia.addressMatch.enabled",false);
|
||||
defaultCity = configuration.get("fangjia.default.city");
|
||||
}
|
||||
|
||||
public static OpenConfig getConfig() {
|
||||
@@ -134,4 +136,7 @@ public class OpenConfig extends Configuration {
|
||||
return enabledAddressMatch;
|
||||
}
|
||||
|
||||
public String getDefaultCity() {
|
||||
return defaultCity;
|
||||
}
|
||||
}
|
||||
|
||||
+6
-3
@@ -89,6 +89,7 @@ import com.fangjia.service.mongo.fangjia.ServerAreaService;
|
||||
import com.fangjia.service.open.WaitCrawlKeywordsService;
|
||||
import com.fangjia.service.sql.FjtEvaluationService;
|
||||
import com.fangjia.service.web.AddressService;
|
||||
import org.sothis.web.mvc.annotation.Param;
|
||||
|
||||
@Authority(role = Role.USER)
|
||||
public class AddressController {
|
||||
@@ -118,6 +119,8 @@ public class AddressController {
|
||||
private static final String GRADE_NATION = "全国评分";
|
||||
private static final String GRADE_CONSUME = "消费评分";
|
||||
|
||||
public final static OpenConfig CONFIG = OpenConfig.getConfig();
|
||||
|
||||
/**
|
||||
* @deprecated see parse2Action
|
||||
* @param model
|
||||
@@ -1712,7 +1715,7 @@ public class AddressController {
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
public Object standardV2Action(AddesssMatchModel model) {
|
||||
public Object standard2Action(AddesssMatchModel model) {
|
||||
|
||||
RestfulModelAndView mav = new RestfulModelAndView();
|
||||
if (StringUtils.isBlank(model.getAddress())) {
|
||||
@@ -1723,7 +1726,7 @@ public class AddressController {
|
||||
HttpRequest request = new HttpRequest();
|
||||
JSONObject json = null;
|
||||
Map<String, String> params = new HashMap<String, String>();
|
||||
params.put("city", StringUtils.isNotBlank(model.getCity()) ? model.getCity() : "重庆市");
|
||||
params.put("city", StringUtils.isNotBlank(model.getCity()) ? model.getCity() : CONFIG.getDefaultCity());
|
||||
params.put("address", model.getAddress());
|
||||
try{
|
||||
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/structure", params, "UTF-8");
|
||||
@@ -1766,7 +1769,7 @@ public class AddressController {
|
||||
HttpRequest request = new HttpRequest();
|
||||
JSONObject json = null;
|
||||
Map<String, String> params = new HashMap<String, String>();
|
||||
params.put("city", StringUtils.isNotBlank(model.getCity()) ? model.getCity() : "重庆市");
|
||||
params.put("city", StringUtils.isNotBlank(model.getCity()) ? model.getCity() : CONFIG.getDefaultCity());
|
||||
params.put("address", model.getAddress());
|
||||
// 地址验证无效也输出标准化结果
|
||||
params.put("flag", "true");
|
||||
|
||||
@@ -100,4 +100,5 @@ fangjia.jms.email.queue=email.queue
|
||||
|
||||
fangjia.redis_nodes=192.168.0.79:6379,192.168.0.79:6380,192.168.0.79:6381,192.168.0.81:6382,192.168.0.81:6383,192.168.0.81:6384
|
||||
|
||||
fangjia.fangjiatong.url = http://user.fangjia.com/fangjiatong2
|
||||
fangjia.fangjiatong.url = http://user.fangjia.com/fangjiatong2
|
||||
fangjia.default.city = \u91CD\u5E86\u5E02
|
||||
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<urlrewrite>
|
||||
<global-params>
|
||||
<param value="st" name="sort" type="attach"/>
|
||||
<param value="pn" name="pager.currentPage" type="attach"/>
|
||||
<!-- <param value="st" name="sort" type="attach"/>-->
|
||||
<!-- <param value="pn" name="pager.currentPage" type="attach"/>-->
|
||||
</global-params>
|
||||
<rules>
|
||||
<rule controller="city" action="condition2" channel="v2">
|
||||
@@ -33,9 +33,9 @@
|
||||
<ladder>/property/avgPrice</ladder>
|
||||
</ladders>
|
||||
</rule>
|
||||
<rule controller="address" action="standardV2" channel="v2">
|
||||
<rule controller="address" action="standard2" channel="v2">
|
||||
<ladders>
|
||||
<ladder>/address/standardV2</ladder>
|
||||
<ladder>/address/standard</ladder>
|
||||
</ladders>
|
||||
</rule>
|
||||
</rules>
|
||||
|
||||
Reference in New Issue
Block a user