【同步】Boot 和 Cloud 的功能同步

This commit is contained in:
YunaiV
2024-07-13 12:56:09 +08:00
parent 3b8675dc6a
commit b8f1d01733
53 changed files with 1766 additions and 161 deletions

View File

@@ -3,11 +3,13 @@ package cn.iocoder.yudao.module.system.api.social;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.system.api.social.dto.SocialWxJsapiSignatureRespDTO;
import cn.iocoder.yudao.module.system.api.social.dto.SocialWxPhoneNumberInfoRespDTO;
import cn.iocoder.yudao.module.system.api.social.dto.SocialWxQrcodeReqDTO;
import cn.iocoder.yudao.module.system.enums.ApiConstants;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
@@ -47,4 +49,8 @@ public interface SocialClientApi {
CommonResult<SocialWxPhoneNumberInfoRespDTO> getWxMaPhoneNumberInfo(@RequestParam("userType") Integer userType,
@RequestParam("phoneCode") String phoneCode);
@GetMapping(PREFIX + "/get-wxa-qrcode")
@Operation(summary = "获得小程序二维码")
CommonResult<byte[]> getWxaQrcode(@Valid SocialWxQrcodeReqDTO reqVO);
}

View File

@@ -0,0 +1,57 @@
package cn.iocoder.yudao.module.system.api.social.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import lombok.Data;
/**
* @see <a href="https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/qrcode-link/qr-code/getUnlimitedQRCode.html">获取不限制的小程序码</a>
*/
@Schema(description = "RPC 服务 - 获得获取小程序码 Request DTO")
@Data
public class SocialWxQrcodeReqDTO {
/**
* 页面路径不能携带参数参数请放在scene字段里
*/
public static final String SCENE = "";
/**
* 二维码宽度
*/
public static final Integer WIDTH = 430;
/**
* 自动配置线条颜色,如果颜色依然是黑色,则说明不建议配置主色调
*/
public static final Boolean AUTO_COLOR = true;
/**
* 检查 page 是否存在
*/
public static final Boolean CHECK_PATH = true;
/**
* 是否需要透明底色
*
* hyaline 为 true 时,生成透明底色的小程序码
*/
public static final Boolean HYALINE = true;
@Schema(description = "场景", requiredMode = Schema.RequiredMode.REQUIRED, example = "1001")
@NotEmpty(message = "场景不能为空")
private String scene;
@Schema(description = "页面路径", requiredMode = Schema.RequiredMode.REQUIRED, example = "pages/goods/index")
@NotEmpty(message = "页面路径不能为空")
private String path;
@Schema(description = "二维码宽度", example = "430")
private Integer width;
@Schema(description = "是否需要透明底色", example = "true")
private Boolean autoColor;
@Schema(description = "是否检查 page 是否存在", example = "true")
private Boolean checkPath;
@Schema(description = "是否需要透明底色", example = "true")
private Boolean hyaline;
}

View File

@@ -28,4 +28,7 @@ public class AdminUserRespDTO implements VO {
@Schema(description = "手机号码", requiredMode = Schema.RequiredMode.REQUIRED, example = "15601691300")
private String mobile;
@Schema(description = "用户头像", requiredMode = Schema.RequiredMode.REQUIRED, example = "https://www.iocoder.cn/1.png")
private String avatar;
}

View File

@@ -120,8 +120,10 @@ public interface ErrorCodeConstants {
ErrorCode SOCIAL_USER_NOT_FOUND = new ErrorCode(1_002_018_001, "社交授权失败,找不到对应的用户");
ErrorCode SOCIAL_CLIENT_WEIXIN_MINI_APP_PHONE_CODE_ERROR = new ErrorCode(1_002_018_200, "获得手机号失败");
ErrorCode SOCIAL_CLIENT_NOT_EXISTS = new ErrorCode(1_002_018_201, "社交客户端不存在");
ErrorCode SOCIAL_CLIENT_UNIQUE = new ErrorCode(1_002_018_202, "社交客户端存在配置");
ErrorCode SOCIAL_CLIENT_WEIXIN_MINI_APP_QRCODE_ERROR = new ErrorCode(1_002_018_201, "获得小程序码失败");
ErrorCode SOCIAL_CLIENT_NOT_EXISTS = new ErrorCode(1_002_018_202, "社交客户端存在");
ErrorCode SOCIAL_CLIENT_UNIQUE = new ErrorCode(1_002_018_203, "社交客户端已存在配置");
// ========== OAuth2 客户端 1-002-020-000 =========
ErrorCode OAUTH2_CLIENT_NOT_EXISTS = new ErrorCode(1_002_020_000, "OAuth2 客户端不存在");