| @@ -7,6 +7,7 @@ import io.swagger.annotations.Api; | |||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import me.chanjar.weixin.common.error.WxErrorException; | import me.chanjar.weixin.common.error.WxErrorException; | ||||
| import me.chanjar.weixin.mp.api.WxMpService; | import me.chanjar.weixin.mp.api.WxMpService; | ||||
| import me.chanjar.weixin.mp.bean.card.WxMpCardResult; | |||||
| import me.chanjar.weixin.mp.bean.card.WxMpCardUserGetCardListResult; | import me.chanjar.weixin.mp.bean.card.WxMpCardUserGetCardListResult; | ||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| @@ -38,4 +39,18 @@ public class WxCardController extends BaseController { | |||||
| } | } | ||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||
| @ApiOperation("查询Code接口") | |||||
| @GetMapping("cardCodeGet/{appId}") | |||||
| public ResultData cardCodeGet(@PathVariable String appId, String code) { | |||||
| logger.debug("[" + getIpAddr() + "] WxCardController::cardCodeGet"); | |||||
| try { | |||||
| WxMpService mpService = openService.getWxOpenComponentService().getWxMpServiceByAppid(appId); | |||||
| WxMpCardResult result = mpService.getCardService().queryCardCode(null, code, true); | |||||
| logger.info(result.toString()); | |||||
| } catch (WxErrorException e) { | |||||
| logger.error(e.getMessage()); | |||||
| } | |||||
| return new ResultData(); | |||||
| } | |||||
| } | } | ||||