a4a10d2e 刘嘉

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

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