build: 保留工具相关的代码在SDK中

This commit is contained in:
CaptainB 2023-09-15 14:38:50 +08:00 committed by 刘瑞斌
parent 9522889ece
commit 2f9640750d
293 changed files with 1077 additions and 1043 deletions

View File

@ -2,7 +2,7 @@ package io.metersphere.listener;
import io.metersphere.api.event.APIEventSource;
import io.metersphere.plan.listener.ExecEventListener;
import io.metersphere.sdk.service.PluginLoadService;
import io.metersphere.system.service.PluginLoadService;
import io.metersphere.sdk.util.CommonBeanFactory;
import io.metersphere.sdk.util.LogUtils;
import jakarta.annotation.Resource;

View File

@ -407,17 +407,6 @@
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-maven-plugin</artifactId>

View File

@ -1,4 +1,4 @@
package io.metersphere.sdk.controller.handler.result;
package io.metersphere.sdk.exception;
import io.metersphere.sdk.util.Translator;

View File

@ -1,6 +1,5 @@
package io.metersphere.sdk.exception;
import io.metersphere.sdk.controller.handler.result.IResultCode;
import org.apache.commons.lang3.StringUtils;
public class MSException extends RuntimeException {

View File

@ -1,4 +0,0 @@
package io.metersphere.sdk.mapper;
public interface BaseMapper {
}

View File

@ -1,9 +0,0 @@
package io.metersphere.sdk.notice.sender;
import io.metersphere.sdk.notice.MessageDetail;
import io.metersphere.sdk.notice.NoticeModel;
public interface NoticeSender {
void send(MessageDetail messageDetail, NoticeModel noticeModel);
}

View File

@ -1,18 +0,0 @@
package io.metersphere.sdk.uid.worker;
/**
* Represents a worker id assigner for {@link io.metersphere.sdk.uid.impl.DefaultUidGenerator}
*
*/
public interface WorkerIdAssigner {
/**
* Assign worker id for {@link io.metersphere.sdk.uid.impl.DefaultUidGenerator}
*
* @return assigned worker id
*/
long assignWorkerId();
}

View File

@ -18,6 +18,24 @@
<artifactId>metersphere-sdk</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>io.metersphere</groupId>
<artifactId>metersphere-system-setting</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>io.metersphere</groupId>
<artifactId>metersphere-system-setting</artifactId>
<version>${revision}</version>
<classifier>tests</classifier>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.metersphere</groupId>
<artifactId>metersphere-project-management</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>org.apache.jmeter</groupId>
<artifactId>ApacheJMeter_components</artifactId>

View File

@ -4,8 +4,8 @@ import io.metersphere.api.dto.definition.ApiDefinitionDTO;
import io.metersphere.api.service.APIDefinitionLogService;
import io.metersphere.api.service.APIDefinitionService;
import io.metersphere.sdk.constants.PermissionConstants;
import io.metersphere.sdk.log.annotation.Log;
import io.metersphere.sdk.log.constants.OperationLogType;
import io.metersphere.system.log.annotation.Log;
import io.metersphere.system.log.constants.OperationLogType;
import io.metersphere.validation.groups.Created;
import io.metersphere.validation.groups.Updated;
import jakarta.annotation.Resource;

View File

@ -6,9 +6,9 @@ import io.metersphere.api.dto.definition.ApiDefinitionDTO;
import io.metersphere.api.mapper.ApiDefinitionMapper;
import io.metersphere.sdk.constants.HttpMethodConstants;
import io.metersphere.sdk.dto.LogDTO;
import io.metersphere.sdk.log.constants.OperationLogModule;
import io.metersphere.sdk.log.constants.OperationLogType;
import io.metersphere.sdk.util.JSON;
import io.metersphere.system.log.constants.OperationLogModule;
import io.metersphere.system.log.constants.OperationLogType;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
@ -126,6 +126,7 @@ public class APIDefinitionLogService {
/**
* 批量更新接口日志
*
* @return
*/
public List<LogDTO> batchUpdateLog(List<String> ids) {

View File

@ -1,7 +1,7 @@
package io.metersphere.api.service;
import io.metersphere.sdk.service.CleanupProjectResourceService;
import io.metersphere.sdk.util.LogUtils;
import io.metersphere.system.service.CleanupProjectResourceService;
import org.springframework.stereotype.Component;
@Component

View File

@ -19,7 +19,7 @@ import org.springframework.context.annotation.ComponentScan;
MinioProperties.class
})
@ServletComponentScan
@ComponentScan(basePackages = {"io.metersphere.sdk", "io.metersphere.api"})
@ComponentScan(basePackages = {"io.metersphere.sdk", "io.metersphere.api", "io.metersphere.system"})
public class Application {
public static void main(String[] args) {

View File

@ -4,12 +4,12 @@ import io.metersphere.api.dto.jmeter.processors.MSJSR223Processor;
import io.metersphere.api.dto.jmeter.sampler.MSDebugSampler;
import io.metersphere.api.util.JSONUtils;
import io.metersphere.plugin.api.dto.TestElementDTO;
import io.metersphere.system.uid.UUID;
import org.junit.jupiter.api.*;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
import java.util.LinkedList;
import io.metersphere.sdk.uid.UUID;
@SpringBootTest

View File

@ -8,6 +8,6 @@ embedded.mysql.collation=utf8mb4_general_ci
# redis
embedded.redis.enabled=true
# kafka
embedded.kafka.enabled=false
embedded.kafka.enabled=true
# minio
embedded.minio.enabled=true

View File

@ -18,7 +18,16 @@
<artifactId>metersphere-sdk</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>io.metersphere</groupId>
<artifactId>metersphere-system-setting</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>io.metersphere</groupId>
<artifactId>metersphere-project-management</artifactId>
<version>${revision}</version>
</dependency>
</dependencies>

View File

@ -1,6 +1,7 @@
package io.metersphere.bug.controller.result;
import io.metersphere.sdk.controller.handler.result.IResultCode;
import io.metersphere.sdk.exception.IResultCode;
public enum BugMgtResultCode implements IResultCode {

View File

@ -1,6 +1,6 @@
package io.metersphere.bug.service;
import io.metersphere.sdk.service.CleanupProjectResourceService;
import io.metersphere.system.service.CleanupProjectResourceService;
import io.metersphere.sdk.util.LogUtils;
import org.springframework.stereotype.Component;

View File

@ -19,7 +19,7 @@ import org.springframework.context.annotation.ComponentScan;
MinioProperties.class
})
@ServletComponentScan
@ComponentScan(basePackages = {"io.metersphere.sdk", "io.metersphere.bug"})
@ComponentScan(basePackages = {"io.metersphere.sdk", "io.metersphere.bug", "io.metersphere.system"})
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);

View File

@ -4,6 +4,7 @@ import com.jayway.jsonpath.JsonPath;
import io.metersphere.bug.domain.Bug;
import io.metersphere.sdk.constants.SessionConstants;
import io.metersphere.sdk.util.JSON;
import io.metersphere.system.uid.UUID;
import jakarta.annotation.Resource;
import org.junit.jupiter.api.MethodOrderer;
import org.junit.jupiter.api.Order;
@ -16,9 +17,6 @@ import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.MvcResult;
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
import io.metersphere.sdk.uid.UUID;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;
@ -68,33 +66,33 @@ public class BugControllerTest {
bug.setSourceId(UUID.randomUUID().toString());
mockMvc.perform(
MockMvcRequestBuilders.post("/bug/add")
.header(SessionConstants.HEADER_TOKEN, sessionId)
.header(SessionConstants.CSRF_TOKEN, csrfToken)
.content(JSON.toJSONString(bug))
.contentType(MediaType.APPLICATION_JSON))
MockMvcRequestBuilders.post("/bug/add")
.header(SessionConstants.HEADER_TOKEN, sessionId)
.header(SessionConstants.CSRF_TOKEN, csrfToken)
.content(JSON.toJSONString(bug))
.contentType(MediaType.APPLICATION_JSON))
// 检查状态
.andExpect(status().isOk())
// 检查响应头
.andExpect(content().contentType(MediaType.APPLICATION_JSON))
// 检查数据
.andExpect(jsonPath("$.data.title").value("test"))
;
;
// 缺陷已存在校验
mockMvc.perform(
MockMvcRequestBuilders.post("/bug/add")
.header(SessionConstants.HEADER_TOKEN, sessionId)
.header(SessionConstants.CSRF_TOKEN, csrfToken)
.content(JSON.toJSONString(bug))
.contentType(MediaType.APPLICATION_JSON))
MockMvcRequestBuilders.post("/bug/add")
.header(SessionConstants.HEADER_TOKEN, sessionId)
.header(SessionConstants.CSRF_TOKEN, csrfToken)
.content(JSON.toJSONString(bug))
.contentType(MediaType.APPLICATION_JSON))
// 检查失败状态码
.andExpect(status().is5xxServerError())
// 检查响应头
.andExpect(content().contentType(MediaType.APPLICATION_JSON))
// 检查业务状态码
.andExpect(jsonPath("$.code").value(108001))
;
;
}
@Test

