a4a10d2e 刘嘉

菠萝派接口-根据appid与token查找到店铺

1 个父辈 d941bcf5
......@@ -180,7 +180,7 @@ public class PineappleController {
}
private IMSupplierApp findAndCheckSupplierApp(BaseRequest request) {
IMSupplierApp imSupplierApp = imSupplierAppService.findByAppIdAndAppType(request.getAppkey(), SupplierAppTypeEnum.PINE_APPLE);
IMSupplierApp imSupplierApp = imSupplierAppService.findByAppIdAndAppType(request,SupplierAppTypeEnum.PINE_APPLE);
if (imSupplierApp == null) {
throw new BizException(MessageFormat.format("appKey【{0}】的菠萝派应用数据为空,请联系客服", request.getAppkey()));
}
......
......@@ -4,7 +4,7 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.sibu.orderHelper.integral.dao.IMSupplierAppDao">
<select id="findByAppIdAndAppType" resultMap="BaseResultMap">
select * from im_supplier_app where app_id=#{appId} and app_type = #{appType}
select * from im_supplier_app where app_id=#{appId} and app_type = #{appType} and app_token = #{appToken}
</select>
<resultMap id="BaseResultMap" type="com.sibu.orderHelper.integral.model.IMSupplierApp">
<result column="id" property="id"/>
......
......@@ -2,6 +2,7 @@ package com.sibu.orderHelper.integral.service;
import com.sibu.orderHelper.enums.SupplierAppTypeEnum;
import com.sibu.orderHelper.integral.model.IMSupplierApp;
import com.sibu.orderHelper.integral.pineapple.request.BaseRequest;
/**
* @author 陈志杭
......@@ -11,4 +12,6 @@ import com.sibu.orderHelper.integral.model.IMSupplierApp;
*/
public interface IMSupplierAppService {
IMSupplierApp findByAppIdAndAppType(String appId, SupplierAppTypeEnum appType);
IMSupplierApp findByAppIdAndAppType(BaseRequest requestParams, SupplierAppTypeEnum appType);
}
......
......@@ -4,6 +4,7 @@ import com.sibu.orderHelper.common.strategy.DbUtil;
import com.sibu.orderHelper.enums.SupplierAppTypeEnum;
import com.sibu.orderHelper.integral.dao.IMSupplierAppDao;
import com.sibu.orderHelper.integral.model.IMSupplierApp;
import com.sibu.orderHelper.integral.pineapple.request.BaseRequest;
import com.sibu.orderHelper.integral.service.IMSupplierAppService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -29,4 +30,13 @@ public class IMSupplierAppServiceImpl implements IMSupplierAppService {
params.put("appType", appType.getCode());
return imSupplierAppDao.findByAppIdAndAppType(params);
}
@Override
public IMSupplierApp findByAppIdAndAppType(BaseRequest requestParams, SupplierAppTypeEnum appType) {
Map<String, String> params = new HashMap<>();
params.put("appId", requestParams.getAppkey());
params.put("appToken", requestParams.getToken());
params.put("appType", appType.getCode());
return imSupplierAppDao.findByAppIdAndAppType(params);
}
}
......