diff --git a/backend/src/main/java/io/metersphere/base/domain/FucTest.java b/backend/src/main/java/io/metersphere/base/domain/ApiTest.java similarity index 96% rename from backend/src/main/java/io/metersphere/base/domain/FucTest.java rename to backend/src/main/java/io/metersphere/base/domain/ApiTest.java index ac70c732dd..aedb282bde 100644 --- a/backend/src/main/java/io/metersphere/base/domain/FucTest.java +++ b/backend/src/main/java/io/metersphere/base/domain/ApiTest.java @@ -2,7 +2,7 @@ package io.metersphere.base.domain; import java.io.Serializable; -public class FucTest implements Serializable { +public class ApiTest implements Serializable { private String id; private String projectId; diff --git a/backend/src/main/java/io/metersphere/base/domain/FucTestExample.java b/backend/src/main/java/io/metersphere/base/domain/ApiTestExample.java similarity index 99% rename from backend/src/main/java/io/metersphere/base/domain/FucTestExample.java rename to backend/src/main/java/io/metersphere/base/domain/ApiTestExample.java index d62a9a67e3..fd377bba43 100644 --- a/backend/src/main/java/io/metersphere/base/domain/FucTestExample.java +++ b/backend/src/main/java/io/metersphere/base/domain/ApiTestExample.java @@ -3,14 +3,14 @@ package io.metersphere.base.domain; import java.util.ArrayList; import java.util.List; -public class FucTestExample { +public class ApiTestExample { protected String orderByClause; protected boolean distinct; protected List oredCriteria; - public FucTestExample() { + public ApiTestExample() { oredCriteria = new ArrayList(); } diff --git a/backend/src/main/java/io/metersphere/base/domain/FucTestFile.java b/backend/src/main/java/io/metersphere/base/domain/ApiTestFile.java similarity index 90% rename from backend/src/main/java/io/metersphere/base/domain/FucTestFile.java rename to backend/src/main/java/io/metersphere/base/domain/ApiTestFile.java index 85faaefd87..2172236176 100644 --- a/backend/src/main/java/io/metersphere/base/domain/FucTestFile.java +++ b/backend/src/main/java/io/metersphere/base/domain/ApiTestFile.java @@ -2,7 +2,7 @@ package io.metersphere.base.domain; import java.io.Serializable; -public class FucTestFile implements Serializable { +public class ApiTestFile implements Serializable { private String testId; private String fileId; diff --git a/backend/src/main/java/io/metersphere/base/domain/FucTestFileExample.java b/backend/src/main/java/io/metersphere/base/domain/ApiTestFileExample.java similarity index 99% rename from backend/src/main/java/io/metersphere/base/domain/FucTestFileExample.java rename to backend/src/main/java/io/metersphere/base/domain/ApiTestFileExample.java index 863546b8ba..d33ce1db1e 100644 --- a/backend/src/main/java/io/metersphere/base/domain/FucTestFileExample.java +++ b/backend/src/main/java/io/metersphere/base/domain/ApiTestFileExample.java @@ -3,14 +3,14 @@ package io.metersphere.base.domain; import java.util.ArrayList; import java.util.List; -public class FucTestFileExample { +public class ApiTestFileExample { protected String orderByClause; protected boolean distinct; protected List oredCriteria; - public FucTestFileExample() { + public ApiTestFileExample() { oredCriteria = new ArrayList(); } diff --git a/backend/src/main/java/io/metersphere/base/domain/FucTestReport.java b/backend/src/main/java/io/metersphere/base/domain/ApiTestReport.java similarity index 96% rename from backend/src/main/java/io/metersphere/base/domain/FucTestReport.java rename to backend/src/main/java/io/metersphere/base/domain/ApiTestReport.java index 3c87a3e1e8..4f58138870 100644 --- a/backend/src/main/java/io/metersphere/base/domain/FucTestReport.java +++ b/backend/src/main/java/io/metersphere/base/domain/ApiTestReport.java @@ -2,7 +2,7 @@ package io.metersphere.base.domain; import java.io.Serializable; -public class FucTestReport implements Serializable { +public class ApiTestReport implements Serializable { private String id; private String testId; diff --git a/backend/src/main/java/io/metersphere/base/domain/FucTestReportExample.java b/backend/src/main/java/io/metersphere/base/domain/ApiTestReportExample.java similarity index 99% rename from backend/src/main/java/io/metersphere/base/domain/FucTestReportExample.java rename to backend/src/main/java/io/metersphere/base/domain/ApiTestReportExample.java index 9bfca34064..df1d9c3b3a 100644 --- a/backend/src/main/java/io/metersphere/base/domain/FucTestReportExample.java +++ b/backend/src/main/java/io/metersphere/base/domain/ApiTestReportExample.java @@ -3,14 +3,14 @@ package io.metersphere.base.domain; import java.util.ArrayList; import java.util.List; -public class FucTestReportExample { +public class ApiTestReportExample { protected String orderByClause; protected boolean distinct; protected List oredCriteria; - public FucTestReportExample() { + public ApiTestReportExample() { oredCriteria = new ArrayList(); } diff --git a/backend/src/main/java/io/metersphere/base/domain/FucTestWithBLOBs.java b/backend/src/main/java/io/metersphere/base/domain/ApiTestWithBLOBs.java similarity index 91% rename from backend/src/main/java/io/metersphere/base/domain/FucTestWithBLOBs.java rename to backend/src/main/java/io/metersphere/base/domain/ApiTestWithBLOBs.java index 6659473208..1dd78ac768 100644 --- a/backend/src/main/java/io/metersphere/base/domain/FucTestWithBLOBs.java +++ b/backend/src/main/java/io/metersphere/base/domain/ApiTestWithBLOBs.java @@ -2,7 +2,7 @@ package io.metersphere.base.domain; import java.io.Serializable; -public class FucTestWithBLOBs extends FucTest implements Serializable { +public class ApiTestWithBLOBs extends ApiTest implements Serializable { private String runtimeConfiguration; private String schedule; diff --git a/backend/src/main/java/io/metersphere/base/domain/FucTestLog.java b/backend/src/main/java/io/metersphere/base/domain/FucTestLog.java deleted file mode 100644 index f2867f94b0..0000000000 --- a/backend/src/main/java/io/metersphere/base/domain/FucTestLog.java +++ /dev/null @@ -1,23 +0,0 @@ -package io.metersphere.base.domain; - -public class FucTestLog { - - private String seleniumLog; - private String browserDriverLog; - - public String getSeleniumLog() { - return seleniumLog; - } - - public void setSeleniumLog(String seleniumLog) { - this.seleniumLog = seleniumLog; - } - - public String getBrowserDriverLog() { - return browserDriverLog; - } - - public void setBrowserDriverLog(String browserDriverLog) { - this.browserDriverLog = browserDriverLog; - } -} diff --git a/backend/src/main/java/io/metersphere/base/mapper/ApiTestFileMapper.java b/backend/src/main/java/io/metersphere/base/mapper/ApiTestFileMapper.java new file mode 100644 index 0000000000..b0e8663e31 --- /dev/null +++ b/backend/src/main/java/io/metersphere/base/mapper/ApiTestFileMapper.java @@ -0,0 +1,22 @@ +package io.metersphere.base.mapper; + +import io.metersphere.base.domain.ApiTestFile; +import io.metersphere.base.domain.ApiTestFileExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface ApiTestFileMapper { + long countByExample(ApiTestFileExample example); + + int deleteByExample(ApiTestFileExample example); + + int insert(ApiTestFile record); + + int insertSelective(ApiTestFile record); + + List selectByExample(ApiTestFileExample example); + + int updateByExampleSelective(@Param("record") ApiTestFile record, @Param("example") ApiTestFileExample example); + + int updateByExample(@Param("record") ApiTestFile record, @Param("example") ApiTestFileExample example); +} \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/mapper/FucTestFileMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ApiTestFileMapper.xml similarity index 90% rename from backend/src/main/java/io/metersphere/base/mapper/FucTestFileMapper.xml rename to backend/src/main/java/io/metersphere/base/mapper/ApiTestFileMapper.xml index d46e73405c..d81900b6e4 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/FucTestFileMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ApiTestFileMapper.xml @@ -1,7 +1,7 @@ - - + + @@ -66,13 +66,13 @@ test_id, file_id - select distinct - from fuc_test_file + from api_test_file @@ -80,18 +80,18 @@ order by ${orderByClause} - - delete from fuc_test_file + + delete from api_test_file - - insert into fuc_test_file (test_id, file_id) + + insert into api_test_file (test_id, file_id) values (#{testId,jdbcType=VARCHAR}, #{fileId,jdbcType=VARCHAR}) - - insert into fuc_test_file + + insert into api_test_file test_id, @@ -109,14 +109,14 @@ - + select count(*) from api_test_file - update fuc_test_file + update api_test_file test_id = #{record.testId,jdbcType=VARCHAR}, @@ -130,7 +130,7 @@ - update fuc_test_file + update api_test_file set test_id = #{record.testId,jdbcType=VARCHAR}, file_id = #{record.fileId,jdbcType=VARCHAR} diff --git a/backend/src/main/java/io/metersphere/base/mapper/ApiTestMapper.java b/backend/src/main/java/io/metersphere/base/mapper/ApiTestMapper.java new file mode 100644 index 0000000000..0e17bc9566 --- /dev/null +++ b/backend/src/main/java/io/metersphere/base/mapper/ApiTestMapper.java @@ -0,0 +1,37 @@ +package io.metersphere.base.mapper; + +import io.metersphere.base.domain.ApiTest; +import io.metersphere.base.domain.ApiTestExample; +import io.metersphere.base.domain.ApiTestWithBLOBs; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface ApiTestMapper { + long countByExample(ApiTestExample example); + + int deleteByExample(ApiTestExample example); + + int deleteByPrimaryKey(String id); + + int insert(ApiTestWithBLOBs record); + + int insertSelective(ApiTestWithBLOBs record); + + List selectByExampleWithBLOBs(ApiTestExample example); + + List selectByExample(ApiTestExample example); + + ApiTestWithBLOBs selectByPrimaryKey(String id); + + int updateByExampleSelective(@Param("record") ApiTestWithBLOBs record, @Param("example") ApiTestExample example); + + int updateByExampleWithBLOBs(@Param("record") ApiTestWithBLOBs record, @Param("example") ApiTestExample example); + + int updateByExample(@Param("record") ApiTest record, @Param("example") ApiTestExample example); + + int updateByPrimaryKeySelective(ApiTestWithBLOBs record); + + int updateByPrimaryKeyWithBLOBs(ApiTestWithBLOBs record); + + int updateByPrimaryKey(ApiTest record); +} \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/mapper/FucTestMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ApiTestMapper.xml similarity index 92% rename from backend/src/main/java/io/metersphere/base/mapper/FucTestMapper.xml rename to backend/src/main/java/io/metersphere/base/mapper/ApiTestMapper.xml index cc4774250a..ddf7b458e5 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/FucTestMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ApiTestMapper.xml @@ -1,7 +1,7 @@ - - + + @@ -9,7 +9,7 @@ - + @@ -77,7 +77,7 @@ runtime_configuration, schedule - select distinct @@ -85,7 +85,7 @@ , - from fuc_test + from api_test @@ -93,13 +93,13 @@ order by ${orderByClause} - select distinct - from fuc_test + from api_test @@ -112,29 +112,29 @@ , - from fuc_test + from api_test where id = #{id,jdbcType=VARCHAR} - delete from fuc_test + delete from api_test where id = #{id,jdbcType=VARCHAR} - - delete from fuc_test + + delete from api_test - - insert into fuc_test (id, project_id, name, + + insert into api_test (id, project_id, name, description, create_time, update_time, runtime_configuration, schedule) values (#{id,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT}, #{runtimeConfiguration,jdbcType=LONGVARCHAR}, #{schedule,jdbcType=LONGVARCHAR}) - - insert into fuc_test + + insert into api_test id, @@ -188,14 +188,14 @@ - + select count(*) from api_test - update fuc_test + update api_test id = #{record.id,jdbcType=VARCHAR}, @@ -227,7 +227,7 @@ - update fuc_test + update api_test set id = #{record.id,jdbcType=VARCHAR}, project_id = #{record.projectId,jdbcType=VARCHAR}, name = #{record.name,jdbcType=VARCHAR}, @@ -241,7 +241,7 @@ - update fuc_test + update api_test set id = #{record.id,jdbcType=VARCHAR}, project_id = #{record.projectId,jdbcType=VARCHAR}, name = #{record.name,jdbcType=VARCHAR}, @@ -252,8 +252,8 @@ - - update fuc_test + + update api_test project_id = #{projectId,jdbcType=VARCHAR}, @@ -279,8 +279,8 @@ where id = #{id,jdbcType=VARCHAR} - - update fuc_test + + update api_test set project_id = #{projectId,jdbcType=VARCHAR}, name = #{name,jdbcType=VARCHAR}, description = #{description,jdbcType=VARCHAR}, @@ -290,8 +290,8 @@ schedule = #{schedule,jdbcType=LONGVARCHAR} where id = #{id,jdbcType=VARCHAR} - - update fuc_test + + update api_test set project_id = #{projectId,jdbcType=VARCHAR}, name = #{name,jdbcType=VARCHAR}, description = #{description,jdbcType=VARCHAR}, diff --git a/backend/src/main/java/io/metersphere/base/mapper/ApiTestReportMapper.java b/backend/src/main/java/io/metersphere/base/mapper/ApiTestReportMapper.java new file mode 100644 index 0000000000..083193942c --- /dev/null +++ b/backend/src/main/java/io/metersphere/base/mapper/ApiTestReportMapper.java @@ -0,0 +1,36 @@ +package io.metersphere.base.mapper; + +import io.metersphere.base.domain.ApiTestReport; +import io.metersphere.base.domain.ApiTestReportExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface ApiTestReportMapper { + long countByExample(ApiTestReportExample example); + + int deleteByExample(ApiTestReportExample example); + + int deleteByPrimaryKey(String id); + + int insert(ApiTestReport record); + + int insertSelective(ApiTestReport record); + + List selectByExampleWithBLOBs(ApiTestReportExample example); + + List selectByExample(ApiTestReportExample example); + + ApiTestReport selectByPrimaryKey(String id); + + int updateByExampleSelective(@Param("record") ApiTestReport record, @Param("example") ApiTestReportExample example); + + int updateByExampleWithBLOBs(@Param("record") ApiTestReport record, @Param("example") ApiTestReportExample example); + + int updateByExample(@Param("record") ApiTestReport record, @Param("example") ApiTestReportExample example); + + int updateByPrimaryKeySelective(ApiTestReport record); + + int updateByPrimaryKeyWithBLOBs(ApiTestReport record); + + int updateByPrimaryKey(ApiTestReport record); +} \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/mapper/FucTestReportMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ApiTestReportMapper.xml similarity index 91% rename from backend/src/main/java/io/metersphere/base/mapper/FucTestReportMapper.xml rename to backend/src/main/java/io/metersphere/base/mapper/ApiTestReportMapper.xml index 98e9ba0d11..6c3fcfffdc 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/FucTestReportMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ApiTestReportMapper.xml @@ -1,7 +1,7 @@ - - + + @@ -10,7 +10,7 @@ - + @@ -77,7 +77,7 @@ content - select distinct @@ -85,7 +85,7 @@ , - from fuc_test_report + from api_test_report @@ -93,13 +93,13 @@ order by ${orderByClause} - select distinct - from fuc_test_report + from api_test_report @@ -112,29 +112,29 @@ , - from fuc_test_report + from api_test_report where id = #{id,jdbcType=VARCHAR} - delete from fuc_test_report + delete from api_test_report where id = #{id,jdbcType=VARCHAR} - - delete from fuc_test_report + + delete from api_test_report - - insert into fuc_test_report (id, test_id, name, + + insert into api_test_report (id, test_id, name, description, create_time, update_time, status, content) values (#{id,jdbcType=VARCHAR}, #{testId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT}, #{status,jdbcType=VARCHAR}, #{content,jdbcType=LONGVARCHAR}) - - insert into fuc_test_report + + insert into api_test_report id, @@ -188,14 +188,14 @@ - + select count(*) from api_test_report - update fuc_test_report + update api_test_report id = #{record.id,jdbcType=VARCHAR}, @@ -227,7 +227,7 @@ - update fuc_test_report + update api_test_report set id = #{record.id,jdbcType=VARCHAR}, test_id = #{record.testId,jdbcType=VARCHAR}, name = #{record.name,jdbcType=VARCHAR}, @@ -241,7 +241,7 @@ - update fuc_test_report + update api_test_report set id = #{record.id,jdbcType=VARCHAR}, test_id = #{record.testId,jdbcType=VARCHAR}, name = #{record.name,jdbcType=VARCHAR}, @@ -253,8 +253,8 @@ - - update fuc_test_report + + update api_test_report test_id = #{testId,jdbcType=VARCHAR}, @@ -280,8 +280,8 @@ where id = #{id,jdbcType=VARCHAR} - - update fuc_test_report + + update api_test_report set test_id = #{testId,jdbcType=VARCHAR}, name = #{name,jdbcType=VARCHAR}, description = #{description,jdbcType=VARCHAR}, @@ -291,8 +291,8 @@ content = #{content,jdbcType=LONGVARCHAR} where id = #{id,jdbcType=VARCHAR} - - update fuc_test_report + + update api_test_report set test_id = #{testId,jdbcType=VARCHAR}, name = #{name,jdbcType=VARCHAR}, description = #{description,jdbcType=VARCHAR}, diff --git a/backend/src/main/java/io/metersphere/base/mapper/FucTestFileMapper.java b/backend/src/main/java/io/metersphere/base/mapper/FucTestFileMapper.java deleted file mode 100644 index a1a5136f3f..0000000000 --- a/backend/src/main/java/io/metersphere/base/mapper/FucTestFileMapper.java +++ /dev/null @@ -1,22 +0,0 @@ -package io.metersphere.base.mapper; - -import io.metersphere.base.domain.FucTestFile; -import io.metersphere.base.domain.FucTestFileExample; -import java.util.List; -import org.apache.ibatis.annotations.Param; - -public interface FucTestFileMapper { - long countByExample(FucTestFileExample example); - - int deleteByExample(FucTestFileExample example); - - int insert(FucTestFile record); - - int insertSelective(FucTestFile record); - - List selectByExample(FucTestFileExample example); - - int updateByExampleSelective(@Param("record") FucTestFile record, @Param("example") FucTestFileExample example); - - int updateByExample(@Param("record") FucTestFile record, @Param("example") FucTestFileExample example); -} \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/mapper/FucTestMapper.java b/backend/src/main/java/io/metersphere/base/mapper/FucTestMapper.java deleted file mode 100644 index 30da7cda73..0000000000 --- a/backend/src/main/java/io/metersphere/base/mapper/FucTestMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package io.metersphere.base.mapper; - -import io.metersphere.base.domain.FucTest; -import io.metersphere.base.domain.FucTestExample; -import io.metersphere.base.domain.FucTestWithBLOBs; -import java.util.List; -import org.apache.ibatis.annotations.Param; - -public interface FucTestMapper { - long countByExample(FucTestExample example); - - int deleteByExample(FucTestExample example); - - int deleteByPrimaryKey(String id); - - int insert(FucTestWithBLOBs record); - - int insertSelective(FucTestWithBLOBs record); - - List selectByExampleWithBLOBs(FucTestExample example); - - List selectByExample(FucTestExample example); - - FucTestWithBLOBs selectByPrimaryKey(String id); - - int updateByExampleSelective(@Param("record") FucTestWithBLOBs record, @Param("example") FucTestExample example); - - int updateByExampleWithBLOBs(@Param("record") FucTestWithBLOBs record, @Param("example") FucTestExample example); - - int updateByExample(@Param("record") FucTest record, @Param("example") FucTestExample example); - - int updateByPrimaryKeySelective(FucTestWithBLOBs record); - - int updateByPrimaryKeyWithBLOBs(FucTestWithBLOBs record); - - int updateByPrimaryKey(FucTest record); -} \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/mapper/FucTestReportMapper.java b/backend/src/main/java/io/metersphere/base/mapper/FucTestReportMapper.java deleted file mode 100644 index 8143688b11..0000000000 --- a/backend/src/main/java/io/metersphere/base/mapper/FucTestReportMapper.java +++ /dev/null @@ -1,36 +0,0 @@ -package io.metersphere.base.mapper; - -import io.metersphere.base.domain.FucTestReport; -import io.metersphere.base.domain.FucTestReportExample; -import java.util.List; -import org.apache.ibatis.annotations.Param; - -public interface FucTestReportMapper { - long countByExample(FucTestReportExample example); - - int deleteByExample(FucTestReportExample example); - - int deleteByPrimaryKey(String id); - - int insert(FucTestReport record); - - int insertSelective(FucTestReport record); - - List selectByExampleWithBLOBs(FucTestReportExample example); - - List selectByExample(FucTestReportExample example); - - FucTestReport selectByPrimaryKey(String id); - - int updateByExampleSelective(@Param("record") FucTestReport record, @Param("example") FucTestReportExample example); - - int updateByExampleWithBLOBs(@Param("record") FucTestReport record, @Param("example") FucTestReportExample example); - - int updateByExample(@Param("record") FucTestReport record, @Param("example") FucTestReportExample example); - - int updateByPrimaryKeySelective(FucTestReport record); - - int updateByPrimaryKeyWithBLOBs(FucTestReport record); - - int updateByPrimaryKey(FucTestReport record); -} \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtFunctionalTestMapper.java b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestMapper.java similarity index 52% rename from backend/src/main/java/io/metersphere/base/mapper/ext/ExtFunctionalTestMapper.java rename to backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestMapper.java index 6eda784a9d..09161cffed 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtFunctionalTestMapper.java +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestMapper.java @@ -1,11 +1,11 @@ package io.metersphere.base.mapper.ext; import io.metersphere.controller.request.testplan.QueryTestPlanRequest; -import io.metersphere.dto.FunctionalTestDTO; +import io.metersphere.dto.ApiTestDTO; import org.apache.ibatis.annotations.Param; import java.util.List; -public interface ExtFunctionalTestMapper { - List list(@Param("request") QueryTestPlanRequest params); +public interface ExtApiTestMapper { + List list(@Param("request") QueryTestPlanRequest params); } diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtFunctionalTestMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestMapper.xml similarity index 62% rename from backend/src/main/java/io/metersphere/base/mapper/ext/ExtFunctionalTestMapper.xml rename to backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestMapper.xml index 87b2dd9bd2..2ad74e9ef7 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtFunctionalTestMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestMapper.xml @@ -1,19 +1,19 @@ - + - + diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestReportMapper.java b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestReportMapper.java new file mode 100644 index 0000000000..bb308447dd --- /dev/null +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestReportMapper.java @@ -0,0 +1,14 @@ +package io.metersphere.base.mapper.ext; + +import io.metersphere.controller.request.ReportRequest; +import io.metersphere.dto.ApiReportDTO; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +public interface ExtApiTestReportMapper { + + List getReportList(@Param("reportRequest") ReportRequest request); + + ApiReportDTO getReportTestAndProInfo(@Param("id") String id); +} diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtFunctionalTestReportMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestReportMapper.xml similarity index 74% rename from backend/src/main/java/io/metersphere/base/mapper/ext/ExtFunctionalTestReportMapper.xml rename to backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestReportMapper.xml index 4bf8d17a5d..30fe798301 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtFunctionalTestReportMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestReportMapper.xml @@ -1,11 +1,11 @@ - + - select ltr.id, ltr.name, ltr.test_id as testId, ltr.description, ltr.create_time as createTime, ltr.update_time as updateTime, ltr.status as status, lt.name as testName - from fuc_test_report ltr left join fuc_test lt on ltr.test_id = lt.id + from api_test_report ltr left join api_test lt on ltr.test_id = lt.id AND ltr.name like CONCAT('%', #{reportRequest.name},'%') @@ -13,12 +13,12 @@ - select ltr.id, ltr.name, ltr.test_id as testId, ltr.description, ltr.create_time as createTime, ltr.update_time as updateTime, ltr.status as status, ltr.content as content, lt.name as testName, p.id as projectId, p.name as projectName - from fuc_test_report ltr left join fuc_test lt on ltr.test_id = lt.id left join project p on lt.project_id = p.id + from api_test_report ltr left join api_test lt on ltr.test_id = lt.id left join project p on lt.project_id = p.id where ltr.id = #{id} diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtFunctionalTestReportMapper.java b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtFunctionalTestReportMapper.java deleted file mode 100644 index b720e4d57e..0000000000 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtFunctionalTestReportMapper.java +++ /dev/null @@ -1,15 +0,0 @@ -package io.metersphere.base.mapper.ext; - -import io.metersphere.controller.request.ReportRequest; -import io.metersphere.dto.FunctionalReportDTO; -import io.metersphere.dto.ReportDTO; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -public interface ExtFunctionalTestReportMapper { - - List getReportList(@Param("reportRequest") ReportRequest request); - - FunctionalReportDTO getReportTestAndProInfo(@Param("id") String id); -} diff --git a/backend/src/main/java/io/metersphere/controller/FunctionalReportController.java b/backend/src/main/java/io/metersphere/controller/ApiReportController.java similarity index 57% rename from backend/src/main/java/io/metersphere/controller/FunctionalReportController.java rename to backend/src/main/java/io/metersphere/controller/ApiReportController.java index 9b4f44cdbb..81ebc58a22 100644 --- a/backend/src/main/java/io/metersphere/controller/FunctionalReportController.java +++ b/backend/src/main/java/io/metersphere/controller/ApiReportController.java @@ -2,14 +2,13 @@ package io.metersphere.controller; import com.github.pagehelper.Page; import com.github.pagehelper.PageHelper; -import io.metersphere.base.domain.FucTestLog; -import io.metersphere.base.domain.FucTestReport; +import io.metersphere.base.domain.ApiTestReport; import io.metersphere.commons.constants.RoleConstants; import io.metersphere.commons.utils.PageUtils; import io.metersphere.commons.utils.Pager; import io.metersphere.controller.request.ReportRequest; -import io.metersphere.dto.FunctionalReportDTO; -import io.metersphere.service.FunctionalReportService; +import io.metersphere.dto.ApiReportDTO; +import io.metersphere.service.ApiReportService; import io.metersphere.user.SessionUtils; import org.apache.shiro.authz.annotation.Logical; import org.apache.shiro.authz.annotation.RequiresRoles; @@ -19,36 +18,36 @@ import javax.annotation.Resource; import java.util.List; @RestController -@RequestMapping(value = "/functional/report") -public class FunctionalReportController { +@RequestMapping(value = "/api/report") +public class ApiReportController { @Resource - private FunctionalReportService functionalReportService; + private ApiReportService apiReportService; @GetMapping("/recent/{count}") @RequiresRoles(value = {RoleConstants.TEST_MANAGER, RoleConstants.TEST_USER, RoleConstants.TEST_VIEWER}, logical = Logical.OR) - public List recentProjects(@PathVariable int count) { + public List recentProjects(@PathVariable int count) { String currentWorkspaceId = SessionUtils.getCurrentWorkspaceId(); ReportRequest request = new ReportRequest(); request.setWorkspaceId(currentWorkspaceId); PageHelper.startPage(1, count); - return functionalReportService.getRecentReportList(request); + return apiReportService.getRecentReportList(request); } @PostMapping("/list/all/{goPage}/{pageSize}") - public Pager> getReportList(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody ReportRequest request) { + public Pager> getReportList(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody ReportRequest request) { Page page = PageHelper.startPage(goPage, pageSize, true); - return PageUtils.setPageInfo(page, functionalReportService.getReportList(request)); + return PageUtils.setPageInfo(page, apiReportService.getReportList(request)); } @PostMapping("/delete/{reportId}") public void deleteReport(@PathVariable String reportId) { - functionalReportService.deleteReport(reportId); + apiReportService.deleteReport(reportId); } @GetMapping("/test/pro/info/{reportId}") - public FunctionalReportDTO getReportTestAndProInfo(@PathVariable String reportId) { - return functionalReportService.getReportTestAndProInfo(reportId); + public ApiReportDTO getReportTestAndProInfo(@PathVariable String reportId) { + return apiReportService.getReportTestAndProInfo(reportId); } } diff --git a/backend/src/main/java/io/metersphere/controller/FunctionalTestController.java b/backend/src/main/java/io/metersphere/controller/ApiTestController.java similarity index 74% rename from backend/src/main/java/io/metersphere/controller/FunctionalTestController.java rename to backend/src/main/java/io/metersphere/controller/ApiTestController.java index 1901873dc6..0ad6f18c7a 100644 --- a/backend/src/main/java/io/metersphere/controller/FunctionalTestController.java +++ b/backend/src/main/java/io/metersphere/controller/ApiTestController.java @@ -7,9 +7,9 @@ import io.metersphere.commons.constants.RoleConstants; import io.metersphere.commons.utils.PageUtils; import io.metersphere.commons.utils.Pager; import io.metersphere.controller.request.testplan.*; -import io.metersphere.dto.FunctionalTestDTO; +import io.metersphere.dto.ApiTestDTO; import io.metersphere.service.FileService; -import io.metersphere.service.FuctionalTestService; +import io.metersphere.service.ApiTestService; import io.metersphere.user.SessionUtils; import org.apache.shiro.authz.annotation.Logical; import org.apache.shiro.authz.annotation.RequiresRoles; @@ -23,28 +23,28 @@ import javax.annotation.Resource; import java.util.List; @RestController -@RequestMapping(value = "/functional/test") +@RequestMapping(value = "/api") @RequiresRoles(value = {RoleConstants.TEST_MANAGER, RoleConstants.TEST_USER, RoleConstants.TEST_VIEWER}, logical = Logical.OR) -public class FunctionalTestController { +public class ApiTestController { @Resource - private FuctionalTestService fuctionalTestService; + private ApiTestService apiTestService; @Resource private FileService fileService; @GetMapping("recent/{count}") - public List recentTestPlans(@PathVariable int count) { + public List recentTestPlans(@PathVariable int count) { String currentWorkspaceId = SessionUtils.getCurrentWorkspaceId(); QueryTestPlanRequest request = new QueryTestPlanRequest(); request.setWorkspaceId(currentWorkspaceId); PageHelper.startPage(1, count, true); - return fuctionalTestService.recentTestPlans(request); + return apiTestService.recentTestPlans(request); } @PostMapping("/list/{goPage}/{pageSize}") - public Pager> list(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody QueryTestPlanRequest request) { + public Pager> list(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody QueryTestPlanRequest request) { Page page = PageHelper.startPage(goPage, pageSize, true); request.setWorkspaceId(SessionUtils.getCurrentWorkspaceId()); - return PageUtils.setPageInfo(page, fuctionalTestService.list(request)); + return PageUtils.setPageInfo(page, apiTestService.list(request)); } @PostMapping(value = "/save", consumes = {"multipart/form-data"}) @@ -52,7 +52,7 @@ public class FunctionalTestController { @RequestPart("request") SaveTestPlanRequest request, @RequestPart(value = "file") MultipartFile file ) { - return fuctionalTestService.save(request, file); + return apiTestService.save(request, file); } @PostMapping(value = "/edit", consumes = {"multipart/form-data"}) @@ -60,32 +60,32 @@ public class FunctionalTestController { @RequestPart("request") EditTestPlanRequest request, @RequestPart(value = "file", required = false) MultipartFile file ) { - return fuctionalTestService.edit(request, file); + return apiTestService.edit(request, file); } @GetMapping("/get/{testId}") - public FunctionalTestDTO get(@PathVariable String testId) { - return fuctionalTestService.get(testId); + public ApiTestDTO get(@PathVariable String testId) { + return apiTestService.get(testId); } @GetMapping("/get-runtime-config/{testId}") public String getAdvancedConfiguration(@PathVariable String testId) { - return fuctionalTestService.getRuntimeConfiguration(testId); + return apiTestService.getRuntimeConfiguration(testId); } @PostMapping("/delete") public void delete(@RequestBody DeleteTestPlanRequest request) { - fuctionalTestService.delete(request); + apiTestService.delete(request); } @PostMapping("/run") public void run(@RequestBody RunTestPlanRequest request) { - fuctionalTestService.run(request); + apiTestService.run(request); } @GetMapping("/file/metadata/{testId}") public FileMetadata getFileMetadata(@PathVariable String testId) { - return fileService.getFucFileMetadataByTestId(testId); + return fileService.getApiFileMetadataByTestId(testId); } @PostMapping("/file/download") diff --git a/backend/src/main/java/io/metersphere/dto/FunctionalReportDTO.java b/backend/src/main/java/io/metersphere/dto/ApiReportDTO.java similarity index 98% rename from backend/src/main/java/io/metersphere/dto/FunctionalReportDTO.java rename to backend/src/main/java/io/metersphere/dto/ApiReportDTO.java index cdaf185537..e9573633f2 100644 --- a/backend/src/main/java/io/metersphere/dto/FunctionalReportDTO.java +++ b/backend/src/main/java/io/metersphere/dto/ApiReportDTO.java @@ -1,6 +1,6 @@ package io.metersphere.dto; -public class FunctionalReportDTO { +public class ApiReportDTO { private String id; private String testId; diff --git a/backend/src/main/java/io/metersphere/dto/FunctionalTestDTO.java b/backend/src/main/java/io/metersphere/dto/ApiTestDTO.java similarity index 84% rename from backend/src/main/java/io/metersphere/dto/FunctionalTestDTO.java rename to backend/src/main/java/io/metersphere/dto/ApiTestDTO.java index 5a7e53f610..58e088d705 100644 --- a/backend/src/main/java/io/metersphere/dto/FunctionalTestDTO.java +++ b/backend/src/main/java/io/metersphere/dto/ApiTestDTO.java @@ -2,7 +2,7 @@ package io.metersphere.dto; import io.metersphere.base.domain.LoadTest; -public class FunctionalTestDTO extends LoadTest { +public class ApiTestDTO extends LoadTest { private String projectName; public String getProjectName() { diff --git a/backend/src/main/java/io/metersphere/service/ApiReportService.java b/backend/src/main/java/io/metersphere/service/ApiReportService.java new file mode 100644 index 0000000000..fad1c1903c --- /dev/null +++ b/backend/src/main/java/io/metersphere/service/ApiReportService.java @@ -0,0 +1,42 @@ +package io.metersphere.service; + +import io.metersphere.base.domain.ApiTestReport; +import io.metersphere.base.domain.ApiTestReportExample; +import io.metersphere.base.mapper.ApiTestReportMapper; +import io.metersphere.base.mapper.ext.ExtApiTestReportMapper; +import io.metersphere.controller.request.ReportRequest; +import io.metersphere.dto.ApiReportDTO; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.List; + +@Service +@Transactional(rollbackFor = Exception.class) +public class ApiReportService { + + @Resource + private ApiTestReportMapper ApiTestReportMapper; + @Resource + private ExtApiTestReportMapper extApiTestReportMapper; + + public List getRecentReportList(ReportRequest request) { + ApiTestReportExample example = new ApiTestReportExample(); + example.setOrderByClause("update_time desc"); + return ApiTestReportMapper.selectByExample(example); + } + + public List getReportList(ReportRequest request) { + return extApiTestReportMapper.getReportList(request); + } + + public void deleteReport(String reportId) { + ApiTestReportMapper.deleteByPrimaryKey(reportId); + } + + public ApiReportDTO getReportTestAndProInfo(String reportId) { + return extApiTestReportMapper.getReportTestAndProInfo(reportId); + } + +} diff --git a/backend/src/main/java/io/metersphere/service/FuctionalTestService.java b/backend/src/main/java/io/metersphere/service/ApiTestService.java similarity index 64% rename from backend/src/main/java/io/metersphere/service/FuctionalTestService.java rename to backend/src/main/java/io/metersphere/service/ApiTestService.java index 520a277e7c..735409767f 100644 --- a/backend/src/main/java/io/metersphere/service/FuctionalTestService.java +++ b/backend/src/main/java/io/metersphere/service/ApiTestService.java @@ -2,10 +2,10 @@ package io.metersphere.service; import io.metersphere.base.domain.*; import io.metersphere.base.mapper.*; -import io.metersphere.base.mapper.ext.ExtFunctionalTestMapper; +import io.metersphere.base.mapper.ext.ExtApiTestMapper; import io.metersphere.commons.exception.MSException; import io.metersphere.controller.request.testplan.*; -import io.metersphere.dto.FunctionalTestDTO; +import io.metersphere.dto.ApiTestDTO; import io.metersphere.i18n.Translator; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -20,11 +20,11 @@ import java.util.UUID; @Service @Transactional(rollbackFor = Exception.class) -public class FuctionalTestService { +public class ApiTestService { @Resource - private FucTestMapper fucTestMapper; + private ApiTestMapper ApiTestMapper; @Resource - private ExtFunctionalTestMapper extFucTestMapper; + private ExtApiTestMapper extApiTestMapper; @Resource private ProjectMapper projectMapper; @Resource @@ -32,16 +32,16 @@ public class FuctionalTestService { @Resource private FileContentMapper fileContentMapper; @Resource - private FucTestFileMapper fucTestFileMapper; + private ApiTestFileMapper ApiTestFileMapper; @Resource private FileService fileService; - public List list(QueryTestPlanRequest request) { - return extFucTestMapper.list(request); + public List list(QueryTestPlanRequest request) { + return extApiTestMapper.list(request); } public void delete(DeleteTestPlanRequest request) { - fucTestMapper.deleteByPrimaryKey(request.getId()); + ApiTestMapper.deleteByPrimaryKey(request.getId()); fileService.deleteFileByTestId(request.getId()); } @@ -53,34 +53,34 @@ public class FuctionalTestService { final FileMetadata fileMetadata = saveFile(file); - final FucTestWithBLOBs fucTest = saveFucTest(request); + final ApiTestWithBLOBs ApiTest = saveApiTest(request); - FucTestFile fucTestFile = new FucTestFile(); - fucTestFile.setTestId(fucTest.getId()); - fucTestFile.setFileId(fileMetadata.getId()); - fucTestFileMapper.insert(fucTestFile); + ApiTestFile ApiTestFile = new ApiTestFile(); + ApiTestFile.setTestId(ApiTest.getId()); + ApiTestFile.setFileId(fileMetadata.getId()); + ApiTestFileMapper.insert(ApiTestFile); - return fucTest.getId(); + return ApiTest.getId(); } - private FucTestWithBLOBs saveFucTest(SaveTestPlanRequest request) { + private ApiTestWithBLOBs saveApiTest(SaveTestPlanRequest request) { - FucTestExample example = new FucTestExample(); + ApiTestExample example = new ApiTestExample(); example.createCriteria().andNameEqualTo(request.getName()).andProjectIdEqualTo(request.getProjectId()); - if (fucTestMapper.countByExample(example) > 0) { + if (ApiTestMapper.countByExample(example) > 0) { MSException.throwException(Translator.get("function_test_already_exists")); } - final FucTestWithBLOBs fucTes = new FucTestWithBLOBs(); - fucTes.setId(UUID.randomUUID().toString()); - fucTes.setName(request.getName()); - fucTes.setProjectId(request.getProjectId()); - fucTes.setCreateTime(System.currentTimeMillis()); - fucTes.setUpdateTime(System.currentTimeMillis()); - fucTes.setDescription("todo"); - fucTes.setRuntimeConfiguration(request.getRuntimeConfiguration()); - fucTestMapper.insert(fucTes); - return fucTes; + final ApiTestWithBLOBs ApiTes = new ApiTestWithBLOBs(); + ApiTes.setId(UUID.randomUUID().toString()); + ApiTes.setName(request.getName()); + ApiTes.setProjectId(request.getProjectId()); + ApiTes.setCreateTime(System.currentTimeMillis()); + ApiTes.setUpdateTime(System.currentTimeMillis()); + ApiTes.setDescription("todo"); + ApiTes.setRuntimeConfiguration(request.getRuntimeConfiguration()); + ApiTestMapper.insert(ApiTes); + return ApiTes; } private FileMetadata saveFile(MultipartFile file) { @@ -110,30 +110,30 @@ public class FuctionalTestService { if (file != null) { fileService.deleteFileByTestId(request.getId()); final FileMetadata fileMetadata = saveFile(file); - FucTestFile fucTestFile = new FucTestFile(); - fucTestFile.setTestId(request.getId()); - fucTestFile.setFileId(fileMetadata.getId()); - fucTestFileMapper.insert(fucTestFile); + ApiTestFile ApiTestFile = new ApiTestFile(); + ApiTestFile.setTestId(request.getId()); + ApiTestFile.setFileId(fileMetadata.getId()); + ApiTestFileMapper.insert(ApiTestFile); } - final FucTestWithBLOBs fucTest = fucTestMapper.selectByPrimaryKey(request.getId()); - if (fucTest == null) { + final ApiTestWithBLOBs ApiTest = ApiTestMapper.selectByPrimaryKey(request.getId()); + if (ApiTest == null) { MSException.throwException("无法编辑测试,未找到测试:" + request.getId()); } else { - fucTest.setName(request.getName()); - fucTest.setProjectId(request.getProjectId()); - fucTest.setUpdateTime(System.currentTimeMillis()); - fucTest.setDescription("todo"); - fucTest.setRuntimeConfiguration(request.getRuntimeConfiguration()); - fucTestMapper.updateByPrimaryKeySelective(fucTest); + ApiTest.setName(request.getName()); + ApiTest.setProjectId(request.getProjectId()); + ApiTest.setUpdateTime(System.currentTimeMillis()); + ApiTest.setDescription("todo"); + ApiTest.setRuntimeConfiguration(request.getRuntimeConfiguration()); + ApiTestMapper.updateByPrimaryKeySelective(ApiTest); } return request.getId(); } public void run(RunTestPlanRequest request) { - final FucTestWithBLOBs fucTest = fucTestMapper.selectByPrimaryKey(request.getId()); -// if (fucTest == null) { + final ApiTestWithBLOBs ApiTest = ApiTestMapper.selectByPrimaryKey(request.getId()); +// if (ApiTest == null) { // MSException.throwException("无法运行测试,未找到测试:" + request.getId()); // } // @@ -147,7 +147,7 @@ public class FuctionalTestService { // MSException.throwException("无法运行测试,无法获取测试文件内容,测试ID:" + request.getId()); // } // -// System.out.println("开始运行:" + fucTest.getName()); +// System.out.println("开始运行:" + ApiTest.getName()); // final Engine engine = EngineFactory.createEngine(fileMetadata.getType()); // if (engine == null) { // MSException.throwException(String.format("无法运行测试,未识别测试文件类型,测试ID:%s,文件类型:%s", @@ -157,7 +157,7 @@ public class FuctionalTestService { // // boolean init = true; // try { -//// init = engine.init(EngineFactory.createContext(fucTest, fileMetadata, fileContent)); +//// init = engine.init(EngineFactory.createContext(ApiTest, fileMetadata, fileContent)); // } catch (Exception e) { // MSException.throwException(e); // } @@ -170,16 +170,16 @@ public class FuctionalTestService { /// todo:通过调用stop方法能够停止正在运行的engine,但是如果部署了多个backend实例,页面发送的停止请求如何定位到具体的engine } - public List recentTestPlans(QueryTestPlanRequest request) { + public List recentTestPlans(QueryTestPlanRequest request) { // 查询最近的测试计划 request.setRecent(true); - return extFucTestMapper.list(request); + return extApiTestMapper.list(request); } - public FunctionalTestDTO get(String testId) { + public ApiTestDTO get(String testId) { QueryTestPlanRequest request = new QueryTestPlanRequest(); request.setId(testId); - List testDTOS = extFucTestMapper.list(request); + List testDTOS = extApiTestMapper.list(request); if (!CollectionUtils.isEmpty(testDTOS)) { return testDTOS.get(0); } @@ -187,8 +187,8 @@ public class FuctionalTestService { } public String getRuntimeConfiguration(String testId) { - FucTestWithBLOBs fucTestWithBLOBs = fucTestMapper.selectByPrimaryKey(testId); - return Optional.ofNullable(fucTestWithBLOBs).orElse(new FucTestWithBLOBs()).getRuntimeConfiguration(); + ApiTestWithBLOBs ApiTestWithBLOBs = ApiTestMapper.selectByPrimaryKey(testId); + return Optional.ofNullable(ApiTestWithBLOBs).orElse(new ApiTestWithBLOBs()).getRuntimeConfiguration(); } } diff --git a/backend/src/main/java/io/metersphere/service/FileService.java b/backend/src/main/java/io/metersphere/service/FileService.java index 7db2904398..af88722e8a 100644 --- a/backend/src/main/java/io/metersphere/service/FileService.java +++ b/backend/src/main/java/io/metersphere/service/FileService.java @@ -3,7 +3,7 @@ package io.metersphere.service; import io.metersphere.base.domain.*; import io.metersphere.base.mapper.FileContentMapper; import io.metersphere.base.mapper.FileMetadataMapper; -import io.metersphere.base.mapper.FucTestFileMapper; +import io.metersphere.base.mapper.ApiTestFileMapper; import io.metersphere.base.mapper.LoadTestFileMapper; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; @@ -19,7 +19,7 @@ public class FileService { @Resource private LoadTestFileMapper loadTestFileMapper; @Resource - private FucTestFileMapper fucTestFileMapper; + private ApiTestFileMapper ApiTestFileMapper; @Resource private FileContentMapper fileContentMapper; @@ -43,10 +43,10 @@ public class FileService { return fileMetadataMapper.selectByExample(example); } - public FileMetadata getFucFileMetadataByTestId(String testId) { - FucTestFileExample fucTestFileExample = new FucTestFileExample(); - fucTestFileExample.createCriteria().andTestIdEqualTo(testId); - final List loadTestFiles = fucTestFileMapper.selectByExample(fucTestFileExample); + public FileMetadata getApiFileMetadataByTestId(String testId) { + ApiTestFileExample ApiTestFileExample = new ApiTestFileExample(); + ApiTestFileExample.createCriteria().andTestIdEqualTo(testId); + final List loadTestFiles = ApiTestFileMapper.selectByExample(ApiTestFileExample); if (CollectionUtils.isEmpty(loadTestFiles)) { return null; diff --git a/backend/src/main/java/io/metersphere/service/FunctionalReportService.java b/backend/src/main/java/io/metersphere/service/FunctionalReportService.java deleted file mode 100644 index 3736492d14..0000000000 --- a/backend/src/main/java/io/metersphere/service/FunctionalReportService.java +++ /dev/null @@ -1,45 +0,0 @@ -package io.metersphere.service; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import io.metersphere.base.domain.FucTestLog; -import io.metersphere.base.domain.FucTestReport; -import io.metersphere.base.domain.FucTestReportExample; -import io.metersphere.base.mapper.FucTestReportMapper; -import io.metersphere.base.mapper.ext.ExtFunctionalTestReportMapper; -import io.metersphere.controller.request.ReportRequest; -import io.metersphere.dto.FunctionalReportDTO; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import javax.annotation.Resource; -import java.util.List; - -@Service -@Transactional(rollbackFor = Exception.class) -public class FunctionalReportService { - - @Resource - private FucTestReportMapper fucTestReportMapper; - @Resource - private ExtFunctionalTestReportMapper extFunctionalTestReportMapper; - - public List getRecentReportList(ReportRequest request) { - FucTestReportExample example = new FucTestReportExample(); - example.setOrderByClause("update_time desc"); - return fucTestReportMapper.selectByExample(example); - } - - public List getReportList(ReportRequest request) { - return extFunctionalTestReportMapper.getReportList(request); - } - - public void deleteReport(String reportId) { - fucTestReportMapper.deleteByPrimaryKey(reportId); - } - - public FunctionalReportDTO getReportTestAndProInfo(String reportId) { - return extFunctionalTestReportMapper.getReportTestAndProInfo(reportId); - } - -} diff --git a/backend/src/main/resources/db/migration/V2__metersphere_ddl.sql b/backend/src/main/resources/db/migration/V2__metersphere_ddl.sql index 9bf7258cd8..2225e75a3a 100644 --- a/backend/src/main/resources/db/migration/V2__metersphere_ddl.sql +++ b/backend/src/main/resources/db/migration/V2__metersphere_ddl.sql @@ -182,9 +182,9 @@ CREATE TABLE IF NOT EXISTS `workspace` ( DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin; --- funcional start +-- api start -CREATE TABLE IF NOT EXISTS `fuc_test` ( +CREATE TABLE IF NOT EXISTS `api_test` ( `id` varchar(50) NOT NULL COMMENT 'Test ID', `project_id` varchar(50) NOT NULL COMMENT 'Project ID this test belongs to', `name` varchar(64) NOT NULL COMMENT 'Test name', @@ -199,15 +199,15 @@ CREATE TABLE IF NOT EXISTS `fuc_test` ( DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin; -CREATE TABLE IF NOT EXISTS `fuc_test_file` ( +CREATE TABLE IF NOT EXISTS `api_test_file` ( `test_id` varchar(64) DEFAULT NULL, `file_id` varchar(64) DEFAULT NULL, - UNIQUE KEY `load_test_file_unique_key` (`test_id`, `file_id`) + UNIQUE KEY `api_test_file_unique_key` (`test_id`, `file_id`) ) ENGINE = InnoDB - DEFAULT CHARSET = utf8mb4 COMMENT ='功能测试和文件的关联表'; + DEFAULT CHARSET = utf8mb4 COMMENT ='Api test test file relevance table'; -CREATE TABLE IF NOT EXISTS `fuc_test_report` ( +CREATE TABLE IF NOT EXISTS `api_test_report` ( `id` varchar(50) NOT NULL COMMENT 'Test report ID', `test_id` varchar(50) NOT NULL COMMENT 'Test ID this test report belongs to', `name` varchar(64) NOT NULL COMMENT 'Test report name', @@ -222,7 +222,7 @@ CREATE TABLE IF NOT EXISTS `fuc_test_report` ( DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin; --- funcional end +-- api end -- track start diff --git a/backend/src/main/resources/generatorConfig.xml b/backend/src/main/resources/generatorConfig.xml index 58341b1aa3..74208c1aae 100644 --- a/backend/src/main/resources/generatorConfig.xml +++ b/backend/src/main/resources/generatorConfig.xml @@ -46,10 +46,12 @@ - - - -
+ +
+
+ + + diff --git a/frontend/src/business/components/functional/FunctionalTest.vue b/frontend/src/business/components/api/ApiTest.vue similarity index 88% rename from frontend/src/business/components/functional/FunctionalTest.vue rename to frontend/src/business/components/api/ApiTest.vue index 2f17b089e0..07a116a1ea 100644 --- a/frontend/src/business/components/functional/FunctionalTest.vue +++ b/frontend/src/business/components/api/ApiTest.vue @@ -15,11 +15,11 @@ import HeaderMenus from "../common/head/HeaderMenus"; export default { - name: "FunctionalTest", + name: "ApiTest", components: {HeaderMenus}, data() { return { - beaseUrl: "functional" + beaseUrl: "api" } } } diff --git a/frontend/src/business/components/functional/home/FunctionalTestHome.vue b/frontend/src/business/components/api/home/ApiTestHome.vue similarity index 62% rename from frontend/src/business/components/functional/home/FunctionalTestHome.vue rename to frontend/src/business/components/api/home/ApiTestHome.vue index 9f319eaf5e..1b69f2c359 100644 --- a/frontend/src/business/components/functional/home/FunctionalTestHome.vue +++ b/frontend/src/business/components/api/home/ApiTestHome.vue @@ -1,13 +1,13 @@ diff --git a/frontend/src/business/components/functional/project/FunctionalRecentProject.vue b/frontend/src/business/components/api/project/ApiRecentProject.vue similarity index 85% rename from frontend/src/business/components/functional/project/FunctionalRecentProject.vue rename to frontend/src/business/components/api/project/ApiRecentProject.vue index 0f42b91bf5..cefff5308a 100644 --- a/frontend/src/business/components/functional/project/FunctionalRecentProject.vue +++ b/frontend/src/business/components/api/project/ApiRecentProject.vue @@ -6,7 +6,7 @@ + :index="'/api/' + p.id" :route="{name:'fucPlan', params:{projectId:p.id, projectName:p.name}}"> {{ p.name }} @@ -18,7 +18,7 @@ import {hasRoles} from "../../../../common/utils"; export default { - name: "FunctionalRecentProject", + name: "ApiRecentProject", mounted() { if (hasRoles(ROLE_TEST_VIEWER, ROLE_TEST_USER, ROLE_TEST_MANAGER)) { diff --git a/frontend/src/business/components/functional/report/FunctionalRecentReport.vue b/frontend/src/business/components/api/report/ApiRecentReport.vue similarity index 81% rename from frontend/src/business/components/functional/report/FunctionalRecentReport.vue rename to frontend/src/business/components/api/report/ApiRecentReport.vue index 6606265b3d..f51ab00e3e 100644 --- a/frontend/src/business/components/functional/report/FunctionalRecentReport.vue +++ b/frontend/src/business/components/api/report/ApiRecentReport.vue @@ -5,7 +5,7 @@ {{$t('load_test.recent')}} + :index="'/api/report/view/' + p.id" :route="{path: '/api/report/view/' + p.id}"> {{ p.name }} @@ -15,13 +15,13 @@ import {ROLE_TEST_MANAGER, ROLE_TEST_USER, ROLE_TEST_VIEWER} from "../../../../common/constants"; export default { - name: "FunctionalRecentReport", + name: "ApiRecentReport", mounted() { const rolesString = localStorage.getItem("roles"); const roles = rolesString.split(','); if (roles.indexOf(ROLE_TEST_MANAGER) > -1 || roles.indexOf(ROLE_TEST_USER) > -1 || roles.indexOf(ROLE_TEST_VIEWER) > -1) { - this.$get('/functional/report/recent/5', (response) => { + this.$get('/api/report/recent/5', (response) => { this.recentReports = response.data; }); } diff --git a/frontend/src/business/components/functional/report/FunctionalReportView.vue b/frontend/src/business/components/api/report/ApiReportView.vue similarity index 95% rename from frontend/src/business/components/functional/report/FunctionalReportView.vue rename to frontend/src/business/components/api/report/ApiReportView.vue index 7020a76587..bfc05d03b9 100644 --- a/frontend/src/business/components/functional/report/FunctionalReportView.vue +++ b/frontend/src/business/components/api/report/ApiReportView.vue @@ -52,7 +52,7 @@ import ResultDetails from './components/ResultDetails'; export default { - name: "FunctionalReportView", + name: "ApiReportView", components: { MsReportLogDetails, ResultDetails @@ -68,7 +68,7 @@ methods: { initBreadcrumb() { if(this.reportId){ - this.result = this.$get("/functional/report/test/pro/info/" + this.reportId, res => { + this.result = this.$get("/api/report/test/pro/info/" + this.reportId, res => { let data = res.data; if(data){ this.report = data; diff --git a/frontend/src/business/components/functional/report/FunctionalTestReport.vue b/frontend/src/business/components/api/report/ApiTestReport.vue similarity index 96% rename from frontend/src/business/components/functional/report/FunctionalTestReport.vue rename to frontend/src/business/components/api/report/ApiTestReport.vue index 4cf00af420..43b49abb83 100644 --- a/frontend/src/business/components/functional/report/FunctionalTestReport.vue +++ b/frontend/src/business/components/api/report/ApiTestReport.vue @@ -81,15 +81,15 @@