refactor(系统设置): 优化项目日志操作对象的记录

This commit is contained in:
wxg0103 2023-08-23 10:16:41 +08:00 committed by wxg0103
parent 0d76b11adf
commit 9dadc2039d
6 changed files with 21 additions and 18 deletions

View File

@ -71,5 +71,8 @@ public class OperationLogModule {
public static final String SETTING_ORGANIZATION = "SETTING_ORGANIZATION"; public static final String SETTING_ORGANIZATION = "SETTING_ORGANIZATION";
public static final String SETTING_ORGANIZATION_MEMBER = "SETTING_ORGANIZATION_MEMBER"; public static final String SETTING_ORGANIZATION_MEMBER = "SETTING_ORGANIZATION_MEMBER";
public static final String SETTING_ORGANIZATION_SERVICE = "SETTING_ORGANIZATION_SERVICE"; public static final String SETTING_ORGANIZATION_SERVICE = "SETTING_ORGANIZATION_SERVICE";
//系统设置-组织-项目
public static final String SETTING_SYSTEM_ORGANIZATION_PROJECT = "SETTING_SYSTEM_ORGANIZATION_PROJECT";
} }

View File

@ -232,7 +232,7 @@ public class CommonProjectService {
memberRequest.setProjectIds(List.of(project.getId())); memberRequest.setProjectIds(List.of(project.getId()));
memberRequest.setUserIds(insertIds); memberRequest.setUserIds(insertIds);
this.addProjectAdmin(memberRequest, updateUser, path, OperationLogType.ADD.name(), this.addProjectAdmin(memberRequest, updateUser, path, OperationLogType.ADD.name(),
Translator.get("update"), module); Translator.get("add"), module);
} }
} else { } else {
if (CollectionUtils.isNotEmpty(orgUserIds)) { if (CollectionUtils.isNotEmpty(orgUserIds)) {

View File

@ -32,7 +32,7 @@ public class OrganizationProjectLogService {
null, null,
null, null,
OperationLogType.ADD.name(), OperationLogType.ADD.name(),
OperationLogModule.ORGANIZATION_PROJECT, OperationLogModule.SETTING_SYSTEM_ORGANIZATION_PROJECT,
project.getName()); project.getName());
dto.setOriginalValue(JSON.toJSONBytes(project)); dto.setOriginalValue(JSON.toJSONBytes(project));
@ -52,7 +52,7 @@ public class OrganizationProjectLogService {
project.getId(), project.getId(),
project.getCreateUser(), project.getCreateUser(),
OperationLogType.UPDATE.name(), OperationLogType.UPDATE.name(),
OperationLogModule.ORGANIZATION_PROJECT, OperationLogModule.SETTING_SYSTEM_ORGANIZATION_PROJECT,
project.getName()); project.getName());
dto.setOriginalValue(JSON.toJSONBytes(project)); dto.setOriginalValue(JSON.toJSONBytes(project));
@ -95,7 +95,7 @@ public class OrganizationProjectLogService {
id, id,
project.getCreateUser(), project.getCreateUser(),
OperationLogType.DELETE.name(), OperationLogType.DELETE.name(),
OperationLogModule.ORGANIZATION_PROJECT, OperationLogModule.SETTING_SYSTEM_ORGANIZATION_PROJECT,
project.getName()); project.getName());
dto.setOriginalValue(JSON.toJSONBytes(project)); dto.setOriginalValue(JSON.toJSONBytes(project));
@ -118,7 +118,7 @@ public class OrganizationProjectLogService {
id, id,
null, null,
OperationLogType.RECOVER.name(), OperationLogType.RECOVER.name(),
OperationLogModule.ORGANIZATION_PROJECT, OperationLogModule.SETTING_SYSTEM_ORGANIZATION_PROJECT,
project.getName()); project.getName());
dto.setOriginalValue(JSON.toJSONBytes(project)); dto.setOriginalValue(JSON.toJSONBytes(project));
return dto; return dto;

View File

