|
|
@@ -307,4 +307,37 @@ public class TtMerchantPoiController extends BaseController { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation("获取客服链接") |
|
|
|
@PostMapping("/query_customer_service_url") |
|
|
|
public ResultData queryCustomerServiceUrl(@RequestBody Map<String, String> param) { |
|
|
|
logger.debug("[" + getIpAddr() + "] TtMerchantPoiController::queryCustomerServiceUrl"); |
|
|
|
String appid = param.get("appid"); |
|
|
|
String openid = param.get("openid"); |
|
|
|
if(StringUtils.isBlank(appid) || StringUtils.isBlank(openid)){ |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); |
|
|
|
} |
|
|
|
String type = param.get("type"); |
|
|
|
if(StringUtils.isBlank(type)){//来源,抖音传 1128,抖音极速版传 2329 |
|
|
|
type = "1128"; |
|
|
|
} |
|
|
|
if(!type.equals("1128") && !type.equals("2329")){ |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); |
|
|
|
} |
|
|
|
WxAppinfo appinfo = appinfoService.getByAppId(appid); |
|
|
|
|
|
|
|
if(appinfo == null){ |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"找不到小程序信息"); |
|
|
|
} |
|
|
|
|
|
|
|
try{ |
|
|
|
TtOpenMaService openMaService = openService.getTtOpenComponentService().getTtMaServiceByAppid(appid); |
|
|
|
String res = openMaService.queryCustomerServiceUrl(openid,type); |
|
|
|
return new ResultData(res); |
|
|
|
}catch(Exception e){ |
|
|
|
logger.error("获取客服链接 error"+ e.getMessage()); |
|
|
|
return new ResultData(ErrorCode.SYS_SERVER_ERROR.getCode(),"获取客服链接失败"); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |