refactor(项目设置): 修改数据库pos字段的字段类型

This commit is contained in:
song-tianyang 2023-10-31 10:43:15 +08:00 committed by 建国
parent b9f2f97a8a
commit e41e9f6c65
20 changed files with 82 additions and 87 deletions

View File

@ -41,7 +41,7 @@ public class ApiDebugModule implements Serializable {
@Schema(description = "排序", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(description = "排序", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "{api_debug_module.pos.not_blank}", groups = {Created.class}) @NotNull(message = "{api_debug_module.pos.not_blank}", groups = {Created.class})
private Integer pos; private Long pos;
@Schema(description = "创建时间") @Schema(description = "创建时间")
private Long createTime; private Long createTime;
@ -63,7 +63,7 @@ public class ApiDebugModule implements Serializable {
protocol("protocol", "protocol", "VARCHAR", false), protocol("protocol", "protocol", "VARCHAR", false),
parentId("parent_id", "parentId", "VARCHAR", false), parentId("parent_id", "parentId", "VARCHAR", false),
projectId("project_id", "projectId", "VARCHAR", false), projectId("project_id", "projectId", "VARCHAR", false),
pos("pos", "pos", "INTEGER", false), pos("pos", "pos", "BIGINT", false),
createTime("create_time", "createTime", "BIGINT", false), createTime("create_time", "createTime", "BIGINT", false),
updateTime("update_time", "updateTime", "BIGINT", false), updateTime("update_time", "updateTime", "BIGINT", false),
updateUser("update_user", "updateUser", "VARCHAR", false), updateUser("update_user", "updateUser", "VARCHAR", false),

View File

@ -464,52 +464,52 @@ public class ApiDebugModuleExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPosEqualTo(Integer value) { public Criteria andPosEqualTo(Long value) {
addCriterion("pos =", value, "pos"); addCriterion("pos =", value, "pos");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPosNotEqualTo(Integer value) { public Criteria andPosNotEqualTo(Long value) {
addCriterion("pos <>", value, "pos"); addCriterion("pos <>", value, "pos");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPosGreaterThan(Integer value) { public Criteria andPosGreaterThan(Long value) {
addCriterion("pos >", value, "pos"); addCriterion("pos >", value, "pos");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPosGreaterThanOrEqualTo(Integer value) { public Criteria andPosGreaterThanOrEqualTo(Long value) {
addCriterion("pos >=", value, "pos"); addCriterion("pos >=", value, "pos");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPosLessThan(Integer value) { public Criteria andPosLessThan(Long value) {
addCriterion("pos <", value, "pos"); addCriterion("pos <", value, "pos");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPosLessThanOrEqualTo(Integer value) { public Criteria andPosLessThanOrEqualTo(Long value) {
addCriterion("pos <=", value, "pos"); addCriterion("pos <=", value, "pos");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPosIn(List<Integer> values) { public Criteria andPosIn(List<Long> values) {
addCriterion("pos in", values, "pos"); addCriterion("pos in", values, "pos");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPosNotIn(List<Integer> values) { public Criteria andPosNotIn(List<Long> values) {
addCriterion("pos not in", values, "pos"); addCriterion("pos not in", values, "pos");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPosBetween(Integer value1, Integer value2) { public Criteria andPosBetween(Long value1, Long value2) {
addCriterion("pos between", value1, value2, "pos"); addCriterion("pos between", value1, value2, "pos");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPosNotBetween(Integer value1, Integer value2) { public Criteria andPosNotBetween(Long value1, Long value2) {
addCriterion("pos not between", value1, value2, "pos"); addCriterion("pos not between", value1, value2, "pos");
return (Criteria) this; return (Criteria) this;
} }

View File

@ -7,7 +7,7 @@
<result column="protocol" jdbcType="VARCHAR" property="protocol" /> <result column="protocol" jdbcType="VARCHAR" property="protocol" />
<result column="parent_id" jdbcType="VARCHAR" property="parentId" /> <result column="parent_id" jdbcType="VARCHAR" property="parentId" />
<result column="project_id" jdbcType="VARCHAR" property="projectId" /> <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="create_time" jdbcType="BIGINT" property="createTime" />
<result column="update_time" jdbcType="BIGINT" property="updateTime" /> <result column="update_time" jdbcType="BIGINT" property="updateTime" />
<result column="update_user" jdbcType="VARCHAR" property="updateUser" /> <result column="update_user" jdbcType="VARCHAR" property="updateUser" />
@ -111,7 +111,7 @@
create_time, update_time, update_user, create_time, update_time, update_user,
create_user) create_user)
values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{protocol,jdbcType=VARCHAR}, 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}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT}, #{updateUser,jdbcType=VARCHAR},
#{createUser,jdbcType=VARCHAR}) #{createUser,jdbcType=VARCHAR})
</insert> </insert>
@ -166,7 +166,7 @@
#{projectId,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR},
</if> </if>
<if test="pos != null"> <if test="pos != null">
#{pos,jdbcType=INTEGER}, #{pos,jdbcType=BIGINT},
</if> </if>
<if test="createTime != null"> <if test="createTime != null">
#{createTime,jdbcType=BIGINT}, #{createTime,jdbcType=BIGINT},
@ -207,7 +207,7 @@
project_id = #{record.projectId,jdbcType=VARCHAR}, project_id = #{record.projectId,jdbcType=VARCHAR},
</if> </if>
<if test="record.pos != null"> <if test="record.pos != null">
pos = #{record.pos,jdbcType=INTEGER}, pos = #{record.pos,jdbcType=BIGINT},
</if> </if>
<if test="record.createTime != null"> <if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=BIGINT}, create_time = #{record.createTime,jdbcType=BIGINT},
@ -233,7 +233,7 @@
protocol = #{record.protocol,jdbcType=VARCHAR}, protocol = #{record.protocol,jdbcType=VARCHAR},
parent_id = #{record.parentId,jdbcType=VARCHAR}, parent_id = #{record.parentId,jdbcType=VARCHAR},
project_id = #{record.projectId,jdbcType=VARCHAR}, project_id = #{record.projectId,jdbcType=VARCHAR},
pos = #{record.pos,jdbcType=INTEGER}, pos = #{record.pos,jdbcType=BIGINT},
create_time = #{record.createTime,jdbcType=BIGINT}, create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT}, update_time = #{record.updateTime,jdbcType=BIGINT},
update_user = #{record.updateUser,jdbcType=VARCHAR}, update_user = #{record.updateUser,jdbcType=VARCHAR},
@ -258,7 +258,7 @@
project_id = #{projectId,jdbcType=VARCHAR}, project_id = #{projectId,jdbcType=VARCHAR},
</if> </if>
<if test="pos != null"> <if test="pos != null">
pos = #{pos,jdbcType=INTEGER}, pos = #{pos,jdbcType=BIGINT},
</if> </if>
<if test="createTime != null"> <if test="createTime != null">
create_time = #{createTime,jdbcType=BIGINT}, create_time = #{createTime,jdbcType=BIGINT},
@ -281,7 +281,7 @@
protocol = #{protocol,jdbcType=VARCHAR}, protocol = #{protocol,jdbcType=VARCHAR},
parent_id = #{parentId,jdbcType=VARCHAR}, parent_id = #{parentId,jdbcType=VARCHAR},
project_id = #{projectId,jdbcType=VARCHAR}, project_id = #{projectId,jdbcType=VARCHAR},
pos = #{pos,jdbcType=INTEGER}, pos = #{pos,jdbcType=BIGINT},
create_time = #{createTime,jdbcType=BIGINT}, create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT}, update_time = #{updateTime,jdbcType=BIGINT},
update_user = #{updateUser,jdbcType=VARCHAR}, update_user = #{updateUser,jdbcType=VARCHAR},
@ -295,7 +295,7 @@
values values
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
(#{item.id,jdbcType=VARCHAR}, #{item.name,jdbcType=VARCHAR}, #{item.protocol,jdbcType=VARCHAR}, (#{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.createTime,jdbcType=BIGINT}, #{item.updateTime,jdbcType=BIGINT}, #{item.updateUser,jdbcType=VARCHAR},
#{item.createUser,jdbcType=VARCHAR}) #{item.createUser,jdbcType=VARCHAR})
</foreach> </foreach>
@ -326,7 +326,7 @@
#{item.projectId,jdbcType=VARCHAR} #{item.projectId,jdbcType=VARCHAR}
</if> </if>
<if test="'pos'.toString() == column.value"> <if test="'pos'.toString() == column.value">
#{item.pos,jdbcType=INTEGER} #{item.pos,jdbcType=BIGINT}
</if> </if>
<if test="'create_time'.toString() == column.value"> <if test="'create_time'.toString() == column.value">
#{item.createTime,jdbcType=BIGINT} #{item.createTime,jdbcType=BIGINT}

View File

@ -1,15 +1,12 @@
package io.metersphere.project.domain; package io.metersphere.project.domain;
import io.metersphere.validation.groups.Created; import io.metersphere.validation.groups.*;
import io.metersphere.validation.groups.Updated;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.*;
import jakarta.validation.constraints.Size;
import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import lombok.Data;
@Data @Data
public class FileModule implements Serializable { public class FileModule implements Serializable {
@ -37,8 +34,9 @@ public class FileModule implements Serializable {
@Schema(description = "更新时间") @Schema(description = "更新时间")
private Long updateTime; private Long updateTime;
@Schema(description = "排序用的标识") @Schema(description = "排序用的标识", requiredMode = Schema.RequiredMode.REQUIRED)
private Integer pos; @NotNull(message = "{file_module.pos.not_blank}", groups = {Created.class})
private Long pos;
@Schema(description = "修改人") @Schema(description = "修改人")
private String updateUser; private String updateUser;
@ -58,7 +56,7 @@ public class FileModule implements Serializable {
parentId("parent_id", "parentId", "VARCHAR", false), parentId("parent_id", "parentId", "VARCHAR", false),
createTime("create_time", "createTime", "BIGINT", false), createTime("create_time", "createTime", "BIGINT", false),
updateTime("update_time", "updateTime", "BIGINT", false), updateTime("update_time", "updateTime", "BIGINT", false),
pos("pos", "pos", "INTEGER", false), pos("pos", "pos", "BIGINT", false),
updateUser("update_user", "updateUser", "VARCHAR", false), updateUser("update_user", "updateUser", "VARCHAR", false),
createUser("create_user", "createUser", "VARCHAR", false), createUser("create_user", "createUser", "VARCHAR", false),
moduleType("module_type", "moduleType", "VARCHAR", false); moduleType("module_type", "moduleType", "VARCHAR", false);

View File

@ -514,52 +514,52 @@ public class FileModuleExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPosEqualTo(Integer value) { public Criteria andPosEqualTo(Long value) {
addCriterion("pos =", value, "pos"); addCriterion("pos =", value, "pos");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPosNotEqualTo(Integer value) { public Criteria andPosNotEqualTo(Long value) {
addCriterion("pos <>", value, "pos"); addCriterion("pos <>", value, "pos");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPosGreaterThan(Integer value) { public Criteria andPosGreaterThan(Long value) {
addCriterion("pos >", value, "pos"); addCriterion("pos >", value, "pos");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPosGreaterThanOrEqualTo(Integer value) { public Criteria andPosGreaterThanOrEqualTo(Long value) {
addCriterion("pos >=", value, "pos"); addCriterion("pos >=", value, "pos");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPosLessThan(Integer value) { public Criteria andPosLessThan(Long value) {
addCriterion("pos <", value, "pos"); addCriterion("pos <", value, "pos");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPosLessThanOrEqualTo(Integer value) { public Criteria andPosLessThanOrEqualTo(Long value) {
addCriterion("pos <=", value, "pos"); addCriterion("pos <=", value, "pos");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPosIn(List<Integer> values) { public Criteria andPosIn(List<Long> values) {
addCriterion("pos in", values, "pos"); addCriterion("pos in", values, "pos");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPosNotIn(List<Integer> values) { public Criteria andPosNotIn(List<Long> values) {
addCriterion("pos not in", values, "pos"); addCriterion("pos not in", values, "pos");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPosBetween(Integer value1, Integer value2) { public Criteria andPosBetween(Long value1, Long value2) {
addCriterion("pos between", value1, value2, "pos"); addCriterion("pos between", value1, value2, "pos");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPosNotBetween(Integer value1, Integer value2) { public Criteria andPosNotBetween(Long value1, Long value2) {
addCriterion("pos not between", value1, value2, "pos"); addCriterion("pos not between", value1, value2, "pos");
return (Criteria) this; return (Criteria) this;
} }

View File

@ -8,7 +8,7 @@
<result column="parent_id" jdbcType="VARCHAR" property="parentId" /> <result column="parent_id" jdbcType="VARCHAR" property="parentId" />
<result column="create_time" jdbcType="BIGINT" property="createTime" /> <result column="create_time" jdbcType="BIGINT" property="createTime" />
<result column="update_time" jdbcType="BIGINT" property="updateTime" /> <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="update_user" jdbcType="VARCHAR" property="updateUser" />
<result column="create_user" jdbcType="VARCHAR" property="createUser" /> <result column="create_user" jdbcType="VARCHAR" property="createUser" />
<result column="module_type" jdbcType="VARCHAR" property="moduleType" /> <result column="module_type" jdbcType="VARCHAR" property="moduleType" />
@ -112,7 +112,7 @@
module_type) module_type)
values (#{id,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, values (#{id,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
#{parentId,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT}, #{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}) #{moduleType,jdbcType=VARCHAR})
</insert> </insert>
<insert id="insertSelective" parameterType="io.metersphere.project.domain.FileModule"> <insert id="insertSelective" parameterType="io.metersphere.project.domain.FileModule">
@ -169,7 +169,7 @@
#{updateTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT},
</if> </if>
<if test="pos != null"> <if test="pos != null">
#{pos,jdbcType=INTEGER}, #{pos,jdbcType=BIGINT},
</if> </if>
<if test="updateUser != null"> <if test="updateUser != null">
#{updateUser,jdbcType=VARCHAR}, #{updateUser,jdbcType=VARCHAR},
@ -210,7 +210,7 @@
update_time = #{record.updateTime,jdbcType=BIGINT}, update_time = #{record.updateTime,jdbcType=BIGINT},
</if> </if>
<if test="record.pos != null"> <if test="record.pos != null">
pos = #{record.pos,jdbcType=INTEGER}, pos = #{record.pos,jdbcType=BIGINT},
</if> </if>
<if test="record.updateUser != null"> <if test="record.updateUser != null">
update_user = #{record.updateUser,jdbcType=VARCHAR}, update_user = #{record.updateUser,jdbcType=VARCHAR},
@ -234,7 +234,7 @@
parent_id = #{record.parentId,jdbcType=VARCHAR}, parent_id = #{record.parentId,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT}, create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT}, update_time = #{record.updateTime,jdbcType=BIGINT},
pos = #{record.pos,jdbcType=INTEGER}, pos = #{record.pos,jdbcType=BIGINT},
update_user = #{record.updateUser,jdbcType=VARCHAR}, update_user = #{record.updateUser,jdbcType=VARCHAR},
create_user = #{record.createUser,jdbcType=VARCHAR}, create_user = #{record.createUser,jdbcType=VARCHAR},
module_type = #{record.moduleType,jdbcType=VARCHAR} module_type = #{record.moduleType,jdbcType=VARCHAR}
@ -261,7 +261,7 @@
update_time = #{updateTime,jdbcType=BIGINT}, update_time = #{updateTime,jdbcType=BIGINT},
</if> </if>
<if test="pos != null"> <if test="pos != null">
pos = #{pos,jdbcType=INTEGER}, pos = #{pos,jdbcType=BIGINT},
</if> </if>
<if test="updateUser != null"> <if test="updateUser != null">
update_user = #{updateUser,jdbcType=VARCHAR}, update_user = #{updateUser,jdbcType=VARCHAR},
@ -282,7 +282,7 @@
parent_id = #{parentId,jdbcType=VARCHAR}, parent_id = #{parentId,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT}, create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT}, update_time = #{updateTime,jdbcType=BIGINT},
pos = #{pos,jdbcType=INTEGER}, pos = #{pos,jdbcType=BIGINT},
update_user = #{updateUser,jdbcType=VARCHAR}, update_user = #{updateUser,jdbcType=VARCHAR},
create_user = #{createUser,jdbcType=VARCHAR}, create_user = #{createUser,jdbcType=VARCHAR},
module_type = #{moduleType,jdbcType=VARCHAR} module_type = #{moduleType,jdbcType=VARCHAR}
@ -296,7 +296,7 @@
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
(#{item.id,jdbcType=VARCHAR}, #{item.projectId,jdbcType=VARCHAR}, #{item.name,jdbcType=VARCHAR}, (#{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.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}) #{item.moduleType,jdbcType=VARCHAR})
</foreach> </foreach>
</insert> </insert>
@ -329,7 +329,7 @@
#{item.updateTime,jdbcType=BIGINT} #{item.updateTime,jdbcType=BIGINT}
</if> </if>
<if test="'pos'.toString() == column.value"> <if test="'pos'.toString() == column.value">
#{item.pos,jdbcType=INTEGER} #{item.pos,jdbcType=BIGINT}
</if> </if>
<if test="'update_user'.toString() == column.value"> <if test="'update_user'.toString() == column.value">
#{item.updateUser,jdbcType=VARCHAR} #{item.updateUser,jdbcType=VARCHAR}

View File

@ -116,7 +116,7 @@ CREATE TABLE IF NOT EXISTS file_module
`parent_id` VARCHAR(50) COMMENT '父级ID', `parent_id` VARCHAR(50) COMMENT '父级ID',
`create_time` BIGINT NOT NULL COMMENT '创建时间', `create_time` BIGINT NOT NULL COMMENT '创建时间',
`update_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 '修改人', `update_user` VARCHAR(50) COMMENT '修改人',
`create_user` VARCHAR(50) COMMENT '创建人', `create_user` VARCHAR(50) COMMENT '创建人',
`module_type` VARCHAR(20) DEFAULT 'module' COMMENT '模块类型: module/repository', `module_type` VARCHAR(20) DEFAULT 'module' COMMENT '模块类型: module/repository',

View File

@ -44,7 +44,7 @@ CREATE TABLE api_debug_module(
`protocol` VARCHAR(20) NOT NULL COMMENT '协议' , `protocol` VARCHAR(20) NOT NULL COMMENT '协议' ,
`parent_id` VARCHAR(50) NOT NULL DEFAULT 'NONE' COMMENT '父级fk' , `parent_id` VARCHAR(50) NOT NULL DEFAULT 'NONE' COMMENT '父级fk' ,
`project_id` VARCHAR(50) NOT NULL 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 '创建时间' , `create_time` BIGINT NOT NULL COMMENT '创建时间' ,
`update_time` BIGINT NOT NULL COMMENT '修改时间' , `update_time` BIGINT NOT NULL COMMENT '修改时间' ,
`update_user` VARCHAR(50) NOT NULL COMMENT '修改人' , `update_user` VARCHAR(50) NOT NULL COMMENT '修改人' ,

View File

@ -20,15 +20,15 @@ public interface ExtApiDebugModuleMapper {
void deleteByIds(@Param("ids") List<String> deleteId); void deleteByIds(@Param("ids") List<String> deleteId);
Integer getMaxPosByParentId(String parentId); Long getMaxPosByParentId(String parentId);
List<String> selectIdsByProjectId(String projectId); List<String> selectIdsByProjectId(String projectId);
ApiDebugModule getLastModuleByParentId(String id); 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); List<ApiTreeNode> selectApiDebugByProtocolAndUser(String protocol, String userId);

View File

@ -40,7 +40,7 @@
#{id} #{id}
</foreach> </foreach>
</delete> </delete>
<select id="getMaxPosByParentId" resultType="java.lang.Integer"> <select id="getMaxPosByParentId" resultType="java.lang.Long">
SELECT max(pos) SELECT max(pos)
FROM api_debug_module FROM api_debug_module
WHERE parent_id = #{0} WHERE parent_id = #{0}

View File

@ -113,8 +113,8 @@ public class ApiDebugModuleService extends ModuleTreeService {
return apiDebugModule.getId(); return apiDebugModule.getId();
} }
private Integer countPos(String parentId) { private Long countPos(String parentId) {
Integer maxPos = extApiDebugModuleMapper.getMaxPosByParentId(parentId); Long maxPos = extApiDebugModuleMapper.getMaxPosByParentId(parentId);
if (maxPos == null) { if (maxPos == null) {
return LIMIT_POS; return LIMIT_POS;
} else { } else {
@ -297,7 +297,7 @@ public class ApiDebugModuleService extends ModuleTreeService {
@Override @Override
public void updatePos(String id, int pos) { public void updatePos(String id, long pos) {
ApiDebugModule updateModule = new ApiDebugModule(); ApiDebugModule updateModule = new ApiDebugModule();
updateModule.setPos(pos); updateModule.setPos(pos);
updateModule.setId(id); updateModule.setId(id);

View File

@ -518,7 +518,7 @@ public class ApiDebugModuleControllerTests extends BaseTest {
//更改pos //更改pos
ApiDebugModule updateModule = new ApiDebugModule(); ApiDebugModule updateModule = new ApiDebugModule();
updateModule.setId(a1Node.getId()); updateModule.setId(a1Node.getId());
updateModule.setPos(2); updateModule.setPos(2L);
apiDebugModuleMapper.updateByPrimaryKeySelective(updateModule); apiDebugModuleMapper.updateByPrimaryKeySelective(updateModule);
//开始移动 //开始移动
@ -543,10 +543,10 @@ public class ApiDebugModuleControllerTests extends BaseTest {
//更改pos //更改pos
ApiDebugModule updateModule = new ApiDebugModule(); ApiDebugModule updateModule = new ApiDebugModule();
updateModule.setId(a1Node.getId()); updateModule.setId(a1Node.getId());
updateModule.setPos(3 * 64); updateModule.setPos(3 * 64L);
apiDebugModuleMapper.updateByPrimaryKeySelective(updateModule); apiDebugModuleMapper.updateByPrimaryKeySelective(updateModule);
updateModule.setId(a2Node.getId()); updateModule.setId(a2Node.getId());
updateModule.setPos(3 * 64 + 2); updateModule.setPos(3 * 64 + 2L);
apiDebugModuleMapper.updateByPrimaryKeySelective(updateModule); apiDebugModuleMapper.updateByPrimaryKeySelective(updateModule);
//开始移动 //开始移动
@ -570,7 +570,7 @@ public class ApiDebugModuleControllerTests extends BaseTest {
//更改pos //更改pos
ApiDebugModule updateModule = new ApiDebugModule(); ApiDebugModule updateModule = new ApiDebugModule();
updateModule.setId(a1b1Node.getId()); updateModule.setId(a1b1Node.getId());
updateModule.setPos(2); updateModule.setPos(2L);
apiDebugModuleMapper.updateByPrimaryKeySelective(updateModule); apiDebugModuleMapper.updateByPrimaryKeySelective(updateModule);
//开始移动 //开始移动
@ -594,10 +594,10 @@ public class ApiDebugModuleControllerTests extends BaseTest {
//更改pos //更改pos
ApiDebugModule updateModule = new ApiDebugModule(); ApiDebugModule updateModule = new ApiDebugModule();
updateModule.setId(a1b1Node.getId()); updateModule.setId(a1b1Node.getId());
updateModule.setPos(3 * 64); updateModule.setPos(3 * 64L);
apiDebugModuleMapper.updateByPrimaryKeySelective(updateModule); apiDebugModuleMapper.updateByPrimaryKeySelective(updateModule);
updateModule.setId(a1a1Node.getId()); updateModule.setId(a1a1Node.getId());
updateModule.setPos(3 * 64 + 2); updateModule.setPos(3 * 64 + 2L);
apiDebugModuleMapper.updateByPrimaryKeySelective(updateModule); apiDebugModuleMapper.updateByPrimaryKeySelective(updateModule);
//开始移动 //开始移动

View File

@ -9,7 +9,6 @@ import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource; import jakarta.annotation.Resource;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
@ -29,7 +28,6 @@ public class FilePreviewController {
@GetMapping(value = "/original/{userId}/{fileId}") @GetMapping(value = "/original/{userId}/{fileId}")
@Operation(summary = "预览原图") @Operation(summary = "预览原图")
@RequiresPermissions(PermissionConstants.PROJECT_FILE_MANAGEMENT_READ_DOWNLOAD)
public ResponseEntity<byte[]> originalImg(@PathVariable String userId,@PathVariable String fileId) { public ResponseEntity<byte[]> originalImg(@PathVariable String userId,@PathVariable String fileId) {
FileInformationDTO fileInformationDTO = fileMetadataService.get(fileId); FileInformationDTO fileInformationDTO = fileMetadataService.get(fileId);
if (StringUtils.isEmpty(fileInformationDTO.getId())) { if (StringUtils.isEmpty(fileInformationDTO.getId())) {

View File

@ -17,15 +17,15 @@ public interface ExtFileModuleMapper {
void deleteByIds(@Param("ids") List<String> deleteId); void deleteByIds(@Param("ids") List<String> deleteId);
Integer getMaxPosByParentId(String parentId); Long getMaxPosByParentId(String parentId);
List<String> selectIdsByProjectId(String projectId); List<String> selectIdsByProjectId(String projectId);
FileModule getLastModuleByParentId(String id); 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); String selectNameById(String moduleId);
} }

View File

@ -29,7 +29,7 @@
#{id} #{id}
</foreach> </foreach>
</delete> </delete>
<select id="getMaxPosByParentId" resultType="java.lang.Integer"> <select id="getMaxPosByParentId" resultType="java.lang.Long">
SELECT max(pos) FROM file_module SELECT max(pos) FROM file_module
WHERE parent_id = #{0} WHERE parent_id = #{0}
</select> </select>
@ -66,5 +66,4 @@
FROM file_module FROM file_module
WHERE id = #{0} WHERE id = #{0}
</select> </select>
</mapper> </mapper>

View File

@ -74,8 +74,8 @@ public class FileModuleService extends ModuleTreeService implements CleanupProje
return fileModule.getId(); return fileModule.getId();
} }
private Integer countPos(String parentId) { private Long countPos(String parentId) {
Integer maxPos = extFileModuleMapper.getMaxPosByParentId(parentId); Long maxPos = extFileModuleMapper.getMaxPosByParentId(parentId);
if (maxPos == null) { if (maxPos == null) {
return LIMIT_POS; return LIMIT_POS;
} else { } else {
@ -251,7 +251,7 @@ public class FileModuleService extends ModuleTreeService implements CleanupProje
@Override @Override
public void updatePos(String id, int pos) { public void updatePos(String id, long pos) {
FileModule updateModule = new FileModule(); FileModule updateModule = new FileModule();
updateModule.setPos(pos); updateModule.setPos(pos);
updateModule.setId(id); updateModule.setId(id);

View File

@ -18,7 +18,7 @@ import java.util.stream.Collectors;
public abstract class ModuleTreeService { public abstract class ModuleTreeService {
protected static final int LIMIT_POS = 64; protected static final long LIMIT_POS = 64;
public BaseTreeNode getDefaultModule(String name) { public BaseTreeNode getDefaultModule(String name) {
//默认模块下不允许创建子模块 它本身也就是叶子节点 //默认模块下不允许创建子模块 它本身也就是叶子节点
@ -91,7 +91,7 @@ public abstract class ModuleTreeService {
updatePos(nodeMoveDTO.getNode().getId(), 0); updatePos(nodeMoveDTO.getNode().getId(), 0);
} else { } else {
boolean refreshPos = false; boolean refreshPos = false;
int pos; long pos;
if (nextNode == null) { if (nextNode == null) {
pos = previousNode.getPos() + LIMIT_POS; pos = previousNode.getPos() + LIMIT_POS;
} else if (previousNode == null) { } else if (previousNode == null) {
@ -100,7 +100,7 @@ public abstract class ModuleTreeService {
refreshPos = true; refreshPos = true;
} }
} else { } else {
int quantityDifference = (nextNode.getPos() - previousNode.getPos()) / 2; long quantityDifference = (nextNode.getPos() - previousNode.getPos()) / 2;
if (quantityDifference <= 2) { if (quantityDifference <= 2) {
refreshPos = true; 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); public abstract void refreshPos(String parentId);

View File

@ -72,8 +72,8 @@
<!--要生成的数据库表 --> <!--要生成的数据库表 -->
<!-- <table tableName="custom_function"/>--> <!-- <table tableName="custom_function"/>-->
<!-- <table tableName="fake_error"/>--> <!-- <table tableName="fake_error"/>-->
<table tableName="file_metadata"/> <!-- <table tableName="file_metadata"/>-->
<!-- <table tableName="file_module"/>--> <table tableName="file_module"/>
<!-- <table tableName="project"/>--> <!-- <table tableName="project"/>-->
<!-- <table tableName="project_application"/>--> <!-- <table tableName="project_application"/>-->
<!-- <table tableName="project_version"/>--> <!-- <table tableName="project_version"/>-->

View File

@ -1137,7 +1137,7 @@ public class FileManagementControllerTests extends BaseTest {
//更改pos //更改pos
FileModule updateModule = new FileModule(); FileModule updateModule = new FileModule();
updateModule.setId(a1Node.getId()); updateModule.setId(a1Node.getId());
updateModule.setPos(2); updateModule.setPos(2L);
fileModuleMapper.updateByPrimaryKeySelective(updateModule); fileModuleMapper.updateByPrimaryKeySelective(updateModule);
//开始移动 //开始移动
@ -1162,10 +1162,10 @@ public class FileManagementControllerTests extends BaseTest {
//更改pos //更改pos
FileModule updateModule = new FileModule(); FileModule updateModule = new FileModule();
updateModule.setId(a1Node.getId()); updateModule.setId(a1Node.getId());
updateModule.setPos(3 * 64); updateModule.setPos(3 * 64L);
fileModuleMapper.updateByPrimaryKeySelective(updateModule); fileModuleMapper.updateByPrimaryKeySelective(updateModule);
updateModule.setId(a2Node.getId()); updateModule.setId(a2Node.getId());
updateModule.setPos(3 * 64 + 2); updateModule.setPos(3 * 64 + 2L);
fileModuleMapper.updateByPrimaryKeySelective(updateModule); fileModuleMapper.updateByPrimaryKeySelective(updateModule);
//开始移动 //开始移动
@ -1189,7 +1189,7 @@ public class FileManagementControllerTests extends BaseTest {
//更改pos //更改pos
FileModule updateModule = new FileModule(); FileModule updateModule = new FileModule();
updateModule.setId(a1b1Node.getId()); updateModule.setId(a1b1Node.getId());
updateModule.setPos(2); updateModule.setPos(2L);
fileModuleMapper.updateByPrimaryKeySelective(updateModule); fileModuleMapper.updateByPrimaryKeySelective(updateModule);
//开始移动 //开始移动
@ -1213,10 +1213,10 @@ public class FileManagementControllerTests extends BaseTest {
//更改pos //更改pos
FileModule updateModule = new FileModule(); FileModule updateModule = new FileModule();
updateModule.setId(a1b1Node.getId()); updateModule.setId(a1b1Node.getId());
updateModule.setPos(3 * 64); updateModule.setPos(3 * 64L);
fileModuleMapper.updateByPrimaryKeySelective(updateModule); fileModuleMapper.updateByPrimaryKeySelective(updateModule);
updateModule.setId(a1a1Node.getId()); updateModule.setId(a1a1Node.getId());
updateModule.setPos(3 * 64 + 2); updateModule.setPos(3 * 64 + 2L);
fileModuleMapper.updateByPrimaryKeySelective(updateModule); fileModuleMapper.updateByPrimaryKeySelective(updateModule);
//开始移动 //开始移动

View File

@ -16,7 +16,7 @@ public class BaseModule {
private String name; private String name;
@Schema(description = "排序单位") @Schema(description = "排序单位")
private int pos; private long pos;
@Schema(description = "项目ID") @Schema(description = "项目ID")
private String projectId; private String projectId;