mirror of
https://gitee.com/fit2cloud-feizhiyun/MeterSphere.git
synced 2024-12-02 12:09:13 +08:00
refactor(项目设置): 修改数据库pos字段的字段类型
This commit is contained in:
parent
b9f2f97a8a
commit
e41e9f6c65
@ -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),
|
||||
|
@ -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<Integer> values) {
|
||||
public Criteria andPosIn(List<Long> values) {
|
||||
addCriterion("pos in", values, "pos");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPosNotIn(List<Integer> values) {
|
||||
public Criteria andPosNotIn(List<Long> 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;
|
||||
}
|
||||
|
@ -7,7 +7,7 @@
|
||||
<result column="protocol" jdbcType="VARCHAR" property="protocol" />
|
||||
<result column="parent_id" jdbcType="VARCHAR" property="parentId" />
|
||||
<result column="project_id" jdbcType="VARCHAR" property="projectId" />
|
||||
<result column="pos" jdbcType="INTEGER" property="pos" />
|
||||
<result column="pos" jdbcType="BIGINT" property="pos" />
|
||||
<result column="create_time" jdbcType="BIGINT" property="createTime" />
|
||||
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
|
||||
<result column="update_user" jdbcType="VARCHAR" property="updateUser" />
|
||||
@ -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})
|
||||
</insert>
|
||||
@ -166,7 +166,7 @@
|
||||
#{projectId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="pos != null">
|
||||
#{pos,jdbcType=INTEGER},
|
||||
#{pos,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime,jdbcType=BIGINT},
|
||||
@ -207,7 +207,7 @@
|
||||
project_id = #{record.projectId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.pos != null">
|
||||
pos = #{record.pos,jdbcType=INTEGER},
|
||||
pos = #{record.pos,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.createTime != null">
|
||||
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},
|
||||
</if>
|
||||
<if test="pos != null">
|
||||
pos = #{pos,jdbcType=INTEGER},
|
||||
pos = #{pos,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
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
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(#{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})
|
||||
</foreach>
|
||||
@ -326,7 +326,7 @@
|
||||
#{item.projectId,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="'pos'.toString() == column.value">
|
||||
#{item.pos,jdbcType=INTEGER}
|
||||
#{item.pos,jdbcType=BIGINT}
|
||||
</if>
|
||||
<if test="'create_time'.toString() == column.value">
|
||||
#{item.createTime,jdbcType=BIGINT}
|
||||
|
@ -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);
|
||||
|
@ -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<Integer> values) {
|
||||
public Criteria andPosIn(List<Long> values) {
|
||||
addCriterion("pos in", values, "pos");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPosNotIn(List<Integer> values) {
|
||||
public Criteria andPosNotIn(List<Long> 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;
|
||||
}
|
||||
|
@ -8,7 +8,7 @@
|
||||
<result column="parent_id" jdbcType="VARCHAR" property="parentId" />
|
||||
<result column="create_time" jdbcType="BIGINT" property="createTime" />
|
||||
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
|
||||
<result column="pos" jdbcType="INTEGER" property="pos" />
|
||||
<result column="pos" jdbcType="BIGINT" property="pos" />
|
||||
<result column="update_user" jdbcType="VARCHAR" property="updateUser" />
|
||||
<result column="create_user" jdbcType="VARCHAR" property="createUser" />
|
||||
<result column="module_type" jdbcType="VARCHAR" property="moduleType" />
|
||||
@ -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})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="io.metersphere.project.domain.FileModule">
|
||||
@ -169,7 +169,7 @@
|
||||
#{updateTime,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="pos != null">
|
||||
#{pos,jdbcType=INTEGER},
|
||||
#{pos,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="updateUser != null">
|
||||
#{updateUser,jdbcType=VARCHAR},
|
||||
@ -210,7 +210,7 @@
|
||||
update_time = #{record.updateTime,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.pos != null">
|
||||
pos = #{record.pos,jdbcType=INTEGER},
|
||||
pos = #{record.pos,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.updateUser != null">
|
||||
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},
|
||||
</if>
|
||||
<if test="pos != null">
|
||||
pos = #{pos,jdbcType=INTEGER},
|
||||
pos = #{pos,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="updateUser != null">
|
||||
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 @@
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(#{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})
|
||||
</foreach>
|
||||
</insert>
|
||||
@ -329,7 +329,7 @@
|
||||
#{item.updateTime,jdbcType=BIGINT}
|
||||
</if>
|
||||
<if test="'pos'.toString() == column.value">
|
||||
#{item.pos,jdbcType=INTEGER}
|
||||
#{item.pos,jdbcType=BIGINT}
|
||||
</if>
|
||||
<if test="'update_user'.toString() == column.value">
|
||||
#{item.updateUser,jdbcType=VARCHAR}
|
||||
|
@ -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',
|
||||
|
@ -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 '修改人' ,
|
||||
|
@ -20,15 +20,15 @@ public interface ExtApiDebugModuleMapper {
|
||||
|
||||
void deleteByIds(@Param("ids") List<String> deleteId);
|
||||
|
||||
Integer getMaxPosByParentId(String parentId);
|
||||
Long getMaxPosByParentId(String parentId);
|
||||
|
||||
List<String> 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<ApiTreeNode> selectApiDebugByProtocolAndUser(String protocol, String userId);
|
||||
|
||||
|
@ -40,7 +40,7 @@
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<select id="getMaxPosByParentId" resultType="java.lang.Integer">
|
||||
<select id="getMaxPosByParentId" resultType="java.lang.Long">
|
||||
SELECT max(pos)
|
||||
FROM api_debug_module
|
||||
WHERE parent_id = #{0}
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
||||
//开始移动
|
||||
|
@ -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<byte[]> originalImg(@PathVariable String userId,@PathVariable String fileId) {
|
||||
FileInformationDTO fileInformationDTO = fileMetadataService.get(fileId);
|
||||
if (StringUtils.isEmpty(fileInformationDTO.getId())) {
|
||||
|
@ -17,15 +17,15 @@ public interface ExtFileModuleMapper {
|
||||
|
||||
void deleteByIds(@Param("ids") List<String> deleteId);
|
||||
|
||||
Integer getMaxPosByParentId(String parentId);
|
||||
Long getMaxPosByParentId(String parentId);
|
||||
|
||||
List<String> 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);
|
||||
}
|
||||
|
@ -29,7 +29,7 @@
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<select id="getMaxPosByParentId" resultType="java.lang.Integer">
|
||||
<select id="getMaxPosByParentId" resultType="java.lang.Long">
|
||||
SELECT max(pos) FROM file_module
|
||||
WHERE parent_id = #{0}
|
||||
</select>
|
||||
@ -66,5 +66,4 @@
|
||||
FROM file_module
|
||||
WHERE id = #{0}
|
||||
</select>
|
||||
|
||||
</mapper>
|
@ -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);
|
||||
|
@ -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);
|
||||
|
||||
|
@ -72,8 +72,8 @@
|
||||
<!--要生成的数据库表 -->
|
||||
<!-- <table tableName="custom_function"/>-->
|
||||
<!-- <table tableName="fake_error"/>-->
|
||||
<table tableName="file_metadata"/>
|
||||
<!-- <table tableName="file_module"/>-->
|
||||
<!-- <table tableName="file_metadata"/>-->
|
||||
<table tableName="file_module"/>
|
||||
<!-- <table tableName="project"/>-->
|
||||
<!-- <table tableName="project_application"/>-->
|
||||
<!-- <table tableName="project_version"/>-->
|
||||
|
@ -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);
|
||||
|
||||
//开始移动
|
||||
|
@ -16,7 +16,7 @@ public class BaseModule {
|
||||
private String name;
|
||||
|
||||
@Schema(description = "排序单位")
|
||||
private int pos;
|
||||
private long pos;
|
||||
|
||||
@Schema(description = "项目ID")
|
||||
private String projectId;
|
||||
|
Loading…
Reference in New Issue
Block a user