Merge branch 'v1.3'

This commit is contained in:
fit2-zhao 2020-10-10 13:24:52 +08:00
commit 04b4d7aa8d
55 changed files with 697 additions and 284 deletions

View File

@ -11,6 +11,7 @@ import io.metersphere.commons.utils.PageUtils;
import io.metersphere.commons.utils.Pager;
import io.metersphere.commons.utils.SessionUtils;
import io.metersphere.dto.DashboardTestDTO;
import io.metersphere.service.CheckOwnerService;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.web.bind.annotation.*;
@ -25,6 +26,8 @@ public class APIReportController {
@Resource
private APIReportService apiReportService;
@Resource
private CheckOwnerService checkOwnerService;
@GetMapping("recent/{count}")
public List<APIReportResult> recentTest(@PathVariable int count) {
@ -38,6 +41,7 @@ public class APIReportController {
@GetMapping("/list/{testId}")
public List<APIReportResult> listByTestId(@PathVariable String testId) {
checkOwnerService.checkApiTestOwner(testId);
return apiReportService.listByTestId(testId);
}

View File

@ -13,6 +13,7 @@ import io.metersphere.commons.utils.Pager;
import io.metersphere.commons.utils.SessionUtils;
import io.metersphere.controller.request.QueryScheduleRequest;
import io.metersphere.dto.ScheduleDao;
import io.metersphere.service.CheckOwnerService;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.web.bind.annotation.*;
@ -28,6 +29,8 @@ import java.util.List;
public class APITestController {
@Resource
private APITestService apiTestService;
@Resource
private CheckOwnerService checkownerService;
@GetMapping("recent/{count}")
public List<APITestResult> recentTest(@PathVariable int count) {
@ -53,6 +56,7 @@ public class APITestController {
@GetMapping("/list/{projectId}")
public List<ApiTest> list(@PathVariable String projectId) {
checkownerService.checkProjectOwner(projectId);
return apiTestService.getApiTestByProjectId(projectId);
}
@ -73,6 +77,7 @@ public class APITestController {
@PostMapping(value = "/update", consumes = {"multipart/form-data"})
public void update(@RequestPart("request") SaveAPITestRequest request, @RequestPart(value = "file") MultipartFile file, @RequestPart(value = "files") List<MultipartFile> bodyFiles) {
checkownerService.checkApiTestOwner(request.getId());
apiTestService.update(request, file, bodyFiles);
}
@ -83,13 +88,16 @@ public class APITestController {
@GetMapping("/get/{testId}")
public APITestResult get(@PathVariable String testId) {
checkownerService.checkApiTestOwner(testId);
return apiTestService.get(testId);
}
@PostMapping("/delete")
public void delete(@RequestBody DeleteAPITestRequest request) {
apiTestService.delete(request.getId());
String testId = request.getId();
checkownerService.checkApiTestOwner(testId);
apiTestService.delete(testId);
}
@PostMapping(value = "/run")

View File

@ -3,6 +3,7 @@ package io.metersphere.api.controller;
import io.metersphere.api.service.ApiTestEnvironmentService;
import io.metersphere.base.domain.ApiTestEnvironmentWithBLOBs;
import io.metersphere.commons.constants.RoleConstants;
import io.metersphere.service.CheckOwnerService;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.web.bind.annotation.*;
@ -17,9 +18,12 @@ public class ApiTestEnvironmentController {
@Resource
ApiTestEnvironmentService apiTestEnvironmentService;
@Resource
private CheckOwnerService checkOwnerService;
@GetMapping("/list/{projectId}")
public List<ApiTestEnvironmentWithBLOBs> list(@PathVariable String projectId) {
checkOwnerService.checkProjectOwner(projectId);
return apiTestEnvironmentService.list(projectId);
}

View File

@ -37,5 +37,7 @@ public class TestCase implements Serializable {
private String otherTestName;
private String reviewStatus;
private static final long serialVersionUID = 1L;
}

View File

@ -1183,6 +1183,76 @@ public class TestCaseExample {
addCriterion("other_test_name not between", value1, value2, "otherTestName");
return (Criteria) this;
}
public Criteria andReviewStatusIsNull() {
addCriterion("review_status is null");
return (Criteria) this;
}
public Criteria andReviewStatusIsNotNull() {
addCriterion("review_status is not null");
return (Criteria) this;
}
public Criteria andReviewStatusEqualTo(String value) {
addCriterion("review_status =", value, "reviewStatus");
return (Criteria) this;
}
public Criteria andReviewStatusNotEqualTo(String value) {
addCriterion("review_status <>", value, "reviewStatus");
return (Criteria) this;
}
public Criteria andReviewStatusGreaterThan(String value) {
addCriterion("review_status >", value, "reviewStatus");
return (Criteria) this;
}
public Criteria andReviewStatusGreaterThanOrEqualTo(String value) {
addCriterion("review_status >=", value, "reviewStatus");
return (Criteria) this;
}
public Criteria andReviewStatusLessThan(String value) {
addCriterion("review_status <", value, "reviewStatus");
return (Criteria) this;
}
public Criteria andReviewStatusLessThanOrEqualTo(String value) {
addCriterion("review_status <=", value, "reviewStatus");
return (Criteria) this;
}
public Criteria andReviewStatusLike(String value) {
addCriterion("review_status like", value, "reviewStatus");
return (Criteria) this;
}
public Criteria andReviewStatusNotLike(String value) {
addCriterion("review_status not like", value, "reviewStatus");
return (Criteria) this;
}
public Criteria andReviewStatusIn(List<String> values) {
addCriterion("review_status in", values, "reviewStatus");
return (Criteria) this;
}
public Criteria andReviewStatusNotIn(List<String> values) {
addCriterion("review_status not in", values, "reviewStatus");
return (Criteria) this;
}
public Criteria andReviewStatusBetween(String value1, String value2) {
addCriterion("review_status between", value1, value2, "reviewStatus");
return (Criteria) this;
}
public Criteria andReviewStatusNotBetween(String value1, String value2) {
addCriterion("review_status not between", value1, value2, "reviewStatus");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {

View File

@ -18,6 +18,7 @@
<result column="sort" jdbcType="INTEGER" property="sort" />
<result column="num" jdbcType="INTEGER" property="num" />
<result column="other_test_name" jdbcType="VARCHAR" property="otherTestName" />
<result column="review_status" jdbcType="VARCHAR" property="reviewStatus" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.metersphere.base.domain.TestCaseWithBLOBs">
<result column="remark" jdbcType="LONGVARCHAR" property="remark" />
@ -83,7 +84,7 @@
</sql>
<sql id="Base_Column_List">
id, node_id, node_path, project_id, `name`, `type`, maintainer, priority, `method`,
prerequisite, create_time, update_time, test_id, sort, num, other_test_name
prerequisite, create_time, update_time, test_id, sort, num, other_test_name, review_status
</sql>
<sql id="Blob_Column_List">
remark, steps
@ -142,15 +143,15 @@
maintainer, priority, `method`,
prerequisite, create_time, update_time,
test_id, sort, num,
other_test_name, remark, steps
)
other_test_name, review_status, remark,
steps)
values (#{id,jdbcType=VARCHAR}, #{nodeId,jdbcType=VARCHAR}, #{nodePath,jdbcType=VARCHAR},
#{projectId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR},
#{maintainer,jdbcType=VARCHAR}, #{priority,jdbcType=VARCHAR}, #{method,jdbcType=VARCHAR},
#{prerequisite,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT},
#{testId,jdbcType=VARCHAR}, #{sort,jdbcType=INTEGER}, #{num,jdbcType=INTEGER},
#{otherTestName,jdbcType=VARCHAR}, #{remark,jdbcType=LONGVARCHAR}, #{steps,jdbcType=LONGVARCHAR}
)
#{otherTestName,jdbcType=VARCHAR}, #{reviewStatus,jdbcType=VARCHAR}, #{remark,jdbcType=LONGVARCHAR},
#{steps,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" parameterType="io.metersphere.base.domain.TestCaseWithBLOBs">
insert into test_case
@ -203,6 +204,9 @@
<if test="otherTestName != null">
other_test_name,
</if>
<if test="reviewStatus != null">
review_status,
</if>
<if test="remark != null">
remark,
</if>
@ -259,6 +263,9 @@
<if test="otherTestName != null">
#{otherTestName,jdbcType=VARCHAR},
</if>
<if test="reviewStatus != null">
#{reviewStatus,jdbcType=VARCHAR},
</if>
<if test="remark != null">
#{remark,jdbcType=LONGVARCHAR},
</if>
@ -324,6 +331,9 @@
<if test="record.otherTestName != null">
other_test_name = #{record.otherTestName,jdbcType=VARCHAR},
</if>
<if test="record.reviewStatus != null">
review_status = #{record.reviewStatus,jdbcType=VARCHAR},
</if>
<if test="record.remark != null">
remark = #{record.remark,jdbcType=LONGVARCHAR},
</if>
@ -353,6 +363,7 @@
sort = #{record.sort,jdbcType=INTEGER},
num = #{record.num,jdbcType=INTEGER},
other_test_name = #{record.otherTestName,jdbcType=VARCHAR},
review_status = #{record.reviewStatus,jdbcType=VARCHAR},
remark = #{record.remark,jdbcType=LONGVARCHAR},
steps = #{record.steps,jdbcType=LONGVARCHAR}
<if test="_parameter != null">
@ -376,7 +387,8 @@
test_id = #{record.testId,jdbcType=VARCHAR},
sort = #{record.sort,jdbcType=INTEGER},
num = #{record.num,jdbcType=INTEGER},
other_test_name = #{record.otherTestName,jdbcType=VARCHAR}
other_test_name = #{record.otherTestName,jdbcType=VARCHAR},
review_status = #{record.reviewStatus,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -429,6 +441,9 @@
<if test="otherTestName != null">
other_test_name = #{otherTestName,jdbcType=VARCHAR},
</if>
<if test="reviewStatus != null">
review_status = #{reviewStatus,jdbcType=VARCHAR},
</if>
<if test="remark != null">
remark = #{remark,jdbcType=LONGVARCHAR},
</if>
@ -455,6 +470,7 @@
sort = #{sort,jdbcType=INTEGER},
num = #{num,jdbcType=INTEGER},
other_test_name = #{otherTestName,jdbcType=VARCHAR},
review_status = #{reviewStatus,jdbcType=VARCHAR},
remark = #{remark,jdbcType=LONGVARCHAR},
steps = #{steps,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=VARCHAR}
@ -475,7 +491,8 @@
test_id = #{testId,jdbcType=VARCHAR},
sort = #{sort,jdbcType=INTEGER},
num = #{num,jdbcType=INTEGER},
other_test_name = #{otherTestName,jdbcType=VARCHAR}
other_test_name = #{otherTestName,jdbcType=VARCHAR},
review_status = #{reviewStatus,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>

View File

@ -99,7 +99,7 @@
<select id="getTestCaseNames" resultType="io.metersphere.base.domain.TestCase">
select test_case.id, test_case.name, test_case.priority, test_case.type
select test_case.id, test_case.name, test_case.priority, test_case.type, test_case.review_status
from test_case
<where>
<if test="request.combine != null">
@ -130,6 +130,12 @@
#{value}
</foreach>
</when>
<when test="key=='status'">
and test_case.review_status in
<foreach collection="values" item="value" separator="," open="(" close=")">
#{value}
</foreach>
</when>
<otherwise>
and test_case.type in
<foreach collection="values" item="value" separator="," open="(" close=")">
@ -181,6 +187,12 @@
#{value}
</foreach>
</when>
<when test="key=='status'">
and test_case.review_status in
<foreach collection="values" item="value" separator="," open="(" close=")">
#{value}
</foreach>
</when>
<otherwise>
and test_case.method in
<foreach collection="values" item="value" separator="," open="(" close=")">

View File

@ -10,6 +10,6 @@ import java.util.List;
public interface ExtTestReviewCaseMapper {
List<TestReviewCaseDTO> list(@Param("request") QueryCaseReviewRequest request);
List<String> getStatusByReviewId(String planId);
List<String> getStatusByReviewId(String reviewId);
List<String> findRelateTestReviewId(String userId, String workspaceId);
}

View File

@ -182,9 +182,9 @@
</select>
<select id="getStatusByReviewId" resultType="java.lang.String">
select status
from test_case_review_test_case
where review_id = #{reviewId}
select review_status
from test_case
where id in (select case_id from test_case_review_test_case where review_id = #{reviewId});
</select>
<select id="findRelateTestReviewId" resultType="java.lang.String">

View File

@ -9,6 +9,7 @@ import io.metersphere.commons.utils.Pager;
import io.metersphere.commons.utils.SessionUtils;
import io.metersphere.controller.request.ProjectRequest;
import io.metersphere.dto.ProjectDTO;
import io.metersphere.service.CheckOwnerService;
import io.metersphere.service.ProjectService;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresRoles;
@ -22,6 +23,8 @@ import java.util.List;
public class ProjectController {
@Resource
private ProjectService projectService;
@Resource
private CheckOwnerService checkOwnerService;
@GetMapping("/listAll")
public List<ProjectDTO> listAll() {
@ -71,6 +74,7 @@ public class ProjectController {
@GetMapping("/delete/{projectId}")
@RequiresRoles(value = {RoleConstants.TEST_MANAGER, RoleConstants.TEST_USER,}, logical = Logical.OR)
public void deleteProject(@PathVariable(value = "projectId") String projectId) {
checkOwnerService.checkProjectOwner(projectId);
projectService.deleteProject(projectId);
}

View File

@ -4,6 +4,7 @@ package io.metersphere.controller.handler;
import io.metersphere.commons.exception.MSException;
import io.metersphere.controller.ResultHolder;
import org.apache.shiro.ShiroException;
import org.apache.shiro.authz.UnauthorizedException;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
@ -21,6 +22,13 @@ public class RestControllerExceptionHandler {
return ResultHolder.error(exception.getMessage());
}
/*=========== Shiro 异常拦截==============*/
@ExceptionHandler(UnauthorizedException.class)
public ResultHolder unauthorizedExceptionHandler(HttpServletRequest request, HttpServletResponse response, Exception exception) {
response.setStatus(HttpStatus.FORBIDDEN.value());
return ResultHolder.error(exception.getMessage());
}
@ExceptionHandler(MSException.class)
public ResultHolder msExceptionHandler(HttpServletRequest request, HttpServletResponse response, MSException e) {

View File

@ -14,6 +14,7 @@ import io.metersphere.dto.DashboardTestDTO;
import io.metersphere.dto.LoadTestDTO;
import io.metersphere.dto.ScheduleDao;
import io.metersphere.performance.service.PerformanceTestService;
import io.metersphere.service.CheckOwnerService;
import io.metersphere.service.FileService;
import io.metersphere.track.request.testplan.*;
import org.apache.shiro.authz.annotation.Logical;
@ -35,6 +36,8 @@ public class PerformanceTestController {
private PerformanceTestService performanceTestService;
@Resource
private FileService fileService;
@Resource
private CheckOwnerService checkOwnerService;
@GetMapping("recent/{count}")
public List<LoadTestDTO> recentTestPlans(@PathVariable int count) {
@ -55,12 +58,14 @@ public class PerformanceTestController {
@GetMapping("/list/{projectId}")
public List<LoadTest> list(@PathVariable String projectId) {
checkOwnerService.checkProjectOwner(projectId);
return performanceTestService.getLoadTestByProjectId(projectId);
}
@GetMapping("/state/get/{testId}")
public LoadTest listByTestId(@PathVariable String testId) {
checkOwnerService.checkPerformanceTestOwner(testId);
return performanceTestService.getLoadTestBytestId(testId);
}
@ -77,26 +82,31 @@ public class PerformanceTestController {
@RequestPart("request") EditTestPlanRequest request,
@RequestPart(value = "file", required = false) List<MultipartFile> files
) {
checkOwnerService.checkPerformanceTestOwner(request.getId());
return performanceTestService.edit(request, files);
}
@GetMapping("/get/{testId}")
public LoadTestDTO get(@PathVariable String testId) {
checkOwnerService.checkPerformanceTestOwner(testId);
return performanceTestService.get(testId);
}
@GetMapping("/get-advanced-config/{testId}")
public String getAdvancedConfiguration(@PathVariable String testId) {
checkOwnerService.checkPerformanceTestOwner(testId);
return performanceTestService.getAdvancedConfiguration(testId);
}
@GetMapping("/get-load-config/{testId}")
public String getLoadConfiguration(@PathVariable String testId) {
checkOwnerService.checkPerformanceTestOwner(testId);
return performanceTestService.getLoadConfiguration(testId);
}
@PostMapping("/delete")
public void delete(@RequestBody DeleteTestPlanRequest request) {
checkOwnerService.checkPerformanceTestOwner(request.getId());
performanceTestService.delete(request);
}
@ -112,6 +122,7 @@ public class PerformanceTestController {
@GetMapping("/file/metadata/{testId}")
public List<FileMetadata> getFileMetadata(@PathVariable String testId) {
checkOwnerService.checkPerformanceTestOwner(testId);
return fileService.getFileMetadataByTestId(testId);
}

View File

@ -0,0 +1,64 @@
package io.metersphere.service;
import io.metersphere.api.dto.APITestResult;
import io.metersphere.api.dto.QueryAPITestRequest;
import io.metersphere.base.domain.Project;
import io.metersphere.base.mapper.ProjectMapper;
import io.metersphere.base.mapper.ext.ExtApiTestMapper;
import io.metersphere.base.mapper.ext.ExtLoadTestMapper;
import io.metersphere.commons.utils.SessionUtils;
import io.metersphere.dto.LoadTestDTO;
import io.metersphere.i18n.Translator;
import io.metersphere.track.request.testplan.QueryTestPlanRequest;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.authz.UnauthorizedException;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service
public class CheckOwnerService {
@Resource
private ProjectMapper projectMapper;
@Resource
private ExtApiTestMapper extApiTestMapper;
@Resource
private ExtLoadTestMapper extLoadTestMapper;
public void checkProjectOwner(String projectId) {
String workspaceId = SessionUtils.getCurrentWorkspaceId();
Project project = projectMapper.selectByPrimaryKey(projectId);
if (project == null) {
return;
}
if (!StringUtils.equals(workspaceId, project.getWorkspaceId())) {
throw new UnauthorizedException(Translator.get("check_owner_project"));
}
}
public void checkApiTestOwner(String testId) {
String workspaceId = SessionUtils.getCurrentWorkspaceId();
QueryAPITestRequest request = new QueryAPITestRequest();
request.setWorkspaceId(workspaceId);
request.setId(testId);
List<APITestResult> apiTestResults = extApiTestMapper.list(request);
if (CollectionUtils.size(apiTestResults) != 1) {
throw new UnauthorizedException(Translator.get("check_owner_test"));
}
}
public void checkPerformanceTestOwner(String testId) {
String workspaceId = SessionUtils.getCurrentWorkspaceId();
QueryTestPlanRequest request = new QueryTestPlanRequest();
request.setWorkspaceId(workspaceId);
request.setId(testId);
List<LoadTestDTO> loadTestDTOS = extLoadTestMapper.list(request);
if (CollectionUtils.size(loadTestDTOS) != 1) {
throw new UnauthorizedException(Translator.get("check_owner_test"));
}
}
}

View File

@ -487,20 +487,18 @@ public class UserService {
/*修改当前用户用户密码*/
private User updateCurrentUserPwd(EditPassWordRequest request) {
if (SessionUtils.getUser() != null) {
User user = userMapper.selectByPrimaryKey(SessionUtils.getUser().getId());
String pwd = user.getPassword();
String prepwd = CodingUtil.md5(request.getPassword(), "utf-8");
String newped = request.getNewpassword();
if (StringUtils.isNotBlank(prepwd)) {
if (prepwd.trim().equals(pwd.trim())) {
user.setPassword(CodingUtil.md5(newped));
user.setUpdateTime(System.currentTimeMillis());
return user;
}
}
MSException.throwException(Translator.get("password_modification_failed"));
String oldPassword = CodingUtil.md5(request.getPassword(), "utf-8");
String newPassword = request.getNewpassword();
UserExample userExample = new UserExample();
userExample.createCriteria().andIdEqualTo(SessionUtils.getUser().getId()).andPasswordEqualTo(oldPassword);
List<User> users = userMapper.selectByExample(userExample);
if (!CollectionUtils.isEmpty(users)) {
User user = users.get(0);
user.setPassword(CodingUtil.md5(newPassword));
user.setUpdateTime(System.currentTimeMillis());
return user;
}
MSException.throwException(Translator.get("password_modification_failed"));
return null;
}
@ -512,8 +510,8 @@ public class UserService {
/*管理员修改用户密码*/
private User updateUserPwd(EditPassWordRequest request) {
User user = userMapper.selectByPrimaryKey(request.getId());
String newped = request.getNewpassword();
user.setPassword(CodingUtil.md5(newped));
String newPassword = request.getNewpassword();
user.setPassword(CodingUtil.md5(newPassword));
user.setUpdateTime(System.currentTimeMillis());
return user;
}

View File

@ -10,6 +10,7 @@ import io.metersphere.commons.utils.PageUtils;
import io.metersphere.commons.utils.Pager;
import io.metersphere.commons.utils.SessionUtils;
import io.metersphere.excel.domain.ExcelResponse;
import io.metersphere.service.CheckOwnerService;
import io.metersphere.track.dto.TestCaseDTO;
import io.metersphere.track.request.testcase.QueryTestCaseRequest;
import io.metersphere.track.request.testcase.TestCaseBatchRequest;
@ -30,6 +31,8 @@ public class TestCaseController {
@Resource
TestCaseService testCaseService;
@Resource
private CheckOwnerService checkOwnerService;
@PostMapping("/list/{goPage}/{pageSize}")
public Pager<List<TestCaseDTO>> list(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody QueryTestCaseRequest request) {
@ -39,6 +42,7 @@ public class TestCaseController {
@GetMapping("/list/{projectId}")
public List<TestCaseDTO> list(@PathVariable String projectId) {
checkOwnerService.checkProjectOwner(projectId);
QueryTestCaseRequest request = new QueryTestCaseRequest();
request.setProjectId(projectId);
return testCaseService.listTestCase(request);
@ -47,6 +51,7 @@ public class TestCaseController {
@GetMapping("/list/method/{projectId}")
public List<TestCaseDTO> listByMethod(@PathVariable String projectId) {
checkOwnerService.checkProjectOwner(projectId);
QueryTestCaseRequest request = new QueryTestCaseRequest();
request.setProjectId(projectId);
return testCaseService.listTestCaseMthod(request);
@ -107,8 +112,9 @@ public class TestCaseController {
@PostMapping("/import/{projectId}/{userId}")
@RequiresRoles(value = {RoleConstants.TEST_USER, RoleConstants.TEST_MANAGER}, logical = Logical.OR)
public ExcelResponse testCaseImport(MultipartFile file, @PathVariable String projectId,@PathVariable String userId) throws NoSuchFieldException {
return testCaseService.testCaseImport(file, projectId,userId);
public ExcelResponse testCaseImport(MultipartFile file, @PathVariable String projectId, @PathVariable String userId) {
checkOwnerService.checkProjectOwner(projectId);
return testCaseService.testCaseImport(file, projectId, userId);
}
@GetMapping("/export/template")
@ -116,6 +122,7 @@ public class TestCaseController {
public void testCaseTemplateExport(HttpServletResponse response) {
testCaseService.testCaseTemplateExport(response);
}
@GetMapping("/export/xmindTemplate")
@RequiresRoles(value = {RoleConstants.TEST_USER, RoleConstants.TEST_MANAGER}, logical = Logical.OR)
public void xmindTemplate(HttpServletResponse response) {

View File

@ -2,6 +2,7 @@ package io.metersphere.track.controller;
import io.metersphere.base.domain.TestCaseNode;
import io.metersphere.commons.constants.RoleConstants;
import io.metersphere.service.CheckOwnerService;
import io.metersphere.track.dto.TestCaseNodeDTO;
import io.metersphere.track.request.testcase.DragNodeRequest;
import io.metersphere.track.request.testcase.QueryNodeRequest;
@ -20,9 +21,12 @@ public class TestCaseNodeController {
@Resource
TestCaseNodeService testCaseNodeService;
@Resource
private CheckOwnerService checkOwnerService;
@GetMapping("/list/{projectId}")
public List<TestCaseNodeDTO> getNodeByProjectId(@PathVariable String projectId) {
checkOwnerService.checkProjectOwner(projectId);
return testCaseNodeService.getNodeTreeByProjectId(projectId);
}

View File

@ -9,7 +9,7 @@ import lombok.Setter;
public class TestReviewCaseDTO extends TestCaseWithBLOBs {
private String reviewer;
private String reviewerName;
private String status;
private String reviewStatus;
private String results;
private String reviewId;
private String caseId;

View File

@ -9,4 +9,5 @@ public class TestReviewDTOWithMetric extends TestCaseReviewDTO {
private Double testRate;
private Integer reviewed;
private Integer total;
private Integer pass;
}

View File

@ -6,8 +6,8 @@ import io.metersphere.base.mapper.ext.ExtProjectMapper;
import io.metersphere.base.mapper.ext.ExtTestCaseReviewMapper;
import io.metersphere.base.mapper.ext.ExtTestReviewCaseMapper;
import io.metersphere.commons.constants.TestCaseReviewStatus;
import io.metersphere.commons.constants.TestPlanStatus;
import io.metersphere.commons.constants.TestPlanTestCaseStatus;
import io.metersphere.commons.constants.TestReviewCaseStatus;
import io.metersphere.commons.exception.MSException;
import io.metersphere.commons.user.SessionUser;
import io.metersphere.commons.utils.LogUtil;
@ -32,7 +32,6 @@ import org.apache.ibatis.session.SqlSessionFactory;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import java.util.*;
import java.util.stream.Collectors;
@ -272,14 +271,20 @@ public class TestCaseReviewService {
List<Project> projects = projectMapper.selectByExample(projectExample);
List<String> projectIds = projects.stream().map(Project::getId).collect(Collectors.toList());
TestCaseReviewProjectExample testCaseReviewProjectExample = new TestCaseReviewProjectExample();
testCaseReviewProjectExample.createCriteria().andProjectIdIn(projectIds);
List<TestCaseReviewProject> testCaseReviewProjects = testCaseReviewProjectMapper.selectByExample(testCaseReviewProjectExample);
List<String> reviewIds = testCaseReviewProjects.stream().map(TestCaseReviewProject::getReviewId).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(projectIds)) {
TestCaseReviewProjectExample testCaseReviewProjectExample = new TestCaseReviewProjectExample();
testCaseReviewProjectExample.createCriteria().andProjectIdIn(projectIds);
List<TestCaseReviewProject> testCaseReviewProjects = testCaseReviewProjectMapper.selectByExample(testCaseReviewProjectExample);
List<String> reviewIds = testCaseReviewProjects.stream().map(TestCaseReviewProject::getReviewId).collect(Collectors.toList());
TestCaseReviewExample testCaseReviewExample = new TestCaseReviewExample();
testCaseReviewExample.createCriteria().andIdIn(reviewIds);
return testCaseReviewMapper.selectByExample(testCaseReviewExample);
if (!CollectionUtils.isEmpty(reviewIds)) {
TestCaseReviewExample testCaseReviewExample = new TestCaseReviewExample();
testCaseReviewExample.createCriteria().andIdIn(reviewIds);
return testCaseReviewMapper.selectByExample(testCaseReviewExample);
}
}
return new ArrayList<>();
}
public void testReviewRelevance(ReviewRelevanceRequest request) {
@ -340,13 +345,13 @@ public class TestCaseReviewService {
testCaseReview.setId(reviewId);
for (String status : statusList) {
if (StringUtils.equals(status, TestPlanTestCaseStatus.Prepare.name())) {
testCaseReview.setStatus(TestPlanStatus.Underway.name());
if (StringUtils.equals(status, TestReviewCaseStatus.Prepare.name())) {
testCaseReview.setStatus(TestCaseReviewStatus.Underway.name());
testCaseReviewMapper.updateByPrimaryKeySelective(testCaseReview);
return;
}
}
testCaseReview.setStatus(TestPlanStatus.Completed.name());
testCaseReview.setStatus(TestCaseReviewStatus.Completed.name());
SaveTestCaseReviewRequest testCaseReviewRequest = new SaveTestCaseReviewRequest();
TestCaseReview _testCaseReview = testCaseReviewMapper.selectByPrimaryKey(reviewId);
List<String> userIds = new ArrayList<>();
@ -405,16 +410,19 @@ public class TestCaseReviewService {
testReview.setReviewed(0);
testReview.setTotal(0);
testReview.setPass(0);
if (testCases != null) {
testReview.setTotal(testCases.size());
testCases.forEach(testCase -> {
if (!StringUtils.equals(testCase.getStatus(), TestPlanTestCaseStatus.Prepare.name())
&& !StringUtils.equals(testCase.getStatus(), TestPlanTestCaseStatus.Underway.name())) {
if (!StringUtils.equals(testCase.getReviewStatus(), TestReviewCaseStatus.Prepare.name())) {
testReview.setReviewed(testReview.getReviewed() + 1);
}
if (StringUtils.equals(testCase.getReviewStatus(), TestReviewCaseStatus.Pass.name())) {
testReview.setPass(testReview.getPass() + 1);
}
});
}
testReview.setTestRate(MathUtils.getPercentWithDecimal(testReview.getTotal() == 0 ? 0 : testReview.getReviewed() * 1.0 / testReview.getTotal()));
});
}
return testReviews;

View File

@ -10,6 +10,7 @@ import io.metersphere.base.mapper.*;
import io.metersphere.base.mapper.ext.ExtTestCaseMapper;
import io.metersphere.commons.constants.RoleConstants;
import io.metersphere.commons.constants.TestCaseConstants;
import io.metersphere.commons.constants.TestCaseReviewStatus;
import io.metersphere.commons.exception.MSException;
import io.metersphere.commons.user.SessionUser;
import io.metersphere.commons.utils.BeanUtils;
@ -88,6 +89,7 @@ public class TestCaseService {
testCase.setCreateTime(System.currentTimeMillis());
testCase.setUpdateTime(System.currentTimeMillis());
testCase.setNum(getNextNum(testCase.getProjectId()));
testCase.setReviewStatus(TestCaseReviewStatus.Prepare.name());
testCaseMapper.insert(testCase);
}
@ -273,6 +275,8 @@ public class TestCaseService {
.map(TestCase::getName)
.collect(Collectors.toSet());
List<ExcelErrData<TestCaseExcelData>> errList = null;
if (multipartFile == null)
MSException.throwException(Translator.get("upload_fail"));
if (multipartFile.getOriginalFilename().endsWith(".xmind")) {
try {
@ -284,6 +288,11 @@ public class TestCaseService {
ExcelErrData excelErrData = new ExcelErrData(null, 1, Translator.get("upload_fail") + "" + processLog);
errList.add(excelErrData);
excelResponse.setErrList(errList);
} else if (xmindParser.getNodePaths().isEmpty() && xmindParser.getTestCase().isEmpty()) {
excelResponse.setSuccess(false);
ExcelErrData excelErrData = new ExcelErrData(null, 1, Translator.get("upload_fail") + "" + Translator.get("upload_content_is_null"));
errList.add(excelErrData);
excelResponse.setErrList(errList);
} else {
if (!xmindParser.getNodePaths().isEmpty()) {
testCaseNodeService.createNodes(xmindParser.getNodePaths(), projectId);
@ -295,7 +304,8 @@ public class TestCaseService {
excelResponse.setSuccess(true);
}
} catch (Exception e) {
e.printStackTrace();
LogUtil.error(e.getMessage(), e);
MSException.throwException(e.getMessage());
}
} else {
@ -339,6 +349,7 @@ public class TestCaseService {
testcase.setNodeId(nodePathMap.get(testcase.getNodePath()));
testcase.setSort(sort.getAndIncrement());
testcase.setNum(num.decrementAndGet());
testcase.setReviewStatus(TestCaseReviewStatus.Prepare.name());
mapper.insert(testcase);
});
}

View File

@ -1,6 +1,7 @@
package io.metersphere.track.service;
import io.metersphere.base.domain.*;
import io.metersphere.base.mapper.TestCaseMapper;
import io.metersphere.base.mapper.TestCaseReviewMapper;
import io.metersphere.base.mapper.TestCaseReviewTestCaseMapper;
import io.metersphere.base.mapper.TestCaseReviewUsersMapper;
@ -38,6 +39,8 @@ public class TestReviewTestCaseService {
TestCaseReviewMapper testCaseReviewMapper;
@Resource
TestCaseReviewService testCaseReviewService;
@Resource
TestCaseMapper testCaseMapper;
public List<TestReviewCaseDTO> list(QueryCaseReviewRequest request) {
request.setOrders(ServiceUtils.getDefaultOrder(request.getOrders()));
@ -111,9 +114,17 @@ public class TestReviewTestCaseService {
MSException.throwException("此用例评审已到截止时间!");
}
// 记录测试用例评审状态变更
testCaseReviewTestCase.setStatus(testCaseReviewTestCase.getStatus());
testCaseReviewTestCase.setReviewer(SessionUtils.getUser().getId());
testCaseReviewTestCase.setUpdateTime(System.currentTimeMillis());
testCaseReviewTestCaseMapper.updateByPrimaryKeySelective(testCaseReviewTestCase);
// 修改用例评审状态
String caseId = testCaseReviewTestCase.getCaseId();
TestCaseWithBLOBs testCase = new TestCaseWithBLOBs();
testCase.setId(caseId);
testCase.setReviewStatus(testCaseReviewTestCase.getStatus());
testCaseMapper.updateByPrimaryKeySelective(testCase);
}
}

View File

@ -33,13 +33,10 @@ public class XmindCaseParser {
private StringBuffer process; // 过程校验记录
// 已存在用例名称
private Set<String> testCaseNames;
// 转换后的案例信息
private List<TestCaseWithBLOBs> testCases;
// 案例详情重写了hashCode方法去重用
private List<TestCaseExcelData> compartDatas;
// 记录没有用例的目录
private List<String> nodePaths;
@ -54,7 +51,10 @@ public class XmindCaseParser {
nodePaths = new ArrayList<>();
}
// 这里清理是为了 加快jvm 回收
private static final String TC_REGEX = "(?:tc:|tc|tc)";
private static final String PC_REGEX = "(?:pc:|pc|pc)";
private static final String RC_REGEX = "(?:rc:|rc|rc)";
public void clear() {
compartDatas.clear();
testCases.clear();
@ -90,9 +90,9 @@ public class XmindCaseParser {
}
// 递归处理案例数据
private void recursion(StringBuffer processBuffer, Attached parent, int level, List<Attached> attacheds) {
private void recursion(Attached parent, int level, List<Attached> attacheds) {
for (Attached item : attacheds) {
if (isAvailable(item.getTitle(), "(?:tc|tc:|tc)")) { // 用例
if (isAvailable(item.getTitle(), TC_REGEX)) { // 用例
item.setParent(parent);
this.newTestCase(item.getTitle(), parent.getPath(), item.getChildren() != null ? item.getChildren().getAttached() : null);
} else {
@ -100,7 +100,7 @@ public class XmindCaseParser {
item.setPath(nodePath);
item.setParent(parent);
if (item.getChildren() != null && !item.getChildren().getAttached().isEmpty()) {
recursion(processBuffer, item, level + 1, item.getChildren().getAttached());
recursion(item, level + 1, item.getChildren().getAttached());
} else {
if (!nodePath.startsWith("/")) {
nodePath = "/" + nodePath;
@ -163,7 +163,7 @@ public class XmindCaseParser {
return;
}
// 用例名称
testCase.setName(this.replace(tcArr[1], "tc:|tc|tc"));
testCase.setName(this.replace(tcArr[1], TC_REGEX));
if (!nodePath.startsWith("/")) {
nodePath = "/" + nodePath;
@ -188,10 +188,10 @@ public class XmindCaseParser {
List<Attached> steps = new LinkedList<>();
if (attacheds != null && !attacheds.isEmpty()) {
attacheds.forEach(item -> {
if (isAvailable(item.getTitle(), "(?:pc:|pc)")) {
testCase.setPrerequisite(replace(item.getTitle(), "(?:pc:|pc)"));
} else if (isAvailable(item.getTitle(), "(?:rc:|rc)")) {
testCase.setRemark(replace(item.getTitle(), "(?:rc:|rc)"));
if (isAvailable(item.getTitle(), PC_REGEX)) {
testCase.setPrerequisite(replace(item.getTitle(), PC_REGEX));
} else if (isAvailable(item.getTitle(), RC_REGEX)) {
testCase.setRemark(replace(item.getTitle(), RC_REGEX));
} else {
steps.add(item);
}
@ -267,28 +267,37 @@ public class XmindCaseParser {
// 导入思维导图处理
public String parse(MultipartFile multipartFile) {
StringBuffer processBuffer = new StringBuffer();
try {
// 获取思维导图内容
JsonRootBean root = XmindParser.parseObject(multipartFile);
if (root != null && root.getRootTopic() != null && root.getRootTopic().getChildren() != null) {
// 判断是模块还是用例
for (Attached item : root.getRootTopic().getChildren().getAttached()) {
if (isAvailable(item.getTitle(), "(?:tc:|tc|tc)")) { // 用例
return replace(item.getTitle(), "(?:tc:|tc|tc)") + "" + Translator.get("test_case_create_module_fail");
} else {
item.setPath(item.getTitle());
if (item.getChildren() != null && !item.getChildren().getAttached().isEmpty()) {
recursion(processBuffer, item, 1, item.getChildren().getAttached());
List<JsonRootBean> roots = XmindParser.parseObject(multipartFile);
for (JsonRootBean root : roots) {
if (root != null && root.getRootTopic() != null && root.getRootTopic().getChildren() != null) {
// 判断是模块还是用例
for (Attached item : root.getRootTopic().getChildren().getAttached()) {
if (isAvailable(item.getTitle(), TC_REGEX)) { // 用例
return replace(item.getTitle(), TC_REGEX) + "" + Translator.get("test_case_create_module_fail");
} else {
String nodePath = item.getTitle();
item.setPath(nodePath);
if (item.getChildren() != null && !item.getChildren().getAttached().isEmpty()) {
recursion(item, 1, item.getChildren().getAttached());
} else {
if (!nodePath.startsWith("/")) {
nodePath = "/" + nodePath;
}
if (nodePath.endsWith("/")) {
nodePath = nodePath.substring(0, nodePath.length() - 1);
}
nodePaths.add(nodePath); // 没有用例的路径
}
}
}
}
}
this.validate();
this.validate(); //检查目录合规性
} catch (Exception ex) {
processBuffer.append(Translator.get("incorrect_format"));
LogUtil.error(ex.getMessage());
return "xmind "+Translator.get("incorrect_format");
return ex.getMessage();
}
return process.toString();
}

View File

@ -5,75 +5,83 @@ import org.json.JSONObject;
import org.json.XML;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
public class XmindLegacy {
/**
* 返回content.xml和comments.xml合并后的json
*
* @param xmlContent
* @param xmlComments
* @return
* @throws IOException
* @throws DocumentException
*/
public static String getContent(String xmlContent, String xmlComments) throws IOException, DocumentException {
// 删除content.xml里面不能识别的字符串
xmlContent = xmlContent.replace("xmlns=\"urn:xmind:xmap:xmlns:content:2.0\"", "");
xmlContent = xmlContent.replace("xmlns:fo=\"http://www.w3.org/1999/XSL/Format\"", "");
// 删除<topic>节点
xmlContent = xmlContent.replace("<topics type=\"attached\">", "");
xmlContent = xmlContent.replace("</topics>", "");
/**
* 返回content.xml和comments.xml合并后的json
*
* @param xmlContent
* @param xmlComments
* @return
* @throws IOException
* @throws DocumentException
*/
public static List<String> getContent(String xmlContent, String xmlComments) throws IOException, DocumentException {
// 删除content.xml里面不能识别的字符串
xmlContent = xmlContent.replace("xmlns=\"urn:xmind:xmap:xmlns:content:2.0\"", "");
xmlContent = xmlContent.replace("xmlns:fo=\"http://www.w3.org/1999/XSL/Format\"", "");
// 删除<topic>节点
xmlContent = xmlContent.replace("<topics type=\"attached\">", "");
xmlContent = xmlContent.replace("</topics>", "");
// 去除title中svg:width属性
xmlContent = xmlContent.replaceAll("<title svg:width=\"[0-9]*\">", "<title>");
// 去除title中svg:width属性
xmlContent = xmlContent.replaceAll("<title svg:width=\"[0-9]*\">", "<title>");
//去除自由风格主题
xmlContent = xmlContent.replaceAll("<topics type=\"detached\">", "");
Document document = DocumentHelper.parseText(xmlContent);// 读取XML文件,获得document对象
Element root = document.getRootElement();
List<Node> topics = root.selectNodes("//topic");
Document document = DocumentHelper.parseText(xmlContent);// 读取XML文件,获得document对象
Element root = document.getRootElement();
List<Node> topics = root.selectNodes("//topic");
if (xmlComments != null) {
// 删除comments.xml里面不能识别的字符串
xmlComments = xmlComments.replace("xmlns=\"urn:xmind:xmap:xmlns:comments:2.0\"", "");
if (xmlComments != null) {
// 删除comments.xml里面不能识别的字符串
xmlComments = xmlComments.replace("xmlns=\"urn:xmind:xmap:xmlns:comments:2.0\"", "");
// 添加评论到content中
Document commentDocument = DocumentHelper.parseText(xmlComments);
List<Node> commentsList = commentDocument.selectNodes("//comment");
// 添加评论到content中
Document commentDocument = DocumentHelper.parseText(xmlComments);
List<Node> commentsList = commentDocument.selectNodes("//comment");
for (Node topic : topics) {
for (Node commentNode : commentsList) {
Element commentElement = (Element) commentNode;
Element topicElement = (Element) topic;
if (topicElement.attribute("id").getValue()
.equals(commentElement.attribute("object-id").getValue())) {
Element comment = topicElement.addElement("comments");
comment.addAttribute("creationTime", commentElement.attribute("time").getValue());
comment.addAttribute("author", commentElement.attribute("author").getValue());
comment.addAttribute("content", commentElement.element("content").getText());
}
}
for (Node topic : topics) {
for (Node commentNode : commentsList) {
Element commentElement = (Element) commentNode;
Element topicElement = (Element) topic;
if (topicElement.attribute("id").getValue()
.equals(commentElement.attribute("object-id").getValue())) {
Element comment = topicElement.addElement("comments");
comment.addAttribute("creationTime", commentElement.attribute("time").getValue());
comment.addAttribute("author", commentElement.attribute("author").getValue());
comment.addAttribute("content", commentElement.element("content").getText());
}
}
}
}
}
}
// 第一个topic转换为json中的rootTopic
Node rootTopic = root.selectSingleNode("/xmap-content/sheet/topic");
rootTopic.setName("rootTopic");
// 第一个topic转换为json中的rootTopic
List<Node> rootTopics = root.selectNodes("/xmap-content/sheet/topic");
for (Node rootTopic : rootTopics) {
rootTopic.setName("rootTopic");
// 将xml中topic节点转换为attached节点
List<Node> topicList = rootTopic.selectNodes("//topic");
// 将xml中topic节点转换为attached节点
List<Node> topicList = rootTopic.selectNodes("//topic");
for (Node node : topicList) {
node.setName("attached");
}
for (Node node : topicList) {
node.setName("attached");
}
// 选取第一个sheet
Element sheet = root.elements("sheet").get(0);
String res = sheet.asXML();
// 将xml转为json
JSONObject xmlJSONObj = XML.toJSONObject(res);
JSONObject jsonObject = xmlJSONObj.getJSONObject("sheet");
// 设置缩进
return jsonObject.toString(4);
}
}
List<String> sheets = new ArrayList<>();
for (Element sheet : root.elements("sheet")) {
String res = sheet.asXML();
// 将xml转为json
JSONObject xmlJSONObj = XML.toJSONObject(res);
JSONObject jsonObject = xmlJSONObj.getJSONObject("sheet");
sheets.add(jsonObject.toString(4));
}
// 设置缩进
return sheets;
}
}

View File

@ -34,61 +34,68 @@ public class XmindParser {
* @throws ArchiveException
* @throws DocumentException
*/
public static String parseJson(MultipartFile multipartFile) throws IOException, ArchiveException, DocumentException {
public static List<String> parseJson(MultipartFile multipartFile) throws IOException, ArchiveException, DocumentException {
File file = FileUtil.multipartFileToFile(multipartFile);
List<String> contents = null;
String res = null;
if (file == null || !file.exists())
MSException.throwException(Translator.get("incorrect_format"));
String res = ZipUtils.extract(file);
String content = null;
if (isXmindZen(res, file)) {
content = getXmindZenContent(file, res);
} else {
content = getXmindLegacyContent(file, res);
try {
res = ZipUtils.extract(file);
if (isXmindZen(res, file)) {
contents = (getXmindZenContent(file, res));
} else {
contents = getXmindLegacyContent(file, res);
}
} catch (Exception e) {
MSException.throwException(e.getMessage());
} finally {
// 删除生成的文件夹
if (res != null) {
File dir = new File(res);
FileUtil.deleteDir(dir);
}
// 删除零时文件
if (file != null)
file.delete();
}
// 删除生成的文件夹
File dir = new File(res);
FileUtil.deleteDir(dir);
JsonRootBean jsonRootBean = JSON.parseObject(content, JsonRootBean.class);
// 删除零时文件
if (file != null)
file.delete();
String json = (JSON.toJSONString(jsonRootBean, false));
if (StringUtils.isEmpty(content) || content.split("(?:tc:|tc|TC:|TC|tc|TC)").length == 1) {
MSException.throwException(Translator.get("import_xmind_not_found"));
}
if (!StringUtils.isEmpty(content) && content.split("(?:tc:|tc|TC:|TC|tc|TC)").length > 500) {
MSException.throwException(Translator.get("import_xmind_count_error"));
}
return json;
return contents;
}
public static JsonRootBean parseObject(MultipartFile multipartFile) throws DocumentException, ArchiveException, IOException {
String content = parseJson(multipartFile);
JsonRootBean jsonRootBean = JSON.parseObject(content, JsonRootBean.class);
return jsonRootBean;
public static List<JsonRootBean> parseObject(MultipartFile multipartFile) throws DocumentException, ArchiveException, IOException {
List<String> contents = parseJson(multipartFile);
int caseCount = 0;
List<JsonRootBean> jsonRootBeans = new ArrayList<>();
if (contents != null) {
for (String content : contents) {
caseCount += content.split("(?:tc:|tc|TC:|TC|tc|TC)").length;
JsonRootBean jsonRootBean = JSON.parseObject(content, JsonRootBean.class);
jsonRootBeans.add(jsonRootBean);
}
if (caseCount > 500) {
MSException.throwException(Translator.get("import_xmind_count_error"));
}
}
return jsonRootBeans;
}
/**
* @return
*/
public static String getXmindZenContent(File file, String extractFileDir)
public static List<String> getXmindZenContent(File file, String extractFileDir)
throws IOException, ArchiveException {
List<String> keys = new ArrayList<>();
keys.add(xmindZenJson);
Map<String, String> map = ZipUtils.getContents(keys, file, extractFileDir);
String content = map.get(xmindZenJson);
content = XmindZen.getContent(content);
return content;
return XmindZen.getContent(content);
}
/**
* @return
*/
public static String getXmindLegacyContent(File file, String extractFileDir)
public static List<String> getXmindLegacyContent(File file, String extractFileDir)
throws IOException, ArchiveException, DocumentException {
List<String> keys = new ArrayList<>();
keys.add(xmindLegacyContent);
@ -97,7 +104,7 @@ public class XmindParser {
String contentXml = map.get(xmindLegacyContent);
String commentsXml = map.get(xmindLegacyComments);
String xmlContent = XmindLegacy.getContent(contentXml, commentsXml);
List<String> xmlContent = XmindLegacy.getContent(contentXml, commentsXml);
return xmlContent;
}

View File

@ -5,61 +5,68 @@ import com.alibaba.fastjson.JSONObject;
import org.dom4j.DocumentException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
public class XmindZen {
/**
* @param jsonContent
* @return
* @throws IOException
* @throws DocumentException
*/
public static String getContent(String jsonContent) {
JSONObject jsonObject = JSONArray.parseArray(jsonContent).getJSONObject(0);
JSONObject rootTopic = jsonObject.getJSONObject("rootTopic");
transferNotes(rootTopic);
JSONObject children = rootTopic.getJSONObject("children");
recursionChildren(children);
return jsonObject.toString();
}
/**
* @param jsonContent
* @return
* @throws IOException
* @throws DocumentException
*/
public static List<String> getContent(String jsonContent) {
JSONArray jsonArray = JSONArray.parseArray(jsonContent);//.getJSONObject(0);
List<String> contents = new ArrayList<>();
for (int i = 0; i < jsonArray.size(); i++) {
JSONObject jsonObject = (JSONObject) jsonArray.get(i);
JSONObject rootTopic = jsonObject.getJSONObject("rootTopic");
transferNotes(rootTopic);
JSONObject children = rootTopic.getJSONObject("children");
recursionChildren(children);
contents.add(jsonObject.toString());
}
return contents;
}
/**
* 递归转换children
*
* @param children
*/
private static void recursionChildren(JSONObject children) {
if (children == null) {
return;
}
JSONArray attachedArray = children.getJSONArray("attached");
if (attachedArray == null) {
return;
}
for (Object attached : attachedArray) {
JSONObject attachedObject = (JSONObject) attached;
transferNotes(attachedObject);
JSONObject childrenObject = attachedObject.getJSONObject("children");
if (childrenObject == null) {
continue;
}
recursionChildren(childrenObject);
}
}
/**
* 递归转换children
*
* @param children
*/
private static void recursionChildren(JSONObject children) {
if (children == null) {
return;
}
JSONArray attachedArray = children.getJSONArray("attached");
if (attachedArray == null) {
return;
}
for (Object attached : attachedArray) {
JSONObject attachedObject = (JSONObject) attached;
transferNotes(attachedObject);
JSONObject childrenObject = attachedObject.getJSONObject("children");
if (childrenObject == null) {
continue;
}
recursionChildren(childrenObject);
}
}
private static void transferNotes(JSONObject object) {
JSONObject notes = object.getJSONObject("notes");
if (notes == null) {
return;
}
JSONObject plain = notes.getJSONObject("plain");
if (plain != null) {
String content = plain.getString("content");
notes.remove("plain");
notes.put("content", content);
} else {
notes.put("content", null);
}
}
private static void transferNotes(JSONObject object) {
JSONObject notes = object.getJSONObject("notes");
if (notes == null) {
return;
}
JSONObject plain = notes.getJSONObject("plain");
if (plain != null) {
String content = plain.getString("content");
notes.remove("plain");
notes.put("content", content);
} else {
notes.put("content", null);
}
}
}

View File

@ -0,0 +1,3 @@
alter table test_case add review_status varchar(25) null;
update test_case set review_status = 'Prepare' where review_status is null;

View File

@ -158,3 +158,7 @@ license_valid_license_error=Authorization authentication failed
timing_task_result_notification=Timing task result notification
test_review_task_notice=Test review task notice
test_track.length_less_than=The title is too long, the length must be less than
# check owner
check_owner_project=The current user does not have permission to operate this project
check_owner_test=The current user does not have permission to operate this test
upload_content_is_null=Imported content is empty

View File

@ -158,4 +158,7 @@ import_xmind_not_found=未找到测试用例
timing_task_result_notification=定时任务结果通知
test_review_task_notice=测试评审任务通知
test_track.length_less_than=标题过长,字数必须小于
# check owner
check_owner_project=当前用户没有操作此项目的权限
check_owner_test=当前用户没有操作此测试的权限
upload_content_is_null=导入内容为空

View File

@ -158,4 +158,8 @@ import_xmind_count_error=思維導圖導入用例數量不能超過 500 條
import_xmind_not_found=未找到测试用例
timing_task_result_notification=定時任務結果通知
test_review_task_notice=測試評審任務通知
test_track.length_less_than=標題過長,字數必須小於
test_track.length_less_than=標題過長,字數必須小於
# check owner
check_owner_project=當前用戶沒有操作此項目的權限
check_owner_test=當前用戶沒有操作此測試的權限
upload_content_is_null=導入內容為空

View File

@ -32,7 +32,8 @@
"js-base64": "^3.4.4",
"json-bigint": "^1.0.0",
"html2canvas": "^1.0.0-rc.7",
"jspdf": "^2.1.1"
"jspdf": "^2.1.1",
"yan-progress": "^1.0.3"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^4.1.0",

View File

@ -1,5 +1,5 @@
<template>
<div id="menu-bar">
<div id="menu-bar" v-if="isRouterAlive">
<el-row type="flex">
<el-col :span="8">
<el-menu class="header-menu" :unique-opened="true" mode="horizontal" router :default-active='$route.path'>
@ -7,7 +7,7 @@
{{ $t("i18n.home") }}
</el-menu-item>
<el-submenu v-permission="['test_manager','test_user','test_viewer']" index="3">
<el-submenu :class="{'deactivation':!isProjectActivation}" v-permission="['test_manager','test_user','test_viewer']" index="3">
<template v-slot:title>{{ $t('commons.project') }}</template>
<ms-recent-list ref="projectRecent" :options="projectRecent"/>
<el-divider class="menu-divider"/>
@ -21,6 +21,7 @@
<ms-recent-list ref="testRecent" :options="testRecent"/>
<el-divider class="menu-divider"/>
<ms-show-all :index="'/api/test/list/all'"/>
<el-menu-item :index="apiTestProjectPath" class="blank_item"></el-menu-item>
<ms-create-button v-permission="['test_manager','test_user']" :index="'/api/test/create'"
:title="$t('load_test.create')"/>
</el-submenu>
@ -84,7 +85,15 @@ export default {
index: function (item) {
return '/api/report/view/' + item.id;
}
}
},
isProjectActivation: true,
isRouterAlive: true,
apiTestProjectPath: '',
}
},
watch: {
'$route'(to) {
this.init();
}
},
methods: {
@ -98,7 +107,25 @@ export default {
this.$refs.testRecent.recent();
this.$refs.reportRecent.recent();
});
}
},
reload() {
this.isRouterAlive = false;
this.$nextTick(function () {
this.isRouterAlive = true;
});
},
init() {
let path = this.$route.path;
if (path.indexOf("/api/test/list") >= 0 && !!this.$route.params.projectId) {
this.apiTestProjectPath = path;
//
this.isProjectActivation = false;
this.reload();
} else {
this.isProjectActivation = true;
}
},
},
mounted() {
this.registerEvents();
@ -108,12 +135,20 @@ export default {
</script>
<style scoped>
#menu-bar {
border-bottom: 1px solid #E6E6E6;
background-color: #FFF;
}
#menu-bar {
border-bottom: 1px solid #E6E6E6;
background-color: #FFF;
}
.menu-divider {
margin: 0;
}
.menu-divider {
margin: 0;
}
.blank_item {
display: none;
}
.deactivation >>> .el-submenu__title {
border-bottom: white !important;
}
</style>

View File

@ -3,7 +3,7 @@
<template v-slot:header>
<span class="title">{{$t('api_report.title')}}</span>
</template>
<el-table border :data="tableData" class="adjust-table table-content" @row-click="link">
<el-table border :data="tableData" class="adjust-table table-content" @row-click="link" height="300px">
<el-table-column prop="name" :label="$t('commons.name')" width="150" show-overflow-tooltip/>
<el-table-column width="250" :label="$t('commons.create_time')">
<template v-slot:default="scope">

View File

@ -3,7 +3,7 @@
<template v-slot:header>
<span class="title">{{$t('commons.test')}}</span>
</template>
<el-table border :data="tableData" class="adjust-table table-content" @row-click="link">
<el-table border :data="tableData" class="adjust-table table-content" @row-click="link" height="300px">
<el-table-column prop="name" :label="$t('commons.name')" width="150" show-overflow-tooltip/>
<el-table-column prop="projectName" :label="$t('load_test.project_name')" width="150" show-overflow-tooltip/>
<el-table-column width="250" :label="$t('commons.create_time')">

View File

@ -69,7 +69,6 @@ export default {
},
mounted() {
console.log(this.response.headers);
if (!this.response.headers) {
return;
}

View File

@ -30,7 +30,7 @@
</el-form-item>
<el-form-item v-if="useEnvironment || selectedPlatformValue == 'Swagger2'" :label="$t('api_test.environment.environment_config')" prop="environmentId">
<el-select v-if="showEnvironmentSelect" size="small" v-model="formData.environmentId" class="environment-select" clearable>
<el-option v-for="(environment, index) in environments" :key="index" :label="environment.name + ': ' + environment.protocol + '://' + environment.socket" :value="environment.id"/>
<el-option v-for="(environment, index) in environments" :key="index" :label="environment.name" :value="environment.id"/>
<el-button class="environment-button" size="mini" type="primary" @click="openEnvironmentConfig">{{$t('api_test.environment.environment_config')}}</el-button>
<template v-slot:empty>
<div class="empty-environment">
@ -203,6 +203,15 @@
if (this.formData.projectId) {
this.$get('/api/environment/list/' + this.formData.projectId, response => {
this.environments = response.data;
let hasEnvironmentId = false;
this.environments.forEach(env => {
if (env.id === this.formData.environmentId) {
hasEnvironmentId = true;
}
});
if (!hasEnvironmentId) {
this.formData.environmentId = '';
}
});
} else {
this.environments = [];

View File

@ -1170,10 +1170,12 @@ class JMXGenerator {
let domain = request.environment.config.httpConfig.domain;
let validHosts = [];
hosts.forEach(item => {
let d = item.domain.trim().replace("http://", "").replace("https://", "");
if (item && d === domain.trim()) {
item.domain = d; // 域名去掉协议
validHosts.push(item);
if (item.domain != undefined && domain != undefined) {
let d = item.domain.trim().replace("http://", "").replace("https://", "");
if (d === domain.trim()) {
item.domain = d; // 域名去掉协议
validHosts.push(item);
}
}
});
if (validHosts.length > 0) {

View File

@ -41,6 +41,13 @@ router.beforeEach((to, from, next) => {
}
});
//重复点击导航路由报错
const routerPush = VueRouter.prototype.push;
VueRouter.prototype.push = function push(location) {
return routerPush.call(this, location).catch(error => error)
}
// 登入后跳转至原路径
function redirectLoginPath(originPath) {
let redirectUrl = sessionStorage.getItem('redirectUrl');

View File

@ -3,7 +3,7 @@
<template v-slot:header>
<span class="title">{{$t('api_report.title')}}</span>
</template>
<el-table border :data="tableData" class="adjust-table table-content" @row-click="link">
<el-table border :data="tableData" class="adjust-table table-content" @row-click="link" height="300px">
<el-table-column prop="name" :label="$t('commons.name')" width="150" show-overflow-tooltip/>
<el-table-column width="250" :label="$t('commons.create_time')">
<template v-slot:default="scope">

View File

@ -3,7 +3,7 @@
<template v-slot:header>
<span class="title">{{$t('commons.test')}}</span>
</template>
<el-table border :data="tableData" class="adjust-table table-content" @row-click="link">
<el-table border :data="tableData" class="adjust-table table-content" @row-click="link" height="300px">
<el-table-column prop="name" :label="$t('commons.name')" width="150" show-overflow-tooltip/>
<el-table-column prop="projectName" :label="$t('load_test.project_name')" width="150" show-overflow-tooltip/>
<el-table-column width="250" :label="$t('commons.create_time')">

View File

@ -39,8 +39,7 @@
:disabled="!row.edit || readOnly"
size="mini"
v-model="row.enable"
active-color="#13ce66"
inactive-color="#ff4949">
inactive-color="#DCDFE6">
</el-switch>
</template>
</el-table-column>

View File

@ -37,8 +37,7 @@
<el-table-column prop="status" :label="$t('commons.status')">
<template v-slot:default="scope">
<el-switch v-model="scope.row.status"
active-color="#13ce66"
inactive-color="#ff4949"
inactive-color="#DCDFE6"
active-value="ACTIVE"
inactive-value="DISABLED"
@change="changeSwitch(scope.row)"

View File

@ -16,8 +16,7 @@
<el-table-column prop="status" :label="$t('test_resource_pool.enable_disable')">
<template v-slot:default="scope">
<el-switch v-model="scope.row.status"
active-color="#13ce66"
inactive-color="#ff4949"
inactive-color="#DCDFE6"
active-value="VALID"
inactive-value="INVALID"
@change="changeSwitch(scope.row)"

View File

@ -19,8 +19,7 @@
<el-table-column prop="status" :label="$t('commons.status')" width="120">
<template v-slot:default="scope">
<el-switch v-model="scope.row.status"
active-color="#13ce66"
inactive-color="#ff4949"
inactive-color="#DCDFE6"
active-value="1"
inactive-value="0"
@change="changeSwitch(scope.row)"

View File

@ -86,6 +86,18 @@
<method-table-item :value="scope.row.method"/>
</template>
</el-table-column>
<el-table-column
:filters="statusFilters"
column-key="status"
:label="$t('test_track.case.status')">
<template v-slot:default="scope">
<span class="el-dropdown-link">
<status-table-item :value="scope.row.reviewStatus"/>
</span>
</template>
</el-table-column>
<el-table-column
prop="nodePath"
:label="$t('test_track.case.module')"
@ -146,6 +158,7 @@
import BatchEdit from "./BatchEdit";
import {WORKSPACE_ID} from "../../../../../common/js/constants";
import {LIST_CHANGE, TrackEvent} from "@/business/components/common/head/ListEvent";
import StatusTableItem from "@/business/components/track/common/tableItems/planview/StatusTableItem";
export default {
name: "TestCaseList",
@ -163,7 +176,8 @@
NodeBreadcrumb,
MsTableHeader,
ShowMoreBtn,
BatchEdit
BatchEdit,
StatusTableItem
},
data() {
return {
@ -192,6 +206,11 @@
{text: this.$t('commons.performance'), value: 'performance'},
{text: this.$t('commons.api'), value: 'api'}
],
statusFilters: [
{text: this.$t('test_track.plan.plan_status_prepare'), value: 'Prepare'},
{text: this.$t('test_track.plan_view.pass'), value: 'Pass'},
{text: '未通过', value: 'UnPass'},
],
showMore: false,
buttons: [
{

View File

@ -5,7 +5,7 @@
border
:data="tableData"
@row-click="intoPlan"
v-loading="result.loading">
v-loading="result.loading" height="300px">
<el-table-column
prop="name"
fixed

View File

@ -14,7 +14,7 @@
border
:data="tableData"
@row-click="intoPlan"
v-loading="result.loading">
v-loading="result.loading" height="300px">
<el-table-column
prop="name"
fixed
@ -36,31 +36,37 @@
<el-table-column
prop="status"
:label="$t('test_track.plan.plan_status')"
show-overflow-tooltip>
:label="$t('test_track.plan.plan_status')">
<template v-slot:default="scope">
<plan-status-table-item :value="scope.row.status"/>
</template>
</el-table-column>
<el-table-column
prop="projectName"
:label="$t('test_track.review.done')"
show-overflow-tooltip>
:label="$t('test_track.review.result_distribution')">
<template v-slot:default="scope">
{{scope.row.reviewed}}/{{scope.row.total}}
<yan-progress :total="scope.row.total" :done="scope.row.reviewed" :modify="scope.row.pass" :tip="tip"/>
</template>
</el-table-column>
<el-table-column
prop="projectName"
:label="$t('test_track.home.review_progress')"
min-width="100"
show-overflow-tooltip>
<template v-slot:default="scope">
<el-progress :percentage="scope.row.testRate"></el-progress>
</template>
</el-table-column>
<!-- <el-table-column-->
<!-- prop="projectName"-->
<!-- :label="$t('test_track.review.done')"-->
<!-- show-overflow-tooltip>-->
<!-- <template v-slot:default="scope">-->
<!-- {{scope.row.reviewed}}/{{scope.row.total}}-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column-->
<!-- prop="projectName"-->
<!-- :label="$t('test_track.home.review_progress')"-->
<!-- min-width="100"-->
<!-- show-overflow-tooltip>-->
<!-- <template v-slot:default="scope">-->
<!-- <el-progress :percentage="scope.row.testRate"></el-progress>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column
prop="projectName"
@ -87,7 +93,12 @@ export default {
return {
result: {},
tableData: [],
showMyCreator: false
showMyCreator: false,
tip: [
{text: "总共X个", fillStyle: '#D3D3D3'},
{text: "评审了X个", fillStyle: '#F08080'},
{text: "通过X个", fillStyle: '#90EE90'}
]
}
},
mounted() {
@ -115,7 +126,7 @@ export default {
},
searchMyCreator() {
this.showMyCreator = !this.showMyCreator;
if (this.showMyCreator){
if (this.showMyCreator) {
this.initTableData("creator");
} else {
this.initTableData("reviewer");

View File

@ -8,7 +8,7 @@
class="adjust-table"
@row-click="editTestCase"
:data="tableData"
v-loading="result.loading">
v-loading="result.loading" height="300px">
<el-table-column
prop="name"

View File

@ -62,6 +62,15 @@
<type-table-item :value="scope.row.type"/>
</template>
</el-table-column>
<el-table-column
:filters="statusFilters"
column-key="status"
:label="$t('test_track.case.status')"
show-overflow-tooltip>
<template v-slot:default="scope">
<status-table-item :value="scope.row.reviewStatus"/>
</template>
</el-table-column>
</el-table>
<div style="text-align: center"> {{testReviews.length}} </div>
</el-main>
@ -91,6 +100,7 @@ import MsTableHeader from "../../../../common/components/MsTableHeader";
import SwitchProject from "../../../case/components/SwitchProject";
import {TEST_CASE_CONFIGS} from "../../../../common/components/search/search-components";
import {_filter} from "../../../../../../common/js/utils";
import StatusTableItem from "@/business/components/track/common/tableItems/planview/StatusTableItem";
export default {
name: "TestReviewRelevance",
@ -102,7 +112,8 @@ export default {
MsTableSearchBar,
MsTableAdvSearchBar,
MsTableHeader,
SwitchProject
SwitchProject,
StatusTableItem
},
data() {
return {
@ -130,7 +141,12 @@ export default {
{text: this.$t('commons.functional'), value: 'functional'},
{text: this.$t('commons.performance'), value: 'performance'},
{text: this.$t('commons.api'), value: 'api'}
]
],
statusFilters: [
{text: this.$t('test_track.case.status_prepare'), value: 'Prepare'},
{text: this.$t('test_track.case.status_pass'), value: 'Pass'},
{text: this.$t('test_track.case.status_un_pass'), value: 'UnPass'},
],
};
},
props: {

View File

@ -283,6 +283,7 @@ export default {
saveCase(status) {
let param = {};
param.id = this.testCase.id;
param.caseId = this.testCase.caseId;
param.reviewId = this.testCase.reviewId;
param.status = status;
this.$post('/test/review/case/edit', param, () => {

View File

@ -104,13 +104,12 @@
</el-table-column>
<el-table-column
prop="status"
:filters="statusFilters"
column-key="status"
:label="$t('test_track.review_view.execute_result')">
<template v-slot:default="scope">
<span class="el-dropdown-link">
<status-table-item :value="scope.row.status"/>
<status-table-item :value="scope.row.reviewStatus"/>
</span>
</template>
</el-table-column>
@ -207,9 +206,9 @@ export default {
{text: this.$t('commons.api'), value: 'api'}
],
statusFilters: [
{text: this.$t('test_track.plan.plan_status_prepare'), value: 'Prepare'},
{text: this.$t('test_track.plan_view.pass'), value: 'Pass'},
{text: '未通过', value: 'UnPass'},
{text: this.$t('test_track.case.status_prepare'), value: 'Prepare'},
{text: this.$t('test_track.case.status_pass'), value: 'Pass'},
{text: this.$t('test_track.case.status_un_pass'), value: 'UnPass'},
],
showMore: false,
buttons: [

View File

@ -7,6 +7,7 @@ import ajax from "../common/js/ajax";
import App from './App.vue';
import message from "../common/js/message";
import router from "./components/common/router/router";
import YanProgress from 'yan-progress';
import './permission' // permission control
import i18n from "../i18n/i18n";
import store from "./store";
@ -28,6 +29,7 @@ Vue.use(chart);
Vue.use(CalendarHeatmap);
Vue.use(message);
Vue.use(CKEditor);
Vue.use(YanProgress)
// v-permission
Vue.directive('permission', permission);

View File

@ -53,6 +53,10 @@ export default {
login();
return;
}
if (error.response && error.response.status === 403) {
window.location.href = "/";
return;
}
result.loading = false;
window.console.error(error.response || error.message);
if (error.response && error.response.data) {

View File

@ -712,6 +712,10 @@ export default {
batch_delete_case: 'Batch delete',
batch_unlink: 'Batch Unlink',
project_name: "Project",
status: 'Status',
status_prepare: 'Prepare',
status_pass: 'Pass',
status_un_pass: 'UnPass',
import: {
import: "Import test case",
case_import: "Import test case",
@ -757,6 +761,10 @@ export default {
plan_status_prepare: "Not started",
plan_status_running: "Starting",
plan_status_completed: "Completed",
planned_start_time: "Scheduled Start Time",
planned_end_time: "Scheduled End Time",
actual_start_time: "Actual Start Time",
actual_end_time: "Actual End Time",
plan_delete_confirm: "All use cases under this plan will be deleted,confirm delete test plan: ",
plan_delete: "Delete test plan",
},
@ -782,7 +790,8 @@ export default {
my_create: "My Create",
reviewed_by_me: "Review By Me",
creator: "Creator",
done: "Commented use cases"
done: "Commented use cases",
result_distribution: "Result Distribution"
},
comment: {
no_comment: "No Comment",

View File

@ -714,6 +714,10 @@ export default {
batch_delete_case: '批量删除用例',
batch_unlink: '批量取消关联',
project_name: '所属项目',
status: '状态',
status_prepare: '未开始',
status_pass: '通过',
status_un_pass: '未通过',
import: {
import: "导入用例",
case_import: "导入测试用例",
@ -788,7 +792,8 @@ export default {
my_create: "我创建的评审",
reviewed_by_me: "待我评审",
creator: "创建人",
done: "已评用例"
done: "已评用例",
result_distribution: "结果分布"
},
comment: {
no_comment: "暂无评论",
@ -802,7 +807,7 @@ export default {
all_case: "全部用例",
start_review: "开始评审",
relevance_case: "关联用例",
execute_result: "执行结果",
execute_result: "评审结果",
},
module: {
search: "搜索模块",

View File

@ -470,9 +470,9 @@ export default {
input_url: "請輸入請求URL",
input_path: "請輸入請求路徑",
name: "請求名稱",
content_type: "請求類型",
method: "請求方法",
url: "請求URL",
content_type: "請求類型",
path: "請求路徑",
address: "請求地址",
refer_to_environment: "引用環境",
@ -714,6 +714,10 @@ export default {
batch_delete_case: '批量刪除用例',
batch_unlink: '批量取消關聯',
project_name: '所屬項目',
status: '狀態',
status_prepare: '未開始',
status_pass: '通過',
status_un_pass: '未通過',
import: {
import: "導入用例",
case_import: "導入測試用例",
@ -759,6 +763,10 @@ export default {
plan_status_prepare: "未開始",
plan_status_running: "進行中",
plan_status_completed: "已完成",
planned_start_time: "計劃開始",
planned_end_time: "計劃結束",
actual_start_time: "實際開始",
actual_end_time: "實際結束",
plan_delete_confirm: "將刪除該測試計劃下所有用例,確認刪除測試計劃: ",
plan_delete: "刪除計劃",
},
@ -784,7 +792,8 @@ export default {
my_create: "我創建的評審",
reviewed_by_me: "待我評審",
creator: "創建人",
done: "已評用例"
done: "已評用例",
result_distribution: "結果分佈"
},
comment: {
no_comment: "暫無評論",
@ -798,7 +807,7 @@ export default {
all_case: "全部用例",
start_review: "開始評審",
relevance_case: "關聯用例",
execute_result: "執行結果",
execute_result: "評審結果",
},
module: {
search: "搜索模塊",