🎨 改进结构和代码格式

pull/17/MERGE
smallbun 2023-02-09 09:00:20 +08:00
parent c69094b86e
commit 4b39be52d4
36 changed files with 283 additions and 185 deletions

View File

@ -68,6 +68,7 @@ public enum AuthenticationType implements BaseEnum {
throw new NullPointerException("未获取到对应平台"); throw new NullPointerException("未获取到对应平台");
} }
@Override
public String getCode() { public String getCode() {
return code; return code;
} }
@ -76,6 +77,7 @@ public enum AuthenticationType implements BaseEnum {
this.code = code; this.code = code;
} }
@Override
public String getDesc() { public String getDesc() {
return desc; return desc;
} }

View File

@ -76,6 +76,7 @@ public enum CaptchaProviderType implements BaseEnum {
this.desc = desc; this.desc = desc;
} }
@Override
public String getCode() { public String getCode() {
return code; return code;
} }

View File

@ -64,10 +64,12 @@ public enum DataOrigin implements BaseEnum {
this.desc = desc; this.desc = desc;
} }
@Override
public String getCode() { public String getCode() {
return code; return code;
} }
@Override
public String getDesc() { public String getDesc() {
return desc; return desc;
} }

View File

@ -61,6 +61,7 @@ public enum Language implements BaseEnum {
return locale; return locale;
} }
@Override
public String getDesc() { public String getDesc() {
return desc; return desc;
} }

View File

@ -52,10 +52,12 @@ public enum MessageCategory implements BaseEnum {
this.desc = desc; this.desc = desc;
} }
@Override
public String getCode() { public String getCode() {
return code; return code;
} }
@Override
public String getDesc() { public String getDesc() {
return desc; return desc;
} }

View File

@ -57,10 +57,12 @@ public enum MfaFactor implements BaseEnum {
this.desc = desc; this.desc = desc;
} }
@Override
public String getCode() { public String getCode() {
return code; return code;
} }
@Override
public String getDesc() { public String getDesc() {
return desc; return desc;
} }

View File

@ -56,10 +56,12 @@ public enum MfaMode implements BaseEnum {
this.desc = desc; this.desc = desc;
} }
@Override
public String getCode() { public String getCode() {
return code; return code;
} }
@Override
public String getDesc() { public String getDesc() {
return desc; return desc;
} }

View File

@ -60,10 +60,12 @@ public enum OrganizationType implements BaseEnum {
this.desc = desc; this.desc = desc;
} }
@Override
public String getCode() { public String getCode() {
return code; return code;
} }
@Override
public String getDesc() { public String getDesc() {
return desc; return desc;
} }

View File

@ -62,10 +62,12 @@ public enum PermissionActionType implements BaseEnum {
this.desc = desc; this.desc = desc;
} }
@Override
public String getCode() { public String getCode() {
return code; return code;
} }
@Override
public String getDesc() { public String getDesc() {
return desc; return desc;
} }

View File

@ -52,10 +52,12 @@ public enum PolicyEffect implements BaseEnum {
this.desc = desc; this.desc = desc;
} }
@Override
public String getCode() { public String getCode() {
return code; return code;
} }
@Override
public String getDesc() { public String getDesc() {
return desc; return desc;
} }

View File

@ -56,10 +56,12 @@ public enum PolicyObjectType implements BaseEnum {
this.desc = desc; this.desc = desc;
} }
@Override
public String getCode() { public String getCode() {
return code; return code;
} }
@Override
public String getDesc() { public String getDesc() {
return desc; return desc;
} }

View File

@ -65,10 +65,12 @@ public enum PolicySubjectType implements BaseEnum {
this.desc = desc; this.desc = desc;
} }
@Override
public String getCode() { public String getCode() {
return code; return code;
} }
@Override
public String getDesc() { public String getDesc() {
return desc; return desc;
} }

View File

@ -110,10 +110,12 @@ public enum SmsType implements BaseEnum {
this.category = category; this.category = category;
} }
@Override
public String getCode() { public String getCode() {
return code; return code;
} }
@Override
public String getDesc() { public String getDesc() {
return desc; return desc;
} }

View File

@ -59,10 +59,12 @@ public enum SyncStatus implements BaseEnum {
this.desc = desc; this.desc = desc;
} }
@Override
public String getCode() { public String getCode() {
return code; return code;
} }
@Override
public String getDesc() { public String getDesc() {
return desc; return desc;
} }

View File

