mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-07-25 08:25:07 +08:00
完善微信小程序码
This commit is contained in:
@ -1,42 +1,17 @@
|
||||
package cn.iocoder.yudao.module.system.api.social.dto;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.enums.UserTypeEnum;
|
||||
import cn.iocoder.yudao.framework.common.validation.InEnum;
|
||||
import cn.iocoder.yudao.module.system.enums.social.SocialTypeEnum;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 获取小程序码 Request DTO
|
||||
*
|
||||
* @see <a href="https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/qrcode-link/qr-code/getUnlimitedQRCode.html">获取不限制的小程序码</a>
|
||||
*
|
||||
* @author HUIHUI
|
||||
* @see <a href="https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/qrcode-link/qr-code/getUnlimitedQRCode.html">获取不限制的小程序码</a>
|
||||
*/
|
||||
@Data
|
||||
public class SocialWxQrcodeReqDTO {
|
||||
|
||||
// TODO @puhui999:userId、userType 应该后续要搞成抽象参数;说白了,就是 path 的参数; socialType 应该去掉,因为就是微信的;
|
||||
/**
|
||||
* 用户编号
|
||||
*/
|
||||
@NotNull(message = "用户编号不能为空")
|
||||
private Long userId;
|
||||
/**
|
||||
* 用户类型
|
||||
*/
|
||||
@InEnum(UserTypeEnum.class)
|
||||
@NotNull(message = "用户类型不能为空")
|
||||
private Integer userType;
|
||||
|
||||
/**
|
||||
* 社交平台的类型
|
||||
*/
|
||||
@InEnum(SocialTypeEnum.class)
|
||||
@NotNull(message = "社交平台的类型不能为空")
|
||||
private Integer socialType;
|
||||
|
||||
/**
|
||||
* 场景
|
||||
*/
|
||||
@ -56,23 +31,17 @@ public class SocialWxQrcodeReqDTO {
|
||||
*/
|
||||
private Integer width;
|
||||
|
||||
// TODO @puhui999:autoColor
|
||||
|
||||
/**
|
||||
* 是否需要透明底色
|
||||
*/
|
||||
private Boolean isAutoColor;
|
||||
|
||||
// TODO @puhui999: checkPath
|
||||
private Boolean autoColor;
|
||||
/**
|
||||
* 是否检查 page 是否存在
|
||||
*/
|
||||
private Boolean isCheckPath;
|
||||
|
||||
// TODO @puhui999: hyaline
|
||||
private Boolean checkPath;
|
||||
/**
|
||||
* 是否需要透明底色
|
||||
*/
|
||||
private Boolean isHyaline;
|
||||
private Boolean hyaline;
|
||||
|
||||
}
|
||||
|
@ -9,6 +9,7 @@ import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.util.ObjUtil;
|
||||
import cn.hutool.core.util.ReflectUtil;
|
||||
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
||||
import cn.iocoder.yudao.framework.common.enums.UserTypeEnum;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.cache.CacheUtils;
|
||||
import cn.iocoder.yudao.framework.common.util.http.HttpUtils;
|
||||
@ -230,11 +231,11 @@ public class SocialClientServiceImpl implements SocialClientService {
|
||||
|
||||
@Override
|
||||
public byte[] getWxaQrcode(SocialWxQrcodeReqDTO reqVO) {
|
||||
WxMaService service = getWxMaService(reqVO.getUserType());
|
||||
WxMaService service = getWxMaService(UserTypeEnum.MEMBER.getValue());
|
||||
try {
|
||||
return service.getQrcodeService().createWxaCodeUnlimitBytes(reqVO.getScene(), reqVO.getPath(),
|
||||
reqVO.getIsCheckPath(), reqVO.getEnvVersion(), reqVO.getWidth(), reqVO.getIsAutoColor(),
|
||||
null, reqVO.getIsHyaline());
|
||||
reqVO.getCheckPath(), reqVO.getEnvVersion(), reqVO.getWidth(), reqVO.getAutoColor(),
|
||||
null, reqVO.getHyaline());
|
||||
} catch (WxErrorException e) {
|
||||
log.error("[getWxQrcode][reqVO({})) 获得小程序码失败]", reqVO, e);
|
||||
throw exception(SOCIAL_CLIENT_WEIXIN_MINI_APP_QRCODE_ERROR);
|
||||
|
Reference in New Issue
Block a user