| @@ -6,6 +6,8 @@ import io.swagger.annotations.Api; | |||||
| import java.awt.image.BufferedImage; | import java.awt.image.BufferedImage; | ||||
| import java.io.IOException; | import java.io.IOException; | ||||
| import java.io.UnsupportedEncodingException; | |||||
| import java.net.URLDecoder; | |||||
| import java.util.Map; | import java.util.Map; | ||||
| import javax.imageio.ImageIO; | import javax.imageio.ImageIO; | ||||
| @@ -213,4 +215,28 @@ public class AlipayController extends BaseController { | |||||
| return new ResultData(Result.ERROR,"topicSubscribe error."); | return new ResultData(Result.ERROR,"topicSubscribe error."); | ||||
| } | } | ||||
| } | } | ||||
| @ApiOperation("获取会员页面") | |||||
| @GetMapping("getMemberPage") | |||||
| @ApiImplicitParam(name = "mallId", value = "wx_mall id", dataType = "Long", paramType = "query", required = true) | |||||
| public ResultData getMemberPage(Long mallId) { | |||||
| WxMall wxMall = mallService.getById(mallId); | |||||
| if (null == wxMall ) { | |||||
| return new ResultData(Result.ERROR,"wxMall未查询到"); | |||||
| } | |||||
| if (StringUtils.isBlank(wxMall.getAlipayAppAuthToken())) { | |||||
| return new ResultData(Result.ERROR,"wxMall alipayAppToken不存在"); | |||||
| } | |||||
| if (StringUtils.isBlank(wxMall.getAlipayMemberTemplateId())) { | |||||
| return new ResultData(Result.ERROR,"wxMall alipayMemberTemplateId不存在"); | |||||
| } | |||||
| String url = aliPayUtil.getSmartDistrictMemberCardUrl(wxMall.getAlipayAppAuthToken(), wxMall.getAlipayMemberTemplateId(), "memberAuth_"+wxMall.getTenantId()); | |||||
| try { | |||||
| return new ResultData(URLDecoder.decode(url, "utf-8")); | |||||
| } catch (UnsupportedEncodingException e) { | |||||
| logger.error("getMemberPage error url["+url+"]",e); | |||||
| return new ResultData(Result.ERROR,"url返回失败"); | |||||
| } | |||||
| } | |||||
| } | } | ||||