@ -46,7 +46,7 @@ public class OrganizationProjectService {
* @return * @return
*/ */
public ProjectExtendDTO add(AddProjectRequest addProjectDTO, String createUser) { public ProjectExtendDTO add(AddProjectRequest addProjectDTO, String createUser) {
return commonProjectService.add(addProjectDTO, createUser, ADD_PROJECT, OperationLogModule.ORGANIZATION_PROJECT); return commonProjectService.add(addProjectDTO, createUser, ADD_PROJECT, OperationLogModule.SETTING_SYSTEM_ORGANIZATION_PROJECT);
} }
public List<ProjectDTO> getProjectList(OrganizationProjectRequest request) { public List<ProjectDTO> getProjectList(OrganizationProjectRequest request) {
@ -57,7 +57,7 @@ public class OrganizationProjectService {
} }
public ProjectExtendDTO update(UpdateProjectRequest updateProjectDto, String updateUser) { public ProjectExtendDTO update(UpdateProjectRequest updateProjectDto, String updateUser) {
return commonProjectService.update(updateProjectDto, updateUser, UPDATE_PROJECT, OperationLogModule.ORGANIZATION_PROJECT); return commonProjectService.update(updateProjectDto, updateUser, UPDATE_PROJECT, OperationLogModule.SETTING_SYSTEM_ORGANIZATION_PROJECT);
} }
public int delete(String id, String deleteUser) { public int delete(String id, String deleteUser) {
@ -76,11 +76,11 @@ public class OrganizationProjectService {
*/ */
public void addProjectMember(ProjectAddMemberBatchRequest request, String createUser) { public void addProjectMember(ProjectAddMemberBatchRequest request, String createUser) {
commonProjectService.addProjectMember(request, createUser, ADD_MEMBER, commonProjectService.addProjectMember(request, createUser, ADD_MEMBER,
OperationLogType.ADD.name(), Translator.get("add"), OperationLogModule.ORGANIZATION_PROJECT); OperationLogType.ADD.name(), Translator.get("add"), OperationLogModule.SETTING_SYSTEM_ORGANIZATION_PROJECT);
} }
public int removeProjectMember(String projectId, String userId, String createUser) { public int removeProjectMember(String projectId, String userId, String createUser) {
return commonProjectService.removeProjectMember(projectId, userId, createUser,OperationLogModule.ORGANIZATION_PROJECT, StringUtils.join(REMOVE_PROJECT_MEMBER,projectId, "/", userId)); return commonProjectService.removeProjectMember(projectId, userId, createUser, OperationLogModule.SETTING_SYSTEM_ORGANIZATION_PROJECT, StringUtils.join(REMOVE_PROJECT_MEMBER, projectId, "/", userId));
} }
public int revoke(String id) { public int revoke(String id) {

View File

@ -32,7 +32,7 @@ public class SystemProjectLogService {
null, null,
null, null,
OperationLogType.ADD.name(), OperationLogType.ADD.name(),
OperationLogModule.SYSTEM_PROJECT, OperationLogModule.SETTING_SYSTEM_ORGANIZATION,
project.getName()); project.getName());
dto.setOriginalValue(JSON.toJSONBytes(project)); dto.setOriginalValue(JSON.toJSONBytes(project));
@ -52,7 +52,7 @@ public class SystemProjectLogService {
project.getId(), project.getId(),
project.getCreateUser(), project.getCreateUser(),
OperationLogType.UPDATE.name(), OperationLogType.UPDATE.name(),
OperationLogModule.SYSTEM_PROJECT, OperationLogModule.SETTING_SYSTEM_ORGANIZATION,
project.getName()); project.getName());
dto.setOriginalValue(JSON.toJSONBytes(project)); dto.setOriginalValue(JSON.toJSONBytes(project));
@ -70,7 +70,7 @@ public class SystemProjectLogService {
project.getId(), project.getId(),
project.getCreateUser(), project.getCreateUser(),
OperationLogType.UPDATE.name(), OperationLogType.UPDATE.name(),
OperationLogModule.SYSTEM_PROJECT, OperationLogModule.SETTING_SYSTEM_ORGANIZATION,
project.getName()); project.getName());
dto.setMethod(HttpMethodConstants.GET.name()); dto.setMethod(HttpMethodConstants.GET.name());
@ -96,7 +96,7 @@ public class SystemProjectLogService {
id, id,
project.getCreateUser(), project.getCreateUser(),
OperationLogType.DELETE.name(), OperationLogType.DELETE.name(),
OperationLogModule.SYSTEM_PROJECT, OperationLogModule.SETTING_SYSTEM_ORGANIZATION,
project.getName()); project.getName());
dto.setOriginalValue(JSON.toJSONBytes(project)); dto.setOriginalValue(JSON.toJSONBytes(project));
@ -119,7 +119,7 @@ public class SystemProjectLogService {
id, id,
null, null,
OperationLogType.RECOVER.name(), OperationLogType.RECOVER.name(),
OperationLogModule.SYSTEM_PROJECT, OperationLogModule.SETTING_SYSTEM_ORGANIZATION,
project.getName()); project.getName());
dto.setOriginalValue(JSON.toJSONBytes(project)); dto.setOriginalValue(JSON.toJSONBytes(project));
return dto; return dto;

View File

@ -45,7 +45,7 @@ public class SystemProjectService {
* @return * @return
*/ */
public ProjectExtendDTO add(AddProjectRequest addProjectDTO, String createUser) { public ProjectExtendDTO add(AddProjectRequest addProjectDTO, String createUser) {
return commonProjectService.add(addProjectDTO, createUser, ADD_PROJECT, OperationLogModule.SYSTEM_PROJECT); return commonProjectService.add(addProjectDTO, createUser, ADD_PROJECT, OperationLogModule.SETTING_SYSTEM_ORGANIZATION);
} }
public List<ProjectDTO> getProjectList(ProjectRequest request) { public List<ProjectDTO> getProjectList(ProjectRequest request) {
@ -54,7 +54,7 @@ public class SystemProjectService {
} }
public ProjectExtendDTO update(UpdateProjectRequest updateProjectDto, String updateUser) { public ProjectExtendDTO update(UpdateProjectRequest updateProjectDto, String updateUser) {
return commonProjectService.update(updateProjectDto, updateUser, UPDATE_PROJECT, OperationLogModule.SYSTEM_PROJECT); return commonProjectService.update(updateProjectDto, updateUser, UPDATE_PROJECT, OperationLogModule.SETTING_SYSTEM_ORGANIZATION);
} }
public int delete(String id, String deleteUser) { public int delete(String id, String deleteUser) {
@ -73,11 +73,11 @@ public class SystemProjectService {
*/ */
public void addProjectMember(ProjectAddMemberBatchRequest request, String createUser) { public void addProjectMember(ProjectAddMemberBatchRequest request, String createUser) {
commonProjectService.addProjectMember(request, createUser, ADD_MEMBER, commonProjectService.addProjectMember(request, createUser, ADD_MEMBER,
OperationLogType.ADD.name(), Translator.get("add"), OperationLogModule.SYSTEM_PROJECT); OperationLogType.ADD.name(), Translator.get("add"), OperationLogModule.SETTING_SYSTEM_ORGANIZATION);
} }
public int removeProjectMember(String projectId, String userId, String createUser) { public int removeProjectMember(String projectId, String userId, String createUser) {
return commonProjectService.removeProjectMember(projectId, userId, createUser,OperationLogModule.SYSTEM_PROJECT, StringUtils.join(REMOVE_PROJECT_MEMBER,projectId, "/", userId)); return commonProjectService.removeProjectMember(projectId, userId, createUser, OperationLogModule.SETTING_SYSTEM_ORGANIZATION, StringUtils.join(REMOVE_PROJECT_MEMBER, projectId, "/", userId));
} }
public int revoke(String id) { public int revoke(String id) {