build: workspace 改成 organization

This commit is contained in:
CaptainB 2023-06-07 14:19:00 +08:00 committed by 刘瑞斌
parent d89ef668ea
commit 7c043382ca
43 changed files with 1392 additions and 542 deletions

View File

@ -14,8 +14,8 @@ public class Project implements Serializable {
private String id;
@Schema(title = "工作空间ID", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{project.workspace_id.not_blank}", groups = {Created.class})
@Size(min = 1, max = 50, message = "{project.workspace_id.length_range}", groups = {Created.class, Updated.class})
@NotBlank(message = "{project.organization_id.not_blank}", groups = {Created.class})
@Size(min = 1, max = 50, message = "{project.organization_id.length_range}", groups = {Created.class, Updated.class})
private String workspaceId;
@Schema(title = "项目名称", requiredMode = Schema.RequiredMode.REQUIRED)

View File

@ -175,72 +175,72 @@ public class ProjectExample {
}
public Criteria andWorkspaceIdIsNull() {
addCriterion("workspace_id is null");
addCriterion("organization_id is null");
return (Criteria) this;
}
public Criteria andWorkspaceIdIsNotNull() {
addCriterion("workspace_id is not null");
addCriterion("organization_id is not null");
return (Criteria) this;
}
public Criteria andWorkspaceIdEqualTo(String value) {
addCriterion("workspace_id =", value, "workspaceId");
addCriterion("organization_id =", value, "workspaceId");
return (Criteria) this;
}
public Criteria andWorkspaceIdNotEqualTo(String value) {
addCriterion("workspace_id <>", value, "workspaceId");
addCriterion("organization_id <>", value, "workspaceId");
return (Criteria) this;
}
public Criteria andWorkspaceIdGreaterThan(String value) {
addCriterion("workspace_id >", value, "workspaceId");
addCriterion("organization_id >", value, "workspaceId");
return (Criteria) this;
}
public Criteria andWorkspaceIdGreaterThanOrEqualTo(String value) {
addCriterion("workspace_id >=", value, "workspaceId");
addCriterion("organization_id >=", value, "workspaceId");
return (Criteria) this;
}
public Criteria andWorkspaceIdLessThan(String value) {
addCriterion("workspace_id <", value, "workspaceId");
addCriterion("organization_id <", value, "workspaceId");
return (Criteria) this;
}
public Criteria andWorkspaceIdLessThanOrEqualTo(String value) {
addCriterion("workspace_id <=", value, "workspaceId");
addCriterion("organization_id <=", value, "workspaceId");
return (Criteria) this;
}
public Criteria andWorkspaceIdLike(String value) {
addCriterion("workspace_id like", value, "workspaceId");
addCriterion("organization_id like", value, "workspaceId");
return (Criteria) this;
}
public Criteria andWorkspaceIdNotLike(String value) {
addCriterion("workspace_id not like", value, "workspaceId");
addCriterion("organization_id not like", value, "workspaceId");
return (Criteria) this;
}
public Criteria andWorkspaceIdIn(List<String> values) {
addCriterion("workspace_id in", values, "workspaceId");
addCriterion("organization_id in", values, "workspaceId");
return (Criteria) this;
}
public Criteria andWorkspaceIdNotIn(List<String> values) {
addCriterion("workspace_id not in", values, "workspaceId");
addCriterion("organization_id not in", values, "workspaceId");
return (Criteria) this;
}
public Criteria andWorkspaceIdBetween(String value1, String value2) {
addCriterion("workspace_id between", value1, value2, "workspaceId");
addCriterion("organization_id between", value1, value2, "workspaceId");
return (Criteria) this;
}
public Criteria andWorkspaceIdNotBetween(String value1, String value2) {
addCriterion("workspace_id not between", value1, value2, "workspaceId");
addCriterion("organization_id not between", value1, value2, "workspaceId");
return (Criteria) this;
}

View File

@ -3,7 +3,7 @@
<mapper namespace="io.metersphere.project.mapper.ProjectMapper">
<resultMap id="BaseResultMap" type="io.metersphere.project.domain.Project">
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="workspace_id" jdbcType="VARCHAR" property="workspaceId" />
<result column="organization_id" jdbcType="VARCHAR" property="workspaceId" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="description" jdbcType="VARCHAR" property="description" />
<result column="create_time" jdbcType="BIGINT" property="createTime" />
@ -70,7 +70,7 @@
</where>
</sql>
<sql id="Base_Column_List">
id, workspace_id, `name`, description, create_time, update_time, create_user, system_id
id, organization_id, `name`, description, create_time, update_time, create_user, system_id
</sql>
<select id="selectByExample" parameterType="io.metersphere.project.domain.ProjectExample" resultMap="BaseResultMap">
select
@ -103,7 +103,7 @@
</if>
</delete>
<insert id="insert" parameterType="io.metersphere.project.domain.Project">
insert into project (id, workspace_id, `name`,
insert into project (id, organization_id, `name`,
description, create_time, update_time,
create_user, system_id)
values (#{id,jdbcType=VARCHAR}, #{workspaceId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
@ -117,7 +117,7 @@
id,
</if>
<if test="workspaceId != null">
workspace_id,
organization_id,
</if>
<if test="name != null">
`name`,
@ -178,7 +178,7 @@
id = #{record.id,jdbcType=VARCHAR},
</if>
<if test="record.workspaceId != null">
workspace_id = #{record.workspaceId,jdbcType=VARCHAR},
organization_id = #{record.workspaceId,jdbcType=VARCHAR},
</if>
<if test="record.name != null">
`name` = #{record.name,jdbcType=VARCHAR},
@ -206,7 +206,7 @@
<update id="updateByExample" parameterType="map">
update project
set id = #{record.id,jdbcType=VARCHAR},
workspace_id = #{record.workspaceId,jdbcType=VARCHAR},
organization_id = #{record.workspaceId,jdbcType=VARCHAR},
`name` = #{record.name,jdbcType=VARCHAR},
description = #{record.description,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
@ -221,7 +221,7 @@
update project
<set>
<if test="workspaceId != null">
workspace_id = #{workspaceId,jdbcType=VARCHAR},
organization_id = #{workspaceId,jdbcType=VARCHAR},
</if>
<if test="name != null">
`name` = #{name,jdbcType=VARCHAR},
@ -246,7 +246,7 @@
</update>
<update id="updateByPrimaryKey" parameterType="io.metersphere.project.domain.Project">
update project
set workspace_id = #{workspaceId,jdbcType=VARCHAR},
set organization_id = #{workspaceId,jdbcType=VARCHAR},
`name` = #{name,jdbcType=VARCHAR},
description = #{description,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},

View File

@ -18,10 +18,10 @@ public class EnvironmentGroup implements Serializable {
@Size(min = 1, max = 255, message = "{environment_group.name.length_range}", groups = {Created.class, Updated.class})
private String name;
@Schema(title = "所属工作空间", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{environment_group.workspace_id.not_blank}", groups = {Created.class})
@Size(min = 1, max = 50, message = "{environment_group.workspace_id.length_range}", groups = {Created.class, Updated.class})
private String workspaceId;
@Schema(title = "所属组织", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{environment_group.organization_id.not_blank}", groups = {Created.class})
@Size(min = 1, max = 50, message = "{environment_group.organization_id.length_range}", groups = {Created.class, Updated.class})
private String organizationId;
@Schema(title = "环境组描述")
private String description;

View File

@ -244,73 +244,73 @@ public class EnvironmentGroupExample {
return (Criteria) this;
}
public Criteria andWorkspaceIdIsNull() {
addCriterion("workspace_id is null");
public Criteria andOrganizationIdIsNull() {
addCriterion("organization_id is null");
return (Criteria) this;
}
public Criteria andWorkspaceIdIsNotNull() {
addCriterion("workspace_id is not null");
public Criteria andOrganizationIdIsNotNull() {
addCriterion("organization_id is not null");
return (Criteria) this;
}
public Criteria andWorkspaceIdEqualTo(String value) {
addCriterion("workspace_id =", value, "workspaceId");
public Criteria andOrganizationIdEqualTo(String value) {
addCriterion("organization_id =", value, "organizationId");
return (Criteria) this;
}
public Criteria andWorkspaceIdNotEqualTo(String value) {
addCriterion("workspace_id <>", value, "workspaceId");
public Criteria andOrganizationIdNotEqualTo(String value) {
addCriterion("organization_id <>", value, "organizationId");
return (Criteria) this;
}
public Criteria andWorkspaceIdGreaterThan(String value) {
addCriterion("workspace_id >", value, "workspaceId");
public Criteria andOrganizationIdGreaterThan(String value) {
addCriterion("organization_id >", value, "organizationId");
return (Criteria) this;
}
public Criteria andWorkspaceIdGreaterThanOrEqualTo(String value) {
addCriterion("workspace_id >=", value, "workspaceId");
public Criteria andOrganizationIdGreaterThanOrEqualTo(String value) {
addCriterion("organization_id >=", value, "organizationId");
return (Criteria) this;
}
public Criteria andWorkspaceIdLessThan(String value) {
addCriterion("workspace_id <", value, "workspaceId");
public Criteria andOrganizationIdLessThan(String value) {
addCriterion("organization_id <", value, "organizationId");
return (Criteria) this;
}
public Criteria andWorkspaceIdLessThanOrEqualTo(String value) {
addCriterion("workspace_id <=", value, "workspaceId");
public Criteria andOrganizationIdLessThanOrEqualTo(String value) {
addCriterion("organization_id <=", value, "organizationId");
return (Criteria) this;
}
public Criteria andWorkspaceIdLike(String value) {
addCriterion("workspace_id like", value, "workspaceId");
public Criteria andOrganizationIdLike(String value) {
addCriterion("organization_id like", value, "organizationId");
return (Criteria) this;
}
public Criteria andWorkspaceIdNotLike(String value) {
addCriterion("workspace_id not like", value, "workspaceId");
public Criteria andOrganizationIdNotLike(String value) {
addCriterion("organization_id not like", value, "organizationId");
return (Criteria) this;
}
public Criteria andWorkspaceIdIn(List<String> values) {
addCriterion("workspace_id in", values, "workspaceId");
public Criteria andOrganizationIdIn(List<String> values) {
addCriterion("organization_id in", values, "organizationId");
return (Criteria) this;
}
public Criteria andWorkspaceIdNotIn(List<String> values) {
addCriterion("workspace_id not in", values, "workspaceId");
public Criteria andOrganizationIdNotIn(List<String> values) {
addCriterion("organization_id not in", values, "organizationId");
return (Criteria) this;
}
public Criteria andWorkspaceIdBetween(String value1, String value2) {
addCriterion("workspace_id between", value1, value2, "workspaceId");
public Criteria andOrganizationIdBetween(String value1, String value2) {
addCriterion("organization_id between", value1, value2, "organizationId");
return (Criteria) this;
}
public Criteria andWorkspaceIdNotBetween(String value1, String value2) {
addCriterion("workspace_id not between", value1, value2, "workspaceId");
public Criteria andOrganizationIdNotBetween(String value1, String value2) {
addCriterion("organization_id not between", value1, value2, "organizationId");
return (Criteria) this;
}

View File

@ -4,7 +4,7 @@
<resultMap id="BaseResultMap" type="io.metersphere.sdk.domain.EnvironmentGroup">
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="workspace_id" jdbcType="VARCHAR" property="workspaceId" />
<result column="organization_id" jdbcType="VARCHAR" property="organizationId" />
<result column="description" jdbcType="VARCHAR" property="description" />
<result column="create_user" jdbcType="VARCHAR" property="createUser" />
<result column="create_time" jdbcType="BIGINT" property="createTime" />
@ -69,7 +69,7 @@
</where>
</sql>
<sql id="Base_Column_List">
id, `name`, workspace_id, description, create_user, create_time, update_time
id, `name`, organization_id, description, create_user, create_time, update_time
</sql>
<select id="selectByExample" parameterType="io.metersphere.sdk.domain.EnvironmentGroupExample" resultMap="BaseResultMap">
select
@ -102,10 +102,10 @@
</if>
</delete>
<insert id="insert" parameterType="io.metersphere.sdk.domain.EnvironmentGroup">
insert into environment_group (id, `name`, workspace_id,
insert into environment_group (id, `name`, organization_id,
description, create_user, create_time,
update_time)
values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{workspaceId,jdbcType=VARCHAR},
values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{organizationId,jdbcType=VARCHAR},
#{description,jdbcType=VARCHAR}, #{createUser,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT},
#{updateTime,jdbcType=BIGINT})
</insert>
@ -118,8 +118,8 @@
<if test="name != null">
`name`,
</if>
<if test="workspaceId != null">
workspace_id,
<if test="organizationId != null">
organization_id,
</if>
<if test="description != null">
description,
@ -141,8 +141,8 @@
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="workspaceId != null">
#{workspaceId,jdbcType=VARCHAR},
<if test="organizationId != null">
#{organizationId,jdbcType=VARCHAR},
</if>
<if test="description != null">
#{description,jdbcType=VARCHAR},
@ -173,8 +173,8 @@
<if test="record.name != null">
`name` = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.workspaceId != null">
workspace_id = #{record.workspaceId,jdbcType=VARCHAR},
<if test="record.organizationId != null">
organization_id = #{record.organizationId,jdbcType=VARCHAR},
</if>
<if test="record.description != null">
description = #{record.description,jdbcType=VARCHAR},
@ -197,7 +197,7 @@
update environment_group
set id = #{record.id,jdbcType=VARCHAR},
`name` = #{record.name,jdbcType=VARCHAR},
workspace_id = #{record.workspaceId,jdbcType=VARCHAR},
organization_id = #{record.organizationId,jdbcType=VARCHAR},
description = #{record.description,jdbcType=VARCHAR},
create_user = #{record.createUser,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
@ -212,8 +212,8 @@
<if test="name != null">
`name` = #{name,jdbcType=VARCHAR},
</if>
<if test="workspaceId != null">
workspace_id = #{workspaceId,jdbcType=VARCHAR},
<if test="organizationId != null">
organization_id = #{organizationId,jdbcType=VARCHAR},
</if>
<if test="description != null">
description = #{description,jdbcType=VARCHAR},
@ -233,7 +233,7 @@
<update id="updateByPrimaryKey" parameterType="io.metersphere.sdk.domain.EnvironmentGroup">
update environment_group
set `name` = #{name,jdbcType=VARCHAR},
workspace_id = #{workspaceId,jdbcType=VARCHAR},
organization_id = #{organizationId,jdbcType=VARCHAR},
description = #{description,jdbcType=VARCHAR},
create_user = #{createUser,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},

View File

@ -0,0 +1,34 @@
package io.metersphere.system.domain;
import io.metersphere.validation.groups.*;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.*;
import java.io.Serializable;
import lombok.Data;
@Data
public class Organization implements Serializable {
@Schema(title = "工作空间ID", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{organization.id.not_blank}", groups = {Updated.class})
@Size(min = 1, max = 50, message = "{organization.id.length_range}", groups = {Created.class, Updated.class})
private String id;
@Schema(title = "工作空间名称", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{organization.name.not_blank}", groups = {Created.class})
@Size(min = 1, max = 100, message = "{organization.name.length_range}", groups = {Created.class, Updated.class})
private String name;
@Schema(title = "描述")
private String description;
@Schema(title = "创建时间")
private Long createTime;
@Schema(title = "更新时间")
private Long updateTime;
@Schema(title = "创建人")
private String createUser;
private static final long serialVersionUID = 1L;
}

View File

@ -0,0 +1,600 @@
package io.metersphere.system.domain;
import java.util.ArrayList;
import java.util.List;
public class OrganizationExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public OrganizationExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(String value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(String value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(String value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(String value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(String value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(String value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdLike(String value) {
addCriterion("id like", value, "id");
return (Criteria) this;
}
public Criteria andIdNotLike(String value) {
addCriterion("id not like", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<String> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<String> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(String value1, String value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(String value1, String value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andNameIsNull() {
addCriterion("`name` is null");
return (Criteria) this;
}
public Criteria andNameIsNotNull() {
addCriterion("`name` is not null");
return (Criteria) this;
}
public Criteria andNameEqualTo(String value) {
addCriterion("`name` =", value, "name");
return (Criteria) this;
}
public Criteria andNameNotEqualTo(String value) {
addCriterion("`name` <>", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThan(String value) {
addCriterion("`name` >", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThanOrEqualTo(String value) {
addCriterion("`name` >=", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThan(String value) {
addCriterion("`name` <", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThanOrEqualTo(String value) {
addCriterion("`name` <=", value, "name");
return (Criteria) this;
}
public Criteria andNameLike(String value) {
addCriterion("`name` like", value, "name");
return (Criteria) this;
}
public Criteria andNameNotLike(String value) {
addCriterion("`name` not like", value, "name");
return (Criteria) this;
}
public Criteria andNameIn(List<String> values) {
addCriterion("`name` in", values, "name");
return (Criteria) this;
}
public Criteria andNameNotIn(List<String> values) {
addCriterion("`name` not in", values, "name");
return (Criteria) this;
}
public Criteria andNameBetween(String value1, String value2) {
addCriterion("`name` between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andNameNotBetween(String value1, String value2) {
addCriterion("`name` not between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andDescriptionIsNull() {
addCriterion("description is null");
return (Criteria) this;
}
public Criteria andDescriptionIsNotNull() {
addCriterion("description is not null");
return (Criteria) this;
}
public Criteria andDescriptionEqualTo(String value) {
addCriterion("description =", value, "description");
return (Criteria) this;
}
public Criteria andDescriptionNotEqualTo(String value) {
addCriterion("description <>", value, "description");
return (Criteria) this;
}
public Criteria andDescriptionGreaterThan(String value) {
addCriterion("description >", value, "description");
return (Criteria) this;
}
public Criteria andDescriptionGreaterThanOrEqualTo(String value) {
addCriterion("description >=", value, "description");
return (Criteria) this;
}
public Criteria andDescriptionLessThan(String value) {
addCriterion("description <", value, "description");
return (Criteria) this;
}
public Criteria andDescriptionLessThanOrEqualTo(String value) {
addCriterion("description <=", value, "description");
return (Criteria) this;
}
public Criteria andDescriptionLike(String value) {
addCriterion("description like", value, "description");
return (Criteria) this;
}
public Criteria andDescriptionNotLike(String value) {
addCriterion("description not like", value, "description");
return (Criteria) this;
}
public Criteria andDescriptionIn(List<String> values) {
addCriterion("description in", values, "description");
return (Criteria) this;
}
public Criteria andDescriptionNotIn(List<String> values) {
addCriterion("description not in", values, "description");
return (Criteria) this;
}
public Criteria andDescriptionBetween(String value1, String value2) {
addCriterion("description between", value1, value2, "description");
return (Criteria) this;
}
public Criteria andDescriptionNotBetween(String value1, String value2) {
addCriterion("description not between", value1, value2, "description");
return (Criteria) this;
}
public Criteria andCreateTimeIsNull() {
addCriterion("create_time is null");
return (Criteria) this;
}
public Criteria andCreateTimeIsNotNull() {
addCriterion("create_time is not null");
return (Criteria) this;
}
public Criteria andCreateTimeEqualTo(Long value) {
addCriterion("create_time =", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotEqualTo(Long value) {
addCriterion("create_time <>", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThan(Long value) {
addCriterion("create_time >", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThanOrEqualTo(Long value) {
addCriterion("create_time >=", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThan(Long value) {
addCriterion("create_time <", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThanOrEqualTo(Long value) {
addCriterion("create_time <=", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeIn(List<Long> values) {
addCriterion("create_time in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotIn(List<Long> values) {
addCriterion("create_time not in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeBetween(Long value1, Long value2) {
addCriterion("create_time between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotBetween(Long value1, Long value2) {
addCriterion("create_time not between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andUpdateTimeIsNull() {
addCriterion("update_time is null");
return (Criteria) this;
}
public Criteria andUpdateTimeIsNotNull() {
addCriterion("update_time is not null");
return (Criteria) this;
}
public Criteria andUpdateTimeEqualTo(Long value) {
addCriterion("update_time =", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotEqualTo(Long value) {
addCriterion("update_time <>", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThan(Long value) {
addCriterion("update_time >", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThanOrEqualTo(Long value) {
addCriterion("update_time >=", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeLessThan(Long value) {
addCriterion("update_time <", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeLessThanOrEqualTo(Long value) {
addCriterion("update_time <=", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeIn(List<Long> values) {
addCriterion("update_time in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotIn(List<Long> values) {
addCriterion("update_time not in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeBetween(Long value1, Long value2) {
addCriterion("update_time between", value1, value2, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotBetween(Long value1, Long value2) {
addCriterion("update_time not between", value1, value2, "updateTime");
return (Criteria) this;
}
public Criteria andCreateUserIsNull() {
addCriterion("create_user is null");
return (Criteria) this;
}
public Criteria andCreateUserIsNotNull() {
addCriterion("create_user is not null");
return (Criteria) this;
}
public Criteria andCreateUserEqualTo(String value) {
addCriterion("create_user =", value, "createUser");
return (Criteria) this;
}
public Criteria andCreateUserNotEqualTo(String value) {
addCriterion("create_user <>", value, "createUser");
return (Criteria) this;
}
public Criteria andCreateUserGreaterThan(String value) {
addCriterion("create_user >", value, "createUser");
return (Criteria) this;
}
public Criteria andCreateUserGreaterThanOrEqualTo(String value) {
addCriterion("create_user >=", value, "createUser");
return (Criteria) this;
}
public Criteria andCreateUserLessThan(String value) {
addCriterion("create_user <", value, "createUser");
return (Criteria) this;
}
public Criteria andCreateUserLessThanOrEqualTo(String value) {
addCriterion("create_user <=", value, "createUser");
return (Criteria) this;
}
public Criteria andCreateUserLike(String value) {
addCriterion("create_user like", value, "createUser");
return (Criteria) this;
}
public Criteria andCreateUserNotLike(String value) {
addCriterion("create_user not like", value, "createUser");
return (Criteria) this;
}
public Criteria andCreateUserIn(List<String> values) {
addCriterion("create_user in", values, "createUser");
return (Criteria) this;
}
public Criteria andCreateUserNotIn(List<String> values) {
addCriterion("create_user not in", values, "createUser");
return (Criteria) this;
}
public Criteria andCreateUserBetween(String value1, String value2) {
addCriterion("create_user between", value1, value2, "createUser");
return (Criteria) this;
}
public Criteria andCreateUserNotBetween(String value1, String value2) {
addCriterion("create_user not between", value1, value2, "createUser");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

View File

@ -29,8 +29,8 @@ public class Quota implements Serializable {
@Schema(title = "资源池列表")
private String resourcePool;
@Schema(title = "工作空间ID")
private String workspaceId;
@Schema(title = "组织ID")
private String organizationId;
@Schema(title = "是否使用默认值")
private Boolean useDefault;

View File

@ -485,73 +485,73 @@ public class QuotaExample {
return (Criteria) this;
}
public Criteria andWorkspaceIdIsNull() {
addCriterion("workspace_id is null");
public Criteria andOrganizationIdIsNull() {
addCriterion("organization_id is null");
return (Criteria) this;
}
public Criteria andWorkspaceIdIsNotNull() {
addCriterion("workspace_id is not null");
public Criteria andOrganizationIdIsNotNull() {
addCriterion("organization_id is not null");
return (Criteria) this;
}
public Criteria andWorkspaceIdEqualTo(String value) {
addCriterion("workspace_id =", value, "workspaceId");
public Criteria andOrganizationIdEqualTo(String value) {
addCriterion("organization_id =", value, "organizationId");
return (Criteria) this;
}
public Criteria andWorkspaceIdNotEqualTo(String value) {
addCriterion("workspace_id <>", value, "workspaceId");
public Criteria andOrganizationIdNotEqualTo(String value) {
addCriterion("organization_id <>", value, "organizationId");
return (Criteria) this;
}
public Criteria andWorkspaceIdGreaterThan(String value) {
addCriterion("workspace_id >", value, "workspaceId");
public Criteria andOrganizationIdGreaterThan(String value) {
addCriterion("organization_id >", value, "organizationId");
return (Criteria) this;
}
public Criteria andWorkspaceIdGreaterThanOrEqualTo(String value) {
addCriterion("workspace_id >=", value, "workspaceId");
public Criteria andOrganizationIdGreaterThanOrEqualTo(String value) {
addCriterion("organization_id >=", value, "organizationId");
return (Criteria) this;
}
public Criteria andWorkspaceIdLessThan(String value) {
addCriterion("workspace_id <", value, "workspaceId");
public Criteria andOrganizationIdLessThan(String value) {
addCriterion("organization_id <", value, "organizationId");
return (Criteria) this;
}
public Criteria andWorkspaceIdLessThanOrEqualTo(String value) {
addCriterion("workspace_id <=", value, "workspaceId");
public Criteria andOrganizationIdLessThanOrEqualTo(String value) {
addCriterion("organization_id <=", value, "organizationId");
return (Criteria) this;
}
public Criteria andWorkspaceIdLike(String value) {
addCriterion("workspace_id like", value, "workspaceId");
public Criteria andOrganizationIdLike(String value) {
addCriterion("organization_id like", value, "organizationId");
return (Criteria) this;
}
public Criteria andWorkspaceIdNotLike(String value) {
addCriterion("workspace_id not like", value, "workspaceId");
public Criteria andOrganizationIdNotLike(String value) {
addCriterion("organization_id not like", value, "organizationId");
return (Criteria) this;
}
public Criteria andWorkspaceIdIn(List<String> values) {
addCriterion("workspace_id in", values, "workspaceId");
public Criteria andOrganizationIdIn(List<String> values) {
addCriterion("organization_id in", values, "organizationId");
return (Criteria) this;
}
public Criteria andWorkspaceIdNotIn(List<String> values) {
addCriterion("workspace_id not in", values, "workspaceId");
public Criteria andOrganizationIdNotIn(List<String> values) {
addCriterion("organization_id not in", values, "organizationId");
return (Criteria) this;
}
public Criteria andWorkspaceIdBetween(String value1, String value2) {
addCriterion("workspace_id between", value1, value2, "workspaceId");
public Criteria andOrganizationIdBetween(String value1, String value2) {
addCriterion("organization_id between", value1, value2, "organizationId");
return (Criteria) this;
}
public Criteria andWorkspaceIdNotBetween(String value1, String value2) {
addCriterion("workspace_id not between", value1, value2, "workspaceId");
public Criteria andOrganizationIdNotBetween(String value1, String value2) {
addCriterion("organization_id not between", value1, value2, "organizationId");
return (Criteria) this;
}

View File

@ -21,7 +21,7 @@ public class Schedule implements Serializable {
@Size(min = 1, max = 50, message = "{schedule.type.length_range}", groups = {Created.class, Updated.class})
private String type;
@Schema(title = "Schedule value", requiredMode = Schema.RequiredMode.REQUIRED)
@Schema(title = "cron 表达式", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{schedule.value.not_blank}", groups = {Created.class})
@Size(min = 1, max = 255, message = "{schedule.value.length_range}", groups = {Created.class, Updated.class})
private String value;
@ -31,7 +31,7 @@ public class Schedule implements Serializable {
@Size(min = 1, max = 64, message = "{schedule.job.length_range}", groups = {Created.class, Updated.class})
private String job;
@Schema(title = "Schedule Eable")
@Schema(title = "是否开启")
private Boolean enable;
@Schema(title = "")
@ -40,10 +40,10 @@ public class Schedule implements Serializable {
@Schema(title = "创建人")
private String createUser;
@Schema(title = "Create timestamp")
@Schema(title = "创建时间")
private Long createTime;
@Schema(title = "Update timestamp")
@Schema(title = "更新时间")
private Long updateTime;
@Schema(title = "项目ID")

View File

@ -18,8 +18,8 @@ public class ServiceIntegration implements Serializable {
@Size(min = 1, max = 50, message = "{service_integration.platform.length_range}", groups = {Created.class, Updated.class})
private String platform;
@Schema(title = "工作空间ID")
private String workspaceId;
@Schema(title = "组织ID")
private String organizationId;
@Schema(title = "", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "{service_integration.configuration.not_blank}", groups = {Created.class})

View File

@ -244,73 +244,73 @@ public class ServiceIntegrationExample {
return (Criteria) this;
}
public Criteria andWorkspaceIdIsNull() {
addCriterion("workspace_id is null");
public Criteria andOrganizationIdIsNull() {
addCriterion("organization_id is null");
return (Criteria) this;
}
public Criteria andWorkspaceIdIsNotNull() {
addCriterion("workspace_id is not null");
public Criteria andOrganizationIdIsNotNull() {
addCriterion("organization_id is not null");
return (Criteria) this;
}
public Criteria andWorkspaceIdEqualTo(String value) {
addCriterion("workspace_id =", value, "workspaceId");
public Criteria andOrganizationIdEqualTo(String value) {
addCriterion("organization_id =", value, "organizationId");
return (Criteria) this;
}
public Criteria andWorkspaceIdNotEqualTo(String value) {
addCriterion("workspace_id <>", value, "workspaceId");
public Criteria andOrganizationIdNotEqualTo(String value) {
addCriterion("organization_id <>", value, "organizationId");
return (Criteria) this;
}
public Criteria andWorkspaceIdGreaterThan(String value) {
addCriterion("workspace_id >", value, "workspaceId");
public Criteria andOrganizationIdGreaterThan(String value) {
addCriterion("organization_id >", value, "organizationId");
return (Criteria) this;
}
public Criteria andWorkspaceIdGreaterThanOrEqualTo(String value) {
addCriterion("workspace_id >=", value, "workspaceId");
public Criteria andOrganizationIdGreaterThanOrEqualTo(String value) {
addCriterion("organization_id >=", value, "organizationId");
return (Criteria) this;
}
public Criteria andWorkspaceIdLessThan(String value) {
addCriterion("workspace_id <", value, "workspaceId");
public Criteria andOrganizationIdLessThan(String value) {
addCriterion("organization_id <", value, "organizationId");
return (Criteria) this;
}
public Criteria andWorkspaceIdLessThanOrEqualTo(String value) {
addCriterion("workspace_id <=", value, "workspaceId");
public Criteria andOrganizationIdLessThanOrEqualTo(String value) {
addCriterion("organization_id <=", value, "organizationId");
return (Criteria) this;
}
public Criteria andWorkspaceIdLike(String value) {
addCriterion("workspace_id like", value, "workspaceId");
public Criteria andOrganizationIdLike(String value) {
addCriterion("organization_id like", value, "organizationId");
return (Criteria) this;
}
public Criteria andWorkspaceIdNotLike(String value) {
addCriterion("workspace_id not like", value, "workspaceId");
public Criteria andOrganizationIdNotLike(String value) {
addCriterion("organization_id not like", value, "organizationId");
return (Criteria) this;
}
public Criteria andWorkspaceIdIn(List<String> values) {
addCriterion("workspace_id in", values, "workspaceId");
public Criteria andOrganizationIdIn(List<String> values) {
addCriterion("organization_id in", values, "organizationId");
return (Criteria) this;
}
public Criteria andWorkspaceIdNotIn(List<String> values) {
addCriterion("workspace_id not in", values, "workspaceId");
public Criteria andOrganizationIdNotIn(List<String> values) {
addCriterion("organization_id not in", values, "organizationId");
return (Criteria) this;
}
public Criteria andWorkspaceIdBetween(String value1, String value2) {
addCriterion("workspace_id between", value1, value2, "workspaceId");
public Criteria andOrganizationIdBetween(String value1, String value2) {
addCriterion("organization_id between", value1, value2, "organizationId");
return (Criteria) this;
}
public Criteria andWorkspaceIdNotBetween(String value1, String value2) {
addCriterion("workspace_id not between", value1, value2, "workspaceId");
public Criteria andOrganizationIdNotBetween(String value1, String value2) {
addCriterion("organization_id not between", value1, value2, "organizationId");
return (Criteria) this;
}
}

View File

@ -40,8 +40,8 @@ public class User implements Serializable {
@Schema(title = "语言")
private String language;
@Schema(title = "当前工作空间ID")
private String lastWorkspaceId;
@Schema(title = "当前组织ID")
private String lastOrganizationId;
@Schema(title = "手机号")
private String phone;

View File

@ -644,73 +644,73 @@ public class UserExample {
return (Criteria) this;
}
public Criteria andLastWorkspaceIdIsNull() {
addCriterion("last_workspace_id is null");
public Criteria andLastOrganizationIdIsNull() {
addCriterion("last_organization_id is null");
return (Criteria) this;
}
public Criteria andLastWorkspaceIdIsNotNull() {
addCriterion("last_workspace_id is not null");
public Criteria andLastOrganizationIdIsNotNull() {
addCriterion("last_organization_id is not null");
return (Criteria) this;
}
public Criteria andLastWorkspaceIdEqualTo(String value) {
addCriterion("last_workspace_id =", value, "lastWorkspaceId");
public Criteria andLastOrganizationIdEqualTo(String value) {
addCriterion("last_organization_id =", value, "lastOrganizationId");
return (Criteria) this;
}
public Criteria andLastWorkspaceIdNotEqualTo(String value) {
addCriterion("last_workspace_id <>", value, "lastWorkspaceId");
public Criteria andLastOrganizationIdNotEqualTo(String value) {
addCriterion("last_organization_id <>", value, "lastOrganizationId");
return (Criteria) this;
}
public Criteria andLastWorkspaceIdGreaterThan(String value) {
addCriterion("last_workspace_id >", value, "lastWorkspaceId");
public Criteria andLastOrganizationIdGreaterThan(String value) {
addCriterion("last_organization_id >", value, "lastOrganizationId");
return (Criteria) this;
}
public Criteria andLastWorkspaceIdGreaterThanOrEqualTo(String value) {
addCriterion("last_workspace_id >=", value, "lastWorkspaceId");
public Criteria andLastOrganizationIdGreaterThanOrEqualTo(String value) {
addCriterion("last_organization_id >=", value, "lastOrganizationId");
return (Criteria) this;
}
public Criteria andLastWorkspaceIdLessThan(String value) {
addCriterion("last_workspace_id <", value, "lastWorkspaceId");
public Criteria andLastOrganizationIdLessThan(String value) {
addCriterion("last_organization_id <", value, "lastOrganizationId");
return (Criteria) this;
}
public Criteria andLastWorkspaceIdLessThanOrEqualTo(String value) {
addCriterion("last_workspace_id <=", value, "lastWorkspaceId");
public Criteria andLastOrganizationIdLessThanOrEqualTo(String value) {
addCriterion("last_organization_id <=", value, "lastOrganizationId");
return (Criteria) this;
}
public Criteria andLastWorkspaceIdLike(String value) {
addCriterion("last_workspace_id like", value, "lastWorkspaceId");
public Criteria andLastOrganizationIdLike(String value) {
addCriterion("last_organization_id like", value, "lastOrganizationId");
return (Criteria) this;
}
public Criteria andLastWorkspaceIdNotLike(String value) {
addCriterion("last_workspace_id not like", value, "lastWorkspaceId");
public Criteria andLastOrganizationIdNotLike(String value) {
addCriterion("last_organization_id not like", value, "lastOrganizationId");
return (Criteria) this;
}
public Criteria andLastWorkspaceIdIn(List<String> values) {
addCriterion("last_workspace_id in", values, "lastWorkspaceId");
public Criteria andLastOrganizationIdIn(List<String> values) {
addCriterion("last_organization_id in", values, "lastOrganizationId");
return (Criteria) this;
}
public Criteria andLastWorkspaceIdNotIn(List<String> values) {
addCriterion("last_workspace_id not in", values, "lastWorkspaceId");
public Criteria andLastOrganizationIdNotIn(List<String> values) {
addCriterion("last_organization_id not in", values, "lastOrganizationId");
return (Criteria) this;
}
public Criteria andLastWorkspaceIdBetween(String value1, String value2) {
addCriterion("last_workspace_id between", value1, value2, "lastWorkspaceId");
public Criteria andLastOrganizationIdBetween(String value1, String value2) {
addCriterion("last_organization_id between", value1, value2, "lastOrganizationId");
return (Criteria) this;
}
public Criteria andLastWorkspaceIdNotBetween(String value1, String value2) {
addCriterion("last_workspace_id not between", value1, value2, "lastWorkspaceId");
public Criteria andLastOrganizationIdNotBetween(String value1, String value2) {
addCriterion("last_organization_id not between", value1, value2, "lastOrganizationId");
return (Criteria) this;
}

View File

@ -0,0 +1,30 @@
package io.metersphere.system.mapper;
import io.metersphere.system.domain.Organization;
import io.metersphere.system.domain.OrganizationExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface OrganizationMapper {
long countByExample(OrganizationExample example);
int deleteByExample(OrganizationExample example);
int deleteByPrimaryKey(String id);
int insert(Organization record);
int insertSelective(Organization record);
List<Organization> selectByExample(OrganizationExample example);
Organization selectByPrimaryKey(String id);
int updateByExampleSelective(@Param("record") Organization record, @Param("example") OrganizationExample example);
int updateByExample(@Param("record") Organization record, @Param("example") OrganizationExample example);
int updateByPrimaryKeySelective(Organization record);
int updateByPrimaryKey(Organization record);
}

View File

@ -0,0 +1,228 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="io.metersphere.system.mapper.OrganizationMapper">
<resultMap id="BaseResultMap" type="io.metersphere.system.domain.Organization">
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="description" jdbcType="VARCHAR" property="description" />
<result column="create_time" jdbcType="BIGINT" property="createTime" />
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
<result column="create_user" jdbcType="VARCHAR" property="createUser" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, `name`, description, create_time, update_time, create_user
</sql>
<select id="selectByExample" parameterType="io.metersphere.system.domain.OrganizationExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from organization
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from organization
where id = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from organization
where id = #{id,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="io.metersphere.system.domain.OrganizationExample">
delete from organization
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="io.metersphere.system.domain.Organization">
insert into organization (id, `name`, description,
create_time, update_time, create_user
)
values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR},
#{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT}, #{createUser,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="io.metersphere.system.domain.Organization">
insert into organization
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="name != null">
`name`,
</if>
<if test="description != null">
description,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="createUser != null">
create_user,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=VARCHAR},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="description != null">
#{description,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=BIGINT},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=BIGINT},
</if>
<if test="createUser != null">
#{createUser,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="io.metersphere.system.domain.OrganizationExample" resultType="java.lang.Long">
select count(*) from organization
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update organization
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=VARCHAR},
</if>
<if test="record.name != null">
`name` = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.description != null">
description = #{record.description,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=BIGINT},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=BIGINT},
</if>
<if test="record.createUser != null">
create_user = #{record.createUser,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update organization
set id = #{record.id,jdbcType=VARCHAR},
`name` = #{record.name,jdbcType=VARCHAR},
description = #{record.description,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT},
create_user = #{record.createUser,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="io.metersphere.system.domain.Organization">
update organization
<set>
<if test="name != null">
`name` = #{name,jdbcType=VARCHAR},
</if>
<if test="description != null">
description = #{description,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=BIGINT},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=BIGINT},
</if>
<if test="createUser != null">
create_user = #{createUser,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="io.metersphere.system.domain.Organization">
update organization
set `name` = #{name,jdbcType=VARCHAR},
description = #{description,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT},
create_user = #{createUser,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>

View File

@ -8,7 +8,7 @@
<result column="max_threads" jdbcType="INTEGER" property="maxThreads" />
<result column="duration" jdbcType="INTEGER" property="duration" />
<result column="resource_pool" jdbcType="VARCHAR" property="resourcePool" />
<result column="workspace_id" jdbcType="VARCHAR" property="workspaceId" />
<result column="organization_id" jdbcType="VARCHAR" property="organizationId" />
<result column="use_default" jdbcType="BIT" property="useDefault" />
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
<result column="member" jdbcType="INTEGER" property="member" />
@ -76,7 +76,7 @@
</where>
</sql>
<sql id="Base_Column_List">
id, api, performance, max_threads, duration, resource_pool, workspace_id, use_default,
id, api, performance, max_threads, duration, resource_pool, organization_id, use_default,
update_time, `member`, project, project_id, vum_total, vum_used
</sql>
<select id="selectByExample" parameterType="io.metersphere.system.domain.QuotaExample" resultMap="BaseResultMap">
@ -112,12 +112,12 @@
<insert id="insert" parameterType="io.metersphere.system.domain.Quota">
insert into quota (id, api, performance,
max_threads, duration, resource_pool,
workspace_id, use_default, update_time,
organization_id, use_default, update_time,
`member`, project, project_id,
vum_total, vum_used)
values (#{id,jdbcType=VARCHAR}, #{api,jdbcType=INTEGER}, #{performance,jdbcType=INTEGER},
#{maxThreads,jdbcType=INTEGER}, #{duration,jdbcType=INTEGER}, #{resourcePool,jdbcType=VARCHAR},
#{workspaceId,jdbcType=VARCHAR}, #{useDefault,jdbcType=BIT}, #{updateTime,jdbcType=BIGINT},
#{organizationId,jdbcType=VARCHAR}, #{useDefault,jdbcType=BIT}, #{updateTime,jdbcType=BIGINT},
#{member,jdbcType=INTEGER}, #{project,jdbcType=INTEGER}, #{projectId,jdbcType=VARCHAR},
#{vumTotal,jdbcType=DECIMAL}, #{vumUsed,jdbcType=DECIMAL})
</insert>
@ -142,8 +142,8 @@
<if test="resourcePool != null">
resource_pool,
</if>
<if test="workspaceId != null">
workspace_id,
<if test="organizationId != null">
organization_id,
</if>
<if test="useDefault != null">
use_default,
@ -186,8 +186,8 @@
<if test="resourcePool != null">
#{resourcePool,jdbcType=VARCHAR},
</if>
<if test="workspaceId != null">
#{workspaceId,jdbcType=VARCHAR},
<if test="organizationId != null">
#{organizationId,jdbcType=VARCHAR},
</if>
<if test="useDefault != null">
#{useDefault,jdbcType=BIT},
@ -239,8 +239,8 @@
<if test="record.resourcePool != null">
resource_pool = #{record.resourcePool,jdbcType=VARCHAR},
</if>
<if test="record.workspaceId != null">
workspace_id = #{record.workspaceId,jdbcType=VARCHAR},
<if test="record.organizationId != null">
organization_id = #{record.organizationId,jdbcType=VARCHAR},
</if>
<if test="record.useDefault != null">
use_default = #{record.useDefault,jdbcType=BIT},
@ -276,7 +276,7 @@
max_threads = #{record.maxThreads,jdbcType=INTEGER},
duration = #{record.duration,jdbcType=INTEGER},
resource_pool = #{record.resourcePool,jdbcType=VARCHAR},
workspace_id = #{record.workspaceId,jdbcType=VARCHAR},
organization_id = #{record.organizationId,jdbcType=VARCHAR},
use_default = #{record.useDefault,jdbcType=BIT},
update_time = #{record.updateTime,jdbcType=BIGINT},
`member` = #{record.member,jdbcType=INTEGER},
@ -306,8 +306,8 @@
<if test="resourcePool != null">
resource_pool = #{resourcePool,jdbcType=VARCHAR},
</if>
<if test="workspaceId != null">
workspace_id = #{workspaceId,jdbcType=VARCHAR},
<if test="organizationId != null">
organization_id = #{organizationId,jdbcType=VARCHAR},
</if>
<if test="useDefault != null">
use_default = #{useDefault,jdbcType=BIT},
@ -340,7 +340,7 @@
max_threads = #{maxThreads,jdbcType=INTEGER},
duration = #{duration,jdbcType=INTEGER},
resource_pool = #{resourcePool,jdbcType=VARCHAR},
workspace_id = #{workspaceId,jdbcType=VARCHAR},
organization_id = #{organizationId,jdbcType=VARCHAR},
use_default = #{useDefault,jdbcType=BIT},
update_time = #{updateTime,jdbcType=BIGINT},
`member` = #{member,jdbcType=INTEGER},

View File

@ -4,7 +4,7 @@
<resultMap id="BaseResultMap" type="io.metersphere.system.domain.ServiceIntegration">
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="platform" jdbcType="VARCHAR" property="platform" />
<result column="workspace_id" jdbcType="VARCHAR" property="workspaceId" />
<result column="organization_id" jdbcType="VARCHAR" property="organizationId" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.metersphere.system.domain.ServiceIntegration">
<result column="configuration" jdbcType="LONGVARBINARY" property="configuration" />
@ -68,7 +68,7 @@
</where>
</sql>
<sql id="Base_Column_List">
id, platform, workspace_id
id, platform, organization_id
</sql>
<sql id="Blob_Column_List">
configuration
@ -122,9 +122,9 @@
</if>
</delete>
<insert id="insert" parameterType="io.metersphere.system.domain.ServiceIntegration">
insert into service_integration (id, platform, workspace_id,
insert into service_integration (id, platform, organization_id,
configuration)
values (#{id,jdbcType=VARCHAR}, #{platform,jdbcType=VARCHAR}, #{workspaceId,jdbcType=VARCHAR},
values (#{id,jdbcType=VARCHAR}, #{platform,jdbcType=VARCHAR}, #{organizationId,jdbcType=VARCHAR},
#{configuration,jdbcType=LONGVARBINARY})
</insert>
<insert id="insertSelective" parameterType="io.metersphere.system.domain.ServiceIntegration">
@ -136,8 +136,8 @@
<if test="platform != null">
platform,
</if>
<if test="workspaceId != null">
workspace_id,
<if test="organizationId != null">
organization_id,
</if>
<if test="configuration != null">
configuration,
@ -150,8 +150,8 @@
<if test="platform != null">
#{platform,jdbcType=VARCHAR},
</if>
<if test="workspaceId != null">
#{workspaceId,jdbcType=VARCHAR},
<if test="organizationId != null">
#{organizationId,jdbcType=VARCHAR},
</if>
<if test="configuration != null">
#{configuration,jdbcType=LONGVARBINARY},
@ -173,8 +173,8 @@
<if test="record.platform != null">
platform = #{record.platform,jdbcType=VARCHAR},
</if>
<if test="record.workspaceId != null">
workspace_id = #{record.workspaceId,jdbcType=VARCHAR},
<if test="record.organizationId != null">
organization_id = #{record.organizationId,jdbcType=VARCHAR},
</if>
<if test="record.configuration != null">
configuration = #{record.configuration,jdbcType=LONGVARBINARY},
@ -188,7 +188,7 @@
update service_integration
set id = #{record.id,jdbcType=VARCHAR},
platform = #{record.platform,jdbcType=VARCHAR},
workspace_id = #{record.workspaceId,jdbcType=VARCHAR},
organization_id = #{record.organizationId,jdbcType=VARCHAR},
configuration = #{record.configuration,jdbcType=LONGVARBINARY}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
@ -198,7 +198,7 @@
update service_integration
set id = #{record.id,jdbcType=VARCHAR},
platform = #{record.platform,jdbcType=VARCHAR},
workspace_id = #{record.workspaceId,jdbcType=VARCHAR}
organization_id = #{record.organizationId,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -209,8 +209,8 @@
<if test="platform != null">
platform = #{platform,jdbcType=VARCHAR},
</if>
<if test="workspaceId != null">
workspace_id = #{workspaceId,jdbcType=VARCHAR},
<if test="organizationId != null">
organization_id = #{organizationId,jdbcType=VARCHAR},
</if>
<if test="configuration != null">
configuration = #{configuration,jdbcType=LONGVARBINARY},
@ -221,14 +221,14 @@
<update id="updateByPrimaryKeyWithBLOBs" parameterType="io.metersphere.system.domain.ServiceIntegration">
update service_integration
set platform = #{platform,jdbcType=VARCHAR},
workspace_id = #{workspaceId,jdbcType=VARCHAR},
organization_id = #{organizationId,jdbcType=VARCHAR},
configuration = #{configuration,jdbcType=LONGVARBINARY}
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="io.metersphere.system.domain.ServiceIntegration">
update service_integration
set platform = #{platform,jdbcType=VARCHAR},
workspace_id = #{workspaceId,jdbcType=VARCHAR}
organization_id = #{organizationId,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>

View File

@ -10,7 +10,7 @@
<result column="create_time" jdbcType="BIGINT" property="createTime" />
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
<result column="language" jdbcType="VARCHAR" property="language" />
<result column="last_workspace_id" jdbcType="VARCHAR" property="lastWorkspaceId" />
<result column="last_organization_id" jdbcType="VARCHAR" property="lastOrganizationId" />
<result column="phone" jdbcType="VARCHAR" property="phone" />
<result column="source" jdbcType="VARCHAR" property="source" />
<result column="last_project_id" jdbcType="VARCHAR" property="lastProjectId" />
@ -75,7 +75,7 @@
</where>
</sql>
<sql id="Base_Column_List">
id, `name`, email, `password`, `status`, create_time, update_time, `language`, last_workspace_id,
id, `name`, email, `password`, `status`, create_time, update_time, `language`, last_organization_id,
phone, `source`, last_project_id, create_user
</sql>
<select id="selectByExample" parameterType="io.metersphere.system.domain.UserExample" resultMap="BaseResultMap">
@ -111,12 +111,12 @@
<insert id="insert" parameterType="io.metersphere.system.domain.User">
insert into user (id, `name`, email,
`password`, `status`, create_time,
update_time, `language`, last_workspace_id,
update_time, `language`, last_organization_id,
phone, `source`, last_project_id,
create_user)
values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR},
#{password,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT},
#{updateTime,jdbcType=BIGINT}, #{language,jdbcType=VARCHAR}, #{lastWorkspaceId,jdbcType=VARCHAR},
#{updateTime,jdbcType=BIGINT}, #{language,jdbcType=VARCHAR}, #{lastOrganizationId,jdbcType=VARCHAR},
#{phone,jdbcType=VARCHAR}, #{source,jdbcType=VARCHAR}, #{lastProjectId,jdbcType=VARCHAR},
#{createUser,jdbcType=VARCHAR})
</insert>
@ -147,8 +147,8 @@
<if test="language != null">
`language`,
</if>
<if test="lastWorkspaceId != null">
last_workspace_id,
<if test="lastOrganizationId != null">
last_organization_id,
</if>
<if test="phone != null">
phone,
@ -188,8 +188,8 @@
<if test="language != null">
#{language,jdbcType=VARCHAR},
</if>
<if test="lastWorkspaceId != null">
#{lastWorkspaceId,jdbcType=VARCHAR},
<if test="lastOrganizationId != null">
#{lastOrganizationId,jdbcType=VARCHAR},
</if>
<if test="phone != null">
#{phone,jdbcType=VARCHAR},
@ -238,8 +238,8 @@
<if test="record.language != null">
`language` = #{record.language,jdbcType=VARCHAR},
</if>
<if test="record.lastWorkspaceId != null">
last_workspace_id = #{record.lastWorkspaceId,jdbcType=VARCHAR},
<if test="record.lastOrganizationId != null">
last_organization_id = #{record.lastOrganizationId,jdbcType=VARCHAR},
</if>
<if test="record.phone != null">
phone = #{record.phone,jdbcType=VARCHAR},
@ -268,7 +268,7 @@
create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT},
`language` = #{record.language,jdbcType=VARCHAR},
last_workspace_id = #{record.lastWorkspaceId,jdbcType=VARCHAR},
last_organization_id = #{record.lastOrganizationId,jdbcType=VARCHAR},
phone = #{record.phone,jdbcType=VARCHAR},
`source` = #{record.source,jdbcType=VARCHAR},
last_project_id = #{record.lastProjectId,jdbcType=VARCHAR},
@ -301,8 +301,8 @@
<if test="language != null">
`language` = #{language,jdbcType=VARCHAR},
</if>
<if test="lastWorkspaceId != null">
last_workspace_id = #{lastWorkspaceId,jdbcType=VARCHAR},
<if test="lastOrganizationId != null">
last_organization_id = #{lastOrganizationId,jdbcType=VARCHAR},
</if>
<if test="phone != null">
phone = #{phone,jdbcType=VARCHAR},
@ -328,7 +328,7 @@
create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT},
`language` = #{language,jdbcType=VARCHAR},
last_workspace_id = #{lastWorkspaceId,jdbcType=VARCHAR},
last_organization_id = #{lastOrganizationId,jdbcType=VARCHAR},
phone = #{phone,jdbcType=VARCHAR},
`source` = #{source,jdbcType=VARCHAR},
last_project_id = #{lastProjectId,jdbcType=VARCHAR},

View File

@ -204,23 +204,23 @@ CREATE TABLE IF NOT EXISTS `plugin`
CREATE TABLE IF NOT EXISTS `quota`
(
`id` VARCHAR(50) NOT NULL,
`api` INT DEFAULT NULL COMMENT '接口数量',
`performance` INT DEFAULT NULL COMMENT '性能测试数量',
`max_threads` INT DEFAULT NULL COMMENT '最大并发数',
`duration` INT DEFAULT NULL COMMENT '最大执行时长',
`resource_pool` VARCHAR(1000) DEFAULT NULL COMMENT '资源池列表',
`workspace_id` VARCHAR(50) DEFAULT NULL COMMENT '工作空间ID',
`use_default` BIT(1) DEFAULT NULL COMMENT '是否使用默认值',
`update_time` BIGINT DEFAULT NULL COMMENT '更新时间',
`member` INT DEFAULT NULL COMMENT '成员数量限制',
`project` INT DEFAULT NULL COMMENT '项目数量限制',
`project_id` VARCHAR(50) DEFAULT NULL COMMENT '项目类型配额',
`vum_total` DECIMAL(10, 2) DEFAULT NULL COMMENT '总vum数',
`vum_used` DECIMAL(10, 2) DEFAULT NULL COMMENT '消耗的vum数',
`id` VARCHAR(50) NOT NULL,
`api` INT DEFAULT NULL COMMENT '接口数量',
`performance` INT DEFAULT NULL COMMENT '性能测试数量',
`max_threads` INT DEFAULT NULL COMMENT '最大并发数',
`duration` INT DEFAULT NULL COMMENT '最大执行时长',
`resource_pool` VARCHAR(1000) DEFAULT NULL COMMENT '资源池列表',
`organization_id` VARCHAR(50) DEFAULT NULL COMMENT '组织ID',
`use_default` BIT(1) DEFAULT NULL COMMENT '是否使用默认值',
`update_time` BIGINT DEFAULT NULL COMMENT '更新时间',
`member` INT DEFAULT NULL COMMENT '成员数量限制',
`project` INT DEFAULT NULL COMMENT '项目数量限制',
`project_id` VARCHAR(50) DEFAULT NULL COMMENT '项目类型配额',
`vum_total` DECIMAL(10, 2) DEFAULT NULL COMMENT '总vum数',
`vum_used` DECIMAL(10, 2) DEFAULT NULL COMMENT '消耗的vum数',
PRIMARY KEY (`id`),
KEY `idx_quota_project_id` (`project_id`),
KEY `idx_quota_workspace_id` (`workspace_id`)
KEY `idx_quota_organization_id` (`organization_id`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_general_ci COMMENT ='配额';
@ -242,7 +242,7 @@ CREATE TABLE IF NOT EXISTS `schedule`
`create_time` BIGINT DEFAULT NULL COMMENT 'Create timestamp',
`update_time` BIGINT DEFAULT NULL COMMENT 'Update timestamp',
`project_id` VARCHAR(50) DEFAULT NULL COMMENT '项目ID',
`name` VARCHAR(100) DEFAULT NULL COMMENT '名称',
`name` VARCHAR(255) DEFAULT NULL COMMENT '名称',
`config` VARCHAR(1000) DEFAULT NULL COMMENT '配置',
PRIMARY KEY (`id`),
KEY `idx_resource_id` (`resource_id`),
@ -263,12 +263,12 @@ CREATE TABLE IF NOT EXISTS `schedule`
CREATE TABLE IF NOT EXISTS `service_integration`
(
`id` VARCHAR(50) NOT NULL,
`platform` VARCHAR(50) NOT NULL COMMENT '平台',
`configuration` BLOB NOT NULL,
`workspace_id` VARCHAR(50) DEFAULT NULL COMMENT '工作空间ID',
`id` VARCHAR(50) NOT NULL,
`platform` VARCHAR(50) NOT NULL COMMENT '平台',
`configuration` BLOB NOT NULL,
`organization_id` VARCHAR(50) DEFAULT NULL COMMENT '组织ID',
PRIMARY KEY (`id`),
KEY `idx_workspace_id` (`workspace_id`)
KEY `idx_organization_id` (`organization_id`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_general_ci COMMENT ='服务集成';
@ -344,25 +344,25 @@ CREATE TABLE IF NOT EXISTS `test_resource_pool`
CREATE TABLE IF NOT EXISTS `user`
(
`id` VARCHAR(50) NOT NULL COMMENT '用户ID',
`name` VARCHAR(255) NOT NULL COMMENT '用户名',
`email` VARCHAR(64) NOT NULL COMMENT '用户邮箱',
`password` VARCHAR(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '用户密码',
`status` VARCHAR(50) NOT NULL COMMENT '用户状态,启用或禁用',
`create_time` BIGINT NOT NULL COMMENT '创建时间',
`update_time` BIGINT NOT NULL COMMENT '更新时间',
`language` VARCHAR(30) DEFAULT NULL COMMENT '语言',
`last_workspace_id` VARCHAR(50) DEFAULT NULL COMMENT '当前工作空间ID',
`phone` VARCHAR(50) DEFAULT NULL COMMENT '手机号',
`source` VARCHAR(50) NOT NULL COMMENT '来源LOCAL OIDC CAS',
`last_project_id` VARCHAR(50) DEFAULT NULL COMMENT '当前项目ID',
`create_user` VARCHAR(50) NOT NULL COMMENT '创建人',
`id` VARCHAR(50) NOT NULL COMMENT '用户ID',
`name` VARCHAR(255) NOT NULL COMMENT '用户名',
`email` VARCHAR(64) NOT NULL COMMENT '用户邮箱',
`password` VARCHAR(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '用户密码',
`status` VARCHAR(50) NOT NULL COMMENT '用户状态,启用或禁用',
`create_time` BIGINT NOT NULL COMMENT '创建时间',
`update_time` BIGINT NOT NULL COMMENT '更新时间',
`language` VARCHAR(30) DEFAULT NULL COMMENT '语言',
`last_organization_id` VARCHAR(50) DEFAULT NULL COMMENT '当前组织ID',
`phone` VARCHAR(50) DEFAULT NULL COMMENT '手机号',
`source` VARCHAR(50) NOT NULL COMMENT '来源LOCAL OIDC CAS',
`last_project_id` VARCHAR(50) DEFAULT NULL COMMENT '当前项目ID',
`create_user` VARCHAR(50) NOT NULL COMMENT '创建人',
PRIMARY KEY (`id`),
KEY `idx_name` (`name`),
KEY `idx_email` (`email`),
KEY `idx_create_time` (`create_time`),
KEY `idx_update_time` (`update_time`),
KEY `idx_workspace_id` (`last_workspace_id`),
KEY `idx_organization_id` (`last_organization_id`),
KEY `idx_project_id` (`last_project_id`),
KEY `idx_create_user` (`create_user`)
) ENGINE = InnoDB
@ -378,7 +378,7 @@ CREATE TABLE IF NOT EXISTS `user_role_relation`
`id` VARCHAR(50) NOT NULL COMMENT '用户组关系ID',
`user_id` VARCHAR(50) NOT NULL COMMENT '用户ID',
`role_id` VARCHAR(50) NOT NULL COMMENT '组ID',
`source_id` VARCHAR(50) NOT NULL COMMENT '工作空间或项目ID',
`source_id` VARCHAR(50) NOT NULL COMMENT '组织或项目ID',
`create_time` BIGINT NOT NULL COMMENT '创建时间',
`update_time` BIGINT NOT NULL COMMENT '更新时间',
PRIMARY KEY (`id`),
@ -428,13 +428,13 @@ CREATE TABLE IF NOT EXISTS `user_key`
COLLATE = utf8mb4_general_ci COMMENT ='用户api key';
--
-- Table structure for table `workspace`
-- Table structure for table `organization`
--
CREATE TABLE IF NOT EXISTS `workspace`
CREATE TABLE IF NOT EXISTS `organization`
(
`id` VARCHAR(50) NOT NULL COMMENT '工作空间ID',
`name` VARCHAR(100) NOT NULL COMMENT '工作空间名称',
`id` VARCHAR(50) NOT NULL COMMENT '组织ID',
`name` VARCHAR(255) NOT NULL COMMENT '组织名称',
`description` VARCHAR(500) DEFAULT NULL COMMENT '描述',
`create_time` BIGINT NOT NULL COMMENT '创建时间',
`update_time` BIGINT NOT NULL COMMENT '更新时间',
@ -446,7 +446,7 @@ CREATE TABLE IF NOT EXISTS `workspace`
KEY `idx_update_time` (`update_time`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_general_ci COMMENT ='工作空间';
COLLATE = utf8mb4_general_ci COMMENT ='组织';
--
-- Table structure for table `user_extend`

View File

@ -177,16 +177,16 @@ CREATE TABLE IF NOT EXISTS `file_module`
CREATE TABLE IF NOT EXISTS `project`
(
`id` VARCHAR(50) NOT NULL COMMENT '项目ID',
`workspace_id` VARCHAR(50) NOT NULL COMMENT '工作空间ID',
`name` VARCHAR(255) NOT NULL COMMENT '项目名称',
`description` VARCHAR(500) DEFAULT NULL COMMENT '项目描述',
`create_time` BIGINT NOT NULL COMMENT '创建时间',
`update_time` BIGINT NOT NULL COMMENT '更新时间',
`create_user` VARCHAR(50) DEFAULT NULL COMMENT '创建人',
`system_id` VARCHAR(50) DEFAULT NULL,
`id` VARCHAR(50) NOT NULL COMMENT '项目ID',
`organization_id` VARCHAR(50) NOT NULL COMMENT '组织ID',
`name` VARCHAR(255) NOT NULL COMMENT '项目名称',
`description` VARCHAR(500) DEFAULT NULL COMMENT '项目描述',
`create_time` BIGINT NOT NULL COMMENT '创建时间',
`update_time` BIGINT NOT NULL COMMENT '更新时间',
`create_user` VARCHAR(50) DEFAULT NULL COMMENT '创建人',
`system_id` VARCHAR(50) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `idx_workspace_id` (`workspace_id`),
KEY `idx_organization_id` (`organization_id`),
KEY `idx_create_user` (`create_user`),
KEY `idx_create_time` (`create_time`),
KEY `idex_update_time` (`update_time`),

View File

@ -1,13 +1,13 @@
-- set innodb lock wait timeout
SET SESSION innodb_lock_wait_timeout = 7200;
-- 初始化工作空间
INSERT INTO workspace (id, name, description, create_user, create_time, update_time) VALUES (uuid(), '默认工作空间', '系统默认创建的工作空间', 'admin', unix_timestamp() * 1000, unix_timestamp() * 1000);
-- 初始化组织
INSERT INTO organization (id, name, description, create_user, create_time, update_time) VALUES (uuid(), '默认组织', '系统默认创建的组织', 'admin', unix_timestamp() * 1000, unix_timestamp() * 1000);
-- 初始化项目
INSERT INTO project (id, workspace_id, name, description, create_user, create_time, update_time) VALUES (uuid(), (SELECT id FROM workspace WHERE name LIKE '默认工作空间'), '默认项目', '系统默认创建的项目', 'admin', unix_timestamp() * 1000, unix_timestamp() * 1000);
INSERT INTO project (id, organization_id, name, description, create_user, create_time, update_time) VALUES (uuid(), (SELECT id FROM organization WHERE name LIKE '默认组织'), '默认项目', '系统默认创建的项目', 'admin', unix_timestamp() * 1000, unix_timestamp() * 1000);
-- 初始化用户
insert into user(id, name, email, password, status, create_time, update_time, language, last_workspace_id, phone, source, last_project_id, create_user)
insert into user(id, name, email, password, status, create_time, update_time, language, last_organization_id, phone, source, last_project_id, create_user)
VALUES ('admin', 'Administrator', 'admin@metersphere.io', MD5('metersphere'), '1', UNIX_TIMESTAMP() * 1000, UNIX_TIMESTAMP() * 1000, NULL, NUll, '', 'LOCAL', NULL, 'admin');
-- 初始化用户组
@ -15,9 +15,9 @@ INSERT INTO user_role (id, name, description, `system`, type, create_time, updat
INSERT INTO user_role (id, name, description, `system`, type, create_time, update_time, create_user, scope_id) VALUES ('project_admin', '项目管理员(系统)', '项目管理员', 1, 'PROJECT', 1620674220004, 1620674220000, 'admin', 'global');
INSERT INTO user_role (id, name, description, `system`, type, create_time, update_time, create_user, scope_id) VALUES ('project_member', '项目成员(系统)', '项目成员', 1, 'PROJECT', 1620674220005, 1620674220000, 'admin', 'global');
INSERT INTO user_role (id, name, description, `system`, type, create_time, update_time, create_user, scope_id) VALUES ('read_only', '只读用户(系统)', '只读用户', 1, 'PROJECT', 1620674220006, 1620674220000, 'admin', 'global');
INSERT INTO user_role (id, name, description, `system`, type, create_time, update_time, create_user, scope_id) VALUES ('super', '超级管理员(系统)', '拥有系统全部工作空间以及项目的操作权限', 1, 'SYSTEM', 1671008474000, 1671008474000, 'admin', 'system');
INSERT INTO user_role (id, name, description, `system`, type, create_time, update_time, create_user, scope_id) VALUES ('ws_admin', '工作空间管理员(系统)', '工作空间管理员', 1, 'WORKSPACE', 1620674220007, 1620674220000, 'admin', 'global');
INSERT INTO user_role (id, name, description, `system`, type, create_time, update_time, create_user, scope_id) VALUES ('ws_member', '工作空间成员(系统)', '工作空间成员', 1, 'WORKSPACE', 1620674220008, 1620674220000, 'admin', 'global');
INSERT INTO user_role (id, name, description, `system`, type, create_time, update_time, create_user, scope_id) VALUES ('super', '超级管理员(系统)', '拥有系统全部组织以及项目的操作权限', 1, 'SYSTEM', 1671008474000, 1671008474000, 'admin', 'system');
INSERT INTO user_role (id, name, description, `system`, type, create_time, update_time, create_user, scope_id) VALUES ('org_admin', '组织管理员(系统)', '组织管理员', 1, 'ORGANIZATION', 1620674220007, 1620674220000, 'admin', 'global');
INSERT INTO user_role (id, name, description, `system`, type, create_time, update_time, create_user, scope_id) VALUES ('org_member', '组织成员(系统)', '组织成员', 1, 'ORGANIZATION', 1620674220008, 1620674220000, 'admin', 'global');
-- 初始化用户和组的关系
INSERT INTO user_role_relation (id, user_id, role_id, source_id, create_time, update_time) VALUES ('c3bb9b4f-46d8-4952-9681-8889974487d1', 'admin', 'super', 'system', 1684747668375, 1684747668375);
@ -59,54 +59,54 @@ INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('15bfd321-d812-46e5-a98f-3220e9515ad6', 'admin', 'PERSONAL_INFORMATION:READ+UI_SETTING', 'PERSONAL_INFORMATION');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('152ead91-a672-4753-904c-815a8d4602a3', 'admin', 'SYSTEM_ROLE:READ+DELETE', 'SYSTEM_ROLE');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('03a829ec-0306-4d92-9a4f-b451dc01617d', 'admin', 'SYSTEM_ROLE:READ+ADD', 'SYSTEM_ROLE');
-- 工作空间管理员权限
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2ef69c80-3bc6-11ed-9680-0242ac130008', 'ws_admin', 'WORKSPACE_PROJECT_MANAGER:READ+DELETE_USER', 'WORKSPACE_PROJECT_MANAGER');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2ef68cda-3bc6-11ed-9680-0242ac130008', 'ws_admin', 'WORKSPACE_PROJECT_MANAGER:READ+ADD_USER', 'WORKSPACE_PROJECT_MANAGER');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2ef67aba-3bc6-11ed-9680-0242ac130008', 'ws_admin', 'WORKSPACE_PROJECT_MANAGER:READ+UPDATE_USER', 'WORKSPACE_PROJECT_MANAGER');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2eb8cdb1-3bc6-11ed-9680-0242ac130008', 'ws_admin', 'WORKSPACE_QUOTA:READ+UPDATE', 'WORKSPACE_QUOTA');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2eb8bc41-3bc6-11ed-9680-0242ac130008', 'ws_admin', 'WORKSPACE_QUOTA:READ', 'WORKSPACE_QUOTA');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2dde1a80-3bc6-11ed-9680-0242ac130008', 'ws_admin', 'PERSONAL_INFORMATION:READ+UPDATE_PASSWORD', 'PERSONAL_INFORMATION');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2dde1a2e-3bc6-11ed-9680-0242ac130008', 'ws_admin', 'PERSONAL_INFORMATION:READ+API_KEYS', 'PERSONAL_INFORMATION');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2dde19c9-3bc6-11ed-9680-0242ac130008', 'ws_admin', 'PERSONAL_INFORMATION:READ+THIRD_ACCOUNT', 'PERSONAL_INFORMATION');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2dde18f5-3bc6-11ed-9680-0242ac130008', 'ws_admin', 'PERSONAL_INFORMATION:READ+UPDATE', 'PERSONAL_INFORMATION');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2d140aab-3bc6-11ed-9680-0242ac130008', 'ws_admin', 'WORKSPACE_PROJECT_ENVIRONMENT:READ+DELETE_GROUP', 'WORKSPACE_PROJECT_ENVIRONMENT');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2d13f889-3bc6-11ed-9680-0242ac130008', 'ws_admin', 'WORKSPACE_PROJECT_ENVIRONMENT:READ+COPY_GROUP', 'WORKSPACE_PROJECT_ENVIRONMENT');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2d13e8c8-3bc6-11ed-9680-0242ac130008', 'ws_admin', 'WORKSPACE_PROJECT_ENVIRONMENT:READ+UPDATE_GROUP', 'WORKSPACE_PROJECT_ENVIRONMENT');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2d13d1c8-3bc6-11ed-9680-0242ac130008', 'ws_admin', 'WORKSPACE_PROJECT_ENVIRONMENT:READ+CREATE_GROUP', 'WORKSPACE_PROJECT_ENVIRONMENT');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2cea1857-3bc6-11ed-9680-0242ac130008', 'ws_admin', 'WORKSPACE_PROJECT_MANAGER:READ+UPLOAD_JAR', 'WORKSPACE_PROJECT_MANAGER');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2caf4318-3bc6-11ed-9680-0242ac130008', 'ws_admin', 'WORKSPACE_MESSAGE:READ+UPDATE', 'WORKSPACE_MESSAGE');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2caf15cd-3bc6-11ed-9680-0242ac130008', 'ws_admin', 'WORKSPACE_MESSAGE:READ', 'WORKSPACE_MESSAGE');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2caf0246-3bc6-11ed-9680-0242ac130008', 'ws_admin', 'WORKSPACE_SERVICE:READ+UPDATE', 'WORKSPACE_SERVICE');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2caed957-3bc6-11ed-9680-0242ac130008', 'ws_admin', 'WORKSPACE_SERVICE:READ', 'WORKSPACE_SERVICE');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2b817d1d-3bc6-11ed-9680-0242ac130008', 'ws_admin', 'WORKSPACE_OPERATING_LOG:READ', 'WORKSPACE_OPERATING_LOG');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2b816897-3bc6-11ed-9680-0242ac130008', 'ws_admin', 'WORKSPACE_PROJECT_ENVIRONMENT:READ+DELETE', 'WORKSPACE_PROJECT_ENVIRONMENT');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2b81585a-3bc6-11ed-9680-0242ac130008', 'ws_admin', 'WORKSPACE_PROJECT_ENVIRONMENT:READ+UPDATE', 'WORKSPACE_PROJECT_ENVIRONMENT');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2b8146ea-3bc6-11ed-9680-0242ac130008', 'ws_admin', 'WORKSPACE_PROJECT_ENVIRONMENT:READ+EXPORT', 'WORKSPACE_PROJECT_ENVIRONMENT');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2b812d70-3bc6-11ed-9680-0242ac130008', 'ws_admin', 'WORKSPACE_PROJECT_ENVIRONMENT:READ+IMPORT', 'WORKSPACE_PROJECT_ENVIRONMENT');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2b811ba3-3bc6-11ed-9680-0242ac130008', 'ws_admin', 'WORKSPACE_PROJECT_ENVIRONMENT:READ+ADD', 'WORKSPACE_PROJECT_ENVIRONMENT');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2b810b30-3bc6-11ed-9680-0242ac130008', 'ws_admin', 'WORKSPACE_PROJECT_ENVIRONMENT:READ+COPY', 'WORKSPACE_PROJECT_ENVIRONMENT');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2b80fb44-3bc6-11ed-9680-0242ac130008', 'ws_admin', 'WORKSPACE_PROJECT_ENVIRONMENT:READ', 'WORKSPACE_PROJECT_ENVIRONMENT');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2b80e844-3bc6-11ed-9680-0242ac130008', 'ws_admin', 'WORKSPACE_PROJECT_MANAGER:READ+UPDATE', 'WORKSPACE_PROJECT_MANAGER');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2b80d69a-3bc6-11ed-9680-0242ac130008', 'ws_admin', 'WORKSPACE_PROJECT_MANAGER:READ+DELETE', 'WORKSPACE_PROJECT_MANAGER');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2b80c5fe-3bc6-11ed-9680-0242ac130008', 'ws_admin', 'WORKSPACE_PROJECT_MANAGER:READ+ADD', 'WORKSPACE_PROJECT_MANAGER');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2b80b588-3bc6-11ed-9680-0242ac130008', 'ws_admin', 'WORKSPACE_PROJECT_MANAGER:READ', 'WORKSPACE_PROJECT_MANAGER');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2b80a580-3bc6-11ed-9680-0242ac130008', 'ws_admin', 'WORKSPACE_TEMPLATE:READ+CASE_TEMPLATE', 'WORKSPACE_TEMPLATE');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2b8091ab-3bc6-11ed-9680-0242ac130008', 'ws_admin', 'WORKSPACE_TEMPLATE:READ+ISSUE_TEMPLATE', 'WORKSPACE_TEMPLATE');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2b8081e3-3bc6-11ed-9680-0242ac130008', 'ws_admin', 'WORKSPACE_TEMPLATE:READ', 'WORKSPACE_TEMPLATE');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2b806fbf-3bc6-11ed-9680-0242ac130008', 'ws_admin', 'WORKSPACE_USER:READ+UPDATE', 'WORKSPACE_USER');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2b80601c-3bc6-11ed-9680-0242ac130008', 'ws_admin', 'WORKSPACE_USER:READ+DELETE', 'WORKSPACE_USER');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2b805052-3bc6-11ed-9680-0242ac130008', 'ws_admin', 'WORKSPACE_USER:READ', 'WORKSPACE_USER');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2b802f2a-3bc6-11ed-9680-0242ac130008', 'ws_admin', 'WORKSPACE_TEMPLATE:READ+CUSTOM', 'WORKSPACE_TEMPLATE');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2b801d1f-3bc6-11ed-9680-0242ac130008', 'ws_admin', 'WORKSPACE_USER:READ+ADD', 'WORKSPACE_USER');
-- 工作空间成员权限
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2cea2a4c-3bc6-11ed-9680-0242ac130008', 'ws_member', 'WORKSPACE_PROJECT_MANAGER:READ+UPLOAD_JAR', 'WORKSPACE_PROJECT_MANAGER');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2caf28b0-3bc6-11ed-9680-0242ac130008', 'ws_member', 'WORKSPACE_MESSAGE:READ', 'WORKSPACE_MESSAGE');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2caeef78-3bc6-11ed-9680-0242ac130008', 'ws_member', 'WORKSPACE_SERVICE:READ', 'WORKSPACE_SERVICE');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2b81d869-3bc6-11ed-9680-0242ac130008', 'ws_member', 'WORKSPACE_OPERATING_LOG:READ', 'WORKSPACE_OPERATING_LOG');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2b81c48b-3bc6-11ed-9680-0242ac130008', 'ws_member', 'WORKSPACE_PROJECT_MANAGER:READ', 'WORKSPACE_PROJECT_MANAGER');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2b81b3ae-3bc6-11ed-9680-0242ac130008', 'ws_member', 'WORKSPACE_PROJECT_ENVIRONMENT:READ', 'WORKSPACE_PROJECT_ENVIRONMENT');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2b81a16c-3bc6-11ed-9680-0242ac130008', 'ws_member', 'WORKSPACE_TEMPLATE:READ', 'WORKSPACE_TEMPLATE');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2b818ee7-3bc6-11ed-9680-0242ac130008', 'ws_member', 'WORKSPACE_USER:READ', 'WORKSPACE_USER');
-- 组织管理员权限
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2ef69c80-3bc6-11ed-9680-0242ac130008', 'org_admin', 'ORGANIZATION_PROJECT_MANAGER:READ+DELETE_USER', 'ORGANIZATION_PROJECT_MANAGER');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2ef68cda-3bc6-11ed-9680-0242ac130008', 'org_admin', 'ORGANIZATION_PROJECT_MANAGER:READ+ADD_USER', 'ORGANIZATION_PROJECT_MANAGER');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2ef67aba-3bc6-11ed-9680-0242ac130008', 'org_admin', 'ORGANIZATION_PROJECT_MANAGER:READ+UPDATE_USER', 'ORGANIZATION_PROJECT_MANAGER');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2eb8cdb1-3bc6-11ed-9680-0242ac130008', 'org_admin', 'ORGANIZATION_QUOTA:READ+UPDATE', 'ORGANIZATION_QUOTA');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2eb8bc41-3bc6-11ed-9680-0242ac130008', 'org_admin', 'ORGANIZATION_QUOTA:READ', 'ORGANIZATION_QUOTA');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2dde1a80-3bc6-11ed-9680-0242ac130008', 'org_admin', 'PERSONAL_INFORMATION:READ+UPDATE_PASSWORD', 'PERSONAL_INFORMATION');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2dde1a2e-3bc6-11ed-9680-0242ac130008', 'org_admin', 'PERSONAL_INFORMATION:READ+API_KEYS', 'PERSONAL_INFORMATION');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2dde19c9-3bc6-11ed-9680-0242ac130008', 'org_admin', 'PERSONAL_INFORMATION:READ+THIRD_ACCOUNT', 'PERSONAL_INFORMATION');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2dde18f5-3bc6-11ed-9680-0242ac130008', 'org_admin', 'PERSONAL_INFORMATION:READ+UPDATE', 'PERSONAL_INFORMATION');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2d140aab-3bc6-11ed-9680-0242ac130008', 'org_admin', 'ORGANIZATION_PROJECT_ENVIRONMENT:READ+DELETE_GROUP', 'ORGANIZATION_PROJECT_ENVIRONMENT');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2d13f889-3bc6-11ed-9680-0242ac130008', 'org_admin', 'ORGANIZATION_PROJECT_ENVIRONMENT:READ+COPY_GROUP', 'ORGANIZATION_PROJECT_ENVIRONMENT');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2d13e8c8-3bc6-11ed-9680-0242ac130008', 'org_admin', 'ORGANIZATION_PROJECT_ENVIRONMENT:READ+UPDATE_GROUP', 'ORGANIZATION_PROJECT_ENVIRONMENT');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2d13d1c8-3bc6-11ed-9680-0242ac130008', 'org_admin', 'ORGANIZATION_PROJECT_ENVIRONMENT:READ+CREATE_GROUP', 'ORGANIZATION_PROJECT_ENVIRONMENT');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2cea1857-3bc6-11ed-9680-0242ac130008', 'org_admin', 'ORGANIZATION_PROJECT_MANAGER:READ+UPLOAD_JAR', 'ORGANIZATION_PROJECT_MANAGER');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2caf4318-3bc6-11ed-9680-0242ac130008', 'org_admin', 'ORGANIZATION_MESSAGE:READ+UPDATE', 'ORGANIZATION_MESSAGE');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2caf15cd-3bc6-11ed-9680-0242ac130008', 'org_admin', 'ORGANIZATION_MESSAGE:READ', 'ORGANIZATION_MESSAGE');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2caf0246-3bc6-11ed-9680-0242ac130008', 'org_admin', 'ORGANIZATION_SERVICE:READ+UPDATE', 'ORGANIZATION_SERVICE');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2caed957-3bc6-11ed-9680-0242ac130008', 'org_admin', 'ORGANIZATION_SERVICE:READ', 'ORGANIZATION_SERVICE');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2b817d1d-3bc6-11ed-9680-0242ac130008', 'org_admin', 'ORGANIZATION_OPERATING_LOG:READ', 'ORGANIZATION_OPERATING_LOG');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2b816897-3bc6-11ed-9680-0242ac130008', 'org_admin', 'ORGANIZATION_PROJECT_ENVIRONMENT:READ+DELETE', 'ORGANIZATION_PROJECT_ENVIRONMENT');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2b81585a-3bc6-11ed-9680-0242ac130008', 'org_admin', 'ORGANIZATION_PROJECT_ENVIRONMENT:READ+UPDATE', 'ORGANIZATION_PROJECT_ENVIRONMENT');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2b8146ea-3bc6-11ed-9680-0242ac130008', 'org_admin', 'ORGANIZATION_PROJECT_ENVIRONMENT:READ+EXPORT', 'ORGANIZATION_PROJECT_ENVIRONMENT');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2b812d70-3bc6-11ed-9680-0242ac130008', 'org_admin', 'ORGANIZATION_PROJECT_ENVIRONMENT:READ+IMPORT', 'ORGANIZATION_PROJECT_ENVIRONMENT');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2b811ba3-3bc6-11ed-9680-0242ac130008', 'org_admin', 'ORGANIZATION_PROJECT_ENVIRONMENT:READ+ADD', 'ORGANIZATION_PROJECT_ENVIRONMENT');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2b810b30-3bc6-11ed-9680-0242ac130008', 'org_admin', 'ORGANIZATION_PROJECT_ENVIRONMENT:READ+COPY', 'ORGANIZATION_PROJECT_ENVIRONMENT');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2b80fb44-3bc6-11ed-9680-0242ac130008', 'org_admin', 'ORGANIZATION_PROJECT_ENVIRONMENT:READ', 'ORGANIZATION_PROJECT_ENVIRONMENT');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2b80e844-3bc6-11ed-9680-0242ac130008', 'org_admin', 'ORGANIZATION_PROJECT_MANAGER:READ+UPDATE', 'ORGANIZATION_PROJECT_MANAGER');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2b80d69a-3bc6-11ed-9680-0242ac130008', 'org_admin', 'ORGANIZATION_PROJECT_MANAGER:READ+DELETE', 'ORGANIZATION_PROJECT_MANAGER');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2b80c5fe-3bc6-11ed-9680-0242ac130008', 'org_admin', 'ORGANIZATION_PROJECT_MANAGER:READ+ADD', 'ORGANIZATION_PROJECT_MANAGER');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2b80b588-3bc6-11ed-9680-0242ac130008', 'org_admin', 'ORGANIZATION_PROJECT_MANAGER:READ', 'ORGANIZATION_PROJECT_MANAGER');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2b80a580-3bc6-11ed-9680-0242ac130008', 'org_admin', 'ORGANIZATION_TEMPLATE:READ+CASE_TEMPLATE', 'ORGANIZATION_TEMPLATE');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2b8091ab-3bc6-11ed-9680-0242ac130008', 'org_admin', 'ORGANIZATION_TEMPLATE:READ+ISSUE_TEMPLATE', 'ORGANIZATION_TEMPLATE');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2b8081e3-3bc6-11ed-9680-0242ac130008', 'org_admin', 'ORGANIZATION_TEMPLATE:READ', 'ORGANIZATION_TEMPLATE');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2b806fbf-3bc6-11ed-9680-0242ac130008', 'org_admin', 'ORGANIZATION_USER:READ+UPDATE', 'ORGANIZATION_USER');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2b80601c-3bc6-11ed-9680-0242ac130008', 'org_admin', 'ORGANIZATION_USER:READ+DELETE', 'ORGANIZATION_USER');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2b805052-3bc6-11ed-9680-0242ac130008', 'org_admin', 'ORGANIZATION_USER:READ', 'ORGANIZATION_USER');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2b802f2a-3bc6-11ed-9680-0242ac130008', 'org_admin', 'ORGANIZATION_TEMPLATE:READ+CUSTOM', 'ORGANIZATION_TEMPLATE');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2b801d1f-3bc6-11ed-9680-0242ac130008', 'org_admin', 'ORGANIZATION_USER:READ+ADD', 'ORGANIZATION_USER');
-- 组织成员权限
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2cea2a4c-3bc6-11ed-9680-0242ac130008', 'org_member', 'ORGANIZATION_PROJECT_MANAGER:READ+UPLOAD_JAR', 'ORGANIZATION_PROJECT_MANAGER');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2caf28b0-3bc6-11ed-9680-0242ac130008', 'org_member', 'ORGANIZATION_MESSAGE:READ', 'ORGANIZATION_MESSAGE');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2caeef78-3bc6-11ed-9680-0242ac130008', 'org_member', 'ORGANIZATION_SERVICE:READ', 'ORGANIZATION_SERVICE');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2b81d869-3bc6-11ed-9680-0242ac130008', 'org_member', 'ORGANIZATION_OPERATING_LOG:READ', 'ORGANIZATION_OPERATING_LOG');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2b81c48b-3bc6-11ed-9680-0242ac130008', 'org_member', 'ORGANIZATION_PROJECT_MANAGER:READ', 'ORGANIZATION_PROJECT_MANAGER');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2b81b3ae-3bc6-11ed-9680-0242ac130008', 'org_member', 'ORGANIZATION_PROJECT_ENVIRONMENT:READ', 'ORGANIZATION_PROJECT_ENVIRONMENT');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2b81a16c-3bc6-11ed-9680-0242ac130008', 'org_member', 'ORGANIZATION_TEMPLATE:READ', 'ORGANIZATION_TEMPLATE');
INSERT INTO user_role_permission (id, role_id, permission_id, module_id) VALUES ('2b818ee7-3bc6-11ed-9680-0242ac130008', 'org_member', 'ORGANIZATION_USER:READ', 'ORGANIZATION_USER');
-- set innodb lock wait timeout to default

View File

@ -90,7 +90,7 @@
<table tableName="user_role"/>
<table tableName="user_role_permission"/>
<table tableName="user_role_relation"/>
<table tableName="workspace"/>
<table tableName="organization"/>
<!-- 要忽略的字段-->
<!-- <table tableName="test_case">

View File

@ -103,7 +103,7 @@ public interface Platform {
* Get请求的代理
* 目前使用场景富文本框中如果有图片是存储在第三方平台MS 通过 url 访问
* 这时如果第三方平台需要登入才能访问到静态资源可以通过将富文本框图片内容构造如下格式访问
* ![name](/resource/md/get/path?platform=Jira?project_id=&workspace_id=&path=)
* ![name](/resource/md/get/path?platform=Jira?project_id=&organization_id=&path=)
* @param path
* @return
*/

View File

@ -7,6 +7,6 @@ import lombok.Setter;
@Setter
public class PlatformRequest {
private String integrationConfig;
private String workspaceId;
private String organizationId;
private String userPlatformInfo;
}

View File

@ -14,11 +14,6 @@ public class PermissionConstants {
public static final String SYSTEM_ORGANIZATION_READ_UPDATE = "SYSTEM_ORGANIZATION:READ+UPDATE";
public static final String SYSTEM_ORGANIZATION_READ_DELETE = "SYSTEM_ORGANIZATION:READ+DELETE";
public static final String SYSTEM_WORKSPACE_READ = "SYSTEM_WORKSPACE:READ";
public static final String SYSTEM_WORKSPACE_READ_ADD = "SYSTEM_WORKSPACE:READ+ADD";
public static final String SYSTEM_WORKSPACE_READ_UPDATE = "SYSTEM_WORKSPACE:READ+UPDATE";
public static final String SYSTEM_WORKSPACE_READ_DELETE = "SYSTEM_WORKSPACE:READ+DELETE";
public static final String SYSTEM_TEST_POOL_READ = "SYSTEM_TEST_POOL:READ";
public static final String SYSTEM_TEST_POOL_READ_ADD = "SYSTEM_TEST_POOL:READ+ADD";
public static final String SYSTEM_TEST_POOL_READ_UPDATE = "SYSTEM_TEST_POOL:READ+UPDATE";
@ -40,29 +35,29 @@ public class PermissionConstants {
public static final String SYSTEM_OPERATING_LOG_READ = "SYSTEM_OPERATING_LOG:READ";
public static final String WORKSPACE_SERVICE_READ = "WORKSPACE_SERVICE:READ";
public static final String WORKSPACE_SERVICE_READ_UPDATE = "WORKSPACE_SERVICE:READ+UPDATE";
public static final String ORGANIZATION_SERVICE_READ = "ORGANIZATION_SERVICE:READ";
public static final String ORGANIZATION_SERVICE_READ_UPDATE = "ORGANIZATION_SERVICE:READ+UPDATE";
public static final String WORKSPACE_USER_READ = "WORKSPACE_USER:READ";
public static final String WORKSPACE_USER_READ_ADD = "WORKSPACE_USER:READ+ADD";
public static final String WORKSPACE_USER_READ_UPDATE = "WORKSPACE_USER:READ+UPDATE";
public static final String WORKSPACE_USER_READ_DELETE = "WORKSPACE_USER:READ+DELETE";
public static final String ORGANIZATION_USER_READ = "ORGANIZATION_USER:READ";
public static final String ORGANIZATION_USER_READ_ADD = "ORGANIZATION_USER:READ+ADD";
public static final String ORGANIZATION_USER_READ_UPDATE = "ORGANIZATION_USER:READ+UPDATE";
public static final String ORGANIZATION_USER_READ_DELETE = "ORGANIZATION_USER:READ+DELETE";
public static final String WORKSPACE_PROJECT_MANAGER_READ = "WORKSPACE_PROJECT_MANAGER:READ";
public static final String WORKSPACE_PROJECT_MANAGER_READ_ADD = "WORKSPACE_PROJECT_MANAGER:READ+ADD";
public static final String WORKSPACE_PROJECT_MANAGER_READ_UPDATE = "WORKSPACE_PROJECT_MANAGER:READ+UPDATE";
public static final String WORKSPACE_PROJECT_MANAGER_READ_DELETE = "WORKSPACE_PROJECT_MANAGER:READ+DELETE";
public static final String WORKSPACE_PROJECT_MANAGER_READ_ADD_USER = "WORKSPACE_PROJECT_MANAGER:READ+ADD_USER";
public static final String ORGANIZATION_PROJECT_MANAGER_READ = "ORGANIZATION_PROJECT_MANAGER:READ";
public static final String ORGANIZATION_PROJECT_MANAGER_READ_ADD = "ORGANIZATION_PROJECT_MANAGER:READ+ADD";
public static final String ORGANIZATION_PROJECT_MANAGER_READ_UPDATE = "ORGANIZATION_PROJECT_MANAGER:READ+UPDATE";
public static final String ORGANIZATION_PROJECT_MANAGER_READ_DELETE = "ORGANIZATION_PROJECT_MANAGER:READ+DELETE";
public static final String ORGANIZATION_PROJECT_MANAGER_READ_ADD_USER = "ORGANIZATION_PROJECT_MANAGER:READ+ADD_USER";
public static final String WORKSPACE_PROJECT_ENVIRONMENT_READ = "WORKSPACE_PROJECT_ENVIRONMENT:READ";
public static final String WORKSPACE_PROJECT_ENVIRONMENT_READ_ADD = "WORKSPACE_PROJECT_ENVIRONMENT:READ+ADD";
public static final String WORKSPACE_PROJECT_ENVIRONMENT_READ_UPDATE = "WORKSPACE_PROJECT_ENVIRONMENT:READ+UPDATE";
public static final String WORKSPACE_PROJECT_ENVIRONMENT_READ_DELETE = "WORKSPACE_PROJECT_ENVIRONMENT:READ+DELETE";
public static final String WORKSPACE_PROJECT_ENVIRONMENT_READ_COPY = "WORKSPACE_PROJECT_ENVIRONMENT:READ+COPY";
public static final String WORKSPACE_PROJECT_ENVIRONMENT_READ_IMPORT = "WORKSPACE_PROJECT_ENVIRONMENT:READ+IMPORT";
public static final String WORKSPACE_PROJECT_ENVIRONMENT_READ_EXPORT = "WORKSPACE_PROJECT_ENVIRONMENT:READ+EXPORT";
public static final String ORGANIZATION_PROJECT_ENVIRONMENT_READ = "ORGANIZATION_PROJECT_ENVIRONMENT:READ";
public static final String ORGANIZATION_PROJECT_ENVIRONMENT_READ_ADD = "ORGANIZATION_PROJECT_ENVIRONMENT:READ+ADD";
public static final String ORGANIZATION_PROJECT_ENVIRONMENT_READ_UPDATE = "ORGANIZATION_PROJECT_ENVIRONMENT:READ+UPDATE";
public static final String ORGANIZATION_PROJECT_ENVIRONMENT_READ_DELETE = "ORGANIZATION_PROJECT_ENVIRONMENT:READ+DELETE";
public static final String ORGANIZATION_PROJECT_ENVIRONMENT_READ_COPY = "ORGANIZATION_PROJECT_ENVIRONMENT:READ+COPY";
public static final String ORGANIZATION_PROJECT_ENVIRONMENT_READ_IMPORT = "ORGANIZATION_PROJECT_ENVIRONMENT:READ+IMPORT";
public static final String ORGANIZATION_PROJECT_ENVIRONMENT_READ_EXPORT = "ORGANIZATION_PROJECT_ENVIRONMENT:READ+EXPORT";
public static final String WORKSPACE_OPERATING_LOG_READ = "WORKSPACE_OPERATING_LOG:READ";
public static final String ORGANIZATION_OPERATING_LOG_READ = "ORGANIZATION_OPERATING_LOG:READ";
public static final String PROJECT_USER_READ = "PROJECT_USER:READ";
public static final String PROJECT_USER_READ_ADD = "PROJECT_USER:READ+ADD";

View File

@ -9,7 +9,7 @@ public class SessionConstants {
public final static String CSRF_TOKEN = "CSRF-TOKEN";
public final static String SSO_TOKEN = "SSO-TOKEN";
public final static String CURRENT_PROJECT = "PROJECT";
public final static String CURRENT_WORKSPACE = "WORKSPACE";
public final static String CURRENT_ORGANIZATION = "ORGANIZATION";
public final static String ACCESS_KEY = "accessKey";
public final static String SIGNATURE = "signature";
}

View File

@ -112,7 +112,7 @@ public class MybatisInterceptor implements Interceptor {
if (MapUtils.isEmpty(localInterceptorConfigMap)) {
return obj;
}
Object newObject = obj.getClass().newInstance();
Object newObject = obj.getClass().getDeclaredConstructor().newInstance();
BeanUtils.copyBean(newObject, obj);
for (String attrName : localInterceptorConfigMap.keySet()) {
if (MapUtils.isEmpty(localInterceptorConfigMap.get(attrName))) {
@ -145,7 +145,7 @@ public class MybatisInterceptor implements Interceptor {
if (MapUtils.isEmpty(localDecryptConfigMap)) {
return obj;
}
result = obj.getClass().newInstance();
result = obj.getClass().getDeclaredConstructor().newInstance();
BeanUtils.copyBean(result, obj);
for (String attrName : localDecryptConfigMap.keySet()) {
if (MapUtils.isEmpty(localDecryptConfigMap.get(attrName))) {

View File

@ -11,8 +11,6 @@ public interface BaseUserMapper {
List<User> findAll();
void insert(User user);
void batchSave(@Param("users") List<User> users);
boolean isSuperUser(String userId);

View File

@ -13,23 +13,15 @@
FROM user
</select>
<insert id="insert">
INSERT INTO user(id, name, email, password, status, create_time, update_time, language, last_workspace_id,
phone,
source, last_project_id, create_user)
VALUES (#{id}, #{name}, #{email}, #{password}, #{status}, #{createTime}, #{updateTime}, #{language},
#{lastWorkspaceId}, #{phone}, #{source}, #{lastProjectId}, #{createUser})
</insert>
<insert id="batchSave">
INSERT INTO user(id, name, email, password, status, create_time, update_time, language, last_workspace_id,
INSERT INTO user(id, name, email, password, status, create_time, update_time, language, last_organization_id,
phone,
source, last_project_id, create_user)
VALUES
<foreach collection="users" item="user" separator=",">
(#{user.id}, #{user.name}, #{user.email}, #{user.password}, #{user.status}, #{user.createTime},
#{user.updateTime}, #{user.language},
#{user.lastWorkspaceId}, #{user.phone}, #{user.source}, #{user.lastProjectId}, #{user.createUser})
#{user.lastOrganizationId}, #{user.phone}, #{user.source}, #{user.lastProjectId}, #{user.createUser})
</foreach>
</insert>

View File

@ -54,11 +54,11 @@ public class MsPermissionAnnotationMethodInterceptor extends PermissionAnnotatio
}
}
try {
SessionUtils.setCurrentWorkspaceId(workspaceId);
SessionUtils.setCurrentOrganizationId(workspaceId);
SessionUtils.setCurrentProjectId(projectId);
super.assertAuthorized(mi);
} finally {
SessionUtils.clearCurrentWorkspaceId();
SessionUtils.clearCurrentOrganizationId();
SessionUtils.clearCurrentProjectId();
}
}

View File

@ -74,7 +74,7 @@ public class LocalRealm extends AuthorizingRealm {
@Override
public boolean isPermitted(PrincipalCollection principals, String permission) {
return SessionUtils.hasPermission(SessionUtils.getCurrentWorkspaceId(), SessionUtils.getCurrentProjectId(), permission);
return SessionUtils.hasPermission(SessionUtils.getCurrentOrganizationId(), SessionUtils.getCurrentProjectId(), permission);
}
private UserDTO getUserWithOutAuthenticate(String userId) {

View File

@ -112,7 +112,7 @@ public class BaseUserService {
if (hasLastProjectPermission(user)) {
return;
}
// 用户有 last_workspace_id 权限
// 用户有 last_organization_id 权限
if (hasLastWorkspacePermission(user)) {
return;
}
@ -152,7 +152,7 @@ public class BaseUserService {
}
} else {
// 用户登录之后没有项目和工作空间的权限就把值清空
user.setLastWorkspaceId(StringUtils.EMPTY);
user.setLastOrganizationId(StringUtils.EMPTY);
user.setLastProjectId(StringUtils.EMPTY);
updateUser(user);
}
@ -165,7 +165,7 @@ public class BaseUserService {
String wsId = p.getWorkspaceId();
user.setId(user.getId());
user.setLastProjectId(projectId);
user.setLastWorkspaceId(wsId);
user.setLastOrganizationId(wsId);
updateUser(user);
}
}
@ -177,11 +177,11 @@ public class BaseUserService {
.collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(userRoleRelations)) {
Project project = projectMapper.selectByPrimaryKey(user.getLastProjectId());
if (StringUtils.equals(project.getWorkspaceId(), user.getLastWorkspaceId())) {
if (StringUtils.equals(project.getWorkspaceId(), user.getLastOrganizationId())) {
return true;
}
// last_project_id last_workspace_id 对应不上了
user.setLastWorkspaceId(project.getWorkspaceId());
// last_project_id last_organization_id 对应不上了
user.setLastOrganizationId(project.getWorkspaceId());
updateUser(user);
return true;
} else {
@ -192,13 +192,13 @@ public class BaseUserService {
}
private boolean hasLastWorkspacePermission(UserDTO user) {
if (StringUtils.isNotBlank(user.getLastWorkspaceId())) {
if (StringUtils.isNotBlank(user.getLastOrganizationId())) {
List<UserRoleRelation> userRoleRelations = user.getUserRoleRelations().stream()
.filter(ug -> StringUtils.equals(user.getLastWorkspaceId(), ug.getSourceId()))
.filter(ug -> StringUtils.equals(user.getLastOrganizationId(), ug.getSourceId()))
.collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(userRoleRelations)) {
ProjectExample example = new ProjectExample();
example.createCriteria().andWorkspaceIdEqualTo(user.getLastWorkspaceId());
example.createCriteria().andWorkspaceIdEqualTo(user.getLastOrganizationId());
List<Project> projects = projectMapper.selectByExample(example);
// 工作空间下没有项目
if (CollectionUtils.isEmpty(projects)) {
@ -229,7 +229,7 @@ public class BaseUserService {
String wsId = project.getWorkspaceId();
user.setId(user.getId());
user.setLastProjectId(project.getId());
user.setLastWorkspaceId(wsId);
user.setLastOrganizationId(wsId);
updateUser(user);
return true;
} else {
@ -246,8 +246,8 @@ public class BaseUserService {
User newUser = new User();
boolean isSuper = baseUserMapper.isSuperUser(sessionUser.getId());
if (StringUtils.equals("workspace", sign)) {
user.setLastWorkspaceId(sourceId);
sessionUser.setLastWorkspaceId(sourceId);
user.setLastOrganizationId(sourceId);
sessionUser.setLastOrganizationId(sourceId);
List<Project> projects = getProjectListByWsAndUserId(sessionUser.getId(), sourceId);
if (CollectionUtils.isNotEmpty(projects)) {
user.setLastProjectId(projects.get(0).getId());
@ -274,8 +274,8 @@ public class BaseUserService {
// 获取最新UserDTO
UserDTO user = getUserDTO(sessionUser.getId());
User newUser = new User();
user.setLastWorkspaceId(workspaceId);
sessionUser.setLastWorkspaceId(workspaceId);
user.setLastOrganizationId(workspaceId);
sessionUser.setLastOrganizationId(workspaceId);
user.setLastProjectId(projectId);
BeanUtils.copyProperties(user, newUser);
// 切换工作空间或组织之后更新 session 里的 user
@ -299,10 +299,10 @@ public class BaseUserService {
// 变更前
User userFromDB = userMapper.selectByPrimaryKey(user.getId());
// last workspace id 变了
if (user.getLastWorkspaceId() != null && !StringUtils.equals(user.getLastWorkspaceId(), userFromDB.getLastWorkspaceId())) {
List<Project> projects = getProjectListByWsAndUserId(user.getId(), user.getLastWorkspaceId());
if (user.getLastOrganizationId() != null && !StringUtils.equals(user.getLastOrganizationId(), userFromDB.getLastOrganizationId())) {
List<Project> projects = getProjectListByWsAndUserId(user.getId(), user.getLastOrganizationId());
if (projects.size() > 0) {
// 如果传入的 last_project_id last_workspace_id 下面的
// 如果传入的 last_project_id last_organization_id 下面的
boolean present = projects.stream().anyMatch(p -> StringUtils.equals(p.getId(), user.getLastProjectId()));
if (!present) {
user.setLastProjectId(projects.get(0).getId());

View File

@ -24,7 +24,7 @@ import static io.metersphere.sdk.constants.SessionConstants.ATTR_USER;
public class SessionUtils {
private static final ThreadLocal<String> projectId = new ThreadLocal<>();
private static final ThreadLocal<String> workspaceId = new ThreadLocal<>();
private static final ThreadLocal<String> organizationId = new ThreadLocal<>();
public static String getUserId() {
SessionUser user = getUser();
@ -73,10 +73,10 @@ public class SessionUtils {
}
/**
* 权限验证时从 controller 参数列表中找到 workspaceId 传入
* 权限验证时从 controller 参数列表中找到 organizationId 传入
*/
public static void setCurrentWorkspaceId(String workspaceId) {
SessionUtils.workspaceId.set(workspaceId);
public static void setCurrentOrganizationId(String organizationId) {
SessionUtils.organizationId.set(organizationId);
}
/**
@ -86,20 +86,20 @@ public class SessionUtils {
SessionUtils.projectId.set(projectId);
}
public static String getCurrentWorkspaceId() {
if (StringUtils.isNotEmpty(workspaceId.get())) {
return workspaceId.get();
public static String getCurrentOrganizationId() {
if (StringUtils.isNotEmpty(organizationId.get())) {
return organizationId.get();
}
try {
HttpServletRequest request = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest();
LogUtils.debug("WORKSPACE: {}", request.getHeader("WORKSPACE"));
if (request.getHeader("WORKSPACE") != null) {
return request.getHeader("WORKSPACE");
LogUtils.debug("ORGANIZATION: {}", request.getHeader("ORGANIZATION"));
if (request.getHeader("ORGANIZATION") != null) {
return request.getHeader("ORGANIZATION");
}
} catch (Exception e) {
LogUtils.error(e.getMessage(), e);
}
return getUser().getLastWorkspaceId();
return getUser().getLastOrganizationId();
}
public static String getCurrentProjectId() {
@ -130,7 +130,7 @@ public class SessionUtils {
}
}
public static boolean hasPermission(String workspaceId, String projectId, String permission) {
public static boolean hasPermission(String organizationId, String projectId, String permission) {
Map<String, List<UserRolePermission>> userRolePermissions = new HashMap<>();
Map<String, UserRole> role = new HashMap<>();
SessionUser user = Objects.requireNonNull(SessionUtils.getUser());
@ -156,8 +156,8 @@ public class SessionUtils {
return true;
}
Set<String> currentWorkspacePermissions = getCurrentWorkspacePermissions(userRolePermissions, workspaceId, role, user);
if (currentWorkspacePermissions.contains(permission)) {
Set<String> currentOrganizationPermissions = getCurrentOrganizationPermissions(userRolePermissions, organizationId, role, user);
if (currentOrganizationPermissions.contains(permission)) {
return true;
}
@ -174,10 +174,10 @@ public class SessionUtils {
.collect(Collectors.toSet());
}
private static Set<String> getCurrentWorkspacePermissions(Map<String, List<UserRolePermission>> userRolePermissions, String workspaceId, Map<String, UserRole> role, SessionUser user) {
private static Set<String> getCurrentOrganizationPermissions(Map<String, List<UserRolePermission>> userRolePermissions, String organizationId, Map<String, UserRole> role, SessionUser user) {
return user.getUserRoleRelations().stream()
.filter(ug -> role.get(ug.getId()) != null && StringUtils.equals(role.get(ug.getId()).getType(), "WORKSPACE"))
.filter(ug -> StringUtils.equals(ug.getSourceId(), workspaceId))
.filter(ug -> role.get(ug.getId()) != null && StringUtils.equals(role.get(ug.getId()).getType(), "ORGANIZATION"))
.filter(ug -> StringUtils.equals(ug.getSourceId(), organizationId))
.flatMap(ug -> userRolePermissions.get(ug.getId()).stream())
.map(UserRolePermission::getPermissionId)
.collect(Collectors.toSet());
@ -192,8 +192,8 @@ public class SessionUtils {
.collect(Collectors.toSet());
}
public static void clearCurrentWorkspaceId() {
workspaceId.remove();
public static void clearCurrentOrganizationId() {
organizationId.remove();
}
public static void clearCurrentProjectId() {

View File

@ -52,8 +52,8 @@ project_extend.project_id.not_blank
project_extend.platform.length_range
project_extend.platform.not_blank
project.id.not_blank
project.workspace_id.length_range
project.workspace_id.not_blank
project.organization_id.length_range
project.organization_id.not_blank
project.name.length_range
project.name.not_blank
custom_function.id.not_blank

View File

@ -52,8 +52,8 @@ project_extend.project_id.not_blank=Project ID is required
project_extend.platform.length_range=Platform length must be between {min} and {max}
project_extend.platform.not_blank=Platform is required
project.id.not_blank=ID is required
project.workspace_id.length_range=Workspace ID length must be between {min} and {max}
project.workspace_id.not_blank=Workspace ID is required
project.organization_id.length_range=Workspace ID length must be between {min} and {max}
project.organization_id.not_blank=Workspace ID is required
project.name.length_range=Name length must be between {min} and {max}
project.name.not_blank=Name is required
custom_function.id.not_blank=ID is required

View File

@ -52,8 +52,8 @@ project_extend.project_id.not_blank=项目ID不能为空
project_extend.platform.length_range=平台长度必须在{min}-{max}之间
project_extend.platform.not_blank=平台不能为空
project.id.not_blank=ID不能为空
project.workspace_id.length_range=工作空间ID长度必须在{min}-{max}之间
project.workspace_id.not_blank=工作空间ID不能为空
project.organization_id.length_range=工作空间ID长度必须在{min}-{max}之间
project.organization_id.not_blank=工作空间ID不能为空
project.name.length_range=名称长度必须在{min}-{max}之间
project.name.not_blank=名称不能为空
custom_function.id.not_blank=ID不能为空

View File

@ -52,8 +52,8 @@ project_extend.project_id.not_blank=項目ID不能為空
project_extend.platform.length_range=平台長度必須在{min}-{max}之間
project_extend.platform.not_blank=平台不能為空
project.id.not_blank=ID不能為空
project.workspace_id.length_range=工作空間ID長度必須在{min}-{max}之間
project.workspace_id.not_blank=工作空間ID不能為空
project.organization_id.length_range=工作空間ID長度必須在{min}-{max}之間
project.organization_id.not_blank=工作空間ID不能為空
project.name.length_range=名稱長度必須在{min}-{max}之間
project.name.not_blank=名稱不能為空
custom_function.id.not_blank=ID不能為空

View File

@ -44,12 +44,6 @@ public class UserController {
return userService.delete(userId);
}
@PostMapping("/batch-add2")
@RequiresPermissions(PermissionConstants.SYSTEM_USER_READ_ADD)
public boolean batchSaveUser2(@Validated({Created.class}) @RequestBody List<User> user) {
return userService.batchSave2(user);
}
@PostMapping("/batch-add3")
@RequiresPermissions(PermissionConstants.SYSTEM_USER_READ_ADD)
public boolean batchSaveUser3(@Validated({Created.class}) @RequestBody List<User> user) {

View File

@ -60,23 +60,6 @@ public class UserService {
return baseUserMapper.selectById(id);
}
public boolean batchSave2(List<User> users) {
long start = System.currentTimeMillis();
try (SqlSession sqlSession = sqlSessionFactory.openSession()) {
BaseUserMapper mapper = sqlSession.getMapper(BaseUserMapper.class);
for (int i = 0, size = users.size(); i < size; i++) {
mapper.insert(users.get(i));
if (i % 100 == 0) {
sqlSession.flushStatements();
}
}
sqlSession.flushStatements();
}
System.out.println("batch save cost: " + (System.currentTimeMillis() - start) + "ms");
return true;
}
public boolean batchSave3(List<User> users) {
long start = System.currentTimeMillis();

View File

@ -31,24 +31,24 @@
"resourceId": "SYSTEM_USER"
},
{
"id": "SYSTEM_WORKSPACE:READ",
"name": "permission.system_workspace.read",
"resourceId": "SYSTEM_WORKSPACE"
"id": "SYSTEM_ORGANIZATION:READ",
"name": "permission.system_organization.read",
"resourceId": "SYSTEM_ORGANIZATION"
},
{
"id": "SYSTEM_WORKSPACE:READ+ADD",
"name": "permission.system_workspace.add",
"resourceId": "SYSTEM_WORKSPACE"
"id": "SYSTEM_ORGANIZATION:READ+ADD",
"name": "permission.system_organization.add",
"resourceId": "SYSTEM_ORGANIZATION"
},
{
"id": "SYSTEM_WORKSPACE:READ+EDIT",
"name": "permission.system_workspace.edit",
"resourceId": "SYSTEM_WORKSPACE"
"id": "SYSTEM_ORGANIZATION:READ+EDIT",
"name": "permission.system_organization.edit",
"resourceId": "SYSTEM_ORGANIZATION"
},
{
"id": "SYSTEM_WORKSPACE:READ+DELETE",
"name": "permission.system_workspace.delete",
"resourceId": "SYSTEM_WORKSPACE"
"id": "SYSTEM_ORGANIZATION:READ+DELETE",
"name": "permission.system_organization.delete",
"resourceId": "SYSTEM_ORGANIZATION"
},
{
"id": "SYSTEM_ROLE:READ",
@ -131,144 +131,144 @@
"resourceId": "SYSTEM_OPERATING_LOG"
},
{
"id": "WORKSPACE_SERVICE:READ",
"name": "permission.workspace_service.read",
"resourceId": "WORKSPACE_SERVICE"
"id": "ORGANIZATION_SERVICE:READ",
"name": "permission.organization_service.read",
"resourceId": "ORGANIZATION_SERVICE"
},
{
"id": "WORKSPACE_SERVICE:READ+EDIT",
"name": "permission.workspace_service.edit",
"resourceId": "WORKSPACE_SERVICE"
"id": "ORGANIZATION_SERVICE:READ+EDIT",
"name": "permission.organization_service.edit",
"resourceId": "ORGANIZATION_SERVICE"
},
{
"id": "WORKSPACE_USER:READ",
"name": "permission.workspace_user.read",
"resourceId": "WORKSPACE_USER"
"id": "ORGANIZATION_USER:READ",
"name": "permission.organization_user.read",
"resourceId": "ORGANIZATION_USER"
},
{
"id": "WORKSPACE_USER:READ+ADD",
"name": "permission.workspace_user.add",
"resourceId": "WORKSPACE_USER"
"id": "ORGANIZATION_USER:READ+ADD",
"name": "permission.organization_user.add",
"resourceId": "ORGANIZATION_USER"
},
{
"id": "WORKSPACE_USER:READ+EDIT",
"name": "permission.workspace_user.edit",
"resourceId": "WORKSPACE_USER"
"id": "ORGANIZATION_USER:READ+EDIT",
"name": "permission.organization_user.edit",
"resourceId": "ORGANIZATION_USER"
},
{
"id": "WORKSPACE_USER:READ+DELETE",
"name": "permission.workspace_user.delete",
"resourceId": "WORKSPACE_USER"
"id": "ORGANIZATION_USER:READ+DELETE",
"name": "permission.organization_user.delete",
"resourceId": "ORGANIZATION_USER"
},
{
"id": "WORKSPACE_PROJECT_MANAGER:READ",
"name": "permission.workspace_project_manager.read",
"resourceId": "WORKSPACE_PROJECT_MANAGER"
"id": "ORGANIZATION_PROJECT_MANAGER:READ",
"name": "permission.organization_project_manager.read",
"resourceId": "ORGANIZATION_PROJECT_MANAGER"
},
{
"id": "WORKSPACE_PROJECT_MANAGER:READ+ADD",
"name": "permission.workspace_project_manager.add",
"resourceId": "WORKSPACE_PROJECT_MANAGER"
"id": "ORGANIZATION_PROJECT_MANAGER:READ+ADD",
"name": "permission.organization_project_manager.add",
"resourceId": "ORGANIZATION_PROJECT_MANAGER"
},
{
"id": "WORKSPACE_PROJECT_MANAGER:READ+EDIT",
"name": "permission.workspace_project_manager.edit",
"resourceId": "WORKSPACE_PROJECT_MANAGER"
"id": "ORGANIZATION_PROJECT_MANAGER:READ+EDIT",
"name": "permission.organization_project_manager.edit",
"resourceId": "ORGANIZATION_PROJECT_MANAGER"
},
{
"id": "WORKSPACE_PROJECT_MANAGER:READ+DELETE",
"name": "permission.workspace_project_manager.delete",
"resourceId": "WORKSPACE_PROJECT_MANAGER"
"id": "ORGANIZATION_PROJECT_MANAGER:READ+DELETE",
"name": "permission.organization_project_manager.delete",
"resourceId": "ORGANIZATION_PROJECT_MANAGER"
},
{
"id": "WORKSPACE_PROJECT_MANAGER:READ+ENVIRONMENT_CONFIG",
"name": "permission.workspace_project_manager.environment_config",
"resourceId": "WORKSPACE_PROJECT_MANAGER"
"id": "ORGANIZATION_PROJECT_MANAGER:READ+ENVIRONMENT_CONFIG",
"name": "permission.organization_project_manager.environment_config",
"resourceId": "ORGANIZATION_PROJECT_MANAGER"
},
{
"id": "WORKSPACE_PROJECT_MANAGER:READ+ADD_USER",
"name": "permission.workspace_user.add",
"resourceId": "WORKSPACE_PROJECT_MANAGER"
"id": "ORGANIZATION_PROJECT_MANAGER:READ+ADD_USER",
"name": "permission.organization_user.add",
"resourceId": "ORGANIZATION_PROJECT_MANAGER"
},
{
"id": "WORKSPACE_PROJECT_MANAGER:READ+EDIT_USER",
"name": "permission.workspace_user.edit",
"resourceId": "WORKSPACE_PROJECT_MANAGER"
"id": "ORGANIZATION_PROJECT_MANAGER:READ+EDIT_USER",
"name": "permission.organization_user.edit",
"resourceId": "ORGANIZATION_PROJECT_MANAGER"
},
{
"id": "WORKSPACE_PROJECT_MANAGER:READ+DELETE_USER",
"name": "permission.workspace_user.delete",
"resourceId": "WORKSPACE_PROJECT_MANAGER"
"id": "ORGANIZATION_PROJECT_MANAGER:READ+DELETE_USER",
"name": "permission.organization_user.delete",
"resourceId": "ORGANIZATION_PROJECT_MANAGER"
},
{
"id": "WORKSPACE_PROJECT_ENVIRONMENT:READ",
"name": "permission.workspace_project_environment.read",
"resourceId": "WORKSPACE_PROJECT_ENVIRONMENT"
"id": "ORGANIZATION_PROJECT_ENVIRONMENT:READ",
"name": "permission.organization_project_environment.read",
"resourceId": "ORGANIZATION_PROJECT_ENVIRONMENT"
},
{
"id": "WORKSPACE_PROJECT_ENVIRONMENT:READ+ADD",
"name": "permission.workspace_project_environment.add",
"resourceId": "WORKSPACE_PROJECT_ENVIRONMENT"
"id": "ORGANIZATION_PROJECT_ENVIRONMENT:READ+ADD",
"name": "permission.organization_project_environment.add",
"resourceId": "ORGANIZATION_PROJECT_ENVIRONMENT"
},
{
"id": "WORKSPACE_PROJECT_ENVIRONMENT:READ+EDIT",
"name": "permission.workspace_project_environment.edit",
"resourceId": "WORKSPACE_PROJECT_ENVIRONMENT"
"id": "ORGANIZATION_PROJECT_ENVIRONMENT:READ+EDIT",
"name": "permission.organization_project_environment.edit",
"resourceId": "ORGANIZATION_PROJECT_ENVIRONMENT"
},
{
"id": "WORKSPACE_PROJECT_ENVIRONMENT:READ+DELETE",
"name": "permission.workspace_project_environment.delete",
"resourceId": "WORKSPACE_PROJECT_ENVIRONMENT"
"id": "ORGANIZATION_PROJECT_ENVIRONMENT:READ+DELETE",
"name": "permission.organization_project_environment.delete",
"resourceId": "ORGANIZATION_PROJECT_ENVIRONMENT"
},
{
"id": "WORKSPACE_PROJECT_ENVIRONMENT:READ+COPY",
"name": "permission.workspace_project_environment.copy",
"resourceId": "WORKSPACE_PROJECT_ENVIRONMENT"
"id": "ORGANIZATION_PROJECT_ENVIRONMENT:READ+COPY",
"name": "permission.organization_project_environment.copy",
"resourceId": "ORGANIZATION_PROJECT_ENVIRONMENT"
},
{
"id": "WORKSPACE_PROJECT_ENVIRONMENT:READ+IMPORT",
"name": "permission.workspace_project_environment.import",
"resourceId": "WORKSPACE_PROJECT_ENVIRONMENT"
"id": "ORGANIZATION_PROJECT_ENVIRONMENT:READ+IMPORT",
"name": "permission.organization_project_environment.import",
"resourceId": "ORGANIZATION_PROJECT_ENVIRONMENT"
},
{
"id": "WORKSPACE_PROJECT_ENVIRONMENT:READ+EXPORT",
"name": "permission.workspace_project_environment.export",
"resourceId": "WORKSPACE_PROJECT_ENVIRONMENT"
"id": "ORGANIZATION_PROJECT_ENVIRONMENT:READ+EXPORT",
"name": "permission.organization_project_environment.export",
"resourceId": "ORGANIZATION_PROJECT_ENVIRONMENT"
},
{
"id": "WORKSPACE_PROJECT_ENVIRONMENT:READ+ADD_GROUP",
"name": "permission.workspace_project_environment.add_group",
"resourceId": "WORKSPACE_PROJECT_ENVIRONMENT"
"id": "ORGANIZATION_PROJECT_ENVIRONMENT:READ+ADD_GROUP",
"name": "permission.organization_project_environment.add_group",
"resourceId": "ORGANIZATION_PROJECT_ENVIRONMENT"
},
{
"id": "WORKSPACE_PROJECT_ENVIRONMENT:READ+EDIT_GROUP",
"name": "permission.workspace_project_environment.edit_group",
"resourceId": "WORKSPACE_PROJECT_ENVIRONMENT"
"id": "ORGANIZATION_PROJECT_ENVIRONMENT:READ+EDIT_GROUP",
"name": "permission.organization_project_environment.edit_group",
"resourceId": "ORGANIZATION_PROJECT_ENVIRONMENT"
},
{
"id": "WORKSPACE_PROJECT_ENVIRONMENT:READ+COPY_GROUP",
"name": "permission.workspace_project_environment.copy_group",
"resourceId": "WORKSPACE_PROJECT_ENVIRONMENT"
"id": "ORGANIZATION_PROJECT_ENVIRONMENT:READ+COPY_GROUP",
"name": "permission.organization_project_environment.copy_group",
"resourceId": "ORGANIZATION_PROJECT_ENVIRONMENT"
},
{
"id": "WORKSPACE_PROJECT_ENVIRONMENT:READ+DELETE_GROUP",
"name": "permission.workspace_project_environment.delete_group",
"resourceId": "WORKSPACE_PROJECT_ENVIRONMENT"
"id": "ORGANIZATION_PROJECT_ENVIRONMENT:READ+DELETE_GROUP",
"name": "permission.organization_project_environment.delete_group",
"resourceId": "ORGANIZATION_PROJECT_ENVIRONMENT"
},
{
"id": "WORKSPACE_QUOTA:READ",
"name": "permission.workspace_quota.read",
"resourceId": "WORKSPACE_QUOTA"
"id": "ORGANIZATION_QUOTA:READ",
"name": "permission.organization_quota.read",
"resourceId": "ORGANIZATION_QUOTA"
},
{
"id": "WORKSPACE_QUOTA:READ+EDIT",
"name": "permission.workspace_quota.edit",
"resourceId": "WORKSPACE_QUOTA"
"id": "ORGANIZATION_QUOTA:READ+EDIT",
"name": "permission.organization_quota.edit",
"resourceId": "ORGANIZATION_QUOTA"
},
{
"id": "WORKSPACE_OPERATING_LOG:READ",
"name": "permission.workspace_operation_log.read",
"resourceId": "WORKSPACE_OPERATING_LOG"
"id": "ORGANIZATION_OPERATING_LOG:READ",
"name": "permission.organization_operation_log.read",
"resourceId": "ORGANIZATION_OPERATING_LOG"
},
{
"id": "SYSTEM_PLUGIN:UPLOAD",
@ -318,8 +318,8 @@
"name": "permission.system_user.name"
},
{
"id": "SYSTEM_WORKSPACE",
"name": "permission.system_workspace.name"
"id": "SYSTEM_ORGANIZATION",
"name": "permission.system_organization.name"
},
{
"id": "SYSTEM_ROLE",
@ -350,28 +350,28 @@
"name": "permission.system_plugin.name"
},
{
"id": "WORKSPACE_USER",
"name": "permission.workspace_user.name"
"id": "ORGANIZATION_USER",
"name": "permission.organization_user.name"
},
{
"id": "WORKSPACE_SERVICE",
"name": "permission.workspace_service.name"
"id": "ORGANIZATION_SERVICE",
"name": "permission.organization_service.name"
},
{
"id": "WORKSPACE_PROJECT_MANAGER",
"name": "permission.workspace_project_manager.name"
"id": "ORGANIZATION_PROJECT_MANAGER",
"name": "permission.organization_project_manager.name"
},
{
"id": "WORKSPACE_PROJECT_ENVIRONMENT",
"name": "permission.workspace_project_environment.name"
"id": "ORGANIZATION_PROJECT_ENVIRONMENT",
"name": "permission.organization_project_environment.name"
},
{
"id": "WORKSPACE_QUOTA",
"name": "permission.workspace_quota.name"
"id": "ORGANIZATION_QUOTA",
"name": "permission.organization_quota.name"
},
{
"id": "WORKSPACE_OPERATING_LOG",
"name": "permission.workspace_operation_log.name"
"id": "ORGANIZATION_OPERATING_LOG",
"name": "permission.organization_operation_log.name"
},
{
"id": "PERSONAL_INFORMATION",

View File

@ -6,10 +6,7 @@ import io.metersphere.sdk.dto.UserDTO;
import io.metersphere.sdk.util.JSON;
import io.metersphere.system.domain.User;
import jakarta.annotation.Resource;
import org.junit.jupiter.api.MethodOrderer;
import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestMethodOrder;
import org.junit.jupiter.api.*;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.http.MediaType;
@ -31,8 +28,7 @@ public class UserControllerTests {
private static String sessionId;
private static String csrfToken;
@Test
@Order(0)
@BeforeEach
public void login() throws Exception {
MvcResult mvcResult = mockMvc.perform(MockMvcRequestBuilders.post("/login")
.content("{\"username\":\"admin\",\"password\":\"metersphere\"}")