refactor(项目管理): 修改初始化项目的sql
This commit is contained in:
parent
be3622ba00
commit
5d348c144e
|
@ -4,7 +4,7 @@ SET SESSION innodb_lock_wait_timeout = 7200;
|
||||||
-- 初始化组织
|
-- 初始化组织
|
||||||
INSERT INTO organization (id, num, name, description, create_user, update_user, create_time, update_time) VALUES ('100001', 100001, '默认组织', '系统默认创建的组织', 'admin', 'admin', unix_timestamp() * 1000, unix_timestamp() * 1000);
|
INSERT INTO organization (id, num, name, description, create_user, update_user, create_time, update_time) VALUES ('100001', 100001, '默认组织', '系统默认创建的组织', 'admin', 'admin', unix_timestamp() * 1000, unix_timestamp() * 1000);
|
||||||
-- 初始化项目
|
-- 初始化项目
|
||||||
INSERT INTO project (id, num, organization_id, name, description, create_user, update_user, create_time, update_time) VALUES ('100001100001', 100001, (SELECT id FROM organization WHERE name LIKE '默认组织'), '默认项目', '系统默认创建的项目', 'admin', 'admin', unix_timestamp() * 1000, unix_timestamp() * 1000);
|
INSERT INTO project (id, num, organization_id, name, description, create_user, update_user, create_time, update_time, module_setting) VALUES ('100001100001', 100001, (SELECT id FROM organization WHERE name LIKE '默认组织'), '默认项目', '系统默认创建的项目', 'admin', 'admin', unix_timestamp() * 1000, unix_timestamp() * 1000,'["workstation","loadTest","testPlan","bugManagement","caseManagement","apiTest","uiTest"]');
|
||||||
|
|
||||||
-- 初始化用户
|
-- 初始化用户
|
||||||
insert into user(id, name, email, password, create_time, update_time, language, last_organization_id, phone, source, last_project_id, create_user, update_user,deleted)
|
insert into user(id, name, email, password, create_time, update_time, language, last_organization_id, phone, source, last_project_id, create_user, update_user,deleted)
|
||||||
|
|
|
@ -8,7 +8,6 @@ import io.metersphere.project.dto.environment.host.HostConfig;
|
||||||
import io.metersphere.project.dto.environment.http.HttpConfig;
|
import io.metersphere.project.dto.environment.http.HttpConfig;
|
||||||
import io.metersphere.project.dto.environment.script.post.EnvironmentPostScript;
|
import io.metersphere.project.dto.environment.script.post.EnvironmentPostScript;
|
||||||
import io.metersphere.project.dto.environment.script.pre.EnvironmentPreScript;
|
import io.metersphere.project.dto.environment.script.pre.EnvironmentPreScript;
|
||||||
import io.metersphere.project.dto.environment.ssl.KeyStoreConfig;
|
|
||||||
import io.metersphere.project.dto.environment.tcp.TCPConfig;
|
import io.metersphere.project.dto.environment.tcp.TCPConfig;
|
||||||
import io.metersphere.project.dto.environment.variables.CommonVariables;
|
import io.metersphere.project.dto.environment.variables.CommonVariables;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
@ -37,8 +36,6 @@ public class EnvironmentConfig implements Serializable {
|
||||||
private TCPConfig tcpConfig;
|
private TCPConfig tcpConfig;
|
||||||
@Schema(description = "认证配置")
|
@Schema(description = "认证配置")
|
||||||
private AuthConfig authConfig;
|
private AuthConfig authConfig;
|
||||||
@Schema(description = "SSL配置")
|
|
||||||
private KeyStoreConfig sslConfig;
|
|
||||||
@Schema(description = "全局前置脚本")
|
@Schema(description = "全局前置脚本")
|
||||||
private EnvironmentPreScript preScript;
|
private EnvironmentPreScript preScript;
|
||||||
@Schema(description = "全局后置脚本")
|
@Schema(description = "全局后置脚本")
|
||||||
|
@ -58,7 +55,6 @@ public class EnvironmentConfig implements Serializable {
|
||||||
this.preScript = new EnvironmentPreScript();
|
this.preScript = new EnvironmentPreScript();
|
||||||
this.postScript = new EnvironmentPostScript();
|
this.postScript = new EnvironmentPostScript();
|
||||||
this.assertions = new EnvironmentAssertions();
|
this.assertions = new EnvironmentAssertions();
|
||||||
this.sslConfig = new KeyStoreConfig();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package io.metersphere.project.dto.environment.auth;
|
package io.metersphere.project.dto.environment.auth;
|
||||||
|
|
||||||
|
import io.metersphere.project.dto.environment.ssl.KeyStoreConfig;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
@ -13,9 +14,12 @@ public class AuthConfig implements Serializable {
|
||||||
@Schema(description = "密码")
|
@Schema(description = "密码")
|
||||||
private String password;
|
private String password;
|
||||||
|
|
||||||
@Schema(description = "认证方式 No Auth、Basic Auth、Digest Auth、ssl")
|
@Schema(description = "认证方式 No Auth、Basic Auth、Digest Auth、ssl证书")
|
||||||
private String verification;
|
private String verification;
|
||||||
|
|
||||||
|
@Schema(description = "SSL配置")
|
||||||
|
private KeyStoreConfig sslConfig;
|
||||||
|
|
||||||
@Serial
|
@Serial
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
}
|
}
|
||||||
|
|
|
@ -582,7 +582,9 @@ public class EnvironmentControllerTests extends BaseTest {
|
||||||
checkLog(response.getId(), OperationLogType.ADD);
|
checkLog(response.getId(), OperationLogType.ADD);
|
||||||
|
|
||||||
//ssl配置
|
//ssl配置
|
||||||
envConfig.setSslConfig(createKeyStoreConfig());
|
AuthConfig authConfig = envConfig.getAuthConfig();
|
||||||
|
authConfig.setSslConfig(createKeyStoreConfig());
|
||||||
|
envConfig.setAuthConfig(authConfig);
|
||||||
request.setName("sslConfig");
|
request.setName("sslConfig");
|
||||||
request.setConfig(envConfig);
|
request.setConfig(envConfig);
|
||||||
paramMap.set("request", JSON.toJSONString(request));
|
paramMap.set("request", JSON.toJSONString(request));
|
||||||
|
@ -600,8 +602,8 @@ public class EnvironmentControllerTests extends BaseTest {
|
||||||
if (StringUtils.isNotBlank(config)) {
|
if (StringUtils.isNotBlank(config)) {
|
||||||
EnvironmentConfig environmentConfig = JSON.parseObject(config, EnvironmentConfig.class);
|
EnvironmentConfig environmentConfig = JSON.parseObject(config, EnvironmentConfig.class);
|
||||||
Assertions.assertNotNull(environmentConfig);
|
Assertions.assertNotNull(environmentConfig);
|
||||||
Assertions.assertNotNull(environmentConfig.getSslConfig());
|
Assertions.assertNotNull(environmentConfig.getAuthConfig());
|
||||||
Assertions.assertEquals(envConfig.getSslConfig(), environmentConfig.getSslConfig());
|
Assertions.assertEquals(envConfig.getAuthConfig().getSslConfig(), environmentConfig.getAuthConfig().getSslConfig());
|
||||||
}
|
}
|
||||||
//校验日志
|
//校验日志
|
||||||
checkLog(response.getId(), OperationLogType.ADD);
|
checkLog(response.getId(), OperationLogType.ADD);
|
||||||
|
|
Loading…
Reference in New Issue