refactor(项目设置): 优化环境接口
This commit is contained in:
parent
a0bcb9f31c
commit
e05341c4e0
|
@ -54,7 +54,7 @@
|
|||
FROM api_debug
|
||||
WHERE create_user = #{userId}
|
||||
|
||||
ORDER BY pos ASC
|
||||
ORDER BY pos DESC
|
||||
</select>
|
||||
<select id="countModuleIdByKeywordAndProtocol" resultType="io.metersphere.project.dto.ModuleCountDTO">
|
||||
SELECT f.module_id AS moduleId, count(f.id) AS dataCount
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
FROM api_definition
|
||||
where api_definition.deleted = #{deleted}
|
||||
<include refid="queryWhereCondition"/>
|
||||
ORDER BY pos ASC
|
||||
ORDER BY pos DESC
|
||||
</select>
|
||||
<select id="countModuleIdByRequest" resultType="io.metersphere.project.dto.ModuleCountDTO">
|
||||
SELECT module_id AS moduleId, count(id) AS dataCount
|
||||
|
|
|
@ -39,4 +39,8 @@ public abstract class MsAssertion {
|
|||
*/
|
||||
@Size(max = 100)
|
||||
private String name;
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private String id;
|
||||
}
|
||||
|
|
|
@ -27,8 +27,6 @@ public class EnvironmentRequest implements Serializable {
|
|||
private String name;
|
||||
@Schema(description = "环境配置")
|
||||
private EnvironmentConfig config;
|
||||
@Schema(description = "是否是mock环境")
|
||||
private Boolean mock;
|
||||
@Schema(description = "描述")
|
||||
private String description;
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
)
|
||||
|
||||
</if>
|
||||
ORDER BY pos asc
|
||||
ORDER BY pos DESC
|
||||
</select>
|
||||
<select id="groupList" resultType="io.metersphere.sdk.domain.EnvironmentGroup">
|
||||
SELECT
|
||||
|
@ -33,7 +33,7 @@
|
|||
)
|
||||
|
||||
</if>
|
||||
ORDER BY pos asc
|
||||
ORDER BY pos DESC
|
||||
</select>
|
||||
<select id="getPos" resultType="java.lang.Long">
|
||||
SELECT pos
|
||||
|
|
|
@ -307,6 +307,7 @@ public class EnvironmentService {
|
|||
environment.setUpdateUser(userId);
|
||||
environment.setProjectId(request.getProjectId());
|
||||
environment.setName(request.getName());
|
||||
environment.setDescription(request.getDescription());
|
||||
checkEnvironmentExist(environment);
|
||||
environment.setUpdateTime(System.currentTimeMillis());
|
||||
environmentMapper.updateByPrimaryKeySelective(environment);
|
||||
|
|
|
@ -419,26 +419,26 @@
|
|||
|
||||
const params = {
|
||||
projectId: appStore.currentProjectId,
|
||||
targetId: type === EnvAuthTypeEnum.ENVIRONMENT ? envList.value[_newIndex].id : evnGroupList.value[_newIndex].id,
|
||||
moveId: '',
|
||||
moveId: type === EnvAuthTypeEnum.ENVIRONMENT ? envList.value[_newIndex].id : evnGroupList.value[_newIndex].id,
|
||||
targetId: '',
|
||||
moveMode: 'AFTER',
|
||||
};
|
||||
if (type === EnvAuthTypeEnum.ENVIRONMENT) {
|
||||
if (envList.value[_newIndex + 1].id) {
|
||||
params.moveMode = 'BEFORE';
|
||||
params.moveId = envList.value[_newIndex + 1].id;
|
||||
params.targetId = envList.value[_newIndex + 1].id;
|
||||
} else if (envList.value[_newIndex - 1].id && !envList.value[_newIndex + 1].id) {
|
||||
params.moveMode = 'AFTER';
|
||||
params.moveId = envList.value[_newIndex - 1].id;
|
||||
params.targetId = envList.value[_newIndex - 1].id;
|
||||
}
|
||||
}
|
||||
if (type === EnvAuthTypeEnum.ENVIRONMENT_GROUP) {
|
||||
if (evnGroupList.value[_newIndex + 1].id) {
|
||||
params.moveMode = 'AFTER';
|
||||
params.moveId = evnGroupList.value[_newIndex + 1].id;
|
||||
params.targetId = evnGroupList.value[_newIndex + 1].id;
|
||||
} else if (evnGroupList.value[_newIndex - 1].id && !evnGroupList.value[_newIndex + 1].id) {
|
||||
params.moveMode = 'BEFORE';
|
||||
params.moveId = evnGroupList.value[_newIndex - 1].id;
|
||||
params.targetId = evnGroupList.value[_newIndex - 1].id;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue