ConstsOperateAction to ConstsAct

This commit is contained in:
MaxKey 2024-06-03 15:08:47 +08:00
parent aed97e114f
commit 50a3c40b88
7 changed files with 53 additions and 50 deletions

View File

@ -18,8 +18,9 @@
package org.dromara.maxkey.constants; package org.dromara.maxkey.constants;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
public final class ConstsOperateAction { public final class ConstsAct {
public static final String CREATE = "create"; public static final String CREATE = "create";
@ -28,6 +29,8 @@ public final class ConstsOperateAction {
public static final String UPDATE = "update"; public static final String UPDATE = "update";
public static final String CHANGE_PASSWORD = "change_password"; public static final String CHANGE_PASSWORD = "change_password";
public static final String FORGOT_PASSWORD = "forgot_password";
public static final String ADD_MEMBER = "add_member"; public static final String ADD_MEMBER = "add_member";
@ -45,10 +48,10 @@ public final class ConstsOperateAction {
public static final String VIEW = "view"; public static final String VIEW = "view";
public static ConcurrentHashMap<Integer,String> statusActon ; public static final ConcurrentMap<Integer,String> statusActon ;
static { static {
statusActon= new ConcurrentHashMap<Integer,String>(); statusActon = new ConcurrentHashMap<>();
statusActon.put(ConstsStatus.ACTIVE, ENABLE); statusActon.put(ConstsStatus.ACTIVE, ENABLE);
statusActon.put(ConstsStatus.INACTIVE, INACTIVE); statusActon.put(ConstsStatus.INACTIVE, INACTIVE);
statusActon.put(ConstsStatus.DISABLED, DISABLE); statusActon.put(ConstsStatus.DISABLED, DISABLE);

View File

@ -17,7 +17,7 @@
package org.dromara.maxkey.constants; package org.dromara.maxkey.constants;
public final class ConstsOperateResult { public final class ConstsActResult {
public static final String SUCCESS = "success"; public static final String SUCCESS = "success";
public static final String ERROR = "error"; public static final String ERROR = "error";
public static final String FAIL = "fail"; public static final String FAIL = "fail";

View File

@ -19,8 +19,8 @@ package org.dromara.maxkey.web.contorller;
import org.dromara.maxkey.authn.annotation.CurrentUser; import org.dromara.maxkey.authn.annotation.CurrentUser;
import org.dromara.maxkey.constants.ConstsEntryType; import org.dromara.maxkey.constants.ConstsEntryType;
import org.dromara.maxkey.constants.ConstsOperateAction; import org.dromara.maxkey.constants.ConstsAct;
import org.dromara.maxkey.constants.ConstsOperateResult; import org.dromara.maxkey.constants.ConstsActResult;
import org.dromara.maxkey.crypto.password.PasswordReciprocal; import org.dromara.maxkey.crypto.password.PasswordReciprocal;
import org.dromara.maxkey.entity.Accounts; import org.dromara.maxkey.entity.Accounts;
import org.dromara.maxkey.entity.AccountsStrategy; import org.dromara.maxkey.entity.AccountsStrategy;
@ -104,8 +104,8 @@ public class AccountsController {
systemLog.insert( systemLog.insert(
ConstsEntryType.ACCOUNT, ConstsEntryType.ACCOUNT,
account, account,
ConstsOperateAction.CREATE, ConstsAct.CREATE,
ConstsOperateResult.SUCCESS, ConstsActResult.SUCCESS,
currentUser); currentUser);
return new Message<Accounts>(Message.SUCCESS).buildResponse(); return new Message<Accounts>(Message.SUCCESS).buildResponse();
} else { } else {
@ -123,8 +123,8 @@ public class AccountsController {
systemLog.insert( systemLog.insert(
ConstsEntryType.ACCOUNT, ConstsEntryType.ACCOUNT,
account, account,
ConstsOperateAction.UPDATE, ConstsAct.UPDATE,
ConstsOperateResult.SUCCESS, ConstsActResult.SUCCESS,
currentUser); currentUser);
return new Message<Accounts>(Message.SUCCESS).buildResponse(); return new Message<Accounts>(Message.SUCCESS).buildResponse();
} else { } else {
@ -149,8 +149,8 @@ public class AccountsController {
systemLog.insert( systemLog.insert(
ConstsEntryType.ACCOUNT, ConstsEntryType.ACCOUNT,
accounts, accounts,
ConstsOperateAction.statusActon.get(accounts.getStatus()), ConstsAct.statusActon.get(accounts.getStatus()),
ConstsOperateResult.SUCCESS, ConstsActResult.SUCCESS,
currentUser); currentUser);
return new Message<Accounts>(Message.SUCCESS).buildResponse(); return new Message<Accounts>(Message.SUCCESS).buildResponse();
} else { } else {
@ -167,8 +167,8 @@ public class AccountsController {
systemLog.insert( systemLog.insert(
ConstsEntryType.ACCOUNT, ConstsEntryType.ACCOUNT,
ids, ids,
ConstsOperateAction.DELETE, ConstsAct.DELETE,
ConstsOperateResult.SUCCESS, ConstsActResult.SUCCESS,
currentUser); currentUser);
return new Message<Accounts>(Message.SUCCESS).buildResponse(); return new Message<Accounts>(Message.SUCCESS).buildResponse();
} else { } else {

View File

@ -19,8 +19,8 @@ package org.dromara.maxkey.web.idm.contorller;
import org.dromara.maxkey.authn.annotation.CurrentUser; import org.dromara.maxkey.authn.annotation.CurrentUser;
import org.dromara.maxkey.constants.ConstsEntryType; import org.dromara.maxkey.constants.ConstsEntryType;
import org.dromara.maxkey.constants.ConstsOperateAction; import org.dromara.maxkey.constants.ConstsAct;
import org.dromara.maxkey.constants.ConstsOperateResult; import org.dromara.maxkey.constants.ConstsActResult;
import org.dromara.maxkey.entity.Groups; import org.dromara.maxkey.entity.Groups;
import org.dromara.maxkey.entity.Message; import org.dromara.maxkey.entity.Message;
import org.dromara.maxkey.entity.Roles; import org.dromara.maxkey.entity.Roles;
@ -98,8 +98,8 @@ public class GroupsController {
systemLog.insert( systemLog.insert(
ConstsEntryType.ROLE, ConstsEntryType.ROLE,
group, group,
ConstsOperateAction.CREATE, ConstsAct.CREATE,
ConstsOperateResult.SUCCESS, ConstsActResult.SUCCESS,
currentUser); currentUser);
return new Message<Groups>(Message.SUCCESS).buildResponse(); return new Message<Groups>(Message.SUCCESS).buildResponse();
} else { } else {
@ -120,8 +120,8 @@ public class GroupsController {
systemLog.insert( systemLog.insert(
ConstsEntryType.ROLE, ConstsEntryType.ROLE,
group, group,
ConstsOperateAction.UPDATE, ConstsAct.UPDATE,
ConstsOperateResult.SUCCESS, ConstsActResult.SUCCESS,
currentUser); currentUser);
return new Message<Roles>(Message.SUCCESS).buildResponse(); return new Message<Roles>(Message.SUCCESS).buildResponse();
} else { } else {
@ -138,8 +138,8 @@ public class GroupsController {
systemLog.insert( systemLog.insert(
ConstsEntryType.ROLE, ConstsEntryType.ROLE,
ids, ids,
ConstsOperateAction.DELETE, ConstsAct.DELETE,
ConstsOperateResult.SUCCESS, ConstsActResult.SUCCESS,
currentUser); currentUser);
return new Message<Roles>(Message.SUCCESS).buildResponse(); return new Message<Roles>(Message.SUCCESS).buildResponse();
} else { } else {

View File

@ -29,8 +29,8 @@ import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
import org.dromara.maxkey.authn.annotation.CurrentUser; import org.dromara.maxkey.authn.annotation.CurrentUser;
import org.dromara.maxkey.constants.ConstsEntryType; import org.dromara.maxkey.constants.ConstsEntryType;
import org.dromara.maxkey.constants.ConstsOperateAction; import org.dromara.maxkey.constants.ConstsAct;
import org.dromara.maxkey.constants.ConstsOperateResult; import org.dromara.maxkey.constants.ConstsActResult;
import org.dromara.maxkey.entity.ExcelImport; import org.dromara.maxkey.entity.ExcelImport;
import org.dromara.maxkey.entity.Message; import org.dromara.maxkey.entity.Message;
import org.dromara.maxkey.entity.Organizations; import org.dromara.maxkey.entity.Organizations;
@ -106,8 +106,8 @@ public class OrganizationsController {
systemLog.insert( systemLog.insert(
ConstsEntryType.ORGANIZATION, ConstsEntryType.ORGANIZATION,
org, org,
ConstsOperateAction.CREATE, ConstsAct.CREATE,
ConstsOperateResult.SUCCESS, ConstsActResult.SUCCESS,
currentUser); currentUser);
return new Message<Organizations>(Message.SUCCESS).buildResponse(); return new Message<Organizations>(Message.SUCCESS).buildResponse();
} else { } else {
@ -124,8 +124,8 @@ public class OrganizationsController {
systemLog.insert( systemLog.insert(
ConstsEntryType.ORGANIZATION, ConstsEntryType.ORGANIZATION,
org, org,
ConstsOperateAction.UPDATE, ConstsAct.UPDATE,
ConstsOperateResult.SUCCESS, ConstsActResult.SUCCESS,
currentUser); currentUser);
return new Message<Organizations>(Message.SUCCESS).buildResponse(); return new Message<Organizations>(Message.SUCCESS).buildResponse();
} else { } else {
@ -141,8 +141,8 @@ public class OrganizationsController {
systemLog.insert( systemLog.insert(
ConstsEntryType.ORGANIZATION, ConstsEntryType.ORGANIZATION,
ids, ids,
ConstsOperateAction.DELETE, ConstsAct.DELETE,
ConstsOperateResult.SUCCESS, ConstsActResult.SUCCESS,
currentUser); currentUser);
return new Message<Organizations>(Message.SUCCESS).buildResponse(); return new Message<Organizations>(Message.SUCCESS).buildResponse();
} else { } else {

View File

@ -34,8 +34,8 @@ import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
import org.dromara.maxkey.authn.annotation.CurrentUser; import org.dromara.maxkey.authn.annotation.CurrentUser;
import org.dromara.maxkey.constants.ConstsEntryType; import org.dromara.maxkey.constants.ConstsEntryType;
import org.dromara.maxkey.constants.ConstsOperateAction; import org.dromara.maxkey.constants.ConstsAct;
import org.dromara.maxkey.constants.ConstsOperateResult; import org.dromara.maxkey.constants.ConstsActResult;
import org.dromara.maxkey.constants.ConstsPasswordSetType; import org.dromara.maxkey.constants.ConstsPasswordSetType;
import org.dromara.maxkey.entity.ChangePassword; import org.dromara.maxkey.entity.ChangePassword;
import org.dromara.maxkey.entity.ExcelImport; import org.dromara.maxkey.entity.ExcelImport;
@ -134,8 +134,8 @@ public class UserInfoController {
systemLog.insert( systemLog.insert(
ConstsEntryType.USERINFO, ConstsEntryType.USERINFO,
userInfo, userInfo,
ConstsOperateAction.CREATE, ConstsAct.CREATE,
ConstsOperateResult.SUCCESS, ConstsActResult.SUCCESS,
currentUser); currentUser);
return new Message<UserInfo>(Message.SUCCESS).buildResponse(); return new Message<UserInfo>(Message.SUCCESS).buildResponse();
} else { } else {
@ -162,8 +162,8 @@ public class UserInfoController {
systemLog.insert( systemLog.insert(
ConstsEntryType.USERINFO, ConstsEntryType.USERINFO,
userInfo, userInfo,
ConstsOperateAction.UPDATE, ConstsAct.UPDATE,
ConstsOperateResult.SUCCESS, ConstsActResult.SUCCESS,
currentUser); currentUser);
return new Message<UserInfo>(Message.SUCCESS).buildResponse(); return new Message<UserInfo>(Message.SUCCESS).buildResponse();
} else { } else {
@ -180,8 +180,8 @@ public class UserInfoController {
systemLog.insert( systemLog.insert(
ConstsEntryType.USERINFO, ConstsEntryType.USERINFO,
ids, ids,
ConstsOperateAction.DELETE, ConstsAct.DELETE,
ConstsOperateResult.SUCCESS, ConstsActResult.SUCCESS,
currentUser); currentUser);
return new Message<UserInfo>(Message.SUCCESS).buildResponse(); return new Message<UserInfo>(Message.SUCCESS).buildResponse();
} else { } else {
@ -225,8 +225,8 @@ public class UserInfoController {
systemLog.insert( systemLog.insert(
ConstsEntryType.USERINFO, ConstsEntryType.USERINFO,
changePassword, changePassword,
ConstsOperateAction.CHANGE_PASSWORD, ConstsAct.CHANGE_PASSWORD,
ConstsOperateResult.SUCCESS, ConstsActResult.SUCCESS,
currentUser); currentUser);
return new Message<UserInfo>(Message.SUCCESS).buildResponse(); return new Message<UserInfo>(Message.SUCCESS).buildResponse();
} else { } else {
@ -246,8 +246,8 @@ public class UserInfoController {
systemLog.insert( systemLog.insert(
ConstsEntryType.USERINFO, ConstsEntryType.USERINFO,
userInfo, userInfo,
ConstsOperateAction.statusActon.get(userInfo.getStatus()), ConstsAct.statusActon.get(userInfo.getStatus()),
ConstsOperateResult.SUCCESS, ConstsActResult.SUCCESS,
currentUser); currentUser);
return new Message<UserInfo>(Message.SUCCESS).buildResponse(); return new Message<UserInfo>(Message.SUCCESS).buildResponse();
} else { } else {

View File

@ -21,8 +21,8 @@ import java.util.List;
import org.dromara.maxkey.authn.annotation.CurrentUser; import org.dromara.maxkey.authn.annotation.CurrentUser;
import org.dromara.maxkey.constants.ConstsEntryType; import org.dromara.maxkey.constants.ConstsEntryType;
import org.dromara.maxkey.constants.ConstsOperateAction; import org.dromara.maxkey.constants.ConstsAct;
import org.dromara.maxkey.constants.ConstsOperateResult; import org.dromara.maxkey.constants.ConstsActResult;
import org.dromara.maxkey.entity.Message; import org.dromara.maxkey.entity.Message;
import org.dromara.maxkey.entity.Resources; import org.dromara.maxkey.entity.Resources;
import org.dromara.maxkey.entity.UserInfo; import org.dromara.maxkey.entity.UserInfo;
@ -94,8 +94,8 @@ public class ResourcesController {
systemLog.insert( systemLog.insert(
ConstsEntryType.RESOURCE, ConstsEntryType.RESOURCE,
resource, resource,
ConstsOperateAction.CREATE, ConstsAct.CREATE,
ConstsOperateResult.SUCCESS, ConstsActResult.SUCCESS,
currentUser); currentUser);
return new Message<Resources>(Message.SUCCESS).buildResponse(); return new Message<Resources>(Message.SUCCESS).buildResponse();
} else { } else {
@ -112,8 +112,8 @@ public class ResourcesController {
systemLog.insert( systemLog.insert(
ConstsEntryType.RESOURCE, ConstsEntryType.RESOURCE,
resource, resource,
ConstsOperateAction.UPDATE, ConstsAct.UPDATE,
ConstsOperateResult.SUCCESS, ConstsActResult.SUCCESS,
currentUser); currentUser);
return new Message<Resources>(Message.SUCCESS).buildResponse(); return new Message<Resources>(Message.SUCCESS).buildResponse();
} else { } else {
@ -129,8 +129,8 @@ public class ResourcesController {
systemLog.insert( systemLog.insert(
ConstsEntryType.RESOURCE, ConstsEntryType.RESOURCE,
ids, ids,
ConstsOperateAction.DELETE, ConstsAct.DELETE,
ConstsOperateResult.SUCCESS, ConstsActResult.SUCCESS,
currentUser); currentUser);
return new Message<Resources>(Message.SUCCESS).buildResponse(); return new Message<Resources>(Message.SUCCESS).buildResponse();
} else { } else {