Commit 80a616c1 by 徐康

麦咖啡p1v2

parent f06c8499
......@@ -59,6 +59,24 @@ public interface CouponService {
List<GetCouponDetailResponseDto.Details> getMemberCoupons(String partnerId, String storeId, List<String> codes);
/**
* 获取麦咖啡卡券详情
*
* @param requestVo
* @return
*/
GetCouponDetailResponseDto getMCDMemberCoupon(GetMemberCouponRequestVo requestVo);
/**
* 批次查询麦咖啡券详情
*
* @param partnerId
* @param storeId
* @param codes
* @return
*/
List<GetCouponDetailResponseDto.Details> getMCDMemberCoupons(String partnerId, String storeId, List<String> codes);
/**
* 同步券到会员卡包(投放会员卡包)
*
* @param requestVo
......@@ -80,6 +98,11 @@ public interface CouponService {
String getAppSecret(String partnerId);
/**
* 获取卡券服务麦咖啡商户密钥
*/
String getAppSecretMCD(String partnerId);
/**
* 通过code校验券是否存在,返回商品券信息pid、price、code
*
* @param requestDto
......
......@@ -94,6 +94,8 @@ public class CouponServiceImpl implements CouponService {
@Autowired
private CardBinClient cardBinClient;
@Autowired
private CardBinMCDClient cardBinMCDClient;
@Autowired
private StoreItemClient storeItemClient;
@Autowired
private StoreItemAdapter storeItemAdapter;
......@@ -304,6 +306,22 @@ public class CouponServiceImpl implements CouponService {
return appSecret;
}
@Override
public String getAppSecretMCD(String partnerId) {
// 获取券服务的密钥
String couponAppSecret = RedisUtil.getCouponAppSecret(partnerId);
String appSecret = redisCache.getValue(couponAppSecret);
if (StringUtils.isBlank(appSecret)) {
GetAppKeyResponseDto getAppKeyResponseDto = cardBinMCDClient.getAppKey(GetAppKeyRequestDto.builder().partnerId(partnerId).appId(appid).build());
if (Objects.equals(String.valueOf(getAppKeyResponseDto.getStatusCode()), ResponseResult.SUCCESS.getCode())
&& getAppKeyResponseDto.getData() != null) {
redisCache.save(couponAppSecret, getAppKeyResponseDto.getData().getAppKey());
appSecret = getAppKeyResponseDto.getData().getAppKey();
}
}
return appSecret;
}
/**
* key = 活动code , value = 返回是否匹配点餐方式
*/
......
package cn.freemud.service.thirdparty;
//import cn.freemud.constant.IgnoreFeignLogAnnotation;
import cn.freemud.entities.dto.GetCouponDetailResponseDto;
import cn.freemud.interceptor.FormSupportConfig;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.Map;
//@IgnoreFeignLogAnnotation
@FeignClient(name = "COUPONOLINE", url = "${saas.coupononlineclient.feign.url}", configuration = FormSupportConfig.class)
public interface CouponOnlineMCDClient {
/**
* 查询券详情
*/
@PostMapping(value = "/code_v4", produces = MediaType.APPLICATION_JSON_UTF8_VALUE,
consumes = {MediaType.APPLICATION_FORM_URLENCODED_VALUE}
)
GetCouponDetailResponseDto getCouponDetails(@RequestBody Map<String, ?> map);
}
......@@ -192,7 +192,7 @@ public class CouponServiceTest {
@Test
public String getAppSecret(String partner) {
String appSecret = couponService.getAppSecret(partner);
String appSecret = couponService.getAppSecretMCD(partner);
System.out.println(appSecret);
return appSecret;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment