saas:支持社交应用的多租户配置

This commit is contained in:
YunaiV
2023-10-18 23:48:14 +08:00
parent 5842a361e2
commit d256275099
17 changed files with 375 additions and 140 deletions

View File

@ -0,0 +1,22 @@
package cn.iocoder.yudao.module.system.api.social;
import cn.iocoder.yudao.module.system.enums.social.SocialTypeEnum;
/**
* 社交应用的 API 接口
*
* @author 芋道源码
*/
public interface SocialClientApi {
/**
* 获得社交平台的授权 URL
*
* @param type 社交平台的类型 {@link SocialTypeEnum}
* @param userType 用户类型
* @param redirectUri 重定向 URL
* @return 社交平台的授权 URL
*/
String getAuthorizeUrl(Integer type, Integer userType, String redirectUri);
}

View File

@ -4,7 +4,6 @@ import cn.iocoder.yudao.framework.common.exception.ServiceException;
import cn.iocoder.yudao.module.system.api.social.dto.SocialUserBindReqDTO;
import cn.iocoder.yudao.module.system.api.social.dto.SocialUserRespDTO;
import cn.iocoder.yudao.module.system.api.social.dto.SocialUserUnbindReqDTO;
import cn.iocoder.yudao.module.system.enums.social.SocialTypeEnum;
import javax.validation.Valid;
@ -15,15 +14,6 @@ import javax.validation.Valid;
*/
public interface SocialUserApi {
/**
* 获得社交平台的授权 URL
*
* @param type 社交平台的类型 {@link SocialTypeEnum}
* @param redirectUri 重定向 URL
* @return 社交平台的授权 URL
*/
String getAuthorizeUrl(Integer type, String redirectUri);
/**
* 绑定社交用户
*

View File

@ -37,7 +37,7 @@ public class SocialUserBindReqDTO {
*/
@InEnum(SocialTypeEnum.class)
@NotNull(message = "社交平台的类型不能为空")
private Integer type;
private Integer socialType;
/**
* 授权码
*/

View File

@ -33,12 +33,12 @@ public class SocialUserUnbindReqDTO {
*/
@InEnum(SocialTypeEnum.class)
@NotNull(message = "社交平台的类型不能为空")
private Integer type;
private Integer socialType;
/**
* 社交平台的 unionId
* 社交平台的 openid
*/
@NotEmpty(message = "社交平台的 unionId 不能为空")
private String unionId;
@NotEmpty(message = "社交平台的 openid 不能为空")
private String openid;
}

View File

@ -18,33 +18,39 @@ public enum SocialTypeEnum implements IntArrayValuable {
/**
* Gitee
* 文档链接https://gitee.com/api/v5/oauth_doc#/
*
* @see <a href="https://gitee.com/api/v5/oauth_doc#/">接入文档</a>
*/
GITEE(10, "GITEE"),
/**
* 钉钉
* 文档链接https://developers.dingtalk.com/document/app/obtain-identity-credentials
*
* @see <a href="https://developers.dingtalk.com/document/app/obtain-identity-credentials">接入文档</a>
*/
DINGTALK(20, "DINGTALK"),
/**
* 企业微信
* 文档链接https://xkcoding.com/2019/08/06/use-justauth-integration-wechat-enterprise.html
*
* @see <a href="https://xkcoding.com/2019/08/06/use-justauth-integration-wechat-enterprise.html">接入文档</a>
*/
WECHAT_ENTERPRISE(30, "WECHAT_ENTERPRISE"),
/**
* 微信公众平台 - 移动端 H5
* 文档链接https://www.cnblogs.com/juewuzhe/p/11905461.html
*
* @see <a href="https://www.cnblogs.com/juewuzhe/p/11905461.html">接入文档</a>
*/
WECHAT_MP(31, "WECHAT_MP"),
/**
* 微信开放平台 - 网站应用 PC 端扫码授权登录
* 文档链接https://justauth.wiki/guide/oauth/wechat_open/#_2-申请开发者资质认证
*
* @see <a href="https://justauth.wiki/guide/oauth/wechat_open/#_2-申请开发者资质认证">接入文档</a>
*/
WECHAT_OPEN(32, "WECHAT_OPEN"),
/**
* 微信小程序
* 文档链接https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/login.html
*
* @see <a href="https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/login.html">接入文档</a>
*/
WECHAT_MINI_APP(34, "WECHAT_MINI_APP"),
;