@ -46,10 +46,12 @@ public enum TriggerType implements BaseEnum {
this.desc = desc; this.desc = desc;
} }
@Override
public String getCode() { public String getCode() {
return code; return code;
} }
@Override
public String getDesc() { public String getDesc() {
return desc; return desc;
} }

View File

@ -50,10 +50,12 @@ public enum UserGender implements BaseEnum {
this.desc = desc; this.desc = desc;
} }
@Override
public String getCode() { public String getCode() {
return code; return code;
} }
@Override
public String getDesc() { public String getDesc() {
return desc; return desc;
} }

View File

@ -49,10 +49,12 @@ public enum UserIdType implements BaseEnum {
this.desc = desc; this.desc = desc;
} }
@Override
public String getCode() { public String getCode() {
return code; return code;
} }
@Override
public String getDesc() { public String getDesc() {
return desc; return desc;
} }

View File

@ -66,10 +66,12 @@ public enum UserStatus implements BaseEnum {
this.desc = desc; this.desc = desc;
} }
@Override
public String getCode() { public String getCode() {
return code; return code;
} }
@Override
public String getDesc() { public String getDesc() {
return desc; return desc;
} }

View File

@ -72,6 +72,7 @@ public enum UserType implements BaseEnum {
throw new NullPointerException("未获取到类型"); throw new NullPointerException("未获取到类型");
} }
@Override
public String getCode() { public String getCode() {
return code; return code;
} }
@ -80,6 +81,7 @@ public enum UserType implements BaseEnum {
this.code = code; this.code = code;
} }
@Override
public String getDesc() { public String getDesc() {
return desc; return desc;
} }

View File

@ -54,6 +54,7 @@ public enum AppCertUsingType implements BaseEnum {
this.desc = desc; this.desc = desc;
} }
@Override
public String getCode() { public String getCode() {
return code; return code;
} }

View File

@ -71,6 +71,7 @@ public enum AppProtocol implements BaseEnum {
this.desc = desc; this.desc = desc;
} }
@Override
public String getCode() { public String getCode() {
return code; return code;
} }

View File

@ -63,10 +63,12 @@ public enum AppType implements BaseEnum {
this.desc = desc; this.desc = desc;
} }
@Override
public String getCode() { public String getCode() {
return code; return code;
} }
@Override
public String getDesc() { public String getDesc() {
return desc; return desc;
} }

View File

@ -53,10 +53,12 @@ public enum AuthorizationType implements BaseEnum {
this.desc = desc; this.desc = desc;
} }
@Override
public String getCode() { public String getCode() {
return code; return code;
} }
@Override
public String getDesc() { public String getDesc() {
return desc; return desc;
} }

View File

@ -19,6 +19,7 @@ package cn.topiam.employee.common.enums.app;
import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonValue;
import cn.topiam.employee.common.enums.BaseEnum;
import cn.topiam.employee.support.web.converter.EnumConvert; import cn.topiam.employee.support.web.converter.EnumConvert;
/** /**
@ -27,7 +28,7 @@ import cn.topiam.employee.support.web.converter.EnumConvert;
* @author TopIAM * @author TopIAM
* Created by support@topiam.cn on 2022/5/22 23:49 * Created by support@topiam.cn on 2022/5/22 23:49
*/ */
public enum CasUserIdentityType { public enum CasUserIdentityType implements BaseEnum {
/** /**
* *
*/ */
@ -56,10 +57,16 @@ public enum CasUserIdentityType {
this.code = code; this.code = code;
} }
@Override
public String getCode() { public String getCode() {
return code; return code;
} }
@Override
public String getDesc() {
return null;
}
@EnumConvert @EnumConvert
public static CasUserIdentityType getType(String code) { public static CasUserIdentityType getType(String code) {
CasUserIdentityType[] values = values(); CasUserIdentityType[] values = values();

View File

@ -52,10 +52,12 @@ public enum FormSubmitType implements BaseEnum {
this.desc = desc; this.desc = desc;
} }
@Override
public String getCode() { public String getCode() {
return code; return code;
} }
@Override
public String getDesc() { public String getDesc() {
return desc; return desc;
} }

View File

@ -84,6 +84,7 @@ public enum SamlAttributeStatementValueType implements BaseEnum {
return null; return null;
} }
@Override
public String getCode() { public String getCode() {
return code; return code;
} }

View File

@ -19,6 +19,7 @@ package cn.topiam.employee.common.enums.app;
import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonValue;
import cn.topiam.employee.common.enums.BaseEnum;
import cn.topiam.employee.support.web.converter.EnumConvert; import cn.topiam.employee.support.web.converter.EnumConvert;
/** /**
@ -27,7 +28,7 @@ import cn.topiam.employee.support.web.converter.EnumConvert;
* @author TopIAM * @author TopIAM
* Created by support@topiam.cn on 2022/5/22 23:49 * Created by support@topiam.cn on 2022/5/22 23:49
*/ */
public enum SamlNameIdValueType { public enum SamlNameIdValueType implements BaseEnum {
/** /**
* *
*/ */
@ -56,10 +57,16 @@ public enum SamlNameIdValueType {
this.code = code; this.code = code;
} }
@Override
public String getCode() { public String getCode() {
return code; return code;
} }
@Override
public String getDesc() {
return null;
}
@EnumConvert @EnumConvert
public static SamlNameIdValueType getType(String code) { public static SamlNameIdValueType getType(String code) {
SamlNameIdValueType[] values = values(); SamlNameIdValueType[] values = values();

View File

@ -57,10 +57,12 @@ public enum IdentitySourceActionType implements BaseEnum {
this.desc = desc; this.desc = desc;
} }
@Override
public String getCode() { public String getCode() {
return code; return code;
} }
@Override
public String getDesc() { public String getDesc() {
return desc; return desc;
} }

View File

@ -55,10 +55,12 @@ public enum IdentitySourceObjectType implements BaseEnum {
this.desc = desc; this.desc = desc;
} }
@Override
public String getCode() { public String getCode() {
return code; return code;
} }
@Override
public String getDesc() { public String getDesc() {
return desc; return desc;
} }

View File

@ -80,6 +80,7 @@ public enum IdentitySourceProvider implements BaseEnum {
return null; return null;
} }
@Override
public String getCode() { public String getCode() {
return code; return code;
} }
@ -88,6 +89,7 @@ public enum IdentitySourceProvider implements BaseEnum {
return name; return name;
} }
@Override
public String getDesc() { public String getDesc() {
return desc; return desc;
} }

View File

@ -17,10 +17,9 @@
*/ */
package cn.topiam.employee.common.message.enums; package cn.topiam.employee.common.message.enums;
import java.io.Serializable;
import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonValue;
import cn.topiam.employee.common.enums.BaseEnum;
import cn.topiam.employee.support.web.converter.EnumConvert; import cn.topiam.employee.support.web.converter.EnumConvert;
/** /**
@ -28,7 +27,7 @@ import cn.topiam.employee.support.web.converter.EnumConvert;
* *
* @author TopIAM * @author TopIAM
*/ */
public enum MailProvider implements Serializable { public enum MailProvider implements BaseEnum {
/** /**
* *
@ -37,18 +36,17 @@ public enum MailProvider implements Serializable {
/** /**
* *
*/ */
TENCENT("tencent", "腾讯企业邮", "smtp.exmail.qq.com", TENCENT("tencent", "腾讯企业邮", "smtp.exmail.qq.com", 25,
25, 465), 465),
/** /**
* *
*/ */
ALIYUN("aliyun", "阿里企业邮", "smtp.mxhichina.com", ALIYUN("aliyun", "阿里企业邮", "smtp.mxhichina.com", 25,
25, 465), 465),
/** /**
* *
*/ */
NETEASE("netease", "网易企业邮", "smtp.163.com", 25, NETEASE("netease", "网易企业邮", "smtp.163.com", 25, 465);
465);
/** /**
* code * code
@ -80,10 +78,16 @@ public enum MailProvider implements Serializable {
this.sslPort = sslPort; this.sslPort = sslPort;
} }
@Override
public String getCode() { public String getCode() {
return code; return code;
} }
@Override
public String getDesc() {
return null;
}
public String getName() { public String getName() {
return name; return name;
} }

View File

@ -17,10 +17,9 @@
*/ */
package cn.topiam.employee.core.security.password.enums; package cn.topiam.employee.core.security.password.enums;
import java.io.Serializable;
import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonValue;
import cn.topiam.employee.common.enums.BaseEnum;
import cn.topiam.employee.support.web.converter.EnumConvert; import cn.topiam.employee.support.web.converter.EnumConvert;
/** /**
@ -29,7 +28,7 @@ import cn.topiam.employee.support.web.converter.EnumConvert;
* @author TopIAM * @author TopIAM
* Created by support@topiam.cn on 2020/8/17 21:20 * Created by support@topiam.cn on 2020/8/17 21:20
*/ */
public enum PasswordComplexityRule implements Serializable { public enum PasswordComplexityRule implements BaseEnum {
/** /**
* *
*/ */
@ -38,8 +37,7 @@ public enum PasswordComplexityRule implements Serializable {
/** /**
* *
*/ */
MUST_NUMBERS_AND_LETTERS("1", MUST_NUMBERS_AND_LETTERS("1", "必须包含数字和字母"),
"必须包含数字和字母"),
/** /**
* *
*/ */
@ -76,10 +74,12 @@ public enum PasswordComplexityRule implements Serializable {
this.desc = desc; this.desc = desc;
} }
@Override
public String getCode() { public String getCode() {
return code; return code;
} }
@Override
public String getDesc() { public String getDesc() {
return desc; return desc;
} }

View File

@ -19,11 +19,13 @@ package cn.topiam.employee.identitysource.dingtalk.enums;
import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonValue;
import cn.topiam.employee.common.enums.BaseEnum;
/** /**
* *
* @author TopIAM * @author TopIAM
*/ */
public enum DingTalkEventType { public enum DingTalkEventType implements BaseEnum {
/** /**
* *
*/ */
@ -72,10 +74,16 @@ public enum DingTalkEventType {
this.name = name; this.name = name;
} }
@Override
public String getCode() { public String getCode() {
return code; return code;
} }
@Override
public String getDesc() {
return null;
}
public String getName() { public String getName() {
return name; return name;
} }

View File

@ -61,8 +61,8 @@ public class FeiShuConfigValidator implements
throw new ConstraintViolationException(validationResult.getConstraintViolations()); throw new ConstraintViolationException(validationResult.getConstraintViolations());
} }
cn.topiam.employee.identitysource.feishu.domain.request.GetAccessTokenRequest request = new GetAccessTokenRequest( GetAccessTokenRequest request = new GetAccessTokenRequest(config.getAppId(),
config.getAppId(), config.getAppSecret()); config.getAppSecret());
GetAccessTokenResponse response = postToken(request); GetAccessTokenResponse response = postToken(request);
if (response.getCode() != 0) { if (response.getCode() != 0) {
throw new ApiCallException(response.getMsg()); throw new ApiCallException(response.getMsg());

View File

@ -19,11 +19,13 @@ package cn.topiam.employee.identitysource.feishu.enums;
import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonValue;
import cn.topiam.employee.common.enums.BaseEnum;
/** /**
* *
* @author TopIAM * @author TopIAM
*/ */
public enum FeiShuEventType { public enum FeiShuEventType implements BaseEnum {
/** /**
* url * url
*/ */
@ -35,23 +37,28 @@ public enum FeiShuEventType {
/** /**
* *
*/ */
USER_MODIFY_ORG("contact.user.updated_v3", "通讯录用户更改"), USER_MODIFY_ORG("contact.user.updated_v3",
"通讯录用户更改"),
/** /**
* *
*/ */
USER_LEAVE_ORG("contact.user.deleted_v3", "通讯录用户离职"), USER_LEAVE_ORG("contact.user.deleted_v3",
"通讯录用户离职"),
/** /**
* - * -
*/ */
ORG_DEPT_CREATE("contact.department.created_v3", "通讯录企业部门创建"), ORG_DEPT_CREATE("contact.department.created_v3",
"通讯录企业部门创建"),
/** /**
* *
*/ */
ORG_DEPT_MODIFY("contact.department.updated_v3", "通讯录企业部门修改"), ORG_DEPT_MODIFY("contact.department.updated_v3",
"通讯录企业部门修改"),
/** /**
* *
*/ */
ORG_DEPT_REMOVE("contact.department.deleted_v3", "通讯录企业部门删除"); ORG_DEPT_REMOVE("contact.department.deleted_v3",
"通讯录企业部门删除");
/** /**
* code * code
@ -68,10 +75,16 @@ public enum FeiShuEventType {
this.name = name; this.name = name;
} }
@Override
public String getCode() { public String getCode() {
return code; return code;
} }
@Override
public String getDesc() {
return null;
}
public String getName() { public String getName() {
return name; return name;
} }

View File

@ -19,11 +19,13 @@ package cn.topiam.employee.identitysource.wechatwork.enums;
import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonValue;
import cn.topiam.employee.common.enums.BaseEnum;
/** /**
* *
* @author TopIAM * @author TopIAM
*/ */
public enum WeChatWorkEventType { public enum WeChatWorkEventType implements BaseEnum {
/** /**
* - * -
*/ */
@ -64,10 +66,16 @@ public enum WeChatWorkEventType {
this.name = name; this.name = name;
} }
@Override
public String getCode() { public String getCode() {
return code; return code;
} }
@Override
public String getDesc() {
return null;
}
public String getName() { public String getName() {
return name; return name;
} }