From 53f2c736f7043c5255cfa7f35ac397aca72387f6 Mon Sep 17 00:00:00 2001 From: WangXu10 Date: Mon, 15 Apr 2024 20:19:04 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E7=B3=BB=E7=BB=9F):=20=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E7=9B=B8=E5=85=B3=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ProjectLogController.java | 22 +++++++-------- .../controller/ProjectLogControllerTests.java | 12 ++++---- .../controller/OperationLogController.java | 4 +-- .../controller/OrganizationLogController.java | 28 +++++++++---------- .../log/service/OperationLogService.java | 4 +-- ...uest.java => BaseOperationLogRequest.java} | 23 ++++++--------- .../system/log/vo/OrgOperationLogRequest.java | 16 +++++++++++ .../system/log/vo/ProOperationLogRequest.java | 11 ++++++++ .../log/vo/SystemOperationLogRequest.java | 19 +++++++++++++ .../system/mapper/BaseOperationLogMapper.java | 4 +-- .../system/mapper/BaseOperationLogMapper.xml | 2 +- .../OperationLogControllerTests.java | 14 +++++----- .../OrganizationLogControllerTests.java | 15 +++++----- 13 files changed, 105 insertions(+), 69 deletions(-) rename backend/services/system-setting/src/main/java/io/metersphere/system/log/vo/{OperationLogRequest.java => BaseOperationLogRequest.java} (62%) create mode 100644 backend/services/system-setting/src/main/java/io/metersphere/system/log/vo/OrgOperationLogRequest.java create mode 100644 backend/services/system-setting/src/main/java/io/metersphere/system/log/vo/ProOperationLogRequest.java create mode 100644 backend/services/system-setting/src/main/java/io/metersphere/system/log/vo/SystemOperationLogRequest.java diff --git a/backend/services/project-management/src/main/java/io/metersphere/project/controller/ProjectLogController.java b/backend/services/project-management/src/main/java/io/metersphere/project/controller/ProjectLogController.java index 477d3d5ecd..4716e6d800 100644 --- a/backend/services/project-management/src/main/java/io/metersphere/project/controller/ProjectLogController.java +++ b/backend/services/project-management/src/main/java/io/metersphere/project/controller/ProjectLogController.java @@ -4,18 +4,19 @@ package io.metersphere.project.controller; import com.github.pagehelper.Page; import com.github.pagehelper.PageHelper; import io.metersphere.sdk.constants.PermissionConstants; +import io.metersphere.sdk.util.BeanUtils; +import io.metersphere.system.domain.User; import io.metersphere.system.log.service.OperationLogService; -import io.metersphere.system.log.vo.OperationLogRequest; import io.metersphere.system.log.vo.OperationLogResponse; +import io.metersphere.system.log.vo.ProOperationLogRequest; +import io.metersphere.system.log.vo.SystemOperationLogRequest; +import io.metersphere.system.service.UserService; import io.metersphere.system.utils.PageUtils; import io.metersphere.system.utils.Pager; import io.metersphere.system.utils.SessionUtils; -import io.metersphere.system.domain.User; -import io.metersphere.system.service.UserService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.tags.Tag; -import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; @@ -47,21 +48,20 @@ public class ProjectLogController { public List getUserList(@PathVariable(value = "projectId") String projectId, @Schema(description = "查询关键字,根据邮箱和用户名查询") @RequestParam(value = "keyword", required = false) String keyword) { - return userService.getUserListByOrgId(StringUtils.defaultIfBlank(projectId,SessionUtils.getCurrentProjectId()), keyword); + return userService.getUserListByOrgId(StringUtils.defaultIfBlank(projectId, SessionUtils.getCurrentProjectId()), keyword); } @PostMapping("/list") @Operation(summary = "项目管理-日志--操作日志列表查询") @RequiresPermissions(PermissionConstants.PROJECT_LOG_READ) - public Pager> projectLogList(@Validated @RequestBody OperationLogRequest request) { + public Pager> projectLogList(@Validated @RequestBody ProOperationLogRequest request) { Page page = PageHelper.startPage(request.getCurrent(), request.getPageSize(), StringUtils.isNotBlank(request.getSortString()) ? request.getSortString() : "create_time desc"); - if (CollectionUtils.isEmpty(request.getProjectIds())) { - //未传项目id 获取登录用户当前项目id - request.setProjectIds(Arrays.asList(SessionUtils.getCurrentProjectId())); - } - return PageUtils.setPageInfo(page, operationLogService.list(request)); + SystemOperationLogRequest operationLogRequest = new SystemOperationLogRequest(); + BeanUtils.copyBean(operationLogRequest, request); + operationLogRequest.setProjectIds(Arrays.asList(SessionUtils.getCurrentProjectId())); + return PageUtils.setPageInfo(page, operationLogService.list(operationLogRequest)); } } diff --git a/backend/services/project-management/src/test/java/io/metersphere/project/controller/ProjectLogControllerTests.java b/backend/services/project-management/src/test/java/io/metersphere/project/controller/ProjectLogControllerTests.java index f7ea2a8ad9..44902e4d0f 100644 --- a/backend/services/project-management/src/test/java/io/metersphere/project/controller/ProjectLogControllerTests.java +++ b/backend/services/project-management/src/test/java/io/metersphere/project/controller/ProjectLogControllerTests.java @@ -3,7 +3,7 @@ package io.metersphere.project.controller; import io.metersphere.sdk.constants.PermissionConstants; import io.metersphere.system.base.BaseTest; -import io.metersphere.system.log.vo.OperationLogRequest; +import io.metersphere.system.log.vo.ProOperationLogRequest; import org.junit.jupiter.api.MethodOrderer; import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Test; @@ -11,10 +11,9 @@ import org.junit.jupiter.api.TestMethodOrder; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; import org.springframework.boot.test.context.SpringBootTest; -import java.util.Arrays; import java.util.HashMap; -@SpringBootTest(webEnvironment= SpringBootTest.WebEnvironment.RANDOM_PORT) +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) @TestMethodOrder(MethodOrderer.OrderAnnotation.class) @AutoConfigureMockMvc public class ProjectLogControllerTests extends BaseTest { @@ -34,7 +33,7 @@ public class ProjectLogControllerTests extends BaseTest { @Test @Order(3) public void testProjectLogList() throws Exception { - OperationLogRequest request = buildParam(PROJECT); + ProOperationLogRequest request = buildParam(PROJECT); //项目级别 全部 this.requestPostWithOkAndReturn(PROJECT_LOG_LIST, request); @@ -43,7 +42,6 @@ public class ProjectLogControllerTests extends BaseTest { request.setType("add"); request.setModule("SYSTEM_PARAMETER_SETTING"); request.setContent("认证配置"); - request.setProjectIds(Arrays.asList("project_id_001", "project_id_002")); request.setSort(new HashMap<>() {{ put("createTime", "desc"); }}); @@ -54,8 +52,8 @@ public class ProjectLogControllerTests extends BaseTest { } - private OperationLogRequest buildParam(String level) { - OperationLogRequest request = new OperationLogRequest(); + private ProOperationLogRequest buildParam(String level) { + ProOperationLogRequest request = new ProOperationLogRequest(); request.setCurrent(1); request.setPageSize(10); request.setStartTime(1689131059000l); diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/controller/OperationLogController.java b/backend/services/system-setting/src/main/java/io/metersphere/system/controller/OperationLogController.java index 2fcc450d11..0baaff35f6 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/controller/OperationLogController.java +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/controller/OperationLogController.java @@ -5,7 +5,7 @@ import com.github.pagehelper.Page; import com.github.pagehelper.PageHelper; import io.metersphere.sdk.constants.PermissionConstants; import io.metersphere.system.log.service.OperationLogService; -import io.metersphere.system.log.vo.OperationLogRequest; +import io.metersphere.system.log.vo.SystemOperationLogRequest; import io.metersphere.system.log.vo.OperationLogResponse; import io.metersphere.system.utils.PageUtils; import io.metersphere.system.utils.Pager; @@ -65,7 +65,7 @@ public class OperationLogController { @PostMapping("/list") @Operation(summary = "系统设置-系统-日志-系统操作日志列表查询") @RequiresPermissions(PermissionConstants.SYSTEM_LOG_READ) - public Pager> list(@Validated @RequestBody OperationLogRequest request) { + public Pager> list(@Validated @RequestBody SystemOperationLogRequest request) { Page page = PageHelper.startPage(request.getCurrent(), request.getPageSize(), StringUtils.isNotBlank(request.getSortString()) ? request.getSortString() : "create_time desc"); return PageUtils.setPageInfo(page, operationLogService.list(request)); diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/controller/OrganizationLogController.java b/backend/services/system-setting/src/main/java/io/metersphere/system/controller/OrganizationLogController.java index 717c5b9606..d14da9c969 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/controller/OrganizationLogController.java +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/controller/OrganizationLogController.java @@ -4,22 +4,23 @@ package io.metersphere.system.controller; import com.github.pagehelper.Page; import com.github.pagehelper.PageHelper; import io.metersphere.sdk.constants.PermissionConstants; -import io.metersphere.system.log.service.OperationLogService; -import io.metersphere.system.log.vo.OperationLogRequest; -import io.metersphere.system.log.vo.OperationLogResponse; -import io.metersphere.system.utils.PageUtils; -import io.metersphere.system.utils.Pager; -import io.metersphere.system.utils.SessionUtils; +import io.metersphere.sdk.util.BeanUtils; import io.metersphere.system.domain.User; import io.metersphere.system.dto.OrganizationProjectOptionsDTO; import io.metersphere.system.dto.response.OrganizationProjectOptionsResponse; +import io.metersphere.system.log.service.OperationLogService; +import io.metersphere.system.log.vo.OperationLogResponse; +import io.metersphere.system.log.vo.OrgOperationLogRequest; +import io.metersphere.system.log.vo.SystemOperationLogRequest; import io.metersphere.system.service.SystemProjectService; import io.metersphere.system.service.UserService; +import io.metersphere.system.utils.PageUtils; +import io.metersphere.system.utils.Pager; +import io.metersphere.system.utils.SessionUtils; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.annotation.Resource; -import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.validation.annotation.Validated; @@ -66,21 +67,20 @@ public class OrganizationLogController { public List getLogUserList(@PathVariable(value = "organizationId") String organizationId, @Schema(description = "查询关键字,根据邮箱和用户名查询") @RequestParam(value = "keyword", required = false) String keyword) { - return userService.getUserListByOrgId(organizationId,keyword); + return userService.getUserListByOrgId(organizationId, keyword); } @PostMapping("/list") @Operation(summary = "系统设置-组织-日志-组织菜单下操作日志列表查询") @RequiresPermissions(PermissionConstants.ORGANIZATION_LOG_READ) - public Pager> organizationLogList(@Validated @RequestBody OperationLogRequest request) { + public Pager> organizationLogList(@Validated @RequestBody OrgOperationLogRequest request) { Page page = PageHelper.startPage(request.getCurrent(), request.getPageSize(), StringUtils.isNotBlank(request.getSortString()) ? request.getSortString() : "create_time desc"); - if (CollectionUtils.isEmpty(request.getOrganizationIds())) { - //未传组织id 获取登录用户当前组织id - request.setOrganizationIds(Arrays.asList(SessionUtils.getCurrentOrganizationId())); - } - return PageUtils.setPageInfo(page, operationLogService.list(request)); + SystemOperationLogRequest operationLogRequest = new SystemOperationLogRequest(); + BeanUtils.copyBean(operationLogRequest, request); + operationLogRequest.setOrganizationIds(Arrays.asList(SessionUtils.getCurrentOrganizationId())); + return PageUtils.setPageInfo(page, operationLogService.list(operationLogRequest)); } } diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/log/service/OperationLogService.java b/backend/services/system-setting/src/main/java/io/metersphere/system/log/service/OperationLogService.java index 228debb6ce..926e55c8f5 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/log/service/OperationLogService.java +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/log/service/OperationLogService.java @@ -12,7 +12,7 @@ import io.metersphere.system.domain.OperationHistoryExample; import io.metersphere.system.domain.Organization; import io.metersphere.system.dto.sdk.OptionDTO; import io.metersphere.system.log.dto.LogDTO; -import io.metersphere.system.log.vo.OperationLogRequest; +import io.metersphere.system.log.vo.SystemOperationLogRequest; import io.metersphere.system.log.vo.OperationLogResponse; import io.metersphere.system.mapper.*; import jakarta.annotation.Resource; @@ -90,7 +90,7 @@ public class OperationLogService { operationLogBlobMapper.insert(getBlob(log)); } - public List list(OperationLogRequest request) { + public List list(SystemOperationLogRequest request) { int compare = Long.compare(request.getStartTime(), request.getEndTime()); if (compare > 0) { throw new MSException(Translator.get("startTime_must_be_less_than_endTime")); diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/log/vo/OperationLogRequest.java b/backend/services/system-setting/src/main/java/io/metersphere/system/log/vo/BaseOperationLogRequest.java similarity index 62% rename from backend/services/system-setting/src/main/java/io/metersphere/system/log/vo/OperationLogRequest.java rename to backend/services/system-setting/src/main/java/io/metersphere/system/log/vo/BaseOperationLogRequest.java index 3117b8905e..447d3d52cc 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/log/vo/OperationLogRequest.java +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/log/vo/BaseOperationLogRequest.java @@ -14,36 +14,29 @@ import java.util.List; @Data @EqualsAndHashCode(callSuper = false) -public class OperationLogRequest extends BasePageRequest { +public class BaseOperationLogRequest extends BasePageRequest { - @Schema(description = "操作人") + @Schema(description = "操作人") private String operUser; - - @Schema(description = "开始日期") + @Schema(description = "开始日期") @NotNull(message = "{start_time_is_null}") private Long startTime; - @Schema(description = "结束日期") + @Schema(description = "结束日期") @NotNull(message = "{end_time_is_null}") private Long endTime; - @Schema(description = "项目id") - private List projectIds; - - @Schema(description = "组织id") - private List organizationIds; - - @Schema(description = "操作类型") + @Schema(description = "操作类型") private String type; - @Schema(description = "操作对象") + @Schema(description = "操作对象") private String module; - @Schema(description = "名称") + @Schema(description = "名称") private String content; - @Schema(description = "级别 系统|组织|项目") + @Schema(description = "级别 系统|组织|项目") @EnumValue(enumClass = UserRoleType.class, groups = {Created.class, Updated.class}) private String level; diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/log/vo/OrgOperationLogRequest.java b/backend/services/system-setting/src/main/java/io/metersphere/system/log/vo/OrgOperationLogRequest.java new file mode 100644 index 0000000000..eb79e9e2fc --- /dev/null +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/log/vo/OrgOperationLogRequest.java @@ -0,0 +1,16 @@ +package io.metersphere.system.log.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.List; + +@Data +@EqualsAndHashCode(callSuper = false) +public class OrgOperationLogRequest extends BaseOperationLogRequest { + + @Schema(description = "项目id") + private List projectIds; + +} diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/log/vo/ProOperationLogRequest.java b/backend/services/system-setting/src/main/java/io/metersphere/system/log/vo/ProOperationLogRequest.java new file mode 100644 index 0000000000..06626d0266 --- /dev/null +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/log/vo/ProOperationLogRequest.java @@ -0,0 +1,11 @@ +package io.metersphere.system.log.vo; + +import lombok.Data; +import lombok.EqualsAndHashCode; + +@Data +@EqualsAndHashCode(callSuper = false) +public class ProOperationLogRequest extends BaseOperationLogRequest { + + +} diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/log/vo/SystemOperationLogRequest.java b/backend/services/system-setting/src/main/java/io/metersphere/system/log/vo/SystemOperationLogRequest.java new file mode 100644 index 0000000000..16f218dc2e --- /dev/null +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/log/vo/SystemOperationLogRequest.java @@ -0,0 +1,19 @@ +package io.metersphere.system.log.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.List; + +@Data +@EqualsAndHashCode(callSuper = false) +public class SystemOperationLogRequest extends BaseOperationLogRequest { + + @Schema(description = "项目id") + private List projectIds; + + @Schema(description = "组织id") + private List organizationIds; + +} diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/BaseOperationLogMapper.java b/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/BaseOperationLogMapper.java index b04a9a1cea..208accd4a4 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/BaseOperationLogMapper.java +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/BaseOperationLogMapper.java @@ -1,7 +1,7 @@ package io.metersphere.system.mapper; -import io.metersphere.system.log.vo.OperationLogRequest; +import io.metersphere.system.log.vo.SystemOperationLogRequest; import io.metersphere.system.log.vo.OperationLogResponse; import org.apache.ibatis.annotations.Param; @@ -9,7 +9,7 @@ import java.util.List; public interface BaseOperationLogMapper { - List list(@Param("request") OperationLogRequest request); + List list(@Param("request") SystemOperationLogRequest request); void deleteByTime(@Param("timestamp") long timestamp); diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/BaseOperationLogMapper.xml b/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/BaseOperationLogMapper.xml index 2d81758fe9..2cbf23ed8c 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/BaseOperationLogMapper.xml +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/BaseOperationLogMapper.xml @@ -2,7 +2,7 @@ - SELECT t.project_id, t.organization_id, diff --git a/backend/services/system-setting/src/test/java/io/metersphere/system/controller/OperationLogControllerTests.java b/backend/services/system-setting/src/test/java/io/metersphere/system/controller/OperationLogControllerTests.java index b79cdc80fd..733c7f49d9 100644 --- a/backend/services/system-setting/src/test/java/io/metersphere/system/controller/OperationLogControllerTests.java +++ b/backend/services/system-setting/src/test/java/io/metersphere/system/controller/OperationLogControllerTests.java @@ -4,7 +4,7 @@ import io.metersphere.system.base.BaseTest; import io.metersphere.sdk.constants.PermissionConstants; import io.metersphere.system.log.dto.LogDTO; import io.metersphere.system.log.service.OperationLogService; -import io.metersphere.system.log.vo.OperationLogRequest; +import io.metersphere.system.log.vo.SystemOperationLogRequest; import io.metersphere.system.controller.param.OperationLogRequestDefinition; import jakarta.annotation.Resource; import org.junit.jupiter.api.MethodOrderer; @@ -54,7 +54,7 @@ public class OperationLogControllerTests extends BaseTest { executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD) public void testSystemOperationLogList() throws Exception { //系统级别 全部 - OperationLogRequest request = buildParam(SYSTEM); + SystemOperationLogRequest request = buildParam(SYSTEM); this.requestPostWithOkAndReturn(OPERATION_LOG_LIST, request); //其他查询条件 @@ -80,7 +80,7 @@ public class OperationLogControllerTests extends BaseTest { @Test @Order(4) public void testOrganizationOperationLogList() throws Exception { - OperationLogRequest request = buildParam(ORGANIZATION); + SystemOperationLogRequest request = buildParam(ORGANIZATION); //组织级别 全部 this.requestPostWithOkAndReturn(OPERATION_LOG_LIST, request); @@ -111,7 +111,7 @@ public class OperationLogControllerTests extends BaseTest { @Test @Order(5) public void testProjectOperationLogList() throws Exception { - OperationLogRequest request = buildParam(PROJECT); + SystemOperationLogRequest request = buildParam(PROJECT); //项目级别 全部 this.requestPostWithOkAndReturn(OPERATION_LOG_LIST, request); @@ -155,7 +155,7 @@ public class OperationLogControllerTests extends BaseTest { @Test @Order(6) public void testGetOperationLogParamsError() throws Exception { - OperationLogRequest request = buildParam(SYSTEM); + SystemOperationLogRequest request = buildParam(SYSTEM); request.setStartTime(1689149059000l); request.setEndTime(1689131059000l); ResultActions resultActions = this.requestPost(OPERATION_LOG_LIST, request); @@ -163,8 +163,8 @@ public class OperationLogControllerTests extends BaseTest { } - private OperationLogRequest buildParam(String level) { - OperationLogRequest request = new OperationLogRequest(); + private SystemOperationLogRequest buildParam(String level) { + SystemOperationLogRequest request = new SystemOperationLogRequest(); request.setCurrent(1); request.setPageSize(10); request.setStartTime(1689131059000l); diff --git a/backend/services/system-setting/src/test/java/io/metersphere/system/controller/OrganizationLogControllerTests.java b/backend/services/system-setting/src/test/java/io/metersphere/system/controller/OrganizationLogControllerTests.java index 491a77a63b..c6609d7e6a 100644 --- a/backend/services/system-setting/src/test/java/io/metersphere/system/controller/OrganizationLogControllerTests.java +++ b/backend/services/system-setting/src/test/java/io/metersphere/system/controller/OrganizationLogControllerTests.java @@ -1,9 +1,9 @@ package io.metersphere.system.controller; -import io.metersphere.system.base.BaseTest; import io.metersphere.sdk.constants.PermissionConstants; -import io.metersphere.system.log.vo.OperationLogRequest; +import io.metersphere.system.base.BaseTest; import io.metersphere.system.controller.param.OperationLogRequestDefinition; +import io.metersphere.system.log.vo.OrgOperationLogRequest; import org.junit.jupiter.api.MethodOrderer; import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Test; @@ -14,7 +14,7 @@ import org.springframework.boot.test.context.SpringBootTest; import java.util.Arrays; import java.util.HashMap; -@SpringBootTest(webEnvironment= SpringBootTest.WebEnvironment.RANDOM_PORT) +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) @AutoConfigureMockMvc @TestMethodOrder(MethodOrderer.OrderAnnotation.class) public class OrganizationLogControllerTests extends BaseTest { @@ -41,14 +41,14 @@ public class OrganizationLogControllerTests extends BaseTest { @Order(2) public void testOrganizationUserList() throws Exception { String keyword = "o"; - this.requestGetWithOkAndReturn(ORGANIZATION_USER_LIST+ "/organization_id_001" + "?keyword=" + keyword); + this.requestGetWithOkAndReturn(ORGANIZATION_USER_LIST + "/organization_id_001" + "?keyword=" + keyword); } @Test @Order(3) public void testOrganizationLogList() throws Exception { - OperationLogRequest request = buildParam(ORGANIZATION); + OrgOperationLogRequest request = buildParam(ORGANIZATION); //项目级别 全部 this.requestPostWithOkAndReturn(ORGANIZATION_LOG_LIST, request); @@ -57,7 +57,6 @@ public class OrganizationLogControllerTests extends BaseTest { request.setType("add"); request.setModule("SYSTEM_PARAMETER_SETTING"); request.setContent("认证配置"); - request.setOrganizationIds(Arrays.asList("organization_id_001", "organization_id_002")); this.requestPostWithOkAndReturn(ORGANIZATION_LOG_LIST, request); //项目级别 指定项目查询 @@ -74,8 +73,8 @@ public class OrganizationLogControllerTests extends BaseTest { } - private OperationLogRequest buildParam(String level) { - OperationLogRequest request = new OperationLogRequest(); + private OrgOperationLogRequest buildParam(String level) { + OrgOperationLogRequest request = new OrgOperationLogRequest(); request.setCurrent(1); request.setPageSize(10); request.setStartTime(1689131059000l);