From 699801b3967186c2eec2f5aa0a3eacacb85c8d14 Mon Sep 17 00:00:00 2001 From: awenes <1121353141@qq.com> Date: Sat, 17 Aug 2024 17:11:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../audit/annotation/AuditAspect.java | 2 +- .../oidc/IdTokenCustomClaimValueType.java | 110 ------------------ 2 files changed, 1 insertion(+), 111 deletions(-) delete mode 100644 eiam-protocol/eiam-protocol-oidc/src/main/java/cn/topiam/eiam/protocol/oidc/IdTokenCustomClaimValueType.java diff --git a/eiam-audit/src/main/java/cn/topiam/employee/audit/annotation/AuditAspect.java b/eiam-audit/src/main/java/cn/topiam/employee/audit/annotation/AuditAspect.java index 999aa686..d228628b 100644 --- a/eiam-audit/src/main/java/cn/topiam/employee/audit/annotation/AuditAspect.java +++ b/eiam-audit/src/main/java/cn/topiam/employee/audit/annotation/AuditAspect.java @@ -136,7 +136,7 @@ public class AuditAspect { } //上下文内容,自动拼接事件类型描述 if (Objects.isNull(content) && StringUtils.isNoneBlank(AuditContext.getContent())) { - content = audit.type().getDesc() +COLON + AuditContext.getContent(); + content = audit.type().getDesc() + COLON + AuditContext.getContent(); } if (Objects.isNull(content) && StringUtils.isBlank(AuditContext.getContent())) { content = audit.type().getDesc(); diff --git a/eiam-protocol/eiam-protocol-oidc/src/main/java/cn/topiam/eiam/protocol/oidc/IdTokenCustomClaimValueType.java b/eiam-protocol/eiam-protocol-oidc/src/main/java/cn/topiam/eiam/protocol/oidc/IdTokenCustomClaimValueType.java deleted file mode 100644 index a8846ce4..00000000 --- a/eiam-protocol/eiam-protocol-oidc/src/main/java/cn/topiam/eiam/protocol/oidc/IdTokenCustomClaimValueType.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * eiam-protocol-oidc - Employee Identity and Access Management - * Copyright © 2022-Present Jinan Yuanchuang Network Technology Co., Ltd. (support@topiam.cn) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ -package cn.topiam.eiam.protocol.oidc; - -import com.fasterxml.jackson.annotation.JsonValue; - -import cn.topiam.employee.support.enums.BaseEnum; -import cn.topiam.employee.support.web.converter.EnumConvert; -import static org.apache.commons.text.StringSubstitutor.DEFAULT_VAR_END; -import static org.apache.commons.text.StringSubstitutor.DEFAULT_VAR_START; - -/** - * IdTokenCustomClaimValueType - * - * @author TopIAM - * Created by support@topiam.cn on 2022/5/22 23:26 - */ -public enum IdTokenCustomClaimValueType implements BaseEnum { - /** - * 手机号 - */ - PHONE("user.phone", - DEFAULT_VAR_START + "user.phone" - + DEFAULT_VAR_END), - /** - * 用户名 - */ - USERNAME("user.username", - DEFAULT_VAR_START + "user.username" - + DEFAULT_VAR_END), - /** - * 昵称 - */ - NICK_NAME("user.nickName", - DEFAULT_VAR_START + "user.nickName" - + DEFAULT_VAR_END), - /** - * 邮箱 - */ - EMAIL("user.email", - DEFAULT_VAR_START + "user.email" - + DEFAULT_VAR_END), - - /** - * 员工工号 - */ - USER_EMPLOYEE_NUMBER("user.employee_number", - DEFAULT_VAR_START + "user.employee_number" - + DEFAULT_VAR_END), - /** - * 应用用户名 - */ - APP_USERNAME("app_user.username", - DEFAULT_VAR_START + "app_user.username" - + DEFAULT_VAR_END); - - @JsonValue - private final String code; - private final String expression; - - IdTokenCustomClaimValueType(String code, String expression) { - this.code = code; - this.expression = expression; - } - - @EnumConvert - public static IdTokenCustomClaimValueType getType(String code) { - IdTokenCustomClaimValueType[] values = values(); - for (IdTokenCustomClaimValueType status : values) { - if (String.valueOf(status.getCode()).equals(code)) { - return status; - } - } - return null; - } - - @Override - public String getCode() { - return code; - } - - @Override - public String getDesc() { - return null; - } - - public String getExpression() { - return expression; - } - - @Override - public String toString() { - return code; - } -}