整理代码

This commit is contained in:
2025-02-12 15:53:59 +08:00
parent a2c1ec0d1c
commit 2215b4bd50
9 changed files with 112 additions and 32 deletions

View File

@@ -17,7 +17,7 @@ public interface TestApiMapper {
* @param id 接口主键
* @return 接口
*/
public TestApi selectTestApiById(Long id);
TestApi selectTestApiById(Long id);
/**
* 查询接口列表
@@ -25,7 +25,7 @@ public interface TestApiMapper {
* @param qo 接口
* @return 接口集合
*/
public List<TestApi> selectTestApiList(TestApiListQO qo);
List<TestApi> selectTestApiList(TestApiListQO qo);
/**
* 新增接口
@@ -33,7 +33,7 @@ public interface TestApiMapper {
* @param testApi 接口
* @return 结果
*/
public int insertTestApi(TestApi testApi);
int insertTestApi(TestApi testApi);
/**
* 修改接口
@@ -41,7 +41,7 @@ public interface TestApiMapper {
* @param testApi 接口
* @return 结果
*/
public int updateTestApi(TestApi testApi);
int updateTestApi(TestApi testApi);
/**
* 删除接口
@@ -49,13 +49,13 @@ public interface TestApiMapper {
* @param id 接口主键
* @return 结果
*/
public int deleteTestApiById(Long id);
int deleteTestApiById(Long id);
/**
* 批量删除接口
* 批量删除接口通过节点id
*
* @param ids 需要删除的数据主键集合
* @param groupId 需要删除的接口主键集合
* @return 结果
*/
public int deleteTestApiByIds(Long[] ids);
int deleteTestApiByGroupId(Long groupId);
}

View File

@@ -17,7 +17,7 @@ public interface ITestApiService {
* @param id 接口主键
* @return 接口
*/
public TestApi selectTestApiById(Long id);
TestApi selectTestApiById(Long id);
/**
* 查询接口列表
@@ -25,7 +25,7 @@ public interface ITestApiService {
* @param qo 接口
* @return 接口集合
*/
public List<TestApi> selectTestApiList(TestApiListQO qo);
List<TestApi> selectTestApiList(TestApiListQO qo);
/**
* 新增接口
@@ -33,7 +33,7 @@ public interface ITestApiService {
* @param testApi 接口
* @return 结果
*/
public int insertTestApi(TestApi testApi);
int insertTestApi(TestApi testApi);
/**
* 导入Swagger接口
@@ -49,15 +49,15 @@ public interface ITestApiService {
* @param testApi 接口
* @return 结果
*/
public int updateTestApi(TestApi testApi);
int updateTestApi(TestApi testApi);
/**
* 批量删除接口
* 批量删除接口通过节点id
*
* @param ids 需要删除的接口主键集合
* @param groupId 需要删除的接口主键集合
* @return 结果
*/
public int deleteTestApiByIds(Long[] ids);
int deleteTestApiByGroupId(Long groupId);
/**
* 删除接口信息
@@ -65,5 +65,5 @@ public interface ITestApiService {
* @param id 接口主键
* @return 结果
*/
public int deleteTestApiById(Long id);
int deleteTestApiById(Long id);
}

View File

@@ -2,7 +2,6 @@ package com.test.test.service.impl;
import java.util.List;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject;
import com.test.common.utils.DateUtils;
import com.test.common.utils.http.HttpUtils;
@@ -75,15 +74,9 @@ public class TestApiServiceImpl implements ITestApiService {
return testApiMapper.updateTestApi(testApi);
}
/**
* 批量删除接口
*
* @param ids 需要删除的接口主键
* @return 结果
*/
@Override
public int deleteTestApiByIds(Long[] ids) {
return testApiMapper.deleteTestApiByIds(ids);
public int deleteTestApiByGroupId(Long groupId) {
return testApiMapper.deleteTestApiByGroupId(groupId);
}
/**

View File

@@ -20,6 +20,9 @@ public class TestGroupServiceImpl implements ITestGroupService {
@Resource
private TestGroupMapper testGroupMapper;
@Resource
private TestApiServiceImpl testApiServiceImpl;
/**
* 查询节点(文件夹)列表
*
@@ -64,6 +67,7 @@ public class TestGroupServiceImpl implements ITestGroupService {
*/
@Override
public int deleteTestGroupById(Long id) {
return testGroupMapper.deleteTestGroupById(id);
}
}

View File

@@ -94,10 +94,7 @@
delete from test_api where id = #{id}
</delete>
<delete id="deleteTestApiByIds" parameterType="String">
delete from test_api where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
<delete id="deleteTestApiByGroupId" parameterType="Long">
delete from test_api where groupId = #{groupId}
</delete>
</mapper>