店铺名称接口
This commit is contained in:
parent
db0dadcb28
commit
5a2fdc14de
|
@ -58,6 +58,7 @@ public interface IMeituanService {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
String mtgsigInfo(String orderId,String regionId,String regionVersion);
|
String mtgsigInfo(String orderId,String regionId,String regionVersion);
|
||||||
|
String getStoreName(String cookie);
|
||||||
|
|
||||||
void getReturnInfo();
|
void getReturnInfo();
|
||||||
}
|
}
|
||||||
|
|
|
@ -468,6 +468,32 @@ public class MeituanServiceImpl implements IMeituanService {
|
||||||
return jsonObject;
|
return jsonObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getStoreName(String cookie){
|
||||||
|
String url = "https://e.waimai.meituan.com/v2/index/homePage";
|
||||||
|
HttpGet request = new HttpGet(url);
|
||||||
|
request.setHeader("Cookie",cookie);
|
||||||
|
request.setHeader("User-Agent","Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36");
|
||||||
|
CloseableHttpClient client = proxyHttpClient();
|
||||||
|
String result = null;
|
||||||
|
try {
|
||||||
|
result = EntityUtils.toString(client.execute(request).getEntity());
|
||||||
|
} catch (Exception e) {
|
||||||
|
System.out.println(e.getMessage());
|
||||||
|
}
|
||||||
|
if (result != null){
|
||||||
|
JSONObject jsonObject = JSONObject.parseObject(result);
|
||||||
|
String code = jsonObject.getString(("code"));
|
||||||
|
if ("0".equals(code)) {
|
||||||
|
JSONObject data = jsonObject.getJSONObject("data");
|
||||||
|
JSONObject wmPoiData = data.getJSONObject("wmPoiData");
|
||||||
|
String wmPoiName = wmPoiData.getString("wmPoiName");
|
||||||
|
return wmPoiName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取号码
|
* 获取号码
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue