|
|
@@ -0,0 +1,41 @@ |
|
|
|
|
|
package com.iformall.controller.card; |
|
|
|
|
|
|
|
|
|
|
|
import com.iformall.common.ResultData; |
|
|
|
|
|
import com.iformall.controller.base.BaseController; |
|
|
|
|
|
import com.iformall.service.wechat.FmOpenService; |
|
|
|
|
|
import io.swagger.annotations.Api; |
|
|
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
|
|
import me.chanjar.weixin.common.error.WxErrorException; |
|
|
|
|
|
import me.chanjar.weixin.mp.api.WxMpService; |
|
|
|
|
|
import me.chanjar.weixin.mp.bean.card.WxMpCardUserGetCardListResult; |
|
|
|
|
|
import org.slf4j.Logger; |
|
|
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping; |
|
|
|
|
|
import org.springframework.web.bind.annotation.PathVariable; |
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping; |
|
|
|
|
|
import org.springframework.web.bind.annotation.RestController; |
|
|
|
|
|
|
|
|
|
|
|
@RestController |
|
|
|
|
|
@RequestMapping("wxCardIO") |
|
|
|
|
|
@Api(description = "微信卡券接口") |
|
|
|
|
|
public class WxCardController extends BaseController { |
|
|
|
|
|
private final Logger logger = LoggerFactory.getLogger(this.getClass()); |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
private FmOpenService openService; |
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation("获取用户卡券") |
|
|
|
|
|
@GetMapping("getCardList/{appId}") |
|
|
|
|
|
public ResultData getCardList(@PathVariable String appId, String openId) { |
|
|
|
|
|
logger.debug("[" + getIpAddr() + "] WxCardController::getCardList"); |
|
|
|
|
|
try { |
|
|
|
|
|
WxMpService mpService = openService.getWxOpenComponentService().getWxMpServiceByAppid(appId); |
|
|
|
|
|
WxMpCardUserGetCardListResult result = mpService.getCardService().getUserCardList(openId, null); |
|
|
|
|
|
logger.info(result.toString()); |
|
|
|
|
|
} catch (WxErrorException e) { |
|
|
|
|
|
logger.error(e.getMessage()); |
|
|
|
|
|
} |
|
|
|
|
|
return new ResultData(); |
|
|
|
|
|
} |
|
|
|
|
|
} |