店铺名称接口

This commit is contained in:
Lenovo 2024-07-18 19:06:09 +08:00
parent db0dadcb28
commit 5a2fdc14de
2 changed files with 27 additions and 0 deletions

View File

@ -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();
} }

View File

@ -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;
}
/** /**
* 获取号码 * 获取号码
* *