View File

@ -8,6 +8,6 @@ embedded.mysql.collation=utf8mb4_general_ci
# redis
embedded.redis.enabled=true
# kafka
embedded.kafka.enabled=false
embedded.kafka.enabled=true
# minio
embedded.minio.enabled=true

View File

@ -18,7 +18,16 @@
<artifactId>metersphere-sdk</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>io.metersphere</groupId>
<artifactId>metersphere-system-setting</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>io.metersphere</groupId>
<artifactId>metersphere-project-management</artifactId>
<version>${revision}</version>
</dependency>
</dependencies>
<build>

View File

@ -1,6 +1,6 @@
package io.metersphere.functional.service;
import io.metersphere.sdk.service.CleanupProjectResourceService;
import io.metersphere.system.service.CleanupProjectResourceService;
import io.metersphere.sdk.util.LogUtils;
import org.springframework.stereotype.Component;

View File

@ -20,7 +20,7 @@ import org.springframework.context.annotation.ComponentScan;
MinioProperties.class
})
@ServletComponentScan
@ComponentScan(basePackages = {"io.metersphere.sdk", "io.metersphere.functional"})
@ComponentScan(basePackages = {"io.metersphere.sdk", "io.metersphere.functional", "io.metersphere.system"})
public class Application {
public static void main(String[] args) {

View File

@ -8,6 +8,6 @@ embedded.mysql.collation=utf8mb4_general_ci
# redis
embedded.redis.enabled=true
# kafka
embedded.kafka.enabled=false
embedded.kafka.enabled=true
# minio
embedded.minio.enabled=true

View File

@ -18,7 +18,16 @@
<artifactId>metersphere-sdk</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>io.metersphere</groupId>
<artifactId>metersphere-system-setting</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>io.metersphere</groupId>
<artifactId>metersphere-project-management</artifactId>
<version>${revision}</version>
</dependency>
</dependencies>

View File

@ -21,7 +21,7 @@
<dependency>
<groupId>io.metersphere</groupId>
<artifactId>metersphere-sdk</artifactId>
<artifactId>metersphere-system-setting</artifactId>
<version>${revision}</version>
<classifier>tests</classifier>
<type>test-jar</type>

View File

@ -3,7 +3,7 @@ package io.metersphere.project.controller;
import io.metersphere.project.dto.MessageTaskDTO;
import io.metersphere.project.service.NoticeMessageTaskService;
import io.metersphere.sdk.controller.handler.ResultHolder;
import io.metersphere.system.controller.handler.ResultHolder;
import io.metersphere.sdk.dto.request.MessageTaskRequest;
import io.metersphere.sdk.util.SessionUtils;
import io.metersphere.validation.groups.Created;

View File

@ -5,8 +5,8 @@ import io.metersphere.project.request.ProjectApplicationRequest;
import io.metersphere.project.service.ProjectApplicationService;
import io.metersphere.sdk.constants.PermissionConstants;
import io.metersphere.sdk.dto.OptionDTO;
import io.metersphere.sdk.log.annotation.Log;
import io.metersphere.sdk.log.constants.OperationLogType;
import io.metersphere.system.log.annotation.Log;
import io.metersphere.system.log.constants.OperationLogType;
import io.metersphere.sdk.util.SessionUtils;
import io.metersphere.system.domain.User;
import io.metersphere.validation.groups.Updated;

View File

@ -4,9 +4,9 @@ package io.metersphere.project.controller;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import io.metersphere.sdk.constants.PermissionConstants;
import io.metersphere.sdk.log.service.OperationLogService;
import io.metersphere.sdk.log.vo.OperationLogRequest;
import io.metersphere.sdk.log.vo.OperationLogResponse;
import io.metersphere.system.log.service.OperationLogService;
import io.metersphere.system.log.vo.OperationLogRequest;
import io.metersphere.system.log.vo.OperationLogResponse;
import io.metersphere.sdk.util.PageUtils;
import io.metersphere.sdk.util.Pager;
import io.metersphere.sdk.util.SessionUtils;

View File

@ -13,8 +13,8 @@ import io.metersphere.sdk.constants.PermissionConstants;
import io.metersphere.sdk.dto.PermissionDefinitionItem;
import io.metersphere.sdk.dto.UserExtend;
import io.metersphere.sdk.dto.request.PermissionSettingUpdateRequest;
import io.metersphere.sdk.log.annotation.Log;
import io.metersphere.sdk.log.constants.OperationLogType;
import io.metersphere.system.log.annotation.Log;
import io.metersphere.system.log.constants.OperationLogType;
import io.metersphere.sdk.util.BeanUtils;
import io.metersphere.sdk.util.PageUtils;
import io.metersphere.sdk.util.Pager;

View File

@ -1,6 +1,6 @@
package io.metersphere.project.enums.result;
import io.metersphere.sdk.controller.handler.result.IResultCode;
import io.metersphere.sdk.exception.IResultCode;
/**
* @author guoyuqi

View File

@ -1,6 +1,6 @@
package io.metersphere.project.job;
import io.metersphere.sdk.sechedule.BaseScheduleJob;
import io.metersphere.system.sechedule.BaseScheduleJob;
import org.quartz.JobExecutionContext;
import org.quartz.JobKey;
import org.quartz.TriggerKey;

View File

@ -37,7 +37,7 @@
<choose>
<when test="key == 'roleIds'">
and urr.role_id in
<include refid="io.metersphere.sdk.mapper.BaseMapper.filterInWrapper"/>
<include refid="io.metersphere.system.mapper.BaseMapper.filterInWrapper"/>
</when>
</choose>
</if>

View File

@ -5,7 +5,7 @@ import io.metersphere.sdk.domain.ProjectParametersExample;
import io.metersphere.sdk.mapper.EnvironmentBlobMapper;
import io.metersphere.sdk.mapper.EnvironmentMapper;
import io.metersphere.sdk.mapper.ProjectParametersMapper;
import io.metersphere.sdk.service.CleanupProjectResourceService;
import io.metersphere.system.service.CleanupProjectResourceService;
import io.metersphere.sdk.util.LogUtils;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Component;

View File

@ -2,7 +2,7 @@ package io.metersphere.project.service;
import io.metersphere.project.domain.ProjectRobotExample;
import io.metersphere.project.mapper.ProjectRobotMapper;
import io.metersphere.sdk.service.CleanupProjectResourceService;
import io.metersphere.system.service.CleanupProjectResourceService;
import io.metersphere.sdk.util.LogUtils;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Component;

View File

@ -3,8 +3,8 @@ package io.metersphere.project.service;
import io.metersphere.project.domain.ProjectRobot;
import io.metersphere.project.enums.ProjectRobotPlatform;
import io.metersphere.project.mapper.ProjectRobotMapper;
import io.metersphere.sdk.service.CreateProjectResourceService;
import io.metersphere.sdk.uid.UUID;
import io.metersphere.system.service.CreateProjectResourceService;
import io.metersphere.system.uid.UUID;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Component;

View File

@ -10,10 +10,10 @@ import io.metersphere.project.mapper.MessageTaskBlobMapper;
import io.metersphere.project.mapper.MessageTaskMapper;
import io.metersphere.project.mapper.ProjectMapper;
import io.metersphere.project.mapper.ProjectRobotMapper;
import io.metersphere.sdk.controller.handler.ResultHolder;
import io.metersphere.system.controller.handler.ResultHolder;
import io.metersphere.sdk.dto.request.MessageTaskRequest;
import io.metersphere.sdk.exception.MSException;
import io.metersphere.sdk.uid.UUID;
import io.metersphere.system.uid.UUID;
import io.metersphere.sdk.util.Translator;
import io.metersphere.system.domain.User;
import io.metersphere.system.domain.UserRoleRelation;

View File

@ -13,12 +13,12 @@ import io.metersphere.sdk.constants.ProjectApplicationType;
import io.metersphere.sdk.constants.ScheduleType;
import io.metersphere.sdk.dto.LogDTO;
import io.metersphere.sdk.dto.OptionDTO;
import io.metersphere.sdk.log.constants.OperationLogModule;
import io.metersphere.sdk.log.constants.OperationLogType;
import io.metersphere.sdk.sechedule.BaseScheduleService;
import io.metersphere.sdk.service.PluginLoadService;
import io.metersphere.system.log.constants.OperationLogModule;
import io.metersphere.system.log.constants.OperationLogType;
import io.metersphere.system.sechedule.BaseScheduleService;
import io.metersphere.system.service.PluginLoadService;
import io.metersphere.sdk.util.JSON;
import io.metersphere.sdk.util.ServiceUtils;
import io.metersphere.system.utils.ServiceUtils;
import io.metersphere.sdk.util.SessionUtils;
import io.metersphere.system.domain.*;
import io.metersphere.system.mapper.ExtPluginMapper;

View File

@ -15,10 +15,10 @@ import io.metersphere.sdk.dto.LogDTO;
import io.metersphere.sdk.dto.OptionDTO;
import io.metersphere.sdk.dto.UserExtend;
import io.metersphere.sdk.exception.MSException;
import io.metersphere.sdk.log.constants.OperationLogModule;
import io.metersphere.sdk.log.constants.OperationLogType;
import io.metersphere.sdk.log.service.OperationLogService;
import io.metersphere.sdk.uid.UUID;
import io.metersphere.system.log.constants.OperationLogModule;
import io.metersphere.system.log.constants.OperationLogType;
import io.metersphere.system.log.service.OperationLogService;
import io.metersphere.system.uid.UUID;
import io.metersphere.sdk.util.BeanUtils;
import io.metersphere.sdk.util.JSON;
import io.metersphere.sdk.util.Translator;

View File

@ -17,7 +17,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import io.metersphere.sdk.uid.UUID;
import io.metersphere.system.uid.UUID;
@Service
@Transactional

View File

@ -10,7 +10,7 @@ import io.metersphere.sdk.dto.ProjectExtendDTO;
import io.metersphere.sdk.dto.SessionUser;
import io.metersphere.sdk.dto.UserDTO;
import io.metersphere.sdk.exception.MSException;
import io.metersphere.sdk.service.BaseUserService;
import io.metersphere.system.service.BaseUserService;
import io.metersphere.sdk.util.BeanUtils;
import io.metersphere.sdk.util.JSON;
import io.metersphere.sdk.util.SessionUtils;

View File

@ -7,8 +7,8 @@ import io.metersphere.project.request.ProjectUserRoleMemberEditRequest;
import io.metersphere.sdk.constants.OperationLogConstants;
import io.metersphere.sdk.dto.LogDTO;
import io.metersphere.sdk.dto.request.PermissionSettingUpdateRequest;
import io.metersphere.sdk.log.constants.OperationLogModule;
import io.metersphere.sdk.log.constants.OperationLogType;
import io.metersphere.system.log.constants.OperationLogModule;
import io.metersphere.system.log.constants.OperationLogType;
import io.metersphere.sdk.util.JSON;
import io.metersphere.system.domain.UserRole;
import io.metersphere.system.domain.UserRoleExample;

View File

@ -11,8 +11,8 @@ import io.metersphere.sdk.dto.PermissionDefinitionItem;
import io.metersphere.sdk.dto.UserExtend;
import io.metersphere.sdk.dto.request.PermissionSettingUpdateRequest;
import io.metersphere.sdk.exception.MSException;
import io.metersphere.sdk.service.BaseUserRoleService;
import io.metersphere.sdk.uid.UUID;
import io.metersphere.system.service.BaseUserRoleService;
import io.metersphere.system.uid.UUID;
import io.metersphere.sdk.util.BeanUtils;
import io.metersphere.sdk.util.Translator;
import io.metersphere.system.domain.*;

View File

@ -1,7 +1,7 @@
package io.metersphere.project.controller;
import io.metersphere.project.service.CleanupEnvironmentResourceService;
import io.metersphere.sdk.invoker.ProjectServiceInvoker;
import io.metersphere.system.invoker.ProjectServiceInvoker;
import jakarta.annotation.Resource;
import org.junit.jupiter.api.MethodOrderer;
import org.junit.jupiter.api.Order;

View File

@ -3,11 +3,11 @@ package io.metersphere.project.controller;
import io.metersphere.project.domain.ProjectRobot;
import io.metersphere.project.request.ProjectRobotRequest;
import io.metersphere.project.service.CleanupRobotResourceService;
import io.metersphere.sdk.base.BaseTest;
import io.metersphere.sdk.constants.SessionConstants;
import io.metersphere.sdk.controller.handler.ResultHolder;
import io.metersphere.sdk.util.JSON;
import io.metersphere.sdk.util.Pager;
import io.metersphere.system.base.BaseTest;
import io.metersphere.system.controller.handler.ResultHolder;
import jakarta.annotation.Resource;
import org.apache.commons.collections.CollectionUtils;
import org.junit.jupiter.api.*;

View File

@ -2,12 +2,12 @@ package io.metersphere.project.controller;
import io.metersphere.project.domain.ProjectRobot;
import io.metersphere.project.request.ProjectRobotRequest;
import io.metersphere.sdk.base.BaseTest;
import io.metersphere.sdk.constants.SessionConstants;
import io.metersphere.sdk.controller.handler.ResultHolder;
import io.metersphere.sdk.invoker.ProjectServiceInvoker;
import io.metersphere.sdk.util.JSON;
import io.metersphere.sdk.util.Pager;
import io.metersphere.system.base.BaseTest;
import io.metersphere.system.controller.handler.ResultHolder;
import io.metersphere.system.invoker.ProjectServiceInvoker;
import org.junit.jupiter.api.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;

View File

@ -1,6 +1,6 @@
package io.metersphere.project.controller;
import io.metersphere.sdk.base.BaseTest;
import io.metersphere.system.base.BaseTest;
import org.junit.jupiter.api.MethodOrderer;
import org.junit.jupiter.api.TestMethodOrder;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;

View File

@ -1,10 +1,8 @@
package io.metersphere.project.controller;
import io.metersphere.sdk.base.BaseTest;
import io.metersphere.sdk.constants.PermissionConstants;
import io.metersphere.sdk.constants.SessionConstants;
import io.metersphere.sdk.constants.VariableTypeConstants;
import io.metersphere.sdk.controller.handler.ResultHolder;
import io.metersphere.sdk.domain.ProjectParameters;
import io.metersphere.sdk.domain.ProjectParametersExample;
import io.metersphere.sdk.dto.environment.GlobalParamsDTO;
@ -13,6 +11,8 @@ import io.metersphere.sdk.dto.environment.KeyValue;
import io.metersphere.sdk.dto.environment.variables.CommonVariables;
import io.metersphere.sdk.mapper.ProjectParametersMapper;
import io.metersphere.sdk.util.JSON;
import io.metersphere.system.base.BaseTest;
import io.metersphere.system.controller.handler.ResultHolder;
import jakarta.annotation.Resource;
import org.junit.jupiter.api.*;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;

View File

@ -5,12 +5,12 @@ import io.metersphere.project.domain.MessageTask;
import io.metersphere.project.domain.MessageTaskExample;
import io.metersphere.project.dto.MessageTaskDTO;
import io.metersphere.project.mapper.MessageTaskMapper;
import io.metersphere.sdk.base.BaseTest;
import io.metersphere.sdk.constants.SessionConstants;
import io.metersphere.sdk.controller.handler.ResultHolder;
import io.metersphere.sdk.dto.request.MessageTaskRequest;
import io.metersphere.sdk.notice.constants.NoticeConstants;
import io.metersphere.sdk.util.JSON;
import io.metersphere.system.base.BaseTest;
import io.metersphere.system.controller.handler.ResultHolder;
import io.metersphere.system.notice.constants.NoticeConstants;
import jakarta.annotation.Resource;
import org.apache.commons.collections.CollectionUtils;
import org.junit.jupiter.api.*;
@ -216,7 +216,7 @@ public class NoticeMessageTaskControllerTests extends BaseTest {
ResultHolder resultHolder = JSON.parseObject(contentAsString, ResultHolder.class);
List<MessageTaskDTO> messageTaskDTOList = JSON.parseArray(JSON.toJSONString(resultHolder.getData()), MessageTaskDTO.class);
Assertions.assertTrue(CollectionUtils.isNotEmpty(messageTaskDTOList));
Assertions.assertEquals(messageTaskDTOList.get(0).getTaskType(),NoticeConstants.TaskType.API_DEFINITION_TASK);
Assertions.assertEquals(messageTaskDTOList.get(0).getTaskType(), NoticeConstants.TaskType.API_DEFINITION_TASK);
}
@Test

View File

@ -4,10 +4,10 @@ import io.metersphere.project.controller.param.ProjectApplicationDefinition;
import io.metersphere.project.controller.param.ProjectApplicationRequestDefinition;
import io.metersphere.project.domain.ProjectApplication;
import io.metersphere.project.request.ProjectApplicationRequest;
import io.metersphere.sdk.base.BaseTest;
import io.metersphere.sdk.constants.ProjectApplicationType;
import io.metersphere.sdk.controller.handler.ResultHolder;
import io.metersphere.sdk.util.JSON;
import io.metersphere.system.base.BaseTest;
import io.metersphere.system.controller.handler.ResultHolder;
import io.metersphere.system.domain.Plugin;
import io.metersphere.system.request.PluginUpdateRequest;
import io.metersphere.system.service.PluginService;
@ -298,8 +298,8 @@ public class ProjectApplicationControllerTests extends BaseTest {
@Order(19)
public void testGetApi() throws Exception {
List<String> types = Arrays.asList(ProjectApplicationType.APPLICATION_API_URL_REPEATABLE.name(), ProjectApplicationType.APPLICATION_CLEAN_API_REPORT.name(), ProjectApplicationType.APPLICATION_SHARE_API_REPORT.name(),
ProjectApplicationType.APPLICATION_API_RESOURCE_POOL.name(), ProjectApplicationType.APPLICATION_API_SCRIPT_REVIEWER.name(), ProjectApplicationType.APPLICATION_API_ERROR_REPORT_RULE.name(),
ProjectApplicationType.APPLICATION_API_SYNC_CASE.name());
ProjectApplicationType.APPLICATION_API_RESOURCE_POOL.name(), ProjectApplicationType.APPLICATION_API_SCRIPT_REVIEWER.name(), ProjectApplicationType.APPLICATION_API_ERROR_REPORT_RULE.name(),
ProjectApplicationType.APPLICATION_API_SYNC_CASE.name());
ProjectApplicationRequest request = this.getRequest(types);
this.requestPostWithOkAndReturn(GET_API_URL, request);
}
@ -323,7 +323,6 @@ public class ProjectApplicationControllerTests extends BaseTest {
*/
/**
* ==========用例管理 start==========
*/
@ -377,13 +376,14 @@ public class ProjectApplicationControllerTests extends BaseTest {
@Order(26)
public void testGetPlatformInfo() throws Exception {
plugin = addPlugin();
MvcResult mvcResult = this.requestGetWithOkAndReturn(GET_PLATFORM_INFO_URL + "/"+plugin.getId());
MvcResult mvcResult = this.requestGetWithOkAndReturn(GET_PLATFORM_INFO_URL + "/" + plugin.getId());
// 获取返回值
String returnData = mvcResult.getResponse().getContentAsString(StandardCharsets.UTF_8);
ResultHolder resultHolder = JSON.parseObject(returnData, ResultHolder.class);
// 返回请求正常
Assertions.assertNotNull(resultHolder);
}
/**
* ==========用例管理 start==========
*/

View File

@ -5,13 +5,13 @@ import io.metersphere.project.domain.Project;
import io.metersphere.project.domain.ProjectExample;
import io.metersphere.project.mapper.ProjectMapper;
import io.metersphere.project.request.ProjectSwitchRequest;
import io.metersphere.sdk.base.BaseTest;
import io.metersphere.sdk.constants.PermissionConstants;
import io.metersphere.sdk.constants.SessionConstants;
import io.metersphere.sdk.controller.handler.ResultHolder;
import io.metersphere.sdk.dto.ProjectExtendDTO;
import io.metersphere.sdk.dto.UserDTO;
import io.metersphere.sdk.util.JSON;
import io.metersphere.system.base.BaseTest;
import io.metersphere.system.controller.handler.ResultHolder;
import jakarta.annotation.Resource;
import org.junit.jupiter.api.*;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;

View File

@ -1,9 +1,9 @@
package io.metersphere.project.controller;
import io.metersphere.sdk.base.BaseTest;
import io.metersphere.sdk.constants.PermissionConstants;
import io.metersphere.sdk.log.vo.OperationLogRequest;
import io.metersphere.system.base.BaseTest;
import io.metersphere.system.log.vo.OperationLogRequest;
import org.junit.jupiter.api.MethodOrderer;
import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Test;
@ -28,7 +28,7 @@ public class ProjectLogControllerTests extends BaseTest {
@Order(1)
public void testProjectUserList() throws Exception {
String keyword = "o";
this.requestGetWithOkAndReturn(PROJECT_USER_LIST+ "/default-organization-member-test" + "?keyword=" + keyword);
this.requestGetWithOkAndReturn(PROJECT_USER_LIST + "/default-organization-member-test" + "?keyword=" + keyword);
}
@Test

View File

@ -5,13 +5,13 @@ import io.metersphere.project.request.ProjectMemberAddRequest;
import io.metersphere.project.request.ProjectMemberBatchDeleteRequest;
import io.metersphere.project.request.ProjectMemberEditRequest;
import io.metersphere.project.request.ProjectMemberRequest;
import io.metersphere.sdk.base.BaseTest;
import io.metersphere.sdk.constants.PermissionConstants;
import io.metersphere.sdk.constants.SessionConstants;
import io.metersphere.sdk.controller.handler.ResultHolder;
import io.metersphere.sdk.log.constants.OperationLogType;
import io.metersphere.sdk.util.JSON;
import io.metersphere.sdk.util.Pager;
import io.metersphere.system.base.BaseTest;
import io.metersphere.system.controller.handler.ResultHolder;
import io.metersphere.system.log.constants.OperationLogType;
import org.apache.commons.lang3.StringUtils;
import org.junit.jupiter.api.*;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
@ -46,7 +46,7 @@ public class ProjectMemberControllerTests extends BaseTest {
@Test
@Order(1)
@Sql(scripts = {"/dml/init_project_member.sql"}, config = @SqlConfig(encoding = "utf-8", transactionMode = SqlConfig.TransactionMode.ISOLATED))
public void testListMemberSuccess() throws Exception{
public void testListMemberSuccess() throws Exception {
ProjectMemberRequest request = new ProjectMemberRequest();
request.setProjectId("default-project-member-test");
request.setCurrent(1);

View File

@ -5,14 +5,12 @@ import io.metersphere.project.dto.ProjectRobotDTO;
import io.metersphere.project.enums.ProjectRobotPlatform;
import io.metersphere.project.enums.ProjectRobotType;
import io.metersphere.project.request.ProjectRobotRequest;
import io.metersphere.sdk.base.BaseTest;
import io.metersphere.sdk.constants.SessionConstants;
import io.metersphere.sdk.controller.handler.ResultHolder;
import io.metersphere.sdk.util.BeanUtils;
import io.metersphere.sdk.util.JSON;
import io.metersphere.sdk.util.Pager;
import io.metersphere.system.base.BaseTest;
import io.metersphere.system.controller.handler.ResultHolder;
import org.apache.commons.lang3.StringUtils;
import org.junit.jupiter.api.*;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
@ -219,7 +217,7 @@ public class ProjectRobotControllerTests extends BaseTest {
setCustomRobot("测试删除");
ProjectRobot projectRobot = getRobot("测试删除");
String projectRobotId = projectRobot.getId();
mockMvc.perform(MockMvcRequestBuilders.get(ROBOT_DELETE+"/"+ projectRobotId)
mockMvc.perform(MockMvcRequestBuilders.get(ROBOT_DELETE + "/" + projectRobotId)
.header(SessionConstants.HEADER_TOKEN, sessionId)
.header(SessionConstants.CSRF_TOKEN, csrfToken))
.andExpect(status().isOk())
@ -235,7 +233,7 @@ public class ProjectRobotControllerTests extends BaseTest {
@Test
@Order(17)
void deleteRobotFail() throws Exception {
mockMvc.perform(MockMvcRequestBuilders.get(ROBOT_DELETE+"/no_id")
mockMvc.perform(MockMvcRequestBuilders.get(ROBOT_DELETE + "/no_id")
.header(SessionConstants.HEADER_TOKEN, sessionId)
.header(SessionConstants.CSRF_TOKEN, csrfToken))
.andExpect(status().is5xxServerError())
@ -245,7 +243,7 @@ public class ProjectRobotControllerTests extends BaseTest {
@Test
@Order(18)
void getDetailFail() throws Exception {
mockMvc.perform(MockMvcRequestBuilders.get(ROBOT_DETAIL+"/no_id")
mockMvc.perform(MockMvcRequestBuilders.get(ROBOT_DETAIL + "/no_id")
.header(SessionConstants.HEADER_TOKEN, sessionId)
.header(SessionConstants.CSRF_TOKEN, csrfToken))
.andExpect(status().is5xxServerError())
@ -264,7 +262,7 @@ public class ProjectRobotControllerTests extends BaseTest {
.andExpect(content().contentType(MediaType.APPLICATION_JSON)).andReturn();
ProjectRobot result = getResult(mvcResult);
Assertions.assertTrue(StringUtils.equals(result.getName(), "测试获取详情"));
Assertions.assertTrue(StringUtils.equals(result.getWebhook(),"https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=2b67ccf4-e0da-4cd6-ae74-8d42657865f8"));
Assertions.assertTrue(StringUtils.equals(result.getWebhook(), "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=2b67ccf4-e0da-4cd6-ae74-8d42657865f8"));
}
@Test
@ -275,7 +273,7 @@ public class ProjectRobotControllerTests extends BaseTest {
request.setPageSize(5);
Pager<?> sortPageData = getPager(request);
List<ProjectRobot> projectRobots = JSON.parseArray(JSON.toJSONString(sortPageData.getList()), ProjectRobot.class);
Assertions.assertTrue(projectRobots.size()>0);
Assertions.assertTrue(projectRobots.size() > 0);
}
@Test
@ -314,7 +312,7 @@ public class ProjectRobotControllerTests extends BaseTest {
setCustomRobot("测试Enable");
ProjectRobot projectRobot = getRobot("测试Enable");
String projectRobotId = projectRobot.getId();
mockMvc.perform(MockMvcRequestBuilders.get(ROBOT_ENABLE+"/"+ projectRobotId)
mockMvc.perform(MockMvcRequestBuilders.get(ROBOT_ENABLE + "/" + projectRobotId)
.header(SessionConstants.HEADER_TOKEN, sessionId)
.header(SessionConstants.CSRF_TOKEN, csrfToken))
.andExpect(status().isOk())
@ -326,7 +324,7 @@ public class ProjectRobotControllerTests extends BaseTest {
@Test
@Order(21)
void setEnableFail() throws Exception {
mockMvc.perform(MockMvcRequestBuilders.get(ROBOT_ENABLE+"/no_id")
mockMvc.perform(MockMvcRequestBuilders.get(ROBOT_ENABLE + "/no_id")
.header(SessionConstants.HEADER_TOKEN, sessionId)
.header(SessionConstants.CSRF_TOKEN, csrfToken))
.andExpect(status().is5xxServerError())
@ -335,7 +333,8 @@ public class ProjectRobotControllerTests extends BaseTest {
}
private static ProjectRobot getResult(MvcResult mvcResult) throws UnsupportedEncodingException {
String contentAsString = mvcResult.getResponse().getContentAsString(StandardCharsets.UTF_8);;
String contentAsString = mvcResult.getResponse().getContentAsString(StandardCharsets.UTF_8);
;
ResultHolder resultHolder = JSON.parseObject(contentAsString, ResultHolder.class);
return JSON.parseObject(JSON.toJSONString(resultHolder.getData()), ProjectRobot.class);
}

View File

@ -5,17 +5,17 @@ import io.metersphere.project.request.ProjectUserRoleEditRequest;
import io.metersphere.project.request.ProjectUserRoleMemberEditRequest;
import io.metersphere.project.request.ProjectUserRoleMemberRequest;
import io.metersphere.project.request.ProjectUserRoleRequest;
import io.metersphere.sdk.base.BaseTest;
import io.metersphere.sdk.constants.InternalUserRole;
import io.metersphere.sdk.constants.PermissionConstants;
import io.metersphere.sdk.constants.SessionConstants;
import io.metersphere.sdk.controller.handler.ResultHolder;
import io.metersphere.sdk.dto.request.PermissionSettingUpdateRequest;
import io.metersphere.sdk.service.BaseUserRolePermissionService;
import io.metersphere.sdk.util.JSON;
import io.metersphere.sdk.util.Pager;
import io.metersphere.system.base.BaseTest;
import io.metersphere.system.controller.handler.ResultHolder;
import io.metersphere.system.domain.User;
import io.metersphere.system.request.OrganizationUserRoleEditRequest;
import io.metersphere.system.service.BaseUserRolePermissionService;
import jakarta.annotation.Resource;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
@ -36,7 +36,7 @@ import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
import static io.metersphere.sdk.controller.handler.result.CommonResultCode.INTERNAL_USER_ROLE_PERMISSION;
import static io.metersphere.system.controller.handler.result.CommonResultCode.INTERNAL_USER_ROLE_PERMISSION;
import static io.metersphere.system.controller.result.SystemResultCode.NO_PROJECT_USER_ROLE_PERMISSION;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;

View File

@ -18,18 +18,21 @@
<artifactId>metersphere-sdk</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>io.metersphere</groupId>
<artifactId>metersphere-sdk</artifactId>
<version>${revision}</version>
<classifier>tests</classifier>
<type>test-jar</type>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>

View File

@ -1,4 +1,4 @@
package io.metersphere.sdk.config;
package io.metersphere.system.config;
import io.metersphere.sdk.util.CommonBeanFactory;
import io.metersphere.sdk.util.Translator;

View File

@ -1,4 +1,4 @@
package io.metersphere.sdk.config;
package io.metersphere.system.config;
import org.springdoc.core.models.GroupedOpenApi;
import org.springframework.context.annotation.Bean;

View File

@ -1,10 +1,10 @@
package io.metersphere.sdk.config;
package io.metersphere.system.config;
import com.fit2cloud.quartz.anno.QuartzDataSource;
import com.github.pagehelper.PageInterceptor;
import com.zaxxer.hikari.HikariDataSource;
import io.metersphere.sdk.interceptor.MybatisInterceptor;
import io.metersphere.sdk.interceptor.UserDesensitizationInterceptor;
import io.metersphere.system.interceptor.MybatisInterceptor;
import io.metersphere.system.interceptor.UserDesensitizationInterceptor;
import io.metersphere.sdk.util.MybatisInterceptorConfig;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties;

View File

@ -1,4 +1,4 @@
package io.metersphere.sdk.config;
package io.metersphere.system.config;
import io.metersphere.sdk.constants.SessionConstants;

View File

@ -1,4 +1,4 @@
package io.metersphere.sdk.config;
package io.metersphere.system.config;
import io.metersphere.sdk.dto.PermissionDefinitionItem;
import io.metersphere.sdk.util.JSON;

View File

@ -1,10 +1,10 @@
package io.metersphere.sdk.config;
package io.metersphere.system.config;
import io.metersphere.sdk.file.FileCenter;
import io.metersphere.sdk.file.FileRepository;
import io.metersphere.sdk.file.FileRequest;
import io.metersphere.sdk.log.constants.OperationLogModule;
import io.metersphere.system.log.constants.OperationLogModule;
import io.metersphere.sdk.util.RsaKey;
import io.metersphere.sdk.util.RsaUtil;
import org.apache.commons.lang3.SerializationUtils;

View File

@ -1,7 +1,7 @@
package io.metersphere.sdk.config;
package io.metersphere.system.config;
import io.metersphere.sdk.sechedule.BaseScheduleService;
import io.metersphere.sdk.sechedule.ScheduleManager;
import io.metersphere.system.sechedule.BaseScheduleService;
import io.metersphere.system.sechedule.ScheduleManager;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

View File

@ -1,4 +1,4 @@
package io.metersphere.sdk.config;
package io.metersphere.system.config;
import com.fit2cloud.quartz.anno.QuartzScheduled;

View File

@ -1,11 +1,11 @@
package io.metersphere.sdk.config;
package io.metersphere.system.config;
import io.metersphere.sdk.security.ApiKeyFilter;
import io.metersphere.sdk.security.CsrfFilter;
import io.metersphere.sdk.security.MsPermissionAnnotationMethodInterceptor;
import io.metersphere.sdk.security.TotpFilter;
import io.metersphere.sdk.security.realm.LocalRealm;
import io.metersphere.system.security.ApiKeyFilter;
import io.metersphere.system.security.CsrfFilter;
import io.metersphere.system.security.MsPermissionAnnotationMethodInterceptor;
import io.metersphere.system.security.TotpFilter;
import io.metersphere.system.security.realm.LocalRealm;
import io.metersphere.sdk.util.FilterChainUtils;
import jakarta.servlet.DispatcherType;
import jakarta.servlet.Filter;

View File

@ -1,4 +1,4 @@
package io.metersphere.sdk.config;
package io.metersphere.system.config;
import com.bastiaanjansen.otp.HMACAlgorithm;
import com.bastiaanjansen.otp.TOTPGenerator;

View File

@ -1,4 +1,4 @@
package io.metersphere.sdk.config.interceptor;
package io.metersphere.system.config.interceptor;
import io.metersphere.api.domain.*;
import io.metersphere.sdk.util.CompressUtils;

View File

@ -1,4 +1,4 @@
package io.metersphere.sdk.config.interceptor;
package io.metersphere.system.config.interceptor;
import io.metersphere.load.domain.*;
import io.metersphere.sdk.util.CompressUtils;

View File

@ -1,4 +1,4 @@
package io.metersphere.sdk.config.interceptor;
package io.metersphere.system.config.interceptor;
import io.metersphere.project.domain.CustomFunctionBlob;
import io.metersphere.project.domain.FileMetadataBlob;

View File

@ -1,4 +1,4 @@
package io.metersphere.sdk.config.interceptor;
package io.metersphere.system.config.interceptor;
import io.metersphere.sdk.domain.OperationLogBlob;
import io.metersphere.sdk.util.CompressUtils;

View File

@ -1,4 +1,4 @@
package io.metersphere.sdk.config.interceptor;
package io.metersphere.system.config.interceptor;
import io.metersphere.sdk.util.CompressUtils;
import io.metersphere.sdk.util.MybatisInterceptorConfig;

View File

@ -1,4 +1,4 @@
package io.metersphere.sdk.config.interceptor;
package io.metersphere.system.config.interceptor;
import io.metersphere.load.domain.*;
import io.metersphere.sdk.util.CompressUtils;

View File

@ -4,11 +4,11 @@ import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import io.metersphere.sdk.constants.PermissionConstants;
import io.metersphere.sdk.dto.BasePageRequest;
import io.metersphere.sdk.ldap.service.LdapService;
import io.metersphere.sdk.ldap.vo.LdapLoginRequest;
import io.metersphere.sdk.ldap.vo.LdapRequest;
import io.metersphere.sdk.log.annotation.Log;
import io.metersphere.sdk.log.constants.OperationLogType;
import io.metersphere.system.ldap.service.LdapService;
import io.metersphere.system.ldap.vo.LdapLoginRequest;
import io.metersphere.system.ldap.vo.LdapRequest;
import io.metersphere.system.log.annotation.Log;
import io.metersphere.system.log.constants.OperationLogType;
import io.metersphere.sdk.util.PageUtils;
import io.metersphere.sdk.util.Pager;
import io.metersphere.system.domain.AuthSource;

View File

@ -4,8 +4,8 @@ import io.metersphere.sdk.constants.PermissionConstants;
import io.metersphere.sdk.dto.PermissionDefinitionItem;
import io.metersphere.sdk.dto.request.PermissionSettingUpdateRequest;
import io.metersphere.sdk.dto.request.UserRoleUpdateRequest;
import io.metersphere.sdk.log.annotation.Log;
import io.metersphere.sdk.log.constants.OperationLogType;
import io.metersphere.system.log.annotation.Log;
import io.metersphere.system.log.constants.OperationLogType;
import io.metersphere.sdk.util.BeanUtils;
import io.metersphere.sdk.util.SessionUtils;
import io.metersphere.system.domain.UserRole;

View File

@ -6,8 +6,8 @@ import io.metersphere.sdk.constants.PermissionConstants;
import io.metersphere.sdk.dto.UserExcludeOptionDTO;
import io.metersphere.sdk.dto.UserRoleRelationUserDTO;
import io.metersphere.sdk.dto.request.GlobalUserRoleRelationUpdateRequest;
import io.metersphere.sdk.log.annotation.Log;
import io.metersphere.sdk.log.constants.OperationLogType;
import io.metersphere.system.log.annotation.Log;
import io.metersphere.system.log.constants.OperationLogType;
import io.metersphere.sdk.util.PageUtils;
import io.metersphere.sdk.util.Pager;
import io.metersphere.sdk.util.SessionUtils;

View File

@ -1,8 +1,8 @@
package io.metersphere.sdk.controller;
package io.metersphere.system.controller;
import io.metersphere.sdk.constants.PermissionConstants;
import io.metersphere.sdk.dto.LicenseDTO;
import io.metersphere.sdk.service.LicenseService;
import io.metersphere.system.service.LicenseService;
import io.metersphere.sdk.util.CommonBeanFactory;
import io.metersphere.sdk.util.SessionUtils;
import io.swagger.v3.oas.annotations.Operation;

View File

@ -1,16 +1,16 @@
package io.metersphere.sdk.controller;
package io.metersphere.system.controller;
import io.metersphere.sdk.constants.HttpMethodConstants;
import io.metersphere.sdk.constants.UserSource;
import io.metersphere.sdk.controller.handler.ResultHolder;
import io.metersphere.sdk.controller.handler.result.MsHttpResultCode;
import io.metersphere.system.controller.handler.ResultHolder;
import io.metersphere.system.controller.handler.result.MsHttpResultCode;
import io.metersphere.sdk.dto.LoginRequest;
import io.metersphere.sdk.dto.SessionUser;
import io.metersphere.sdk.dto.UserDTO;
import io.metersphere.sdk.exception.MSException;
import io.metersphere.sdk.log.constants.OperationLogType;
import io.metersphere.sdk.service.BaseUserService;
import io.metersphere.system.log.constants.OperationLogType;
import io.metersphere.system.service.BaseUserService;
import io.metersphere.sdk.util.RsaKey;
import io.metersphere.sdk.util.RsaUtil;
import io.metersphere.sdk.util.SessionUtils;

View File

@ -1,4 +1,4 @@
package io.metersphere.sdk.controller;
package io.metersphere.system.controller;
import com.github.pagehelper.Page;
@ -6,7 +6,7 @@ import com.github.pagehelper.PageHelper;
import io.metersphere.project.domain.Notification;
import io.metersphere.sdk.dto.request.NotificationRequest;
import io.metersphere.sdk.service.NotificationService;
import io.metersphere.system.service.NotificationService;
import io.metersphere.sdk.util.PageUtils;
import io.metersphere.sdk.util.Pager;
import io.metersphere.sdk.util.SessionUtils;

View File

@ -4,9 +4,9 @@ package io.metersphere.system.controller;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import io.metersphere.sdk.constants.PermissionConstants;
import io.metersphere.sdk.log.service.OperationLogService;
import io.metersphere.sdk.log.vo.OperationLogRequest;
import io.metersphere.sdk.log.vo.OperationLogResponse;
import io.metersphere.system.log.service.OperationLogService;
import io.metersphere.system.log.vo.OperationLogRequest;
import io.metersphere.system.log.vo.OperationLogResponse;
import io.metersphere.sdk.util.PageUtils;
import io.metersphere.sdk.util.Pager;
import io.metersphere.system.domain.User;

View File

@ -4,8 +4,8 @@ import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import io.metersphere.sdk.constants.PermissionConstants;
import io.metersphere.sdk.dto.OptionDTO;
import io.metersphere.sdk.log.annotation.Log;
import io.metersphere.sdk.log.constants.OperationLogType;
import io.metersphere.system.log.annotation.Log;
import io.metersphere.system.log.constants.OperationLogType;
import io.metersphere.sdk.util.PageUtils;
import io.metersphere.sdk.util.Pager;
import io.metersphere.sdk.util.SessionUtils;

View File

@ -4,8 +4,8 @@ package io.metersphere.system.controller;
import io.metersphere.sdk.constants.PermissionConstants;
import io.metersphere.sdk.dto.CustomFieldDTO;
import io.metersphere.sdk.dto.request.CustomFieldUpdateRequest;
import io.metersphere.sdk.log.annotation.Log;
import io.metersphere.sdk.log.constants.OperationLogType;
import io.metersphere.system.log.annotation.Log;
import io.metersphere.system.log.constants.OperationLogType;
import io.metersphere.sdk.util.BeanUtils;
import io.metersphere.sdk.util.SessionUtils;
import io.metersphere.system.domain.CustomField;

View File

@ -4,9 +4,9 @@ package io.metersphere.system.controller;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import io.metersphere.sdk.constants.PermissionConstants;
import io.metersphere.sdk.log.service.OperationLogService;
import io.metersphere.sdk.log.vo.OperationLogRequest;
import io.metersphere.sdk.log.vo.OperationLogResponse;
import io.metersphere.system.log.service.OperationLogService;
import io.metersphere.system.log.vo.OperationLogRequest;
import io.metersphere.system.log.vo.OperationLogResponse;
import io.metersphere.sdk.util.PageUtils;
import io.metersphere.sdk.util.Pager;
import io.metersphere.sdk.util.SessionUtils;

View File

@ -6,8 +6,8 @@ import com.github.pagehelper.PageHelper;
import io.metersphere.project.domain.Project;
import io.metersphere.sdk.constants.PermissionConstants;
import io.metersphere.sdk.dto.*;
import io.metersphere.sdk.log.annotation.Log;
import io.metersphere.sdk.log.constants.OperationLogType;
import io.metersphere.system.log.annotation.Log;
import io.metersphere.system.log.constants.OperationLogType;
import io.metersphere.sdk.util.PageUtils;
import io.metersphere.sdk.util.Pager;
import io.metersphere.sdk.util.SessionUtils;

View File

@ -3,8 +3,8 @@ package io.metersphere.system.controller;
import io.metersphere.sdk.constants.PermissionConstants;
import io.metersphere.sdk.dto.TemplateDTO;
import io.metersphere.sdk.dto.request.TemplateUpdateRequest;
import io.metersphere.sdk.log.annotation.Log;
import io.metersphere.sdk.log.constants.OperationLogType;
import io.metersphere.system.log.annotation.Log;
import io.metersphere.system.log.constants.OperationLogType;
import io.metersphere.sdk.util.BeanUtils;
import io.metersphere.sdk.util.SessionUtils;
import io.metersphere.system.domain.Template;

View File

@ -5,8 +5,8 @@ import com.github.pagehelper.PageHelper;
import io.metersphere.sdk.constants.PermissionConstants;
import io.metersphere.sdk.dto.PermissionDefinitionItem;
import io.metersphere.sdk.dto.request.PermissionSettingUpdateRequest;
import io.metersphere.sdk.log.annotation.Log;
import io.metersphere.sdk.log.constants.OperationLogType;
import io.metersphere.system.log.annotation.Log;
import io.metersphere.system.log.constants.OperationLogType;
import io.metersphere.sdk.util.BeanUtils;
import io.metersphere.sdk.util.PageUtils;
import io.metersphere.sdk.util.Pager;

View File

@ -1,8 +1,8 @@
package io.metersphere.system.controller;
import io.metersphere.sdk.constants.PermissionConstants;
import io.metersphere.sdk.log.annotation.Log;
import io.metersphere.sdk.log.constants.OperationLogType;
import io.metersphere.system.log.annotation.Log;
import io.metersphere.system.log.constants.OperationLogType;
import io.metersphere.sdk.util.BeanUtils;
import io.metersphere.sdk.util.SessionUtils;
import io.metersphere.system.domain.Plugin;

View File

@ -1,8 +1,8 @@
package io.metersphere.system.controller;
import io.metersphere.sdk.constants.PermissionConstants;
import io.metersphere.sdk.log.annotation.Log;
import io.metersphere.sdk.log.constants.OperationLogType;
import io.metersphere.system.log.annotation.Log;
import io.metersphere.system.log.constants.OperationLogType;
import io.metersphere.system.domain.ServiceIntegration;
import io.metersphere.system.dto.ServiceIntegrationDTO;
import io.metersphere.system.request.ServiceIntegrationUpdateRequest;

View File

@ -4,9 +4,9 @@ package io.metersphere.system.controller;
import io.metersphere.sdk.constants.PermissionConstants;
import io.metersphere.sdk.dto.BaseSystemConfigDTO;
import io.metersphere.sdk.dto.EMailInfoDto;
import io.metersphere.sdk.log.annotation.Log;
import io.metersphere.sdk.log.constants.OperationLogType;
import io.metersphere.sdk.service.SystemParameterService;
import io.metersphere.system.log.annotation.Log;
import io.metersphere.system.log.constants.OperationLogType;
import io.metersphere.system.service.SystemParameterService;
import io.metersphere.system.domain.SystemParameter;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;

View File

@ -6,8 +6,8 @@ import com.github.pagehelper.PageHelper;
import io.metersphere.project.domain.Project;
import io.metersphere.sdk.constants.PermissionConstants;
import io.metersphere.sdk.dto.*;
import io.metersphere.sdk.log.annotation.Log;
import io.metersphere.sdk.log.constants.OperationLogType;
import io.metersphere.system.log.annotation.Log;
import io.metersphere.system.log.constants.OperationLogType;
import io.metersphere.sdk.util.PageUtils;
import io.metersphere.sdk.util.Pager;
import io.metersphere.sdk.util.SessionUtils;

View File

@ -7,9 +7,9 @@ import io.metersphere.sdk.dto.QueryResourcePoolRequest;
import io.metersphere.sdk.dto.TestResourcePoolDTO;
import io.metersphere.sdk.dto.TestResourcePoolRequest;
import io.metersphere.sdk.dto.TestResourcePoolReturnDTO;
import io.metersphere.sdk.log.annotation.Log;
import io.metersphere.sdk.log.constants.OperationLogType;
import io.metersphere.sdk.service.TestResourcePoolService;
import io.metersphere.system.log.annotation.Log;
import io.metersphere.system.log.constants.OperationLogType;
import io.metersphere.system.service.TestResourcePoolService;
import io.metersphere.sdk.util.BeanUtils;
import io.metersphere.sdk.util.PageUtils;
import io.metersphere.sdk.util.Pager;

View File

@ -7,8 +7,8 @@ import io.metersphere.project.domain.Project;
import io.metersphere.sdk.constants.PermissionConstants;
import io.metersphere.sdk.constants.UserSource;
import io.metersphere.sdk.dto.*;
import io.metersphere.sdk.log.annotation.Log;
import io.metersphere.sdk.log.constants.OperationLogType;
import io.metersphere.system.log.annotation.Log;
import io.metersphere.system.log.constants.OperationLogType;
import io.metersphere.sdk.util.PageUtils;
import io.metersphere.sdk.util.Pager;
import io.metersphere.sdk.util.SessionUtils;

View File

@ -1,11 +1,11 @@
package io.metersphere.sdk.controller.environment;
package io.metersphere.system.controller.environment;
import io.metersphere.sdk.constants.PermissionConstants;
import io.metersphere.sdk.domain.Environment;
import io.metersphere.sdk.dto.OptionDTO;
import io.metersphere.sdk.dto.environment.EnvironmentConfigRequest;
import io.metersphere.sdk.dto.environment.dataSource.DataSource;
import io.metersphere.sdk.service.environment.EnvironmentService;
import io.metersphere.system.service.environment.EnvironmentService;
import io.metersphere.sdk.util.SessionUtils;
import io.metersphere.validation.groups.Created;
import io.swagger.v3.oas.annotations.Operation;

View File

@ -1,8 +1,8 @@
package io.metersphere.sdk.controller.environment;
package io.metersphere.system.controller.environment;
import io.metersphere.sdk.constants.PermissionConstants;
import io.metersphere.sdk.dto.environment.GlobalParamsRequest;
import io.metersphere.sdk.service.environment.GlobalParamsService;
import io.metersphere.system.service.environment.GlobalParamsService;
import io.metersphere.sdk.util.SessionUtils;
import io.metersphere.validation.groups.Created;
import io.metersphere.validation.groups.Updated;

View File

@ -1,9 +1,9 @@
package io.metersphere.sdk.controller.handler;
package io.metersphere.system.controller.handler;
import io.metersphere.sdk.controller.handler.result.IResultCode;
import io.metersphere.sdk.controller.handler.result.MsHttpResultCode;
import io.metersphere.sdk.exception.IResultCode;
import io.metersphere.system.controller.handler.result.MsHttpResultCode;
import io.metersphere.sdk.exception.MSException;
import io.metersphere.sdk.util.ServiceUtils;
import io.metersphere.system.utils.ServiceUtils;
import io.metersphere.sdk.util.Translator;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

View File

@ -1,6 +1,6 @@
package io.metersphere.sdk.controller.handler;
package io.metersphere.system.controller.handler;
import io.metersphere.sdk.controller.handler.result.MsHttpResultCode;
import io.metersphere.system.controller.handler.result.MsHttpResultCode;
import lombok.Data;
@Data

View File

@ -1,6 +1,6 @@
package io.metersphere.sdk.controller.handler;
package io.metersphere.system.controller.handler;
import io.metersphere.sdk.controller.handler.annotation.NoResultHolder;
import io.metersphere.system.controller.handler.annotation.NoResultHolder;
import io.metersphere.sdk.util.JSON;
import org.springframework.core.MethodParameter;
import org.springframework.http.MediaType;

View File

@ -1,4 +1,4 @@
package io.metersphere.sdk.controller.handler.annotation;
package io.metersphere.system.controller.handler.annotation;
import java.lang.annotation.*;

View File

@ -1,4 +1,6 @@
package io.metersphere.sdk.controller.handler.result;
package io.metersphere.system.controller.handler.result;
import io.metersphere.sdk.exception.IResultCode;
/**
* 通用功能状态码

View File

@ -1,4 +1,6 @@
package io.metersphere.sdk.controller.handler.result;
package io.metersphere.system.controller.handler.result;
import io.metersphere.sdk.exception.IResultCode;
/**
* 具有 Http 含义的状态码

View File

@ -1,6 +1,6 @@
package io.metersphere.system.controller.result;
import io.metersphere.sdk.controller.handler.result.IResultCode;
import io.metersphere.sdk.exception.IResultCode;
/**
* @author jianxing

Some files were not shown because too many files have changed in this diff Show More