diff --git a/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiDebugModule.java b/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiDebugModule.java index 6918ac7bb0..39c17a89e8 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiDebugModule.java +++ b/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiDebugModule.java @@ -41,7 +41,7 @@ public class ApiDebugModule implements Serializable { @Schema(description = "排序", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "{api_debug_module.pos.not_blank}", groups = {Created.class}) - private Integer pos; + private Long pos; @Schema(description = "创建时间") private Long createTime; @@ -63,7 +63,7 @@ public class ApiDebugModule implements Serializable { protocol("protocol", "protocol", "VARCHAR", false), parentId("parent_id", "parentId", "VARCHAR", false), projectId("project_id", "projectId", "VARCHAR", false), - pos("pos", "pos", "INTEGER", false), + pos("pos", "pos", "BIGINT", false), createTime("create_time", "createTime", "BIGINT", false), updateTime("update_time", "updateTime", "BIGINT", false), updateUser("update_user", "updateUser", "VARCHAR", false), diff --git a/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiDebugModuleExample.java b/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiDebugModuleExample.java index 62feda4024..6bb8dfedeb 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiDebugModuleExample.java +++ b/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiDebugModuleExample.java @@ -464,52 +464,52 @@ public class ApiDebugModuleExample { return (Criteria) this; } - public Criteria andPosEqualTo(Integer value) { + public Criteria andPosEqualTo(Long value) { addCriterion("pos =", value, "pos"); return (Criteria) this; } - public Criteria andPosNotEqualTo(Integer value) { + public Criteria andPosNotEqualTo(Long value) { addCriterion("pos <>", value, "pos"); return (Criteria) this; } - public Criteria andPosGreaterThan(Integer value) { + public Criteria andPosGreaterThan(Long value) { addCriterion("pos >", value, "pos"); return (Criteria) this; } - public Criteria andPosGreaterThanOrEqualTo(Integer value) { + public Criteria andPosGreaterThanOrEqualTo(Long value) { addCriterion("pos >=", value, "pos"); return (Criteria) this; } - public Criteria andPosLessThan(Integer value) { + public Criteria andPosLessThan(Long value) { addCriterion("pos <", value, "pos"); return (Criteria) this; } - public Criteria andPosLessThanOrEqualTo(Integer value) { + public Criteria andPosLessThanOrEqualTo(Long value) { addCriterion("pos <=", value, "pos"); return (Criteria) this; } - public Criteria andPosIn(List values) { + public Criteria andPosIn(List values) { addCriterion("pos in", values, "pos"); return (Criteria) this; } - public Criteria andPosNotIn(List values) { + public Criteria andPosNotIn(List values) { addCriterion("pos not in", values, "pos"); return (Criteria) this; } - public Criteria andPosBetween(Integer value1, Integer value2) { + public Criteria andPosBetween(Long value1, Long value2) { addCriterion("pos between", value1, value2, "pos"); return (Criteria) this; } - public Criteria andPosNotBetween(Integer value1, Integer value2) { + public Criteria andPosNotBetween(Long value1, Long value2) { addCriterion("pos not between", value1, value2, "pos"); return (Criteria) this; } diff --git a/backend/framework/domain/src/main/java/io/metersphere/api/mapper/ApiDebugModuleMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/api/mapper/ApiDebugModuleMapper.xml index c775cc5a6e..7b3752ddaf 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/api/mapper/ApiDebugModuleMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/api/mapper/ApiDebugModuleMapper.xml @@ -7,7 +7,7 @@ - + @@ -111,7 +111,7 @@ create_time, update_time, update_user, create_user) values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{protocol,jdbcType=VARCHAR}, - #{parentId,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR}, #{pos,jdbcType=INTEGER}, + #{parentId,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR}, #{pos,jdbcType=BIGINT}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT}, #{updateUser,jdbcType=VARCHAR}, #{createUser,jdbcType=VARCHAR}) @@ -166,7 +166,7 @@ #{projectId,jdbcType=VARCHAR}, - #{pos,jdbcType=INTEGER}, + #{pos,jdbcType=BIGINT}, #{createTime,jdbcType=BIGINT}, @@ -207,7 +207,7 @@ project_id = #{record.projectId,jdbcType=VARCHAR}, - pos = #{record.pos,jdbcType=INTEGER}, + pos = #{record.pos,jdbcType=BIGINT}, create_time = #{record.createTime,jdbcType=BIGINT}, @@ -233,7 +233,7 @@ protocol = #{record.protocol,jdbcType=VARCHAR}, parent_id = #{record.parentId,jdbcType=VARCHAR}, project_id = #{record.projectId,jdbcType=VARCHAR}, - pos = #{record.pos,jdbcType=INTEGER}, + pos = #{record.pos,jdbcType=BIGINT}, create_time = #{record.createTime,jdbcType=BIGINT}, update_time = #{record.updateTime,jdbcType=BIGINT}, update_user = #{record.updateUser,jdbcType=VARCHAR}, @@ -258,7 +258,7 @@ project_id = #{projectId,jdbcType=VARCHAR}, - pos = #{pos,jdbcType=INTEGER}, + pos = #{pos,jdbcType=BIGINT}, create_time = #{createTime,jdbcType=BIGINT}, @@ -281,7 +281,7 @@ protocol = #{protocol,jdbcType=VARCHAR}, parent_id = #{parentId,jdbcType=VARCHAR}, project_id = #{projectId,jdbcType=VARCHAR}, - pos = #{pos,jdbcType=INTEGER}, + pos = #{pos,jdbcType=BIGINT}, create_time = #{createTime,jdbcType=BIGINT}, update_time = #{updateTime,jdbcType=BIGINT}, update_user = #{updateUser,jdbcType=VARCHAR}, @@ -295,7 +295,7 @@ values (#{item.id,jdbcType=VARCHAR}, #{item.name,jdbcType=VARCHAR}, #{item.protocol,jdbcType=VARCHAR}, - #{item.parentId,jdbcType=VARCHAR}, #{item.projectId,jdbcType=VARCHAR}, #{item.pos,jdbcType=INTEGER}, + #{item.parentId,jdbcType=VARCHAR}, #{item.projectId,jdbcType=VARCHAR}, #{item.pos,jdbcType=BIGINT}, #{item.createTime,jdbcType=BIGINT}, #{item.updateTime,jdbcType=BIGINT}, #{item.updateUser,jdbcType=VARCHAR}, #{item.createUser,jdbcType=VARCHAR}) @@ -326,7 +326,7 @@ #{item.projectId,jdbcType=VARCHAR} - #{item.pos,jdbcType=INTEGER} + #{item.pos,jdbcType=BIGINT} #{item.createTime,jdbcType=BIGINT} diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/domain/FileModule.java b/backend/framework/domain/src/main/java/io/metersphere/project/domain/FileModule.java index ed6790516f..9b49544af7 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/domain/FileModule.java +++ b/backend/framework/domain/src/main/java/io/metersphere/project/domain/FileModule.java @@ -1,15 +1,12 @@ package io.metersphere.project.domain; -import io.metersphere.validation.groups.Created; -import io.metersphere.validation.groups.Updated; +import io.metersphere.validation.groups.*; import io.swagger.v3.oas.annotations.media.Schema; -import jakarta.validation.constraints.NotBlank; -import jakarta.validation.constraints.Size; -import lombok.Data; - +import jakarta.validation.constraints.*; import java.io.Serializable; import java.util.ArrayList; import java.util.Arrays; +import lombok.Data; @Data public class FileModule implements Serializable { @@ -37,8 +34,9 @@ public class FileModule implements Serializable { @Schema(description = "更新时间") private Long updateTime; - @Schema(description = "排序用的标识") - private Integer pos; + @Schema(description = "排序用的标识", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "{file_module.pos.not_blank}", groups = {Created.class}) + private Long pos; @Schema(description = "修改人") private String updateUser; @@ -58,7 +56,7 @@ public class FileModule implements Serializable { parentId("parent_id", "parentId", "VARCHAR", false), createTime("create_time", "createTime", "BIGINT", false), updateTime("update_time", "updateTime", "BIGINT", false), - pos("pos", "pos", "INTEGER", false), + pos("pos", "pos", "BIGINT", false), updateUser("update_user", "updateUser", "VARCHAR", false), createUser("create_user", "createUser", "VARCHAR", false), moduleType("module_type", "moduleType", "VARCHAR", false); diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/domain/FileModuleExample.java b/backend/framework/domain/src/main/java/io/metersphere/project/domain/FileModuleExample.java index 0c5eddd26f..b3b51fcf13 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/domain/FileModuleExample.java +++ b/backend/framework/domain/src/main/java/io/metersphere/project/domain/FileModuleExample.java @@ -514,52 +514,52 @@ public class FileModuleExample { return (Criteria) this; } - public Criteria andPosEqualTo(Integer value) { + public Criteria andPosEqualTo(Long value) { addCriterion("pos =", value, "pos"); return (Criteria) this; } - public Criteria andPosNotEqualTo(Integer value) { + public Criteria andPosNotEqualTo(Long value) { addCriterion("pos <>", value, "pos"); return (Criteria) this; } - public Criteria andPosGreaterThan(Integer value) { + public Criteria andPosGreaterThan(Long value) { addCriterion("pos >", value, "pos"); return (Criteria) this; } - public Criteria andPosGreaterThanOrEqualTo(Integer value) { + public Criteria andPosGreaterThanOrEqualTo(Long value) { addCriterion("pos >=", value, "pos"); return (Criteria) this; } - public Criteria andPosLessThan(Integer value) { + public Criteria andPosLessThan(Long value) { addCriterion("pos <", value, "pos"); return (Criteria) this; } - public Criteria andPosLessThanOrEqualTo(Integer value) { + public Criteria andPosLessThanOrEqualTo(Long value) { addCriterion("pos <=", value, "pos"); return (Criteria) this; } - public Criteria andPosIn(List values) { + public Criteria andPosIn(List values) { addCriterion("pos in", values, "pos"); return (Criteria) this; } - public Criteria andPosNotIn(List values) { + public Criteria andPosNotIn(List values) { addCriterion("pos not in", values, "pos"); return (Criteria) this; } - public Criteria andPosBetween(Integer value1, Integer value2) { + public Criteria andPosBetween(Long value1, Long value2) { addCriterion("pos between", value1, value2, "pos"); return (Criteria) this; } - public Criteria andPosNotBetween(Integer value1, Integer value2) { + public Criteria andPosNotBetween(Long value1, Long value2) { addCriterion("pos not between", value1, value2, "pos"); return (Criteria) this; } diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FileModuleMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FileModuleMapper.xml index 8eddb6c61c..57b6eaca18 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FileModuleMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FileModuleMapper.xml @@ -8,7 +8,7 @@ - + @@ -112,7 +112,7 @@ module_type) values (#{id,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{parentId,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT}, - #{pos,jdbcType=INTEGER}, #{updateUser,jdbcType=VARCHAR}, #{createUser,jdbcType=VARCHAR}, + #{pos,jdbcType=BIGINT}, #{updateUser,jdbcType=VARCHAR}, #{createUser,jdbcType=VARCHAR}, #{moduleType,jdbcType=VARCHAR}) @@ -169,7 +169,7 @@ #{updateTime,jdbcType=BIGINT}, - #{pos,jdbcType=INTEGER}, + #{pos,jdbcType=BIGINT}, #{updateUser,jdbcType=VARCHAR}, @@ -210,7 +210,7 @@ update_time = #{record.updateTime,jdbcType=BIGINT}, - pos = #{record.pos,jdbcType=INTEGER}, + pos = #{record.pos,jdbcType=BIGINT}, update_user = #{record.updateUser,jdbcType=VARCHAR}, @@ -234,7 +234,7 @@ parent_id = #{record.parentId,jdbcType=VARCHAR}, create_time = #{record.createTime,jdbcType=BIGINT}, update_time = #{record.updateTime,jdbcType=BIGINT}, - pos = #{record.pos,jdbcType=INTEGER}, + pos = #{record.pos,jdbcType=BIGINT}, update_user = #{record.updateUser,jdbcType=VARCHAR}, create_user = #{record.createUser,jdbcType=VARCHAR}, module_type = #{record.moduleType,jdbcType=VARCHAR} @@ -261,7 +261,7 @@ update_time = #{updateTime,jdbcType=BIGINT}, - pos = #{pos,jdbcType=INTEGER}, + pos = #{pos,jdbcType=BIGINT}, update_user = #{updateUser,jdbcType=VARCHAR}, @@ -282,7 +282,7 @@ parent_id = #{parentId,jdbcType=VARCHAR}, create_time = #{createTime,jdbcType=BIGINT}, update_time = #{updateTime,jdbcType=BIGINT}, - pos = #{pos,jdbcType=INTEGER}, + pos = #{pos,jdbcType=BIGINT}, update_user = #{updateUser,jdbcType=VARCHAR}, create_user = #{createUser,jdbcType=VARCHAR}, module_type = #{moduleType,jdbcType=VARCHAR} @@ -296,7 +296,7 @@ (#{item.id,jdbcType=VARCHAR}, #{item.projectId,jdbcType=VARCHAR}, #{item.name,jdbcType=VARCHAR}, #{item.parentId,jdbcType=VARCHAR}, #{item.createTime,jdbcType=BIGINT}, #{item.updateTime,jdbcType=BIGINT}, - #{item.pos,jdbcType=INTEGER}, #{item.updateUser,jdbcType=VARCHAR}, #{item.createUser,jdbcType=VARCHAR}, + #{item.pos,jdbcType=BIGINT}, #{item.updateUser,jdbcType=VARCHAR}, #{item.createUser,jdbcType=VARCHAR}, #{item.moduleType,jdbcType=VARCHAR}) @@ -329,7 +329,7 @@ #{item.updateTime,jdbcType=BIGINT} - #{item.pos,jdbcType=INTEGER} + #{item.pos,jdbcType=BIGINT} #{item.updateUser,jdbcType=VARCHAR} diff --git a/backend/framework/domain/src/main/resources/migration/3.0.0/ddl/V3.0.0_4__project_management.sql b/backend/framework/domain/src/main/resources/migration/3.0.0/ddl/V3.0.0_4__project_management.sql index f11e66dfe3..7a11f6cbf4 100644 --- a/backend/framework/domain/src/main/resources/migration/3.0.0/ddl/V3.0.0_4__project_management.sql +++ b/backend/framework/domain/src/main/resources/migration/3.0.0/ddl/V3.0.0_4__project_management.sql @@ -116,7 +116,7 @@ CREATE TABLE IF NOT EXISTS file_module `parent_id` VARCHAR(50) COMMENT '父级ID', `create_time` BIGINT NOT NULL COMMENT '创建时间', `update_time` BIGINT NOT NULL COMMENT '更新时间', - `pos` INT NOT NULL DEFAULT 0 COMMENT '排序用的标识', + `pos` BIGINT NOT NULL DEFAULT 0 COMMENT '排序用的标识', `update_user` VARCHAR(50) COMMENT '修改人', `create_user` VARCHAR(50) COMMENT '创建人', `module_type` VARCHAR(20) DEFAULT 'module' COMMENT '模块类型: module/repository', diff --git a/backend/framework/domain/src/main/resources/migration/3.0.0/ddl/V3.0.0_5__api_test.sql b/backend/framework/domain/src/main/resources/migration/3.0.0/ddl/V3.0.0_5__api_test.sql index c79914d600..b4a71afc46 100644 --- a/backend/framework/domain/src/main/resources/migration/3.0.0/ddl/V3.0.0_5__api_test.sql +++ b/backend/framework/domain/src/main/resources/migration/3.0.0/ddl/V3.0.0_5__api_test.sql @@ -44,7 +44,7 @@ CREATE TABLE api_debug_module( `protocol` VARCHAR(20) NOT NULL COMMENT '协议' , `parent_id` VARCHAR(50) NOT NULL DEFAULT 'NONE' COMMENT '父级fk' , `project_id` VARCHAR(50) NOT NULL COMMENT '项目fk' , - `pos` INT NOT NULL COMMENT '排序' , + `pos` BIGINT NOT NULL COMMENT '排序' , `create_time` BIGINT NOT NULL COMMENT '创建时间' , `update_time` BIGINT NOT NULL COMMENT '修改时间' , `update_user` VARCHAR(50) NOT NULL COMMENT '修改人' , diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiDebugModuleMapper.java b/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiDebugModuleMapper.java index 14d5864a76..59a640f424 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiDebugModuleMapper.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiDebugModuleMapper.java @@ -20,15 +20,15 @@ public interface ExtApiDebugModuleMapper { void deleteByIds(@Param("ids") List deleteId); - Integer getMaxPosByParentId(String parentId); + Long getMaxPosByParentId(String parentId); List selectIdsByProjectId(String projectId); ApiDebugModule getLastModuleByParentId(String id); - ApiDebugModule getNextModuleInParentId(@Param("parentId") String parentId, @Param("pos") int pos); + ApiDebugModule getNextModuleInParentId(@Param("parentId") String parentId, @Param("pos") long pos); - ApiDebugModule getPreviousModuleInParentId(@Param("parentId") String parentId, @Param("pos") int pos); + ApiDebugModule getPreviousModuleInParentId(@Param("parentId") String parentId, @Param("pos") long pos); List selectApiDebugByProtocolAndUser(String protocol, String userId); diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiDebugModuleMapper.xml b/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiDebugModuleMapper.xml index cea588e107..c58669fa0d 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiDebugModuleMapper.xml +++ b/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiDebugModuleMapper.xml @@ -40,7 +40,7 @@ #{id} - SELECT max(pos) FROM api_debug_module WHERE parent_id = #{0} diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/service/ApiDebugModuleService.java b/backend/services/api-test/src/main/java/io/metersphere/api/service/ApiDebugModuleService.java index 4b42f6634a..4550668194 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/service/ApiDebugModuleService.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/service/ApiDebugModuleService.java @@ -113,8 +113,8 @@ public class ApiDebugModuleService extends ModuleTreeService { return apiDebugModule.getId(); } - private Integer countPos(String parentId) { - Integer maxPos = extApiDebugModuleMapper.getMaxPosByParentId(parentId); + private Long countPos(String parentId) { + Long maxPos = extApiDebugModuleMapper.getMaxPosByParentId(parentId); if (maxPos == null) { return LIMIT_POS; } else { @@ -297,7 +297,7 @@ public class ApiDebugModuleService extends ModuleTreeService { @Override - public void updatePos(String id, int pos) { + public void updatePos(String id, long pos) { ApiDebugModule updateModule = new ApiDebugModule(); updateModule.setPos(pos); updateModule.setId(id); diff --git a/backend/services/api-test/src/test/java/io/metersphere/api/controller/ApiDebugModuleControllerTests.java b/backend/services/api-test/src/test/java/io/metersphere/api/controller/ApiDebugModuleControllerTests.java index 5a1b4bd09d..e06b6c18b9 100644 --- a/backend/services/api-test/src/test/java/io/metersphere/api/controller/ApiDebugModuleControllerTests.java +++ b/backend/services/api-test/src/test/java/io/metersphere/api/controller/ApiDebugModuleControllerTests.java @@ -518,7 +518,7 @@ public class ApiDebugModuleControllerTests extends BaseTest { //更改pos ApiDebugModule updateModule = new ApiDebugModule(); updateModule.setId(a1Node.getId()); - updateModule.setPos(2); + updateModule.setPos(2L); apiDebugModuleMapper.updateByPrimaryKeySelective(updateModule); //开始移动 @@ -543,10 +543,10 @@ public class ApiDebugModuleControllerTests extends BaseTest { //更改pos ApiDebugModule updateModule = new ApiDebugModule(); updateModule.setId(a1Node.getId()); - updateModule.setPos(3 * 64); + updateModule.setPos(3 * 64L); apiDebugModuleMapper.updateByPrimaryKeySelective(updateModule); updateModule.setId(a2Node.getId()); - updateModule.setPos(3 * 64 + 2); + updateModule.setPos(3 * 64 + 2L); apiDebugModuleMapper.updateByPrimaryKeySelective(updateModule); //开始移动 @@ -570,7 +570,7 @@ public class ApiDebugModuleControllerTests extends BaseTest { //更改pos ApiDebugModule updateModule = new ApiDebugModule(); updateModule.setId(a1b1Node.getId()); - updateModule.setPos(2); + updateModule.setPos(2L); apiDebugModuleMapper.updateByPrimaryKeySelective(updateModule); //开始移动 @@ -594,10 +594,10 @@ public class ApiDebugModuleControllerTests extends BaseTest { //更改pos ApiDebugModule updateModule = new ApiDebugModule(); updateModule.setId(a1b1Node.getId()); - updateModule.setPos(3 * 64); + updateModule.setPos(3 * 64L); apiDebugModuleMapper.updateByPrimaryKeySelective(updateModule); updateModule.setId(a1a1Node.getId()); - updateModule.setPos(3 * 64 + 2); + updateModule.setPos(3 * 64 + 2L); apiDebugModuleMapper.updateByPrimaryKeySelective(updateModule); //开始移动 diff --git a/backend/services/project-management/src/main/java/io/metersphere/project/controller/FilePreviewController.java b/backend/services/project-management/src/main/java/io/metersphere/project/controller/FilePreviewController.java index b24b87bdc1..d2095c70f3 100644 --- a/backend/services/project-management/src/main/java/io/metersphere/project/controller/FilePreviewController.java +++ b/backend/services/project-management/src/main/java/io/metersphere/project/controller/FilePreviewController.java @@ -9,7 +9,6 @@ import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.annotation.Resource; import org.apache.commons.lang3.StringUtils; -import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; @@ -29,7 +28,6 @@ public class FilePreviewController { @GetMapping(value = "/original/{userId}/{fileId}") @Operation(summary = "预览原图") - @RequiresPermissions(PermissionConstants.PROJECT_FILE_MANAGEMENT_READ_DOWNLOAD) public ResponseEntity originalImg(@PathVariable String userId,@PathVariable String fileId) { FileInformationDTO fileInformationDTO = fileMetadataService.get(fileId); if (StringUtils.isEmpty(fileInformationDTO.getId())) { diff --git a/backend/services/project-management/src/main/java/io/metersphere/project/mapper/ExtFileModuleMapper.java b/backend/services/project-management/src/main/java/io/metersphere/project/mapper/ExtFileModuleMapper.java index c3d3ae0fba..32b46bc208 100644 --- a/backend/services/project-management/src/main/java/io/metersphere/project/mapper/ExtFileModuleMapper.java +++ b/backend/services/project-management/src/main/java/io/metersphere/project/mapper/ExtFileModuleMapper.java @@ -17,15 +17,15 @@ public interface ExtFileModuleMapper { void deleteByIds(@Param("ids") List deleteId); - Integer getMaxPosByParentId(String parentId); + Long getMaxPosByParentId(String parentId); List selectIdsByProjectId(String projectId); FileModule getLastModuleByParentId(String id); - FileModule getNextModuleInParentId(@Param("parentId") String parentId, @Param("pos") int pos); + FileModule getNextModuleInParentId(@Param("parentId") String parentId, @Param("pos") long pos); - FileModule getPreviousModuleInParentId(@Param("parentId") String parentId, @Param("pos") int pos); + FileModule getPreviousModuleInParentId(@Param("parentId") String parentId, @Param("pos") long pos); String selectNameById(String moduleId); } diff --git a/backend/services/project-management/src/main/java/io/metersphere/project/mapper/ExtFileModuleMapper.xml b/backend/services/project-management/src/main/java/io/metersphere/project/mapper/ExtFileModuleMapper.xml index d4d598f591..83aa02d34f 100644 --- a/backend/services/project-management/src/main/java/io/metersphere/project/mapper/ExtFileModuleMapper.xml +++ b/backend/services/project-management/src/main/java/io/metersphere/project/mapper/ExtFileModuleMapper.xml @@ -29,7 +29,7 @@ #{id} - SELECT max(pos) FROM file_module WHERE parent_id = #{0} @@ -66,5 +66,4 @@ FROM file_module WHERE id = #{0} - \ No newline at end of file diff --git a/backend/services/project-management/src/main/java/io/metersphere/project/service/FileModuleService.java b/backend/services/project-management/src/main/java/io/metersphere/project/service/FileModuleService.java index 9d9575e0b3..815e13b042 100644 --- a/backend/services/project-management/src/main/java/io/metersphere/project/service/FileModuleService.java +++ b/backend/services/project-management/src/main/java/io/metersphere/project/service/FileModuleService.java @@ -74,8 +74,8 @@ public class FileModuleService extends ModuleTreeService implements CleanupProje return fileModule.getId(); } - private Integer countPos(String parentId) { - Integer maxPos = extFileModuleMapper.getMaxPosByParentId(parentId); + private Long countPos(String parentId) { + Long maxPos = extFileModuleMapper.getMaxPosByParentId(parentId); if (maxPos == null) { return LIMIT_POS; } else { @@ -251,7 +251,7 @@ public class FileModuleService extends ModuleTreeService implements CleanupProje @Override - public void updatePos(String id, int pos) { + public void updatePos(String id, long pos) { FileModule updateModule = new FileModule(); updateModule.setPos(pos); updateModule.setId(id); diff --git a/backend/services/project-management/src/main/java/io/metersphere/project/service/ModuleTreeService.java b/backend/services/project-management/src/main/java/io/metersphere/project/service/ModuleTreeService.java index 4599ad2b9a..0da8bcad33 100644 --- a/backend/services/project-management/src/main/java/io/metersphere/project/service/ModuleTreeService.java +++ b/backend/services/project-management/src/main/java/io/metersphere/project/service/ModuleTreeService.java @@ -18,7 +18,7 @@ import java.util.stream.Collectors; public abstract class ModuleTreeService { - protected static final int LIMIT_POS = 64; + protected static final long LIMIT_POS = 64; public BaseTreeNode getDefaultModule(String name) { //默认模块下不允许创建子模块。 它本身也就是叶子节点。 @@ -91,7 +91,7 @@ public abstract class ModuleTreeService { updatePos(nodeMoveDTO.getNode().getId(), 0); } else { boolean refreshPos = false; - int pos; + long pos; if (nextNode == null) { pos = previousNode.getPos() + LIMIT_POS; } else if (previousNode == null) { @@ -100,7 +100,7 @@ public abstract class ModuleTreeService { refreshPos = true; } } else { - int quantityDifference = (nextNode.getPos() - previousNode.getPos()) / 2; + long quantityDifference = (nextNode.getPos() - previousNode.getPos()) / 2; if (quantityDifference <= 2) { refreshPos = true; } @@ -114,7 +114,7 @@ public abstract class ModuleTreeService { } } - public abstract void updatePos(String id, int pos); + public abstract void updatePos(String id, long pos); public abstract void refreshPos(String parentId); diff --git a/backend/services/project-management/src/main/resources/projectGeneratorConfig.xml b/backend/services/project-management/src/main/resources/projectGeneratorConfig.xml index ceaf7b4a0f..377a559094 100644 --- a/backend/services/project-management/src/main/resources/projectGeneratorConfig.xml +++ b/backend/services/project-management/src/main/resources/projectGeneratorConfig.xml @@ -72,8 +72,8 @@ - - + +
diff --git a/backend/services/project-management/src/test/java/io/metersphere/project/controller/filemanagement/FileManagementControllerTests.java b/backend/services/project-management/src/test/java/io/metersphere/project/controller/filemanagement/FileManagementControllerTests.java index 0034e08bf0..80fe4697df 100644 --- a/backend/services/project-management/src/test/java/io/metersphere/project/controller/filemanagement/FileManagementControllerTests.java +++ b/backend/services/project-management/src/test/java/io/metersphere/project/controller/filemanagement/FileManagementControllerTests.java @@ -1137,7 +1137,7 @@ public class FileManagementControllerTests extends BaseTest { //更改pos FileModule updateModule = new FileModule(); updateModule.setId(a1Node.getId()); - updateModule.setPos(2); + updateModule.setPos(2L); fileModuleMapper.updateByPrimaryKeySelective(updateModule); //开始移动 @@ -1162,10 +1162,10 @@ public class FileManagementControllerTests extends BaseTest { //更改pos FileModule updateModule = new FileModule(); updateModule.setId(a1Node.getId()); - updateModule.setPos(3 * 64); + updateModule.setPos(3 * 64L); fileModuleMapper.updateByPrimaryKeySelective(updateModule); updateModule.setId(a2Node.getId()); - updateModule.setPos(3 * 64 + 2); + updateModule.setPos(3 * 64 + 2L); fileModuleMapper.updateByPrimaryKeySelective(updateModule); //开始移动 @@ -1189,7 +1189,7 @@ public class FileManagementControllerTests extends BaseTest { //更改pos FileModule updateModule = new FileModule(); updateModule.setId(a1b1Node.getId()); - updateModule.setPos(2); + updateModule.setPos(2L); fileModuleMapper.updateByPrimaryKeySelective(updateModule); //开始移动 @@ -1213,10 +1213,10 @@ public class FileManagementControllerTests extends BaseTest { //更改pos FileModule updateModule = new FileModule(); updateModule.setId(a1b1Node.getId()); - updateModule.setPos(3 * 64); + updateModule.setPos(3 * 64L); fileModuleMapper.updateByPrimaryKeySelective(updateModule); updateModule.setId(a1a1Node.getId()); - updateModule.setPos(3 * 64 + 2); + updateModule.setPos(3 * 64 + 2L); fileModuleMapper.updateByPrimaryKeySelective(updateModule); //开始移动 diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/dto/sdk/BaseModule.java b/backend/services/system-setting/src/main/java/io/metersphere/system/dto/sdk/BaseModule.java index 154f29d908..cf6734d735 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/dto/sdk/BaseModule.java +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/dto/sdk/BaseModule.java @@ -16,7 +16,7 @@ public class BaseModule { private String name; @Schema(description = "排序单位") - private int pos; + private long pos; @Schema(description = "项目ID") private String projectId;