fix: 处理引用问题 (#6886)

* feat: 删除组织这一级

Co-authored-by: shiziyuan9527 <yuhao.li@fit2cloud.com>
Co-authored-by: Captain.B <bin@fit2cloud.com>
This commit is contained in:
metersphere-bot 2021-10-21 11:20:57 +08:00 committed by GitHub
parent d69d6d7415
commit 8260590257
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
247 changed files with 4635 additions and 9284 deletions

View File

@ -6,14 +6,11 @@ import io.metersphere.api.dto.APIReportResult;
import io.metersphere.api.dto.DeleteAPIReportRequest;
import io.metersphere.api.dto.QueryAPIReportRequest;
import io.metersphere.api.service.APIReportService;
import io.metersphere.commons.constants.RoleConstants;
import io.metersphere.commons.utils.PageUtils;
import io.metersphere.commons.utils.Pager;
import io.metersphere.commons.utils.SessionUtils;
import io.metersphere.dto.DashboardTestDTO;
import io.metersphere.service.CheckPermissionService;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;

View File

@ -2,10 +2,10 @@ package io.metersphere.api.controller;
import io.metersphere.api.dto.scenario.DatabaseConfig;
import io.metersphere.api.service.APIDatabaseService;
import io.metersphere.commons.constants.RoleConstants;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;

View File

@ -5,13 +5,10 @@ import io.metersphere.api.dto.definition.DragModuleRequest;
import io.metersphere.api.service.ApiModuleService;
import io.metersphere.base.domain.ApiModule;
import io.metersphere.commons.constants.OperLogConstants;
import io.metersphere.commons.constants.RoleConstants;
import io.metersphere.commons.utils.ApiDefinitionDefaultApiTypeUtil;
import io.metersphere.commons.utils.SessionUtils;
import io.metersphere.log.annotation.MsAuditLog;
import io.metersphere.service.CheckPermissionService;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;

View File

@ -5,9 +5,6 @@ import io.metersphere.api.dto.ApiMonitorSearch;
import io.metersphere.api.dto.ApiResponseCodeMonitor;
import io.metersphere.api.dto.ApiResponseTimeMonitor;
import io.metersphere.api.service.APIMonitorService;
import io.metersphere.commons.constants.RoleConstants;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;

View File

@ -5,11 +5,8 @@ import io.metersphere.api.dto.automation.DragApiScenarioModuleRequest;
import io.metersphere.api.service.ApiScenarioModuleService;
import io.metersphere.base.domain.ApiScenarioModule;
import io.metersphere.commons.constants.OperLogConstants;
import io.metersphere.commons.constants.RoleConstants;
import io.metersphere.log.annotation.MsAuditLog;
import io.metersphere.service.CheckPermissionService;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;

View File

@ -8,14 +8,11 @@ import io.metersphere.api.service.ApiTestEnvironmentService;
import io.metersphere.api.service.CommandService;
import io.metersphere.base.domain.ApiTestEnvironmentWithBLOBs;
import io.metersphere.commons.constants.OperLogConstants;
import io.metersphere.commons.constants.RoleConstants;
import io.metersphere.commons.utils.PageUtils;
import io.metersphere.commons.utils.Pager;
import io.metersphere.controller.request.EnvironmentRequest;
import io.metersphere.log.annotation.MsAuditLog;
import io.metersphere.service.CheckPermissionService;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

View File

@ -20,16 +20,15 @@ import io.metersphere.api.jmeter.ReportCounter;
import io.metersphere.api.jmeter.ScenarioResult;
import io.metersphere.api.jmeter.TestResult;
import io.metersphere.base.domain.*;
import io.metersphere.base.mapper.ApiScenarioMapper;
import io.metersphere.base.mapper.ApiScenarioReportDetailMapper;
import io.metersphere.base.mapper.ApiScenarioReportMapper;
import io.metersphere.base.mapper.TestPlanApiScenarioMapper;
import io.metersphere.base.mapper.*;
import io.metersphere.base.mapper.ext.ExtApiScenarioReportDetailMapper;
import io.metersphere.base.mapper.ext.ExtApiScenarioReportMapper;
import io.metersphere.base.mapper.ext.ExtProjectMapper;
import io.metersphere.commons.constants.*;
import io.metersphere.commons.exception.MSException;
import io.metersphere.commons.utils.*;
import io.metersphere.commons.utils.DateUtils;
import io.metersphere.commons.utils.LogUtil;
import io.metersphere.commons.utils.ServiceUtils;
import io.metersphere.commons.utils.SessionUtils;
import io.metersphere.dto.ApiReportCountDTO;
import io.metersphere.dto.NodeDTO;
import io.metersphere.dto.UserDTO;
@ -84,7 +83,7 @@ public class ApiScenarioReportService {
@Resource
private UserService userService;
@Resource
private ExtProjectMapper extProjectMapper;
private ProjectMapper projectMapper;
public ApiScenarioReport complete(TestResult result, String runMode) {
// 更新场景
@ -648,8 +647,8 @@ public class ApiScenarioReportService {
.event(event)
.build();
Organization organization = extProjectMapper.getOrganizationByProjectId(scenario.getProjectId());
noticeSendService.send(organization, NoticeConstants.TaskType.API_AUTOMATION_TASK, noticeModel);
Project project = projectMapper.selectByPrimaryKey(scenario.getProjectId());
noticeSendService.send(project, NoticeConstants.TaskType.API_AUTOMATION_TASK, noticeModel);
}
public String update(APIScenarioReportResult test) {

View File

@ -54,18 +54,14 @@ public class EsbImportService {
}
data.setUserIsAdmin(Translator.get("options_no"));
data.setUserIsTester(Translator.get("options_no"));
data.setUserIsOrgMember(Translator.get("options_no"));
data.setUserIsViewer(Translator.get("options_no"));
data.setUserIsTestManager(Translator.get("options_no"));
data.setUserIsOrgAdmin(Translator.get("options_yes"));
data.setOrgAdminOrganization(workspace);
list.add(data);
}
list.add(new UserExcelData());
UserExcelData explain = new UserExcelData();
explain.setName(Translator.get("do_not_modify_header_order"));
explain.setOrgAdminOrganization("多个工作空间请换行展示");
list.add(explain);
return list;
}

View File

@ -153,7 +153,7 @@ public class TestResultService {
if (reportTask != null) {
if (StringUtils.equals(ReportTriggerMode.API.name(), reportTask.getTriggerMode())
|| StringUtils.equals(ReportTriggerMode.SCHEDULE.name(), reportTask.getTriggerMode())) {
sendTask(reportTask, reportUrl, testResult);
sendTask(reportTask, testResult);
}
}
} catch (Exception e) {
@ -194,7 +194,7 @@ public class TestResultService {
}
}
private void sendTask(ApiTestReportVariable report, String reportUrl, TestResult testResult) {
private void sendTask(ApiTestReportVariable report, TestResult testResult) {
if (report == null) {
return;
}
@ -203,21 +203,17 @@ public class TestResultService {
assert systemParameterService != null;
assert noticeSendService != null;
BaseSystemConfigDTO baseSystemConfigDTO = systemParameterService.getBaseInfo();
String url = baseSystemConfigDTO.getUrl() + "/#/api/report/view/" + report.getId();
String url2 = baseSystemConfigDTO.getUrl() + "/#/api/automation/report/view/" + report.getId();
String reportUrl = baseSystemConfigDTO.getUrl() + "/#/api/automation/report/view/" + report.getId();
String successContext = "";
String failedContext = "";
String subject = "";
String event = "";
String successContext = "${operator}执行接口测成功: ${name}" + ", 报告: ${reportUrl}";
String failedContext = "${operator}执行接口测试失败: ${name}" + ", 报告: ${reportUrl}";
if (StringUtils.equals(ReportTriggerMode.API.name(), report.getTriggerMode())) {
successContext = "接口测试 API任务通知:jenkins所执行的" + report.getName() + "'执行成功" + "\n" + "执行环境:" + report.getExecutionEnvironment() + "\n" + "[接口定义暂无报告链接]" + "\n" + "请点击下面链接进入测试报告页面" + "\n" + "(旧版)接口测试路径" + url + "\n" + "(新版)接口测试路径" + url2;
failedContext = "接口测试 API任务通知:jenkins所执行的" + report.getName() + "'执行失败" + "\n" + "执行环境:" + report.getExecutionEnvironment() + "\n" + "[接口定义暂无报告链接]" + "\n" + "请点击下面链接进入测试报告页面" + "\n" + "(旧版)接口测试路径" + url + "\n" + "(新版)接口测试路径" + url2;
subject = Translator.get("task_notification_jenkins");
}
if (StringUtils.equals(ReportTriggerMode.SCHEDULE.name(), report.getTriggerMode())) {
successContext = "接口测试定时任务通知:定时任务所执行的" + report.getName() + "'执行成功" + "\n" + "执行环境:" + report.getExecutionEnvironment() + "\n" + "[接口定义暂无报告链接]" + "\n" + "请点击下面链接进入测试报告页面" + "\n" + "(旧版)接口测试路径" + url + "\n" + "(新版)接口测试路径" + url2;
failedContext = "接口测试定时任务通知:定时任务所执行的" + report.getName() + "'执行失败" + "\n" + "执行环境:" + report.getExecutionEnvironment() + "\n" + "[接口定义暂无报告链接]" + "\n" + "请点击下面链接进入测试报告页面" + "\n" + "(旧版)接口测试路径" + url + "\n" + "(新版)接口测试路径" + url2;
subject = Translator.get("task_notification");
}
if (StringUtils.equals("Success", report.getStatus())) {
@ -235,6 +231,7 @@ public class TestResultService {
Map paramMap = new HashMap<>();
paramMap.put("type", "api");
paramMap.put("url", baseSystemConfigDTO.getUrl());
paramMap.put("reportUrl", reportUrl);
paramMap.put("operator", report.getExecutor());
paramMap.putAll(new BeanMap(report));
NoticeModel noticeModel = NoticeModel.builder()

View File

@ -1,8 +1,7 @@
package io.metersphere.base.domain;
import lombok.Data;
import java.io.Serializable;
import lombok.Data;
@Data
public class MessageTask implements Serializable {
@ -22,12 +21,12 @@ public class MessageTask implements Serializable {
private Boolean isSet;
private String organizationId;
private String testId;
private Long createTime;
private String workspaceId;
private String template;
private static final long serialVersionUID = 1L;

View File

@ -654,76 +654,6 @@ public class MessageTaskExample {
return (Criteria) this;
}
public Criteria andOrganizationIdIsNull() {
addCriterion("organization_id is null");
return (Criteria) this;
}
public Criteria andOrganizationIdIsNotNull() {
addCriterion("organization_id is not null");
return (Criteria) this;
}
public Criteria andOrganizationIdEqualTo(String value) {
addCriterion("organization_id =", value, "organizationId");
return (Criteria) this;
}
public Criteria andOrganizationIdNotEqualTo(String value) {
addCriterion("organization_id <>", value, "organizationId");
return (Criteria) this;
}
public Criteria andOrganizationIdGreaterThan(String value) {
addCriterion("organization_id >", value, "organizationId");
return (Criteria) this;
}
public Criteria andOrganizationIdGreaterThanOrEqualTo(String value) {
addCriterion("organization_id >=", value, "organizationId");
return (Criteria) this;
}
public Criteria andOrganizationIdLessThan(String value) {
addCriterion("organization_id <", value, "organizationId");
return (Criteria) this;
}
public Criteria andOrganizationIdLessThanOrEqualTo(String value) {
addCriterion("organization_id <=", value, "organizationId");
return (Criteria) this;
}
public Criteria andOrganizationIdLike(String value) {
addCriterion("organization_id like", value, "organizationId");
return (Criteria) this;
}
public Criteria andOrganizationIdNotLike(String value) {
addCriterion("organization_id not like", value, "organizationId");
return (Criteria) this;
}
public Criteria andOrganizationIdIn(List<String> values) {
addCriterion("organization_id in", values, "organizationId");
return (Criteria) this;
}
public Criteria andOrganizationIdNotIn(List<String> values) {
addCriterion("organization_id not in", values, "organizationId");
return (Criteria) this;
}
public Criteria andOrganizationIdBetween(String value1, String value2) {
addCriterion("organization_id between", value1, value2, "organizationId");
return (Criteria) this;
}
public Criteria andOrganizationIdNotBetween(String value1, String value2) {
addCriterion("organization_id not between", value1, value2, "organizationId");
return (Criteria) this;
}
public Criteria andTestIdIsNull() {
addCriterion("test_id is null");
return (Criteria) this;
@ -853,6 +783,76 @@ public class MessageTaskExample {
addCriterion("create_time not between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andWorkspaceIdIsNull() {
addCriterion("workspace_id is null");
return (Criteria) this;
}
public Criteria andWorkspaceIdIsNotNull() {
addCriterion("workspace_id is not null");
return (Criteria) this;
}
public Criteria andWorkspaceIdEqualTo(String value) {
addCriterion("workspace_id =", value, "workspaceId");
return (Criteria) this;
}
public Criteria andWorkspaceIdNotEqualTo(String value) {
addCriterion("workspace_id <>", value, "workspaceId");
return (Criteria) this;
}
public Criteria andWorkspaceIdGreaterThan(String value) {
addCriterion("workspace_id >", value, "workspaceId");
return (Criteria) this;
}
public Criteria andWorkspaceIdGreaterThanOrEqualTo(String value) {
addCriterion("workspace_id >=", value, "workspaceId");
return (Criteria) this;
}
public Criteria andWorkspaceIdLessThan(String value) {
addCriterion("workspace_id <", value, "workspaceId");
return (Criteria) this;
}
public Criteria andWorkspaceIdLessThanOrEqualTo(String value) {
addCriterion("workspace_id <=", value, "workspaceId");
return (Criteria) this;
}
public Criteria andWorkspaceIdLike(String value) {
addCriterion("workspace_id like", value, "workspaceId");
return (Criteria) this;
}
public Criteria andWorkspaceIdNotLike(String value) {
addCriterion("workspace_id not like", value, "workspaceId");
return (Criteria) this;
}
public Criteria andWorkspaceIdIn(List<String> values) {
addCriterion("workspace_id in", values, "workspaceId");
return (Criteria) this;
}
public Criteria andWorkspaceIdNotIn(List<String> values) {
addCriterion("workspace_id not in", values, "workspaceId");
return (Criteria) this;
}
public Criteria andWorkspaceIdBetween(String value1, String value2) {
addCriterion("workspace_id between", value1, value2, "workspaceId");
return (Criteria) this;
}
public Criteria andWorkspaceIdNotBetween(String value1, String value2) {
addCriterion("workspace_id not between", value1, value2, "workspaceId");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {

View File

@ -1,22 +0,0 @@
package io.metersphere.base.domain;
import lombok.Data;
import java.io.Serializable;
@Data
public class Organization implements Serializable {
private String id;
private String name;
private String description;
private Long createTime;
private Long updateTime;
private String createUser;
private static final long serialVersionUID = 1L;
}

View File

@ -1,600 +0,0 @@
package io.metersphere.base.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

@ -17,8 +17,6 @@ public class Quota implements Serializable {
private String resourcePool;
private String organizationId;
private String workspaceId;
private Boolean useDefault;

View File

@ -484,76 +484,6 @@ public class QuotaExample {
return (Criteria) this;
}
public Criteria andOrganizationIdIsNull() {
addCriterion("organization_id is null");
return (Criteria) this;
}
public Criteria andOrganizationIdIsNotNull() {
addCriterion("organization_id is not null");
return (Criteria) this;
}
public Criteria andOrganizationIdEqualTo(String value) {
addCriterion("organization_id =", value, "organizationId");
return (Criteria) this;
}
public Criteria andOrganizationIdNotEqualTo(String value) {
addCriterion("organization_id <>", value, "organizationId");
return (Criteria) this;
}
public Criteria andOrganizationIdGreaterThan(String value) {
addCriterion("organization_id >", value, "organizationId");
return (Criteria) this;
}
public Criteria andOrganizationIdGreaterThanOrEqualTo(String value) {
addCriterion("organization_id >=", value, "organizationId");
return (Criteria) this;
}
public Criteria andOrganizationIdLessThan(String value) {
addCriterion("organization_id <", value, "organizationId");
return (Criteria) this;
}
public Criteria andOrganizationIdLessThanOrEqualTo(String value) {
addCriterion("organization_id <=", value, "organizationId");
return (Criteria) this;
}
public Criteria andOrganizationIdLike(String value) {
addCriterion("organization_id like", value, "organizationId");
return (Criteria) this;
}
public Criteria andOrganizationIdNotLike(String value) {
addCriterion("organization_id not like", value, "organizationId");
return (Criteria) this;
}
public Criteria andOrganizationIdIn(List<String> values) {
addCriterion("organization_id in", values, "organizationId");
return (Criteria) this;
}
public Criteria andOrganizationIdNotIn(List<String> values) {
addCriterion("organization_id not in", values, "organizationId");
return (Criteria) this;
}
public Criteria andOrganizationIdBetween(String value1, String value2) {
addCriterion("organization_id between", value1, value2, "organizationId");
return (Criteria) this;
}
public Criteria andOrganizationIdNotBetween(String value1, String value2) {
addCriterion("organization_id not between", value1, value2, "organizationId");
return (Criteria) this;
}
public Criteria andWorkspaceIdIsNull() {
addCriterion("workspace_id is null");
return (Criteria) this;

View File

@ -1,22 +0,0 @@
package io.metersphere.base.domain;
import lombok.Data;
import java.io.Serializable;
@Data
public class Role implements Serializable {
private String id;
private String name;
private String description;
private String type;
private Long createTime;
private Long updateTime;
private static final long serialVersionUID = 1L;
}

View File

@ -1,600 +0,0 @@
package io.metersphere.base.domain;
import java.util.ArrayList;
import java.util.List;
public class RoleExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public RoleExample() {
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 andTypeIsNull() {
addCriterion("type is null");
return (Criteria) this;
}
public Criteria andTypeIsNotNull() {
addCriterion("type is not null");
return (Criteria) this;
}
public Criteria andTypeEqualTo(String value) {
addCriterion("type =", value, "type");
return (Criteria) this;
}
public Criteria andTypeNotEqualTo(String value) {
addCriterion("type <>", value, "type");
return (Criteria) this;
}
public Criteria andTypeGreaterThan(String value) {
addCriterion("type >", value, "type");
return (Criteria) this;
}
public Criteria andTypeGreaterThanOrEqualTo(String value) {
addCriterion("type >=", value, "type");
return (Criteria) this;
}
public Criteria andTypeLessThan(String value) {
addCriterion("type <", value, "type");
return (Criteria) this;
}
public Criteria andTypeLessThanOrEqualTo(String value) {
addCriterion("type <=", value, "type");
return (Criteria) this;
}
public Criteria andTypeLike(String value) {
addCriterion("type like", value, "type");
return (Criteria) this;
}
public Criteria andTypeNotLike(String value) {
addCriterion("type not like", value, "type");
return (Criteria) this;
}
public Criteria andTypeIn(List<String> values) {
addCriterion("type in", values, "type");
return (Criteria) this;
}
public Criteria andTypeNotIn(List<String> values) {
addCriterion("type not in", values, "type");
return (Criteria) this;
}
public Criteria andTypeBetween(String value1, String value2) {
addCriterion("type between", value1, value2, "type");
return (Criteria) this;
}
public Criteria andTypeNotBetween(String value1, String value2) {
addCriterion("type not between", value1, value2, "type");
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 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

@ -7,10 +7,10 @@ import lombok.Data;
public class ServiceIntegration implements Serializable {
private String id;
private String organizationId;
private String platform;
private String workspaceId;
private String configuration;
private static final long serialVersionUID = 1L;

View File

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

View File

@ -23,8 +23,6 @@ public class User implements Serializable {
private String lastWorkspaceId;
private String lastOrganizationId;
private String phone;
private String source;

View File

@ -714,76 +714,6 @@ public class UserExample {
return (Criteria) this;
}
public Criteria andLastOrganizationIdIsNull() {
addCriterion("last_organization_id is null");
return (Criteria) this;
}
public Criteria andLastOrganizationIdIsNotNull() {
addCriterion("last_organization_id is not null");
return (Criteria) this;
}
public Criteria andLastOrganizationIdEqualTo(String value) {
addCriterion("last_organization_id =", value, "lastOrganizationId");
return (Criteria) this;
}
public Criteria andLastOrganizationIdNotEqualTo(String value) {
addCriterion("last_organization_id <>", value, "lastOrganizationId");
return (Criteria) this;
}
public Criteria andLastOrganizationIdGreaterThan(String value) {
addCriterion("last_organization_id >", value, "lastOrganizationId");
return (Criteria) this;
}
public Criteria andLastOrganizationIdGreaterThanOrEqualTo(String value) {
addCriterion("last_organization_id >=", value, "lastOrganizationId");
return (Criteria) this;
}
public Criteria andLastOrganizationIdLessThan(String value) {
addCriterion("last_organization_id <", value, "lastOrganizationId");
return (Criteria) this;
}
public Criteria andLastOrganizationIdLessThanOrEqualTo(String value) {
addCriterion("last_organization_id <=", value, "lastOrganizationId");
return (Criteria) this;
}
public Criteria andLastOrganizationIdLike(String value) {
addCriterion("last_organization_id like", value, "lastOrganizationId");
return (Criteria) this;
}
public Criteria andLastOrganizationIdNotLike(String value) {
addCriterion("last_organization_id not like", value, "lastOrganizationId");
return (Criteria) this;
}
public Criteria andLastOrganizationIdIn(List<String> values) {
addCriterion("last_organization_id in", values, "lastOrganizationId");
return (Criteria) this;
}
public Criteria andLastOrganizationIdNotIn(List<String> values) {
addCriterion("last_organization_id not in", values, "lastOrganizationId");
return (Criteria) this;
}
public Criteria andLastOrganizationIdBetween(String value1, String value2) {
addCriterion("last_organization_id between", value1, value2, "lastOrganizationId");
return (Criteria) this;
}
public Criteria andLastOrganizationIdNotBetween(String value1, String value2) {
addCriterion("last_organization_id not between", value1, value2, "lastOrganizationId");
return (Criteria) this;
}
public Criteria andPhoneIsNull() {
addCriterion("phone is null");
return (Criteria) this;

View File

@ -1,22 +0,0 @@
package io.metersphere.base.domain;
import lombok.Data;
import java.io.Serializable;
@Data
public class UserRole implements Serializable {
private String id;
private String userId;
private String roleId;
private String sourceId;
private Long createTime;
private Long updateTime;
private static final long serialVersionUID = 1L;
}

View File

@ -1,600 +0,0 @@
package io.metersphere.base.domain;
import java.util.ArrayList;
import java.util.List;
public class UserRoleExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public UserRoleExample() {
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 andUserIdIsNull() {
addCriterion("user_id is null");
return (Criteria) this;
}
public Criteria andUserIdIsNotNull() {
addCriterion("user_id is not null");
return (Criteria) this;
}
public Criteria andUserIdEqualTo(String value) {
addCriterion("user_id =", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotEqualTo(String value) {
addCriterion("user_id <>", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdGreaterThan(String value) {
addCriterion("user_id >", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdGreaterThanOrEqualTo(String value) {
addCriterion("user_id >=", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLessThan(String value) {
addCriterion("user_id <", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLessThanOrEqualTo(String value) {
addCriterion("user_id <=", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLike(String value) {
addCriterion("user_id like", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotLike(String value) {
addCriterion("user_id not like", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdIn(List<String> values) {
addCriterion("user_id in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotIn(List<String> values) {
addCriterion("user_id not in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdBetween(String value1, String value2) {
addCriterion("user_id between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotBetween(String value1, String value2) {
addCriterion("user_id not between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andRoleIdIsNull() {
addCriterion("role_id is null");
return (Criteria) this;
}
public Criteria andRoleIdIsNotNull() {
addCriterion("role_id is not null");
return (Criteria) this;
}
public Criteria andRoleIdEqualTo(String value) {
addCriterion("role_id =", value, "roleId");
return (Criteria) this;
}
public Criteria andRoleIdNotEqualTo(String value) {
addCriterion("role_id <>", value, "roleId");
return (Criteria) this;
}
public Criteria andRoleIdGreaterThan(String value) {
addCriterion("role_id >", value, "roleId");
return (Criteria) this;
}
public Criteria andRoleIdGreaterThanOrEqualTo(String value) {
addCriterion("role_id >=", value, "roleId");
return (Criteria) this;
}
public Criteria andRoleIdLessThan(String value) {
addCriterion("role_id <", value, "roleId");
return (Criteria) this;
}
public Criteria andRoleIdLessThanOrEqualTo(String value) {
addCriterion("role_id <=", value, "roleId");
return (Criteria) this;
}
public Criteria andRoleIdLike(String value) {
addCriterion("role_id like", value, "roleId");
return (Criteria) this;
}
public Criteria andRoleIdNotLike(String value) {
addCriterion("role_id not like", value, "roleId");
return (Criteria) this;
}
public Criteria andRoleIdIn(List<String> values) {
addCriterion("role_id in", values, "roleId");
return (Criteria) this;
}
public Criteria andRoleIdNotIn(List<String> values) {
addCriterion("role_id not in", values, "roleId");
return (Criteria) this;
}
public Criteria andRoleIdBetween(String value1, String value2) {
addCriterion("role_id between", value1, value2, "roleId");
return (Criteria) this;
}
public Criteria andRoleIdNotBetween(String value1, String value2) {
addCriterion("role_id not between", value1, value2, "roleId");
return (Criteria) this;
}
public Criteria andSourceIdIsNull() {
addCriterion("source_id is null");
return (Criteria) this;
}
public Criteria andSourceIdIsNotNull() {
addCriterion("source_id is not null");
return (Criteria) this;
}
public Criteria andSourceIdEqualTo(String value) {
addCriterion("source_id =", value, "sourceId");
return (Criteria) this;
}
public Criteria andSourceIdNotEqualTo(String value) {
addCriterion("source_id <>", value, "sourceId");
return (Criteria) this;
}
public Criteria andSourceIdGreaterThan(String value) {
addCriterion("source_id >", value, "sourceId");
return (Criteria) this;
}
public Criteria andSourceIdGreaterThanOrEqualTo(String value) {
addCriterion("source_id >=", value, "sourceId");
return (Criteria) this;
}
public Criteria andSourceIdLessThan(String value) {
addCriterion("source_id <", value, "sourceId");
return (Criteria) this;
}
public Criteria andSourceIdLessThanOrEqualTo(String value) {
addCriterion("source_id <=", value, "sourceId");
return (Criteria) this;
}
public Criteria andSourceIdLike(String value) {
addCriterion("source_id like", value, "sourceId");
return (Criteria) this;
}
public Criteria andSourceIdNotLike(String value) {
addCriterion("source_id not like", value, "sourceId");
return (Criteria) this;
}
public Criteria andSourceIdIn(List<String> values) {
addCriterion("source_id in", values, "sourceId");
return (Criteria) this;
}
public Criteria andSourceIdNotIn(List<String> values) {
addCriterion("source_id not in", values, "sourceId");
return (Criteria) this;
}
public Criteria andSourceIdBetween(String value1, String value2) {
addCriterion("source_id between", value1, value2, "sourceId");
return (Criteria) this;
}
public Criteria andSourceIdNotBetween(String value1, String value2) {
addCriterion("source_id not between", value1, value2, "sourceId");
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 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

@ -7,8 +7,6 @@ import lombok.Data;
public class Workspace implements Serializable {
private String id;
private String organizationId;
private String name;
private String description;

View File

@ -174,76 +174,6 @@ public class WorkspaceExample {
return (Criteria) this;
}
public Criteria andOrganizationIdIsNull() {
addCriterion("organization_id is null");
return (Criteria) this;
}
public Criteria andOrganizationIdIsNotNull() {
addCriterion("organization_id is not null");
return (Criteria) this;
}
public Criteria andOrganizationIdEqualTo(String value) {
addCriterion("organization_id =", value, "organizationId");
return (Criteria) this;
}
public Criteria andOrganizationIdNotEqualTo(String value) {
addCriterion("organization_id <>", value, "organizationId");
return (Criteria) this;
}
public Criteria andOrganizationIdGreaterThan(String value) {
addCriterion("organization_id >", value, "organizationId");
return (Criteria) this;
}
public Criteria andOrganizationIdGreaterThanOrEqualTo(String value) {
addCriterion("organization_id >=", value, "organizationId");
return (Criteria) this;
}
public Criteria andOrganizationIdLessThan(String value) {
addCriterion("organization_id <", value, "organizationId");
return (Criteria) this;
}
public Criteria andOrganizationIdLessThanOrEqualTo(String value) {
addCriterion("organization_id <=", value, "organizationId");
return (Criteria) this;
}
public Criteria andOrganizationIdLike(String value) {
addCriterion("organization_id like", value, "organizationId");
return (Criteria) this;
}
public Criteria andOrganizationIdNotLike(String value) {
addCriterion("organization_id not like", value, "organizationId");
return (Criteria) this;
}
public Criteria andOrganizationIdIn(List<String> values) {
addCriterion("organization_id in", values, "organizationId");
return (Criteria) this;
}
public Criteria andOrganizationIdNotIn(List<String> values) {
addCriterion("organization_id not in", values, "organizationId");
return (Criteria) this;
}
public Criteria andOrganizationIdBetween(String value1, String value2) {
addCriterion("organization_id between", value1, value2, "organizationId");
return (Criteria) this;
}
public Criteria andOrganizationIdNotBetween(String value1, String value2) {
addCriterion("organization_id not between", value1, value2, "organizationId");
return (Criteria) this;
}
public Criteria andNameIsNull() {
addCriterion("`name` is null");
return (Criteria) this;

View File

@ -2,9 +2,8 @@ package io.metersphere.base.mapper;
import io.metersphere.base.domain.MessageTask;
import io.metersphere.base.domain.MessageTaskExample;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface MessageTaskMapper {
long countByExample(MessageTaskExample example);

View File

@ -10,9 +10,9 @@
<result column="webhook" jdbcType="VARCHAR" property="webhook" />
<result column="identification" jdbcType="VARCHAR" property="identification" />
<result column="is_set" jdbcType="BIT" property="isSet" />
<result column="organization_id" jdbcType="VARCHAR" property="organizationId" />
<result column="test_id" jdbcType="VARCHAR" property="testId" />
<result column="create_time" jdbcType="BIGINT" property="createTime" />
<result column="workspace_id" jdbcType="VARCHAR" property="workspaceId" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.metersphere.base.domain.MessageTask">
<result column="template" jdbcType="LONGVARCHAR" property="template" />
@ -28,13 +28,13 @@
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
AND ${criterion.condition} #{criterion.value}
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
AND ${criterion.condition} #{criterion.value} AND #{criterion.secondValue}
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
AND ${criterion.condition}
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
@ -76,26 +76,26 @@
</where>
</sql>
<sql id="Base_Column_List">
id, `type`, event, user_id, task_type, webhook, identification, is_set, organization_id,
test_id, create_time
id, `type`, event, user_id, task_type, webhook, identification, is_set, test_id,
create_time, workspace_id
</sql>
<sql id="Blob_Column_List">
`template`
</sql>
<select id="selectByExampleWithBLOBs" parameterType="io.metersphere.base.domain.MessageTaskExample" resultMap="ResultMapWithBLOBs">
SELECT
select
<if test="distinct">
DISTINCT
distinct
</if>
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
FROM message_task
from message_task
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
ORDER BY ${orderByClause}
order by ${orderByClause}
</if>
</select>
<select id="selectByExample" parameterType="io.metersphere.base.domain.MessageTaskExample" resultMap="BaseResultMap">
@ -131,15 +131,15 @@
</if>
</delete>
<insert id="insert" parameterType="io.metersphere.base.domain.MessageTask">
INSERT INTO message_task (id, `type`, event,
insert into message_task (id, `type`, event,
user_id, task_type, webhook,
identification, is_set, organization_id,
test_id, create_time, `template`
identification, is_set, test_id,
create_time, workspace_id, `template`
)
VALUES (#{id,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{event,jdbcType=VARCHAR},
values (#{id,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{event,jdbcType=VARCHAR},
#{userId,jdbcType=VARCHAR}, #{taskType,jdbcType=VARCHAR}, #{webhook,jdbcType=VARCHAR},
#{identification,jdbcType=VARCHAR}, #{isSet,jdbcType=BIT}, #{organizationId,jdbcType=VARCHAR},
#{testId,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{template,jdbcType=LONGVARCHAR}
#{identification,jdbcType=VARCHAR}, #{isSet,jdbcType=BIT}, #{testId,jdbcType=VARCHAR},
#{createTime,jdbcType=BIGINT}, #{workspaceId,jdbcType=VARCHAR}, #{template,jdbcType=LONGVARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="io.metersphere.base.domain.MessageTask">
@ -169,15 +169,15 @@
<if test="isSet != null">
is_set,
</if>
<if test="organizationId != null">
organization_id,
</if>
<if test="testId != null">
test_id,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="workspaceId != null">
workspace_id,
</if>
<if test="template != null">
`template`,
</if>
@ -207,15 +207,15 @@
<if test="isSet != null">
#{isSet,jdbcType=BIT},
</if>
<if test="organizationId != null">
#{organizationId,jdbcType=VARCHAR},
</if>
<if test="testId != null">
#{testId,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=BIGINT},
</if>
<if test="workspaceId != null">
#{workspaceId,jdbcType=VARCHAR},
</if>
<if test="template != null">
#{template,jdbcType=LONGVARCHAR},
</if>
@ -254,15 +254,15 @@
<if test="record.isSet != null">
is_set = #{record.isSet,jdbcType=BIT},
</if>
<if test="record.organizationId != null">
organization_id = #{record.organizationId,jdbcType=VARCHAR},
</if>
<if test="record.testId != null">
test_id = #{record.testId,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=BIGINT},
</if>
<if test="record.workspaceId != null">
workspace_id = #{record.workspaceId,jdbcType=VARCHAR},
</if>
<if test="record.template != null">
`template` = #{record.template,jdbcType=LONGVARCHAR},
</if>
@ -272,8 +272,8 @@
</if>
</update>
<update id="updateByExampleWithBLOBs" parameterType="map">
UPDATE message_task
SET id = #{record.id,jdbcType=VARCHAR},
update message_task
set id = #{record.id,jdbcType=VARCHAR},
`type` = #{record.type,jdbcType=VARCHAR},
event = #{record.event,jdbcType=VARCHAR},
user_id = #{record.userId,jdbcType=VARCHAR},
@ -281,9 +281,9 @@
webhook = #{record.webhook,jdbcType=VARCHAR},
identification = #{record.identification,jdbcType=VARCHAR},
is_set = #{record.isSet,jdbcType=BIT},
organization_id = #{record.organizationId,jdbcType=VARCHAR},
test_id = #{record.testId,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
workspace_id = #{record.workspaceId,jdbcType=VARCHAR},
`template` = #{record.template,jdbcType=LONGVARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
@ -299,9 +299,9 @@
webhook = #{record.webhook,jdbcType=VARCHAR},
identification = #{record.identification,jdbcType=VARCHAR},
is_set = #{record.isSet,jdbcType=BIT},
organization_id = #{record.organizationId,jdbcType=VARCHAR},
test_id = #{record.testId,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT}
create_time = #{record.createTime,jdbcType=BIGINT},
workspace_id = #{record.workspaceId,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -330,15 +330,15 @@
<if test="isSet != null">
is_set = #{isSet,jdbcType=BIT},
</if>
<if test="organizationId != null">
organization_id = #{organizationId,jdbcType=VARCHAR},
</if>
<if test="testId != null">
test_id = #{testId,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=BIGINT},
</if>
<if test="workspaceId != null">
workspace_id = #{workspaceId,jdbcType=VARCHAR},
</if>
<if test="template != null">
`template` = #{template,jdbcType=LONGVARCHAR},
</if>
@ -346,32 +346,32 @@
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="io.metersphere.base.domain.MessageTask">
UPDATE message_task
SET `type` = #{type,jdbcType=VARCHAR},
update message_task
set `type` = #{type,jdbcType=VARCHAR},
event = #{event,jdbcType=VARCHAR},
user_id = #{userId,jdbcType=VARCHAR},
task_type = #{taskType,jdbcType=VARCHAR},
webhook = #{webhook,jdbcType=VARCHAR},
identification = #{identification,jdbcType=VARCHAR},
is_set = #{isSet,jdbcType=BIT},
organization_id = #{organizationId,jdbcType=VARCHAR},
test_id = #{testId,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
workspace_id = #{workspaceId,jdbcType=VARCHAR},
`template` = #{template,jdbcType=LONGVARCHAR}
WHERE id = #{id,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="io.metersphere.base.domain.MessageTask">
UPDATE message_task
SET `type` = #{type,jdbcType=VARCHAR},
update message_task
set `type` = #{type,jdbcType=VARCHAR},
event = #{event,jdbcType=VARCHAR},
user_id = #{userId,jdbcType=VARCHAR},
task_type = #{taskType,jdbcType=VARCHAR},
webhook = #{webhook,jdbcType=VARCHAR},
identification = #{identification,jdbcType=VARCHAR},
is_set = #{isSet,jdbcType=BIT},
organization_id = #{organizationId,jdbcType=VARCHAR},
test_id = #{testId,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT}
WHERE id = #{id,jdbcType=VARCHAR}
create_time = #{createTime,jdbcType=BIGINT},
workspace_id = #{workspaceId,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>

View File

@ -1,30 +0,0 @@
package io.metersphere.base.mapper;
import io.metersphere.base.domain.Organization;
import io.metersphere.base.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

@ -1,228 +0,0 @@
<?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.base.mapper.OrganizationMapper">
<resultMap id="BaseResultMap" type="io.metersphere.base.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.base.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.base.domain.OrganizationExample">
delete from organization
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="io.metersphere.base.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.base.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.base.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.base.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.base.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,6 @@
<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="organization_id" jdbcType="VARCHAR" property="organizationId" />
<result column="workspace_id" jdbcType="VARCHAR" property="workspaceId" />
<result column="use_default" jdbcType="BIT" property="useDefault" />
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
@ -72,8 +71,8 @@
</where>
</sql>
<sql id="Base_Column_List">
id, api, performance, max_threads, duration, resource_pool, organization_id, workspace_id,
use_default, update_time
id, api, performance, max_threads, duration, resource_pool, workspace_id, use_default,
update_time
</sql>
<select id="selectByExample" parameterType="io.metersphere.base.domain.QuotaExample" resultMap="BaseResultMap">
select
@ -108,12 +107,12 @@
<insert id="insert" parameterType="io.metersphere.base.domain.Quota">
insert into quota (id, api, performance,
max_threads, duration, resource_pool,
organization_id, workspace_id, use_default,
update_time)
workspace_id, use_default, update_time
)
values (#{id,jdbcType=VARCHAR}, #{api,jdbcType=INTEGER}, #{performance,jdbcType=INTEGER},
#{maxThreads,jdbcType=INTEGER}, #{duration,jdbcType=INTEGER}, #{resourcePool,jdbcType=VARCHAR},
#{organizationId,jdbcType=VARCHAR}, #{workspaceId,jdbcType=VARCHAR}, #{useDefault,jdbcType=BIT},
#{updateTime,jdbcType=BIGINT})
#{workspaceId,jdbcType=VARCHAR}, #{useDefault,jdbcType=BIT}, #{updateTime,jdbcType=BIGINT}
)
</insert>
<insert id="insertSelective" parameterType="io.metersphere.base.domain.Quota">
insert into quota
@ -136,9 +135,6 @@
<if test="resourcePool != null">
resource_pool,
</if>
<if test="organizationId != null">
organization_id,
</if>
<if test="workspaceId != null">
workspace_id,
</if>
@ -168,9 +164,6 @@
<if test="resourcePool != null">
#{resourcePool,jdbcType=VARCHAR},
</if>
<if test="organizationId != null">
#{organizationId,jdbcType=VARCHAR},
</if>
<if test="workspaceId != null">
#{workspaceId,jdbcType=VARCHAR},
</if>
@ -209,9 +202,6 @@
<if test="record.resourcePool != null">
resource_pool = #{record.resourcePool,jdbcType=VARCHAR},
</if>
<if test="record.organizationId != null">
organization_id = #{record.organizationId,jdbcType=VARCHAR},
</if>
<if test="record.workspaceId != null">
workspace_id = #{record.workspaceId,jdbcType=VARCHAR},
</if>
@ -234,7 +224,6 @@
max_threads = #{record.maxThreads,jdbcType=INTEGER},
duration = #{record.duration,jdbcType=INTEGER},
resource_pool = #{record.resourcePool,jdbcType=VARCHAR},
organization_id = #{record.organizationId,jdbcType=VARCHAR},
workspace_id = #{record.workspaceId,jdbcType=VARCHAR},
use_default = #{record.useDefault,jdbcType=BIT},
update_time = #{record.updateTime,jdbcType=BIGINT}
@ -260,9 +249,6 @@
<if test="resourcePool != null">
resource_pool = #{resourcePool,jdbcType=VARCHAR},
</if>
<if test="organizationId != null">
organization_id = #{organizationId,jdbcType=VARCHAR},
</if>
<if test="workspaceId != null">
workspace_id = #{workspaceId,jdbcType=VARCHAR},
</if>
@ -282,7 +268,6 @@
max_threads = #{maxThreads,jdbcType=INTEGER},
duration = #{duration,jdbcType=INTEGER},
resource_pool = #{resourcePool,jdbcType=VARCHAR},
organization_id = #{organizationId,jdbcType=VARCHAR},
workspace_id = #{workspaceId,jdbcType=VARCHAR},
use_default = #{useDefault,jdbcType=BIT},
update_time = #{updateTime,jdbcType=BIGINT}

View File

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

View File

@ -1,228 +0,0 @@
<?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.base.mapper.RoleMapper">
<resultMap id="BaseResultMap" type="io.metersphere.base.domain.Role">
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="description" jdbcType="VARCHAR" property="description" />
<result column="type" jdbcType="VARCHAR" property="type" />
<result column="create_time" jdbcType="BIGINT" property="createTime" />
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
</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, type, create_time, update_time
</sql>
<select id="selectByExample" parameterType="io.metersphere.base.domain.RoleExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from role
<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 role
where id = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from role
where id = #{id,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="io.metersphere.base.domain.RoleExample">
delete from role
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="io.metersphere.base.domain.Role">
insert into role (id, name, description,
type, create_time, update_time
)
values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR},
#{type,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT}
)
</insert>
<insert id="insertSelective" parameterType="io.metersphere.base.domain.Role">
insert into role
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="name != null">
name,
</if>
<if test="description != null">
description,
</if>
<if test="type != null">
type,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</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="type != null">
#{type,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=BIGINT},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=BIGINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="io.metersphere.base.domain.RoleExample" resultType="java.lang.Long">
select count(*) from role
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update role
<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.type != null">
type = #{record.type,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>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update role
set id = #{record.id,jdbcType=VARCHAR},
name = #{record.name,jdbcType=VARCHAR},
description = #{record.description,jdbcType=VARCHAR},
type = #{record.type,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="io.metersphere.base.domain.Role">
update role
<set>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
<if test="description != null">
description = #{description,jdbcType=VARCHAR},
</if>
<if test="type != null">
type = #{type,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=BIGINT},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=BIGINT},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="io.metersphere.base.domain.Role">
update role
set name = #{name,jdbcType=VARCHAR},
description = #{description,jdbcType=VARCHAR},
type = #{type,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>

View File

@ -3,8 +3,8 @@
<mapper namespace="io.metersphere.base.mapper.ServiceIntegrationMapper">
<resultMap id="BaseResultMap" type="io.metersphere.base.domain.ServiceIntegration">
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="organization_id" jdbcType="VARCHAR" property="organizationId" />
<result column="platform" jdbcType="VARCHAR" property="platform" />
<result column="workspace_id" jdbcType="VARCHAR" property="workspaceId" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.metersphere.base.domain.ServiceIntegration">
<result column="configuration" jdbcType="LONGVARCHAR" property="configuration" />
@ -68,7 +68,7 @@
</where>
</sql>
<sql id="Base_Column_List">
id, organization_id, platform
id, platform, workspace_id
</sql>
<sql id="Blob_Column_List">
configuration
@ -122,9 +122,9 @@
</if>
</delete>
<insert id="insert" parameterType="io.metersphere.base.domain.ServiceIntegration">
insert into service_integration (id, organization_id, platform,
insert into service_integration (id, platform, workspace_id,
configuration)
values (#{id,jdbcType=VARCHAR}, #{organizationId,jdbcType=VARCHAR}, #{platform,jdbcType=VARCHAR},
values (#{id,jdbcType=VARCHAR}, #{platform,jdbcType=VARCHAR}, #{workspaceId,jdbcType=VARCHAR},
#{configuration,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" parameterType="io.metersphere.base.domain.ServiceIntegration">
@ -133,12 +133,12 @@
<if test="id != null">
id,
</if>
<if test="organizationId != null">
organization_id,
</if>
<if test="platform != null">
platform,
</if>
<if test="workspaceId != null">
workspace_id,
</if>
<if test="configuration != null">
configuration,
</if>
@ -147,12 +147,12 @@
<if test="id != null">
#{id,jdbcType=VARCHAR},
</if>
<if test="organizationId != null">
#{organizationId,jdbcType=VARCHAR},
</if>
<if test="platform != null">
#{platform,jdbcType=VARCHAR},
</if>
<if test="workspaceId != null">
#{workspaceId,jdbcType=VARCHAR},
</if>
<if test="configuration != null">
#{configuration,jdbcType=LONGVARCHAR},
</if>
@ -170,12 +170,12 @@
<if test="record.id != null">
id = #{record.id,jdbcType=VARCHAR},
</if>
<if test="record.organizationId != null">
organization_id = #{record.organizationId,jdbcType=VARCHAR},
</if>
<if test="record.platform != null">
platform = #{record.platform,jdbcType=VARCHAR},
</if>
<if test="record.workspaceId != null">
workspace_id = #{record.workspaceId,jdbcType=VARCHAR},
</if>
<if test="record.configuration != null">
configuration = #{record.configuration,jdbcType=LONGVARCHAR},
</if>
@ -187,8 +187,8 @@
<update id="updateByExampleWithBLOBs" parameterType="map">
update service_integration
set id = #{record.id,jdbcType=VARCHAR},
organization_id = #{record.organizationId,jdbcType=VARCHAR},
platform = #{record.platform,jdbcType=VARCHAR},
workspace_id = #{record.workspaceId,jdbcType=VARCHAR},
configuration = #{record.configuration,jdbcType=LONGVARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
@ -197,8 +197,8 @@
<update id="updateByExample" parameterType="map">
update service_integration
set id = #{record.id,jdbcType=VARCHAR},
organization_id = #{record.organizationId,jdbcType=VARCHAR},
platform = #{record.platform,jdbcType=VARCHAR}
platform = #{record.platform,jdbcType=VARCHAR},
workspace_id = #{record.workspaceId,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -206,12 +206,12 @@
<update id="updateByPrimaryKeySelective" parameterType="io.metersphere.base.domain.ServiceIntegration">
update service_integration
<set>
<if test="organizationId != null">
organization_id = #{organizationId,jdbcType=VARCHAR},
</if>
<if test="platform != null">
platform = #{platform,jdbcType=VARCHAR},
</if>
<if test="workspaceId != null">
workspace_id = #{workspaceId,jdbcType=VARCHAR},
</if>
<if test="configuration != null">
configuration = #{configuration,jdbcType=LONGVARCHAR},
</if>
@ -220,15 +220,15 @@
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="io.metersphere.base.domain.ServiceIntegration">
update service_integration
set organization_id = #{organizationId,jdbcType=VARCHAR},
platform = #{platform,jdbcType=VARCHAR},
set platform = #{platform,jdbcType=VARCHAR},
workspace_id = #{workspaceId,jdbcType=VARCHAR},
configuration = #{configuration,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="io.metersphere.base.domain.ServiceIntegration">
update service_integration
set organization_id = #{organizationId,jdbcType=VARCHAR},
platform = #{platform,jdbcType=VARCHAR}
set platform = #{platform,jdbcType=VARCHAR},
workspace_id = #{workspaceId,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>

View File

@ -11,7 +11,6 @@
<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" />
@ -80,7 +79,7 @@
</sql>
<sql id="Base_Column_List">
id, `name`, email, `password`, `status`, create_time, update_time, `language`, last_workspace_id,
last_organization_id, phone, `source`, last_project_id, create_user
phone, `source`, last_project_id, create_user
</sql>
<sql id="Blob_Column_List">
platform_info
@ -137,15 +136,13 @@
insert into user (id, `name`, email,
`password`, `status`, create_time,
update_time, `language`, last_workspace_id,
last_organization_id, phone, `source`,
last_project_id, create_user, platform_info
)
phone, `source`, last_project_id,
create_user, platform_info)
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},
#{lastOrganizationId,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR}, #{source,jdbcType=VARCHAR},
#{lastProjectId,jdbcType=VARCHAR}, #{createUser,jdbcType=VARCHAR}, #{platformInfo,jdbcType=LONGVARCHAR}
)
#{phone,jdbcType=VARCHAR}, #{source,jdbcType=VARCHAR}, #{lastProjectId,jdbcType=VARCHAR},
#{createUser,jdbcType=VARCHAR}, #{platformInfo,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" parameterType="io.metersphere.base.domain.User">
insert into user
@ -177,9 +174,6 @@
<if test="lastWorkspaceId != null">
last_workspace_id,
</if>
<if test="lastOrganizationId != null">
last_organization_id,
</if>
<if test="phone != null">
phone,
</if>
@ -224,9 +218,6 @@
<if test="lastWorkspaceId != null">
#{lastWorkspaceId,jdbcType=VARCHAR},
</if>
<if test="lastOrganizationId != null">
#{lastOrganizationId,jdbcType=VARCHAR},
</if>
<if test="phone != null">
#{phone,jdbcType=VARCHAR},
</if>
@ -280,9 +271,6 @@
<if test="record.lastWorkspaceId != null">
last_workspace_id = #{record.lastWorkspaceId,jdbcType=VARCHAR},
</if>
<if test="record.lastOrganizationId != null">
last_organization_id = #{record.lastOrganizationId,jdbcType=VARCHAR},
</if>
<if test="record.phone != null">
phone = #{record.phone,jdbcType=VARCHAR},
</if>
@ -314,7 +302,6 @@
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},
@ -335,7 +322,6 @@
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},
@ -371,9 +357,6 @@
<if test="lastWorkspaceId != null">
last_workspace_id = #{lastWorkspaceId,jdbcType=VARCHAR},
</if>
<if test="lastOrganizationId != null">
last_organization_id = #{lastOrganizationId,jdbcType=VARCHAR},
</if>
<if test="phone != null">
phone = #{phone,jdbcType=VARCHAR},
</if>
@ -402,7 +385,6 @@
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},
@ -420,7 +402,6 @@
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

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

View File

@ -1,228 +0,0 @@
<?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.base.mapper.UserRoleMapper">
<resultMap id="BaseResultMap" type="io.metersphere.base.domain.UserRole">
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="user_id" jdbcType="VARCHAR" property="userId" />
<result column="role_id" jdbcType="VARCHAR" property="roleId" />
<result column="source_id" jdbcType="VARCHAR" property="sourceId" />
<result column="create_time" jdbcType="BIGINT" property="createTime" />
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
</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, user_id, role_id, source_id, create_time, update_time
</sql>
<select id="selectByExample" parameterType="io.metersphere.base.domain.UserRoleExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from user_role
<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 user_role
where id = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from user_role
where id = #{id,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="io.metersphere.base.domain.UserRoleExample">
delete from user_role
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="io.metersphere.base.domain.UserRole">
insert into user_role (id, user_id, role_id,
source_id, create_time, update_time
)
values (#{id,jdbcType=VARCHAR}, #{userId,jdbcType=VARCHAR}, #{roleId,jdbcType=VARCHAR},
#{sourceId,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT}
)
</insert>
<insert id="insertSelective" parameterType="io.metersphere.base.domain.UserRole">
insert into user_role
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="userId != null">
user_id,
</if>
<if test="roleId != null">
role_id,
</if>
<if test="sourceId != null">
source_id,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=VARCHAR},
</if>
<if test="userId != null">
#{userId,jdbcType=VARCHAR},
</if>
<if test="roleId != null">
#{roleId,jdbcType=VARCHAR},
</if>
<if test="sourceId != null">
#{sourceId,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=BIGINT},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=BIGINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="io.metersphere.base.domain.UserRoleExample" resultType="java.lang.Long">
select count(*) from user_role
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update user_role
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=VARCHAR},
</if>
<if test="record.userId != null">
user_id = #{record.userId,jdbcType=VARCHAR},
</if>
<if test="record.roleId != null">
role_id = #{record.roleId,jdbcType=VARCHAR},
</if>
<if test="record.sourceId != null">
source_id = #{record.sourceId,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>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update user_role
set id = #{record.id,jdbcType=VARCHAR},
user_id = #{record.userId,jdbcType=VARCHAR},
role_id = #{record.roleId,jdbcType=VARCHAR},
source_id = #{record.sourceId,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="io.metersphere.base.domain.UserRole">
update user_role
<set>
<if test="userId != null">
user_id = #{userId,jdbcType=VARCHAR},
</if>
<if test="roleId != null">
role_id = #{roleId,jdbcType=VARCHAR},
</if>
<if test="sourceId != null">
source_id = #{sourceId,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=BIGINT},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=BIGINT},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="io.metersphere.base.domain.UserRole">
update user_role
set user_id = #{userId,jdbcType=VARCHAR},
role_id = #{roleId,jdbcType=VARCHAR},
source_id = #{sourceId,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>

View File

@ -3,7 +3,6 @@
<mapper namespace="io.metersphere.base.mapper.WorkspaceMapper">
<resultMap id="BaseResultMap" type="io.metersphere.base.domain.Workspace">
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="organization_id" jdbcType="VARCHAR" property="organizationId" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="description" jdbcType="VARCHAR" property="description" />
<result column="create_time" jdbcType="BIGINT" property="createTime" />
@ -69,7 +68,7 @@
</where>
</sql>
<sql id="Base_Column_List">
id, organization_id, `name`, description, create_time, update_time, create_user
id, `name`, description, create_time, update_time, create_user
</sql>
<select id="selectByExample" parameterType="io.metersphere.base.domain.WorkspaceExample" resultMap="BaseResultMap">
select
@ -102,12 +101,12 @@
</if>
</delete>
<insert id="insert" parameterType="io.metersphere.base.domain.Workspace">
insert into workspace (id, organization_id, `name`,
description, create_time, update_time,
create_user)
values (#{id,jdbcType=VARCHAR}, #{organizationId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
#{description,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT},
#{createUser,jdbcType=VARCHAR})
insert into workspace (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.base.domain.Workspace">
insert into workspace
@ -115,9 +114,6 @@
<if test="id != null">
id,
</if>
<if test="organizationId != null">
organization_id,
</if>
<if test="name != null">
`name`,
</if>
@ -138,9 +134,6 @@
<if test="id != null">
#{id,jdbcType=VARCHAR},
</if>
<if test="organizationId != null">
#{organizationId,jdbcType=VARCHAR},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
@ -170,9 +163,6 @@
<if test="record.id != null">
id = #{record.id,jdbcType=VARCHAR},
</if>
<if test="record.organizationId != null">
organization_id = #{record.organizationId,jdbcType=VARCHAR},
</if>
<if test="record.name != null">
`name` = #{record.name,jdbcType=VARCHAR},
</if>
@ -196,7 +186,6 @@
<update id="updateByExample" parameterType="map">
update workspace
set id = #{record.id,jdbcType=VARCHAR},
organization_id = #{record.organizationId,jdbcType=VARCHAR},
`name` = #{record.name,jdbcType=VARCHAR},
description = #{record.description,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
@ -209,9 +198,6 @@
<update id="updateByPrimaryKeySelective" parameterType="io.metersphere.base.domain.Workspace">
update workspace
<set>
<if test="organizationId != null">
organization_id = #{organizationId,jdbcType=VARCHAR},
</if>
<if test="name != null">
`name` = #{name,jdbcType=VARCHAR},
</if>
@ -232,8 +218,7 @@
</update>
<update id="updateByPrimaryKey" parameterType="io.metersphere.base.domain.Workspace">
update workspace
set organization_id = #{organizationId,jdbcType=VARCHAR},
`name` = #{name,jdbcType=VARCHAR},
set `name` = #{name,jdbcType=VARCHAR},
description = #{description,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT},

View File

@ -8,9 +8,9 @@
(select count(distinct ug.user_id) from user_group ug join user on ug.user_id = user.id where ug.group_id =
temp.id) as memberSize
from (
select g.*, o.name as scopeName from `group` g, organization o
select g.*, w.name as scopeName from `group` g, workspace w
<where>
and g.scope_id = o.id
and g.scope_id = w.id
<if test="request.types != null and request.types.size() > 0">
AND g.type in
<foreach collection="request.types" item="type" separator="," open="(" close=")">

View File

@ -1,15 +0,0 @@
package io.metersphere.base.mapper.ext;
import io.metersphere.dto.OrganizationMemberDTO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface ExtOrganizationMapper {
int checkSourceRole(@Param("sourceId") String sourceId,@Param("userId") String userId,@Param("groupId") String groupId);
List<OrganizationMemberDTO> findIdAndNameByOrganizationId(@Param("organizationId")String organizationID);
void setDefaultMessageTask(@Param("orgId") String orgId);
}

View File

@ -1,134 +0,0 @@
<?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.base.mapper.ext.ExtOrganizationMapper">
<select id="checkSourceRole" resultType="Integer">
SELECT COUNT(id)
FROM user_group ug
WHERE ug.user_id = #{userId}
AND ug.source_id = #{sourceId}
AND ug.group_id = #{groupId}
</select>
<select id="findIdAndNameByOrganizationId" resultType="io.metersphere.dto.OrganizationMemberDTO">
SELECT id, name
FROM Organization
<where>
<if test="organizationId != 'All'">
AND id = #{organizationId}
</if>
</where>
</select>
<insert id="setDefaultMessageTask">
INSERT INTO message_task (id, type, event, user_id, task_type, webhook, identification, is_set, organization_id,
test_id, create_time, template)
VALUES (UUID(), 'IN_SITE', 'DELETE', 'CREATOR', 'PERFORMANCE_TEST_TASK', '',
'ce692111-166b-491a-ae69-f047c31de971', 0,
#{orgId}, NULL, 1629686472659, NULL),
(UUID(), 'IN_SITE', 'COMPLETE', 'CREATOR', 'REVIEW_TASK',
'',
'72836b2d-4c2f-4185-95aa-1894c6f0d1c3', 0, #{orgId}, NULL, 1629697096803,
NULL),
(UUID(), 'IN_SITE', 'CLOSE_SCHEDULE', 'CREATOR', 'TRACK_HOME_TASK', '',
'ceb0aeb5-f194-4183-a995-3607a769c61d',
0, #{orgId}, NULL, 1629705930753, NULL),
(UUID(), 'IN_SITE', 'DELETE', 'CREATOR', 'API_AUTOMATION_TASK', '',
'e2865464-0da3-42bc-a041-7d21bd70d339', 0,
#{orgId}, NULL, 1629446356866, NULL),
(UUID(), 'IN_SITE', 'UPDATE', 'FOLLOW_PEOPLE', 'PERFORMANCE_TEST_TASK', '',
'79d7dcdc-68a2-47a2-9ef5-21fdf9bde65c', 0, #{orgId}, NULL, 1629446379928,
NULL),
(UUID(), 'IN_SITE', 'CLOSE_SCHEDULE', 'CREATOR', 'API_HOME_TASK', '',
'dbe5dfcd-927f-4065-93cf-22f33d9570ac', 0,
#{orgId}, NULL, 1629446330438, NULL),
(UUID(), 'IN_SITE', 'UPDATE', 'FOLLOW_PEOPLE', 'TRACK_TEST_CASE_TASK', '',
'3a632784-c73b-4f5f-824c-bdf4fccf6f4d', 0, #{orgId}, NULL, 1629705939795,
NULL),
(UUID(), 'IN_SITE', 'CASE_UPDATE', 'FOLLOW_PEOPLE', 'API_DEFINITION_TASK', '',
'a6a3979a-bd80-414c-a253-06f0364c434f', 0, #{orgId}, NULL, 1629446346104,
NULL),
(UUID(), 'IN_SITE', 'UPDATE', 'FOLLOW_PEOPLE', 'API_AUTOMATION_TASK', '',
'019de091-1a19-4b30-bd5e-23b83bc820fb',
0, #{orgId}, NULL, 1629618010742, NULL),
(UUID(), 'IN_SITE', 'CASE_UPDATE', 'CREATOR', 'API_DEFINITION_TASK', '',
'a6a3979a-bd80-414c-a253-06f0364c434f',
0, #{orgId}, NULL, 1629446346104, NULL),
(UUID(), 'IN_SITE', 'DELETE', 'CREATOR', 'DEFECT_TASK', '', '66568b56-4f9e-4bf6-8621-7402403368b9', 0,
#{orgId}, NULL, 1629446306675, NULL),
(UUID(), 'IN_SITE', 'DELETE', 'FOLLOW_PEOPLE', 'PERFORMANCE_TEST_TASK', '',
'ce692111-166b-491a-ae69-f047c31de971', 0, #{orgId}, NULL, 1629686472659,
NULL),
(UUID(), 'IN_SITE', 'UPDATE', 'CREATOR', 'DEFECT_TASK', '', '3a913f72-7cee-4e36-ae1d-0443c7cb5f97', 0,
#{orgId}, NULL, 1629699608062, NULL),
(UUID(), 'IN_SITE', 'UPDATE', 'FOLLOW_PEOPLE', 'API_DEFINITION_TASK', '',
'7ca324cd-7113-412b-8714-5cbe1bffa535',
0, #{orgId}, NULL, 1629706088088, NULL),
(UUID(), 'IN_SITE', 'CASE_DELETE', 'CREATOR', 'API_DEFINITION_TASK', '',
'aeb9d21a-855c-44d3-a715-dfb1bba8ad6c',
0, #{orgId}, NULL, 1629446334332, NULL),
(UUID(), 'IN_SITE', 'DELETE', 'CREATOR', 'API_REPORT_TASK', '', '4d3309f3-7ab2-492e-b9c9-1127c3e005d1',
0,
#{orgId}, NULL, 1629446364391, NULL),
(UUID(), 'IN_SITE', 'COMMENT', 'CREATOR', 'TRACK_TEST_CASE_TASK', '',
'2e8db54f-2d39-42a6-9832-43bb3384e7d5', 0,
#{orgId}, NULL, 1629446247833, NULL),
(UUID(), 'IN_SITE', 'DELETE', 'CREATOR', 'API_DEFINITION_TASK', '',
'90f2be5d-0a71-44f0-a750-f16bf39d690b', 0,
#{orgId}, NULL, 1629446338557, NULL),
(UUID(), 'IN_SITE', 'DELETE', 'CREATOR', 'PERFORMANCE_REPORT_TASK', '',
'4c1bfa4a-b02b-4e8e-bc09-b13613723a11',
0, #{orgId}, NULL, 1629446384995, NULL),
(UUID(), 'IN_SITE', 'UPDATE', 'CREATOR', 'API_AUTOMATION_TASK', '',
'019de091-1a19-4b30-bd5e-23b83bc820fb', 0,
#{orgId}, NULL, 1629618010742, NULL),
(UUID(), 'IN_SITE', 'COMPLETE', 'CREATOR', 'TEST_PLAN_TASK', '', '86b42beb-a86f-4ff3-a73c-d25112c2f104',
0,
#{orgId}, NULL, 1629446286106, NULL),
(UUID(), 'IN_SITE', 'UPDATE', 'CREATOR', 'PERFORMANCE_TEST_TASK', '',
'79d7dcdc-68a2-47a2-9ef5-21fdf9bde65c', 0,
#{orgId}, NULL, 1629446379928, NULL),
(UUID(), 'IN_SITE', 'UPDATE', 'CREATOR', 'TRACK_TEST_CASE_TASK', '',
'3a632784-c73b-4f5f-824c-bdf4fccf6f4d', 0,
#{orgId}, NULL, 1629705939795, NULL),
(UUID(), 'IN_SITE', 'UPDATE', 'CREATOR', 'API_DEFINITION_TASK', '',
'7ca324cd-7113-412b-8714-5cbe1bffa535', 0,
#{orgId}, NULL, 1629706088088, NULL),
(UUID(), 'IN_SITE', 'DELETE', 'CREATOR', 'TEST_PLAN_TASK', '', '04ea4fbd-a392-4f80-a61c-51d31a302cac', 0,
#{orgId}, NULL, 1629446289522, NULL),
(UUID(), 'IN_SITE', 'UPDATE', 'CREATOR', 'REVIEW_TASK', '', 'db515209-f864-46d3-a2e5-63db6d1339c3', 0,
#{orgId}, NULL, 1629446276516, NULL),
(UUID(), 'IN_SITE', 'DELETE', 'CREATOR', 'TRACK_REPORT_TASK', '', 'ea2fee85-8a44-413a-a128-16bfa01ada0d',
0,
#{orgId}, NULL, 1629283758941, NULL),
(UUID(), 'IN_SITE', 'DELETE', 'CREATOR', 'REVIEW_TASK', '', 'f9b1f60b-6dee-48af-8217-0428b27dcbab', 0,
#{orgId}, NULL, 1629446272477, NULL),
(UUID(), 'IN_SITE', 'DELETE', 'CREATOR', 'TRACK_TEST_CASE_TASK', '',
'7c26254e-85e9-4269-be13-a2ffcfe0b9f5', 0,
#{orgId}, NULL, 1629446251939, NULL),
(UUID(), 'IN_SITE', 'DELETE', 'FOLLOW_PEOPLE', 'TRACK_TEST_CASE_TASK', '',
'7c26254e-85e9-4269-be13-a2ffcfe0b9f5', 0, #{orgId}, NULL, 1629446251939,
NULL),
(UUID(), 'IN_SITE', 'EXECUTE_SUCCESSFUL', 'CREATOR', 'API_DEFINITION_TASK', '',
'7efddbdb-2b6c-4425-96a4-0bc2aa9e2cd2', 0, #{orgId}, NULL, 1629775183917,
NULL),
(UUID(), 'IN_SITE', 'EXECUTE_FAILED', 'CREATOR', 'API_DEFINITION_TASK', '',
'e508035c-1318-40ea-9457-0bbe9865f4ce', 0, #{orgId}, NULL, 1629775194857,
NULL),
(UUID(), 'IN_SITE', 'EXECUTE_COMPLETED', 'CREATOR', 'PERFORMANCE_TEST_TASK', '',
'e3db90c6-fb49-4e89-bc25-1d14b5ce94d0', 0, #{orgId}, NULL, 1629790602744,
NULL),
(UUID(), 'IN_SITE', 'EXECUTE_FAILED', 'CREATOR', 'API_AUTOMATION_TASK', '',
'c25930e8-b617-45f7-af5e-cc94adc14192', 0, #{orgId}, NULL, 1629780485724,
NULL),
(UUID(), 'IN_SITE', 'EXECUTE_SUCCESSFUL', 'CREATOR', 'API_AUTOMATION_TASK', '',
'9f91e5e5-1744-4160-bfc6-3851bfd59e05', 0, #{orgId}, NULL, 1629780475764,
NULL),
(UUID(), 'IN_SITE', 'UPDATE', 'PROCESSOR', 'DEFECT_TASK', '',
'6cad944e-db8d-4786-9ef3-7d6370940325', 0, #{orgId}, NULL, 1629791388405,
NULL),
(UUID(), 'IN_SITE', 'CREATE', 'PROCESSOR', 'DEFECT_TASK', '',
'4a890e41-e755-44fc-b734-d6a0ca25a65c', 0, #{orgId}, NULL, 1629790487682,
NULL)
</insert>
</mapper>

View File

@ -1,6 +1,5 @@
package io.metersphere.base.mapper.ext;
import io.metersphere.base.domain.Organization;
import io.metersphere.base.domain.Project;
import io.metersphere.controller.request.ProjectRequest;
import io.metersphere.dto.ProjectDTO;
@ -16,7 +15,7 @@ public interface ExtProjectMapper {
List<String> getProjectIdByWorkspaceId(String workspaceId);
int removeIssuePlatform(@Param("platform") String platform, @Param("orgId") String orgId);
int removeIssuePlatform(@Param("platform") String platform, @Param("workspaceId") String workspaceId);
List<ProjectDTO> getUserProject(@Param("proRequest") ProjectRequest request);
@ -29,9 +28,9 @@ public interface ExtProjectMapper {
@MapKey("id")
Map<String, Project> queryNameByIds(@Param("ids") List<String> ids);
Organization getOrganizationByProjectId(@Param("projectId") String projectId);
List<Integer> selectTcpPorts();
Project selectProjectByResourceId(@Param("resourceId") String resourceId);
long getProjectMemberSize(@Param("projectId") String projectId);
}

View File

@ -172,20 +172,9 @@
</set>
WHERE project.id IN (SELECT id FROM (SELECT id
FROM project
WHERE workspace_id IN
(SELECT workspace.id
FROM workspace
WHERE organization_id = #{orgId})) AS a)
WHERE workspace_id = #{workspaceId}) AS a)
</update>
<select id="getOrganizationByProjectId" resultType="io.metersphere.base.domain.Organization">
SELECT organization.*
FROM organization
JOIN workspace ON organization.id = organization_id
JOIN project ON workspace.id = workspace_id
WHERE project.id = #{projectId, jdbcType=VARCHAR}
</select>
<select id="selectTcpPorts" resultType="java.lang.Integer">
SELECT mock_tcp_port
FROM project
@ -247,4 +236,9 @@
WHERE id = #{resourceId})
LIMIT 1
</select>
<select id="getProjectMemberSize" resultType="java.lang.Long">
SELECT count(distinct (`user`.id)) FROM user_group JOIN `user` ON user_group.user_id = `user`.id
WHERE user_group.source_id = #{projectId}
</select>
</mapper>

View File

@ -1,11 +0,0 @@
package io.metersphere.base.mapper.ext;
import io.metersphere.base.domain.Role;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface ExtRoleMapper {
List<Role> getRoleList(@Param("sign") String sign);
}

View File

@ -1,9 +0,0 @@
<?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.base.mapper.ext.ExtRoleMapper">
<select id="getRoleList" resultType="io.metersphere.base.domain.Role">
select * from role where id like CONCAT('%', #{sign},'%')
</select>
</mapper>

View File

@ -4,10 +4,8 @@ import io.metersphere.base.domain.Group;
import io.metersphere.base.domain.User;
import io.metersphere.controller.request.group.EditGroupRequest;
import io.metersphere.controller.request.member.QueryMemberRequest;
import io.metersphere.controller.request.organization.QueryOrgMemberRequest;
import io.metersphere.dto.RelatedSource;
import io.metersphere.dto.UserGroupDTO;
import io.metersphere.dto.UserGroupHelpDTO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -16,16 +14,10 @@ public interface ExtUserGroupMapper {
List<UserGroupDTO> getUserGroup(@Param("userId") String userId);
List<Group> getOrganizationMemberGroups(@Param("orgId") String orgId, @Param("userId") String userId);
List<User> getOrgMemberList(@Param("orgMember") QueryOrgMemberRequest request);
List<Group> getWorkspaceMemberGroups(@Param("workspaceId") String workspaceId, @Param("userId") String userId);
List<User> getMemberList(@Param("member") QueryMemberRequest request);
List<UserGroupHelpDTO> getUserRoleHelpList(@Param("userId") String userId);
List<User> getProjectMemberList(@Param("request") QueryMemberRequest request);
List<Group> getProjectMemberGroups(@Param("projectId") String projectId,@Param("userId") String userId);
@ -33,4 +25,6 @@ public interface ExtUserGroupMapper {
List<RelatedSource> getRelatedSource(@Param("userId") String userId);
List<User> getGroupUser(@Param("request")EditGroupRequest request);
int checkSourceRole(@Param("sourceId") String sourceId, @Param("userId") String userId, @Param("groupId") String groupId);
}

View File

@ -8,27 +8,7 @@
from user_group ug join `group` g on ug.group_id = g.id
where ug.user_id = #{userId}
</select>
<select id="getOrganizationMemberGroups" resultType="io.metersphere.base.domain.Group">
select g.id, g.name
from organization o
join user_group ug on o.id = ug.source_id
join `group` g on g.id = ug.group_id
where o.id = #{orgId} and ug.user_id = #{userId}
</select>
<select id="getOrgMemberList" resultType="io.metersphere.base.domain.User">
SELECT DISTINCT * FROM (
SELECT `user`.*
FROM user_group JOIN `user`
ON user_group.user_id = `user`.id
WHERE user_group.source_id in
(
SELECT #{orgMember.organizationId} AS id FROM dual
)
<if test="orgMember.name != null">
AND `user`.name like CONCAT('%', #{orgMember.name},'%')
</if>
order by user_group.update_time desc) temp
</select>
<select id="getWorkspaceMemberGroups" resultType="io.metersphere.base.domain.Group">
select r.id, r.name
from workspace w
@ -45,24 +25,6 @@
</if>
order by user_group.update_time desc) temp
</select>
<select id="getUserRoleHelpList" resultType="io.metersphere.dto.UserGroupHelpDTO">
SELECT
ug.group_id AS roleId,
g.`name` AS roleName,
ug.source_id AS sourceId,
IF(workspace.id IS NULL,IF(organization.id IS NULL,'',organization.`name`),workspace.name) AS sourceName,
IF(workspace.id IS NULL,NULL,workspace.organization_id) AS parentId
FROM user_group ug LEFT JOIN `group` g ON g.id = ug.group_id
LEFT JOIN workspace ON workspace.id = ug.source_id
LEFT JOIN organization ON organization.id = ug.source_id
WHERE ug.user_id = #{userId}
</select>
<select id="getProjectMemberList" resultType="io.metersphere.base.domain.User">
SELECT DISTINCT * FROM (
SELECT `user`.* FROM user_group JOIN `user` ON user_group.user_id = `user`.id
@ -77,23 +39,16 @@
where p.id = #{projectId} and ur.user_id = #{userId}
</select>
<select id="getRelatedSource" resultType="io.metersphere.dto.RelatedSource">
SELECT organization_id, workspace_id, project.id
SELECT workspace_id, project.id
FROM user_group
JOIN project ON source_id = project.id
JOIN workspace w ON project.workspace_id = w.id
JOIN organization o ON w.organization_id = o.id
WHERE user_id = #{userId} -- project_admin project_member read_only bb
UNION
SELECT organization_id, w.id, ''
SELECT w.id, ''
FROM user_group
JOIN workspace w ON user_group.source_id = w.id
JOIN organization o2 ON w.organization_id = o2.id
WHERE user_id = #{userId} -- workspace_admin workspace_member ccc
UNION
SELECT o.id, '', ''
FROM user_group
JOIN organization o ON user_group.source_id = o.id
WHERE user_id = #{userId} -- org_admin org_member aaa
</select>
<select id="getGroupUser" resultType="io.metersphere.base.domain.User">
select distinct user.id, user.name, user.email, user.phone, user.create_time
@ -104,4 +59,13 @@
</if>
order by ug.update_time desc
</select>
<select id="checkSourceRole" resultType="Integer">
SELECT COUNT(id)
FROM user_group ug
WHERE ug.user_id = #{userId}
AND ug.source_id = #{sourceId}
AND ug.group_id = #{groupId}
</select>
</mapper>

View File

@ -12,7 +12,6 @@
<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"/>
</resultMap>
@ -39,7 +38,7 @@
<select id="getUserList" resultMap="BaseResultMap">
select u.id, u.name, u.email, u.phone, u.language, u.status, u.source,
u.last_organization_id, u.last_workspace_id, u.language, u.create_time, u.update_time
u.last_workspace_id, u.language, u.create_time, u.update_time
from `user` u
<where>
<if test="userRequest.id != null">
@ -81,7 +80,7 @@
</select>
<select id="searchUser" parameterType="java.lang.String" resultType="io.metersphere.base.domain.User">
select id, name, email, last_organization_id, last_workspace_id from `user` where id like CONCAT('%', #{condition},'%') or email like CONCAT('%', #{condition},'%') limit 100;
select id, name, email, last_workspace_id from `user` where id like CONCAT('%', #{condition},'%') or email like CONCAT('%', #{condition},'%') limit 100;
</select>
<select id="queryNameByIds" resultType="io.metersphere.base.domain.User">

View File

@ -1,34 +0,0 @@
package io.metersphere.base.mapper.ext;
import io.metersphere.base.domain.Role;
import io.metersphere.base.domain.User;
import io.metersphere.controller.request.UserRequest;
import io.metersphere.controller.request.member.QueryMemberRequest;
import io.metersphere.controller.request.organization.QueryOrgMemberRequest;
import io.metersphere.dto.OrganizationMemberDTO;
import io.metersphere.dto.UserRoleHelpDTO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface ExtUserRoleMapper {
List<UserRoleHelpDTO> getUserRoleHelpList(@Param("userId") String userId);
List<User> getMemberList(@Param("member") QueryMemberRequest request);
List<User> getOrgMemberList(@Param("orgMember") QueryOrgMemberRequest request);
List<OrganizationMemberDTO> getOrganizationMemberDTO(@Param("orgMember") QueryOrgMemberRequest request);
List<Role> getOrganizationMemberRoles(@Param("orgId") String orgId, @Param("userId") String userId);
List<Role> getWorkspaceMemberRoles(@Param("workspaceId") String workspaceId, @Param("userId") String userId);
List<User> getBesideOrgMemberList(@Param("orgId") String orgId);
List<User> getTestManagerAndTestUserList(@Param("request") QueryMemberRequest request);
List<String> selectIdsByQuery(@Param("organizationId") String organizationId, @Param("orgMember")UserRequest condition);
}

View File

@ -1,129 +0,0 @@
<?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.base.mapper.ext.ExtUserRoleMapper">
<resultMap id="BaseOrganizationMemberDTOMap" type="io.metersphere.dto.OrganizationMemberDTO">
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="email" jdbcType="VARCHAR" property="email" />
<result column="phone" jdbcType="VARCHAR" property="phone" />
<result column="status" jdbcType="VARCHAR" property="status" />
<result column="create_time" jdbcType="BIGINT" property="createTime" />
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
<result column="language" jdbcType="VARCHAR" property="language" />
<collection property="roles" javaType="arraylist" ofType="io.metersphere.base.domain.Role">
<id column="rid" jdbcType="VARCHAR" property="id" />
<result column="rname" jdbcType="VARCHAR" property="name" />
</collection>
</resultMap>
<select id="getUserRoleHelpList" parameterType="java.lang.String"
resultType="io.metersphere.dto.UserRoleHelpDTO">
SELECT
user_role.role_id AS roleId,
role.`name` AS roleName,
user_role.source_id AS sourceId,
IF(workspace.id IS NULL,IF(organization.id IS NULL,'',organization.`name`),workspace.name) AS sourceName,
IF(workspace.id IS NULL,NULL,workspace.organization_id) AS parentId
FROM user_role LEFT JOIN role ON role.id = user_role.role_id
LEFT JOIN workspace ON workspace.id = user_role.source_id
LEFT JOIN organization ON organization.id = user_role.source_id
WHERE user_role.user_id = #{userId}
</select>
<select id="getMemberList" resultType="io.metersphere.base.domain.User">
SELECT DISTINCT * FROM (
SELECT `user`.* FROM user_role JOIN `user` ON user_role.user_id = `user`.id
WHERE user_role.source_id = #{member.workspaceId}
<if test="member.name != null">
AND `user`.name like CONCAT('%', #{member.name},'%')
</if>
order by user_role.update_time desc) temp
</select>
<select id="getOrgMemberList" resultType="io.metersphere.base.domain.User">
SELECT DISTINCT * FROM (
SELECT `user`.*
FROM user_role JOIN `user`
ON user_role.user_id = `user`.id
WHERE user_role.source_id in
(
SELECT id FROM workspace w
WHERE w.organization_id = #{orgMember.organizationId}
UNION
SELECT #{orgMember.organizationId} AS id FROM dual
)
<if test="orgMember.name != null">
AND `user`.name like CONCAT('%', #{orgMember.name},'%')
</if>
order by user_role.update_time desc) temp
</select>
<select id="getOrganizationMemberDTO" resultMap="BaseOrganizationMemberDTOMap">
select u.id, u.name, u.email, u.language, u.create_time, u.update_time, u.phone,
o.id, o.name, ur.id, r.id as rid, r.name as rname
from organization o
join user_role ur on o.id = ur.source_id
join user u on ur.user_id = u.id
join role r on r.id = ur.role_id
where o.id = #{orgMember.organizationId}
</select>
<select id="getOrganizationMemberRoles" resultType="io.metersphere.base.domain.Role">
select r.id, r.name
from organization o
join user_role ur on o.id = ur.source_id
join role r on r.id = ur.role_id
where o.id = #{orgId} and ur.user_id = #{userId}
</select>
<select id="getBesideOrgMemberList" parameterType="java.lang.String" resultType="io.metersphere.base.domain.User">
select *
from `user`
where `user`.id not in (select distinct u.id
from `user` u
join user_role ur on u.id = ur.user_id
where ur.source_id = #{orgId})
</select>
<select id="getWorkspaceMemberRoles" resultType="io.metersphere.base.domain.Role">
select r.id, r.name
from workspace w
join user_role ur on w.id = ur.source_id
join role r on r.id = ur.role_id
where w.id = #{workspaceId} and ur.user_id = #{userId}
</select>
<select id="getTestManagerAndTestUserList" resultType="io.metersphere.base.domain.User">
SELECT DISTINCT * FROM (
SELECT `user`.* FROM user_role INNER JOIN `user` ON user_role.user_id = `user`.id
WHERE user_role.source_id = #{request.workspaceId} And user_role.role_id in ('test_manager', 'test_user')
<if test="request.name != null">
AND `user`.name like CONCAT('%', #{request.name},'%')
</if>
order by user_role.update_time desc) temp
</select>
<select id="selectIdsByQuery" resultType="java.lang.String">
SELECT DISTINCT temp.id FROM (
SELECT `user`.* FROM user_role
JOIN `user` ON user_role.user_id = `user`.id
WHERE user_role.source_id in
(
SELECT id FROM workspace w
WHERE w.organization_id = #{organizationId}
UNION
SELECT #{organizationId} AS id FROM dual
)
<if test="orgMember.name != null">
AND `user`.name like CONCAT('%', #{orgMember.name},'%')
</if>
order by user_role.update_time desc
) temp
</select>
</mapper>

View File

@ -8,13 +8,7 @@ import java.util.List;
public interface ExtWorkspaceMapper {
List<WorkspaceDTO> getWorkspaceWithOrg(@Param("request") WorkspaceRequest request);
List<WorkspaceDTO> getWorkspaces(@Param("request") WorkspaceRequest request);
List<String> getWorkspaceIdsByOrgId(@Param("orgId") String orgId);
List<WorkspaceDTO> getWorkspaceIdsOrgId(@Param("orgId") String orgId);
String getOrganizationIdById(String resourceID);
List<WorkspaceDTO> findIdAndNameByOrganizationId(@Param("organizationId") String organizationId);
void setDefaultMessageTask(@Param("workspaceId") String workspaceId);
}

View File

@ -2,9 +2,9 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="io.metersphere.base.mapper.ext.ExtWorkspaceMapper">
<select id="getWorkspaceWithOrg" resultType="io.metersphere.dto.WorkspaceDTO">
select w.id, w.name, w.organization_id as organizationId, w.description, o.name as organizationName
from workspace w join organization o on w.organization_id = o.id
<select id="getWorkspaces" resultType="io.metersphere.dto.WorkspaceDTO">
select w.id, w.name, w.description
from workspace w
<where>
<if test="request.name != null and request.name != ''">
AND w.name LIKE #{request.name,jdbcType=VARCHAR}
@ -13,29 +13,115 @@
order by w.update_time desc
</select>
<select id="getWorkspaceIdsByOrgId" resultType="java.lang.String">
select id
from workspace
where organization_id = #{orgId}
</select>
<select id="getWorkspaceIdsOrgId" resultType="io.metersphere.dto.WorkspaceDTO">
select *
from workspace
where organization_id = #{orgId}
</select>
<select id="findIdAndNameByOrganizationId" resultType="io.metersphere.dto.WorkspaceDTO">
select id,name,organization_id AS organizationId from workspace
<where>
<if test="organizationId != 'All'">
AND organization_id = #{organizationId}
</if>
</where>
</select>
<select id="getOrganizationIdById" resultType="java.lang.String">
select organization_id from workspace
where id = #{orgId}
</select>
<insert id="setDefaultMessageTask">
INSERT INTO message_task (id, type, event, user_id, task_type, webhook, identification, is_set, workspace_id,
test_id, create_time, template)
VALUES (UUID(), 'IN_SITE', 'DELETE', 'CREATOR', 'PERFORMANCE_TEST_TASK', '',
'ce692111-166b-491a-ae69-f047c31de971', 0,
#{workspaceId}, NULL, 1629686472659, NULL),
(UUID(), 'IN_SITE', 'COMPLETE', 'CREATOR', 'REVIEW_TASK',
'',
'72836b2d-4c2f-4185-95aa-1894c6f0d1c3', 0, #{workspaceId}, NULL, 1629697096803,
NULL),
(UUID(), 'IN_SITE', 'CLOSE_SCHEDULE', 'CREATOR', 'TRACK_HOME_TASK', '',
'ceb0aeb5-f194-4183-a995-3607a769c61d',
0, #{workspaceId}, NULL, 1629705930753, NULL),
(UUID(), 'IN_SITE', 'DELETE', 'CREATOR', 'API_AUTOMATION_TASK', '',
'e2865464-0da3-42bc-a041-7d21bd70d339', 0,
#{workspaceId}, NULL, 1629446356866, NULL),
(UUID(), 'IN_SITE', 'UPDATE', 'FOLLOW_PEOPLE', 'PERFORMANCE_TEST_TASK', '',
'79d7dcdc-68a2-47a2-9ef5-21fdf9bde65c', 0, #{workspaceId}, NULL, 1629446379928,
NULL),
(UUID(), 'IN_SITE', 'CLOSE_SCHEDULE', 'CREATOR', 'API_HOME_TASK', '',
'dbe5dfcd-927f-4065-93cf-22f33d9570ac', 0,
#{workspaceId}, NULL, 1629446330438, NULL),
(UUID(), 'IN_SITE', 'UPDATE', 'FOLLOW_PEOPLE', 'TRACK_TEST_CASE_TASK', '',
'3a632784-c73b-4f5f-824c-bdf4fccf6f4d', 0, #{workspaceId}, NULL, 1629705939795,
NULL),
(UUID(), 'IN_SITE', 'CASE_UPDATE', 'FOLLOW_PEOPLE', 'API_DEFINITION_TASK', '',
'a6a3979a-bd80-414c-a253-06f0364c434f', 0, #{workspaceId}, NULL, 1629446346104,
NULL),
(UUID(), 'IN_SITE', 'UPDATE', 'FOLLOW_PEOPLE', 'API_AUTOMATION_TASK', '',
'019de091-1a19-4b30-bd5e-23b83bc820fb',
0, #{workspaceId}, NULL, 1629618010742, NULL),
(UUID(), 'IN_SITE', 'CASE_UPDATE', 'CREATOR', 'API_DEFINITION_TASK', '',
'a6a3979a-bd80-414c-a253-06f0364c434f',
0, #{workspaceId}, NULL, 1629446346104, NULL),
(UUID(), 'IN_SITE', 'DELETE', 'CREATOR', 'DEFECT_TASK', '', '66568b56-4f9e-4bf6-8621-7402403368b9', 0,
#{workspaceId}, NULL, 1629446306675, NULL),
(UUID(), 'IN_SITE', 'DELETE', 'FOLLOW_PEOPLE', 'PERFORMANCE_TEST_TASK', '',
'ce692111-166b-491a-ae69-f047c31de971', 0, #{workspaceId}, NULL, 1629686472659,
NULL),
(UUID(), 'IN_SITE', 'UPDATE', 'CREATOR', 'DEFECT_TASK', '', '3a913f72-7cee-4e36-ae1d-0443c7cb5f97', 0,
#{workspaceId}, NULL, 1629699608062, NULL),
(UUID(), 'IN_SITE', 'UPDATE', 'FOLLOW_PEOPLE', 'API_DEFINITION_TASK', '',
'7ca324cd-7113-412b-8714-5cbe1bffa535',
0, #{workspaceId}, NULL, 1629706088088, NULL),
(UUID(), 'IN_SITE', 'CASE_DELETE', 'CREATOR', 'API_DEFINITION_TASK', '',
'aeb9d21a-855c-44d3-a715-dfb1bba8ad6c',
0, #{workspaceId}, NULL, 1629446334332, NULL),
(UUID(), 'IN_SITE', 'DELETE', 'CREATOR', 'API_REPORT_TASK', '', '4d3309f3-7ab2-492e-b9c9-1127c3e005d1',
0,
#{workspaceId}, NULL, 1629446364391, NULL),
(UUID(), 'IN_SITE', 'COMMENT', 'CREATOR', 'TRACK_TEST_CASE_TASK', '',
'2e8db54f-2d39-42a6-9832-43bb3384e7d5', 0,
#{workspaceId}, NULL, 1629446247833, NULL),
(UUID(), 'IN_SITE', 'DELETE', 'CREATOR', 'API_DEFINITION_TASK', '',
'90f2be5d-0a71-44f0-a750-f16bf39d690b', 0,
#{workspaceId}, NULL, 1629446338557, NULL),
(UUID(), 'IN_SITE', 'DELETE', 'CREATOR', 'PERFORMANCE_REPORT_TASK', '',
'4c1bfa4a-b02b-4e8e-bc09-b13613723a11',
0, #{workspaceId}, NULL, 1629446384995, NULL),
(UUID(), 'IN_SITE', 'UPDATE', 'CREATOR', 'API_AUTOMATION_TASK', '',
'019de091-1a19-4b30-bd5e-23b83bc820fb', 0,
#{workspaceId}, NULL, 1629618010742, NULL),
(UUID(), 'IN_SITE', 'COMPLETE', 'CREATOR', 'TEST_PLAN_TASK', '', '86b42beb-a86f-4ff3-a73c-d25112c2f104',
0,
#{workspaceId}, NULL, 1629446286106, NULL),
(UUID(), 'IN_SITE', 'UPDATE', 'CREATOR', 'PERFORMANCE_TEST_TASK', '',
'79d7dcdc-68a2-47a2-9ef5-21fdf9bde65c', 0,
#{workspaceId}, NULL, 1629446379928, NULL),
(UUID(), 'IN_SITE', 'UPDATE', 'CREATOR', 'TRACK_TEST_CASE_TASK', '',
'3a632784-c73b-4f5f-824c-bdf4fccf6f4d', 0,
#{workspaceId}, NULL, 1629705939795, NULL),
(UUID(), 'IN_SITE', 'UPDATE', 'CREATOR', 'API_DEFINITION_TASK', '',
'7ca324cd-7113-412b-8714-5cbe1bffa535', 0,
#{workspaceId}, NULL, 1629706088088, NULL),
(UUID(), 'IN_SITE', 'DELETE', 'CREATOR', 'TEST_PLAN_TASK', '', '04ea4fbd-a392-4f80-a61c-51d31a302cac', 0,
#{workspaceId}, NULL, 1629446289522, NULL),
(UUID(), 'IN_SITE', 'UPDATE', 'CREATOR', 'REVIEW_TASK', '', 'db515209-f864-46d3-a2e5-63db6d1339c3', 0,
#{workspaceId}, NULL, 1629446276516, NULL),
(UUID(), 'IN_SITE', 'DELETE', 'CREATOR', 'TRACK_REPORT_TASK', '', 'ea2fee85-8a44-413a-a128-16bfa01ada0d',
0,
#{workspaceId}, NULL, 1629283758941, NULL),
(UUID(), 'IN_SITE', 'DELETE', 'CREATOR', 'REVIEW_TASK', '', 'f9b1f60b-6dee-48af-8217-0428b27dcbab', 0,
#{workspaceId}, NULL, 1629446272477, NULL),
(UUID(), 'IN_SITE', 'DELETE', 'CREATOR', 'TRACK_TEST_CASE_TASK', '',
'7c26254e-85e9-4269-be13-a2ffcfe0b9f5', 0,
#{workspaceId}, NULL, 1629446251939, NULL),
(UUID(), 'IN_SITE', 'DELETE', 'FOLLOW_PEOPLE', 'TRACK_TEST_CASE_TASK', '',
'7c26254e-85e9-4269-be13-a2ffcfe0b9f5', 0, #{workspaceId}, NULL, 1629446251939,
NULL),
(UUID(), 'IN_SITE', 'EXECUTE_SUCCESSFUL', 'CREATOR', 'API_DEFINITION_TASK', '',
'7efddbdb-2b6c-4425-96a4-0bc2aa9e2cd2', 0, #{workspaceId}, NULL, 1629775183917,
NULL),
(UUID(), 'IN_SITE', 'EXECUTE_FAILED', 'CREATOR', 'API_DEFINITION_TASK', '',
'e508035c-1318-40ea-9457-0bbe9865f4ce', 0, #{workspaceId}, NULL, 1629775194857,
NULL),
(UUID(), 'IN_SITE', 'EXECUTE_COMPLETED', 'CREATOR', 'PERFORMANCE_TEST_TASK', '',
'e3db90c6-fb49-4e89-bc25-1d14b5ce94d0', 0, #{workspaceId}, NULL, 1629790602744,
NULL),
(UUID(), 'IN_SITE', 'EXECUTE_FAILED', 'CREATOR', 'API_AUTOMATION_TASK', '',
'c25930e8-b617-45f7-af5e-cc94adc14192', 0, #{workspaceId}, NULL, 1629780485724,
NULL),
(UUID(), 'IN_SITE', 'EXECUTE_SUCCESSFUL', 'CREATOR', 'API_AUTOMATION_TASK', '',
'9f91e5e5-1744-4160-bfc6-3851bfd59e05', 0, #{workspaceId}, NULL, 1629780475764,
NULL),
(UUID(), 'IN_SITE', 'UPDATE', 'PROCESSOR', 'DEFECT_TASK', '',
'6cad944e-db8d-4786-9ef3-7d6370940325', 0, #{workspaceId}, NULL, 1629791388405,
NULL),
(UUID(), 'IN_SITE', 'CREATE', 'PROCESSOR', 'DEFECT_TASK', '',
'4a890e41-e755-44fc-b734-d6a0ca25a65c', 0, #{workspaceId}, NULL, 1629790487682,
NULL)
</insert>
</mapper>

View File

@ -38,27 +38,11 @@ public class PermissionConstants {
public static final String SYSTEM_AUTH_READ = "SYSTEM_AUTH:READ";
public static final String SYSTEM_AUTH_READ_EDIT = "SYSTEM_AUTH:READ+EDIT";
public static final String ORGANIZATION_USER_READ = "ORGANIZATION_USER:READ";
public static final String ORGANIZATION_USER_READ_CREATE = "ORGANIZATION_USER:READ+CREATE";
public static final String ORGANIZATION_USER_READ_EDIT = "ORGANIZATION_USER:READ+EDIT";
public static final String ORGANIZATION_USER_READ_DELETE = "ORGANIZATION_USER:READ+DELETE";
public static final String ORGANIZATION_WORKSPACE_READ = "ORGANIZATION_WORKSPACE:READ";
public static final String ORGANIZATION_WORKSPACE_READ_CREATE = "ORGANIZATION_WORKSPACE:READ+CREATE";
public static final String ORGANIZATION_WORKSPACE_READ_EDIT = "ORGANIZATION_WORKSPACE:READ+EDIT";
public static final String ORGANIZATION_WORKSPACE_READ_DELETE = "ORGANIZATION_WORKSPACE:READ+DELETE";
public static final String ORGANIZATION_GROUP_READ = "ORGANIZATION_GROUP:READ";
public static final String ORGANIZATION_GROUP_READ_CREATE = "ORGANIZATION_GROUP:READ+CREATE";
public static final String ORGANIZATION_GROUP_READ_EDIT = "ORGANIZATION_GROUP:READ+EDIT";
public static final String ORGANIZATION_GROUP_READ_SETTING_PERMISSION = "ORGANIZATION_GROUP:READ+SETTING_PERMISSION";
public static final String ORGANIZATION_GROUP_READ_DELETE = "ORGANIZATION_GROUP:READ+DELETE";
public static final String ORGANIZATION_SERVICE_READ = "ORGANIZATION_SERVICE:READ";
public static final String ORGANIZATION_SERVICE_READ_EDIT = "ORGANIZATION_SERVICE:READ+EDIT";
public static final String ORGANIZATION_MESSAGE_READ = "ORGANIZATION_MESSAGE:READ";
public static final String ORGANIZATION_MESSAGE_READ_EDIT = "ORGANIZATION_MESSAGE:READ+EDIT";
public static final String WORKSPACE_SERVICE_READ = "WORKSPACE_SERVICE:READ";
public static final String WORKSPACE_SERVICE_READ_EDIT = "WORKSPACE_SERVICE:READ+EDIT";
public static final String WORKSPACE_MESSAGE_READ = "WORKSPACE_MESSAGE:READ";
public static final String WORKSPACE_MESSAGE_READ_EDIT = "WORKSPACE_MESSAGE:READ+EDIT";
public static final String WORKSPACE_USER_READ = "WORKSPACE_USER:READ";

View File

@ -1,10 +0,0 @@
package io.metersphere.commons.constants;
public class RoleConstants {
public final static String ADMIN = "admin";
public final static String ORG_ADMIN = "org_admin";
public final static String ORG_MEMBER = "org_member";
public final static String TEST_VIEWER = "test_viewer";
public final static String TEST_MANAGER = "test_manager";
public final static String TEST_USER = "test_user";
}

View File

@ -78,17 +78,6 @@ public class SessionUtils {
return getUser().getLastWorkspaceId();
}
public static String getCurrentOrganizationId() {
try {
HttpServletRequest request = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest();
if (request.getHeader("ORGANIZATION_ID") != null) {
return request.getHeader("ORGANIZATION_ID");
}
} catch (Exception e) {
}
return getUser().getLastOrganizationId();
}
public static String getCurrentProjectId() {
try {
HttpServletRequest request = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest();

View File

@ -4,14 +4,11 @@ import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import io.metersphere.base.domain.CustomField;
import io.metersphere.commons.constants.OperLogConstants;
import io.metersphere.commons.constants.RoleConstants;
import io.metersphere.commons.utils.PageUtils;
import io.metersphere.commons.utils.Pager;
import io.metersphere.controller.request.QueryCustomFieldRequest;
import io.metersphere.log.annotation.MsAuditLog;
import io.metersphere.service.CustomFieldService;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;

View File

@ -3,8 +3,8 @@ package io.metersphere.controller;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import io.metersphere.base.domain.Group;
import io.metersphere.base.domain.Organization;
import io.metersphere.base.domain.User;
import io.metersphere.base.domain.Workspace;
import io.metersphere.commons.constants.OperLogConstants;
import io.metersphere.commons.constants.PermissionConstants;
import io.metersphere.commons.utils.PageUtils;
@ -19,6 +19,7 @@ import io.metersphere.service.GroupService;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
@ -33,7 +34,7 @@ public class GroupController {
private GroupService groupService;
@PostMapping("/get/{goPage}/{pageSize}")
@RequiresPermissions(value= {PermissionConstants.SYSTEM_GROUP_READ, PermissionConstants.ORGANIZATION_GROUP_READ}, logical = Logical.OR)
@RequiresPermissions(value= {PermissionConstants.SYSTEM_GROUP_READ}, logical = Logical.OR)
public Pager<List<GroupDTO>> getGroupList(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody EditGroupRequest request) {
request.setGoPage(goPage);
request.setPageSize(pageSize);
@ -46,13 +47,13 @@ public class GroupController {
}
@PostMapping("/get")
@RequiresPermissions(value={PermissionConstants.SYSTEM_GROUP_READ, PermissionConstants.ORGANIZATION_GROUP_READ}, logical = Logical.OR)
@RequiresPermissions(value={PermissionConstants.SYSTEM_GROUP_READ}, logical = Logical.OR)
public List<Group> getGroupByType(@RequestBody EditGroupRequest request) {
return groupService.getGroupByType(request);
}
@PostMapping("/add")
@RequiresPermissions(value={PermissionConstants.SYSTEM_GROUP_READ_CREATE, PermissionConstants.ORGANIZATION_GROUP_READ_CREATE}, logical = Logical.OR)
@RequiresPermissions(value={PermissionConstants.SYSTEM_GROUP_READ_CREATE}, logical = Logical.OR)
@MsAuditLog(module = "group_permission", type = OperLogConstants.CREATE, content = "#msClass.getLogDetails(#request.id)", msClass = GroupService.class)
public Group addGroup(@RequestBody EditGroupRequest request) {
request.setId(UUID.randomUUID().toString());
@ -60,14 +61,14 @@ public class GroupController {
}
@PostMapping("/edit")
@RequiresPermissions(value={PermissionConstants.SYSTEM_GROUP_READ_EDIT, PermissionConstants.ORGANIZATION_GROUP_READ_EDIT}, logical = Logical.OR)
@RequiresPermissions(value={PermissionConstants.SYSTEM_GROUP_READ_EDIT}, logical = Logical.OR)
@MsAuditLog(module = "group_permission", type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#request.id)", content = "#msClass.getLogDetails(#request.id)", msClass = GroupService.class)
public void editGroup(@RequestBody EditGroupRequest request) {
groupService.editGroup(request);
}
@GetMapping("/delete/{id}")
@RequiresPermissions(value={PermissionConstants.SYSTEM_GROUP_READ_DELETE, PermissionConstants.ORGANIZATION_GROUP_READ_DELETE}, logical = Logical.OR)
@RequiresPermissions(value={PermissionConstants.SYSTEM_GROUP_READ_DELETE}, logical = Logical.OR)
@MsAuditLog(module = "group_permission", type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#id)", msClass = GroupService.class)
public void deleteGroup(@PathVariable String id) {
groupService.deleteGroup(id);
@ -79,7 +80,7 @@ public class GroupController {
}
@PostMapping("/permission/edit")
@RequiresPermissions(value={PermissionConstants.SYSTEM_GROUP_READ_SETTING_PERMISSION, PermissionConstants.ORGANIZATION_GROUP_READ_SETTING_PERMISSION}, logical = Logical.OR)
@RequiresPermissions(value={PermissionConstants.SYSTEM_GROUP_READ_SETTING_PERMISSION}, logical = Logical.OR)
public void editGroupPermission(@RequestBody EditGroupRequest editGroupRequest) {
groupService.editGroupPermission(editGroupRequest);
}
@ -94,11 +95,6 @@ public class GroupController {
return groupService.getGroupsByType(request);
}
@GetMapping("/list/org/{orgId}/{userId}")
public List<Group> getOrganizationMemberGroups(@PathVariable String orgId, @PathVariable String userId) {
return groupService.getOrganizationMemberGroups(orgId, userId);
}
@GetMapping("/list/ws/{workspaceId}/{userId}")
public List<Group> getWorkspaceMemberGroups(@PathVariable String workspaceId, @PathVariable String userId) {
return groupService.getWorkspaceMemberGroups(workspaceId, userId);
@ -109,9 +105,9 @@ public class GroupController {
return groupService.getProjectMemberGroups(projectId, userId);
}
@GetMapping("/org/{userId}")
public List<Organization> getOrganization(@PathVariable String userId) {
return groupService.getOrganization(userId);
@GetMapping("/ws/{userId}")
public List<Workspace> getWorkspace(@PathVariable String userId) {
return groupService.getWorkspace(userId);
}
@GetMapping("/{type}/{id}")

View File

@ -4,7 +4,6 @@ import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import io.metersphere.base.domain.IssueTemplate;
import io.metersphere.commons.constants.OperLogConstants;
import io.metersphere.commons.constants.RoleConstants;
import io.metersphere.commons.utils.PageUtils;
import io.metersphere.commons.utils.Pager;
import io.metersphere.controller.request.BaseQueryRequest;
@ -12,8 +11,6 @@ import io.metersphere.controller.request.UpdateIssueTemplateRequest;
import io.metersphere.dto.IssueTemplateDao;
import io.metersphere.log.annotation.MsAuditLog;
import io.metersphere.service.IssueTemplateService;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;

View File

@ -4,13 +4,10 @@ import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import io.metersphere.base.domain.JarConfig;
import io.metersphere.commons.constants.OperLogConstants;
import io.metersphere.commons.constants.RoleConstants;
import io.metersphere.commons.utils.PageUtils;
import io.metersphere.commons.utils.Pager;
import io.metersphere.log.annotation.MsAuditLog;
import io.metersphere.service.JarConfigService;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

View File

@ -1,76 +0,0 @@
package io.metersphere.controller;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import io.metersphere.base.domain.Organization;
import io.metersphere.commons.constants.OperLogConstants;
import io.metersphere.commons.utils.PageUtils;
import io.metersphere.commons.utils.Pager;
import io.metersphere.controller.request.OrganizationRequest;
import io.metersphere.dto.OrganizationMemberDTO;
import io.metersphere.dto.OrganizationResource;
import io.metersphere.log.annotation.MsAuditLog;
import io.metersphere.service.OrganizationService;
import io.metersphere.service.UserService;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
import java.util.UUID;
@RequestMapping("organization")
@RestController
public class OrganizationController {
@Resource
private OrganizationService organizationService;
@Resource
private UserService userService;
@PostMapping("/add")
@MsAuditLog(module = "system_organization", type = OperLogConstants.CREATE, content = "#msClass.getLogDetails(#organization.id)", msClass = OrganizationService.class)
public Organization addOrganization(@RequestBody Organization organization) {
organization.setId(UUID.randomUUID().toString());
return organizationService.addOrganization(organization);
}
@GetMapping("/list")
public List<Organization> getOrganizationList() {
return organizationService.getOrganizationList(new OrganizationRequest());
}
@PostMapping("/list/{goPage}/{pageSize}")
public Pager<List<Organization>> getOrganizationList(@RequestBody OrganizationRequest request, @PathVariable int goPage, @PathVariable int pageSize) {
Page<Object> page = PageHelper.startPage(goPage, pageSize, true);
return PageUtils.setPageInfo(page, organizationService.getOrganizationList(request));
}
@GetMapping("/delete/{organizationId}")
@MsAuditLog(module = "system_organization", type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#organizationId)", msClass = OrganizationService.class)
public void deleteOrganization(@PathVariable(value = "organizationId") String organizationId) {
userService.refreshSessionUser("organization", organizationId);
organizationService.deleteOrganization(organizationId);
}
@PostMapping("/update")
@MsAuditLog(module = "system_organization", type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#organization.id)", content = "#msClass.getLogDetails(#organization.id)", msClass = OrganizationService.class)
public void updateOrganization(@RequestBody Organization organization) {
organizationService.updateOrganization(organization);
}
@GetMapping("/list/userorg/{userId}")
public List<Organization> getOrganizationListByUserId(@PathVariable String userId) {
return organizationService.getOrganizationListByUserId(userId);
}
@PostMapping("/member/update")
@MsAuditLog(module = "organization_member", type = OperLogConstants.UPDATE,beforeEvent = "#msClass.getLogDetails(#memberDTO)", content = "#msClass.getLogDetails(#memberDTO)", msClass = OrganizationService.class)
public void updateOrgMember(@RequestBody OrganizationMemberDTO memberDTO) {
organizationService.updateOrgMember(memberDTO);
}
@GetMapping("/list/resource/{groupId}/{type}")
public OrganizationResource listResource(@PathVariable String groupId, @PathVariable String type) {
return organizationService.listResource(groupId, type);
}
}

View File

@ -68,6 +68,10 @@ public class ProjectController {
public Project getProject(@PathVariable String id) {
return projectService.getProjectById(id);
}
@GetMapping("/member/size/{id}")
public long getProjectMemberSize(@PathVariable String id) {
return projectService.getProjectMemberSize(id);
}
@PostMapping("/add")
@MsAuditLog(module = "project_project_manager", type = OperLogConstants.CREATE, content = "#msClass.getLogDetails(#project.id)", msClass = ProjectService.class)

View File

@ -1,10 +1,7 @@
package io.metersphere.controller;
import io.metersphere.commons.constants.RoleConstants;
import io.metersphere.controller.request.MdUploadRequest;
import io.metersphere.service.ResourceService;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.core.io.FileSystemResource;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

View File

@ -1,32 +0,0 @@
package io.metersphere.controller;
import io.metersphere.base.domain.Role;
import io.metersphere.commons.constants.RoleConstants;
import io.metersphere.service.RoleService;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
@RequestMapping("role")
@RestController
public class RoleController {
@Resource
private RoleService roleService;
@GetMapping("/list/{sign}")
public List<Role> getRoleList(@PathVariable String sign) {
return roleService.getRoleList(sign);
}
@GetMapping("/all")
public List<Role> getAllRole() {
return roleService.getAllRole();
}
}

View File

@ -18,7 +18,7 @@ public class ServiceIntegrationController {
private IntegrationService integrationService;
@PostMapping("/save")
@MsAuditLog(module = "organization_service_integration", type = OperLogConstants.CREATE, content = "#msClass.getLogDetails(#service.id)", msClass = IntegrationService.class)
@MsAuditLog(module = "workspace_service_integration", type = OperLogConstants.CREATE, content = "#msClass.getLogDetails(#service.id)", msClass = IntegrationService.class)
public ServiceIntegration save(@RequestBody ServiceIntegration service) {
return integrationService.save(service);
}
@ -29,14 +29,14 @@ public class ServiceIntegrationController {
}
@PostMapping("/delete")
@MsAuditLog(module = "organization_service_integration", type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#request.id)", msClass = IntegrationService.class)
@MsAuditLog(module = "workspace_service_integration", type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#request.id)", msClass = IntegrationService.class)
public void delete(@RequestBody IntegrationRequest request) {
integrationService.delete(request);
}
@GetMapping("/all/{orgId}")
public List<ServiceIntegration> getAll(@PathVariable String orgId) {
return integrationService.getAll(orgId);
@GetMapping("/all/{workspaceId}")
public List<ServiceIntegration> getAll(@PathVariable String workspaceId) {
return integrationService.getAll(workspaceId);
}
}

View File

@ -7,10 +7,14 @@ import io.metersphere.commons.constants.OperLogConstants;
import io.metersphere.commons.constants.ParamConstants;
import io.metersphere.controller.request.HeaderRequest;
import io.metersphere.dto.BaseSystemConfigDTO;
import io.metersphere.dto.SystemStatisticData;
import io.metersphere.ldap.domain.LdapInfo;
import io.metersphere.log.annotation.MsAuditLog;
import io.metersphere.notice.domain.MailInfo;
import io.metersphere.service.ProjectService;
import io.metersphere.service.SystemParameterService;
import io.metersphere.service.UserService;
import io.metersphere.service.WorkspaceService;
import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.*;
@ -25,6 +29,12 @@ public class SystemParameterController {
private SystemParameterService SystemParameterService;
@Resource
private Environment env;
@Resource
private UserService userService;
@Resource
private WorkspaceService workspaceService;
@Resource
private ProjectService projectService;
@PostMapping("/edit/email")
@MsAuditLog(module = "system_parameter_setting", type = OperLogConstants.UPDATE, title = "邮件设置", beforeEvent = "#msClass.getMailLogDetails()", content = "#msClass.getMailLogDetails()", msClass = SystemParameterService.class)
@ -99,4 +109,29 @@ public class SystemParameterController {
public UserHeader getHeaderInfo(@RequestBody HeaderRequest headerRequest) {
return SystemParameterService.queryUserHeader(headerRequest);
}
@GetMapping("/statistics/data")
public SystemStatisticData getStatisticsData() {
SystemStatisticData systemStatisticData = new SystemStatisticData();
long userSize = userService.getUserSize();
long workspaceSize = workspaceService.getWorkspaceSize();
long projectSize = projectService.getProjectSize();
systemStatisticData.setUserSize(userSize);
systemStatisticData.setWorkspaceSize(workspaceSize);
systemStatisticData.setProjectSize(projectSize);
return systemStatisticData;
}
@GetMapping("/get/info/{key}")
public SystemParameter getInfo(@PathVariable String key) {
return SystemParameterService.getInfo(key);
}
@PostMapping("/edit/info")
public SystemParameter editInfo(@RequestBody SystemParameter systemParameter) {
SystemParameterService.editInfo(systemParameter);
return systemParameter;
}
}

View File

@ -5,7 +5,6 @@ import com.github.pagehelper.PageHelper;
import io.metersphere.base.domain.TestCaseTemplate;
import io.metersphere.base.domain.TestCaseTemplateWithBLOBs;
import io.metersphere.commons.constants.OperLogConstants;
import io.metersphere.commons.constants.RoleConstants;
import io.metersphere.commons.utils.PageUtils;
import io.metersphere.commons.utils.Pager;
import io.metersphere.controller.request.BaseQueryRequest;
@ -13,8 +12,6 @@ import io.metersphere.controller.request.UpdateCaseFieldTemplateRequest;
import io.metersphere.dto.TestCaseTemplateDao;
import io.metersphere.log.annotation.MsAuditLog;
import io.metersphere.service.TestCaseTemplateService;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;

View File

@ -3,7 +3,6 @@ package io.metersphere.controller;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import io.metersphere.commons.constants.OperLogConstants;
import io.metersphere.commons.constants.RoleConstants;
import io.metersphere.commons.utils.PageUtils;
import io.metersphere.commons.utils.Pager;
import io.metersphere.consul.CacheNode;
@ -12,8 +11,6 @@ import io.metersphere.dto.TestResourcePoolDTO;
import io.metersphere.dto.UpdatePoolDTO;
import io.metersphere.log.annotation.MsAuditLog;
import io.metersphere.service.TestResourcePoolService;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;

View File

@ -12,27 +12,19 @@ import io.metersphere.controller.request.member.AddMemberRequest;
import io.metersphere.controller.request.member.EditPassWordRequest;
import io.metersphere.controller.request.member.QueryMemberRequest;
import io.metersphere.controller.request.member.UserRequest;
import io.metersphere.controller.request.organization.AddOrgMemberRequest;
import io.metersphere.controller.request.organization.QueryOrgMemberRequest;
import io.metersphere.controller.request.resourcepool.UserBatchProcessRequest;
import io.metersphere.dto.*;
import io.metersphere.excel.domain.ExcelResponse;
import io.metersphere.i18n.Translator;
import io.metersphere.log.annotation.MsAuditLog;
import io.metersphere.service.OrganizationService;
import io.metersphere.service.UserService;
import io.metersphere.service.WorkspaceService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@RequestMapping("user")
@RestController
@ -40,10 +32,6 @@ public class UserController {
@Resource
private UserService userService;
@Resource
private OrganizationService organizationService;
@Resource
private WorkspaceService workspaceService;
@PostMapping("/special/add")
@MsAuditLog(module = "system_user", type = OperLogConstants.CREATE, content = "#msClass.getLogDetails(#user)", msClass = UserService.class)
@ -57,11 +45,6 @@ public class UserController {
return PageUtils.setPageInfo(page, userService.getUserListWithRequest(request));
}
@GetMapping("/special/user/role/{userId}")
public UserRoleDTO getUserRole(@PathVariable("userId") String userId) {
return userService.getUserRole(userId);
}
@GetMapping("/special/user/group/{userId}")
public UserGroupPermissionDTO getUserGroup(@PathVariable("userId") String userId) {
return userService.getUserGroup(userId);
@ -110,29 +93,6 @@ public class UserController {
userService.deleteMember(workspaceId, userId);
}
@PostMapping("/special/org/member/add")
@MsAuditLog(module = "organization_member", type = OperLogConstants.CREATE, content = "#msClass.getLogDetails(#request.userIds,#request.organizationId)", msClass = UserService.class)
public void addOrganizationMemberByAdmin(@RequestBody AddOrgMemberRequest request) {
userService.addOrganizationMember(request);
}
@GetMapping("/special/org/member/delete/{organizationId}/{userId}")
@MsAuditLog(module = "organization_member", type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#userId)", msClass = UserService.class)
public void delOrganizationMemberByAdmin(@PathVariable String organizationId, @PathVariable String userId) {
userService.delOrganizationMember(organizationId, userId);
}
@PostMapping("/special/org/member/list/{goPage}/{pageSize}")
public Pager<List<User>> getOrgMemberListByAdmin(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody QueryOrgMemberRequest request) {
Page<Object> page = PageHelper.startPage(goPage, pageSize, true);
return PageUtils.setPageInfo(page, userService.getOrgMemberList(request));
}
@PostMapping("/special/org/member/list/all")
public List<User> getOrgMemberListByAdmin(@RequestBody QueryOrgMemberRequest request) {
return userService.getOrgMemberList(request);
}
@GetMapping("/list")
public List<User> getUserList() {
return userService.getUserList();
@ -242,50 +202,13 @@ public class UserController {
userService.deleteProjectMember(projectId, userId);
}
/**
* 添加组织成员
*/
@PostMapping("/org/member/add")
@MsAuditLog(module = "organization_member", type = OperLogConstants.CREATE, title = "'添加组织成员-'+#request.userIds")
public void addOrganizationMember(@RequestBody AddOrgMemberRequest request) {
organizationService.checkOrgOwner(request.getOrganizationId());
userService.addOrganizationMember(request);
}
/**
* 删除组织成
* ws 下所有相关人员
*/
@GetMapping("/org/member/delete/{organizationId}/{userId}")
@MsAuditLog(module = "organization_member", type = OperLogConstants.DELETE, title = "删除组织成员")
public void delOrganizationMember(@PathVariable String organizationId, @PathVariable String userId) {
organizationService.checkOrgOwner(organizationId);
String currentUserId = SessionUtils.getUser().getId();
if (StringUtils.equals(userId, currentUserId)) {
MSException.throwException(Translator.get("cannot_remove_current"));
}
userService.delOrganizationMember(organizationId, userId);
}
/**
* 查询组织成员列表
*/
@PostMapping("/org/member/list/{goPage}/{pageSize}")
public Pager<List<User>> getOrgMemberList(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody QueryOrgMemberRequest request) {
Page<Object> page = PageHelper.startPage(goPage, pageSize, true);
return PageUtils.setPageInfo(page, userService.getOrgMemberList(request));
}
/**
* 组织下所有相关人员
*/
@PostMapping("/org/member/list/all")
public List<User> getOrgMemberList(@RequestBody QueryOrgMemberRequest request) {
return userService.getOrgAllMember(request);
}
@GetMapping("/besideorg/list/{orgId}")
public List<User> getBesideOrgMemberList(@PathVariable String orgId) {
return userService.getBesideOrgMemberList(orgId);
@GetMapping("/ws/member/list/{workspaceId}")
public List<User> getWsMemberList(@PathVariable String workspaceId) {
return userService.getWsAllMember(workspaceId);
}
/*
@ -304,14 +227,6 @@ public class UserController {
return userService.updateUserPassword(request);
}
/**
* 获取工作空间成员用户 不分页
*/
@PostMapping("/ws/member/tester/list")
public List<User> getTestManagerAndTestUserList(@RequestBody QueryMemberRequest request) {
return userService.getTestManagerAndTestUserList(request);
}
@PostMapping("/project/member/tester/list")
public List<User> getProjectMember(@RequestBody QueryMemberRequest request) {
return userService.getProjectMember(request);
@ -340,45 +255,4 @@ public class UserController {
userService.batchProcessUserInfo(request);
return returnString;
}
@GetMapping("/getWorkspaceDataStruct/{organizationId}")
public List<CascaderDTO> getWorkspaceDataStruct(@PathVariable String organizationId) {
List<OrganizationMemberDTO> organizationList = organizationService.findIdAndNameByOrganizationId(organizationId);
List<WorkspaceDTO> workspaceDTOList = workspaceService.findIdAndNameByOrganizationId(organizationId);
if (!workspaceDTOList.isEmpty()) {
Map<String, List<WorkspaceDTO>> orgIdWorkspaceMap = workspaceDTOList.stream().collect(Collectors.groupingBy(WorkspaceDTO::getOrganizationId));
List<CascaderDTO> returnList = CascaderParse.parseWorkspaceDataStruct(organizationList, orgIdWorkspaceMap);
return returnList;
} else {
return new ArrayList<>();
}
}
@GetMapping("/getUserRoleDataStruct/{organizationId}")
public List<CascaderDTO> getUserRoleDataStruct(@PathVariable String organizationId) {
List<OrganizationMemberDTO> organizationList = organizationService.findIdAndNameByOrganizationId(organizationId);
List<WorkspaceDTO> workspaceDTOList = workspaceService.findIdAndNameByOrganizationId(organizationId);
if (!workspaceDTOList.isEmpty()) {
Map<String, List<WorkspaceDTO>> orgIdWorkspaceMap = workspaceDTOList.stream().collect(Collectors.groupingBy(WorkspaceDTO::getOrganizationId));
List<CascaderDTO> returnList = CascaderParse.parseUserRoleDataStruct(organizationList, orgIdWorkspaceMap, false);
return returnList;
} else {
return new ArrayList<>();
}
}
@GetMapping("/getWorkspaceUserRoleDataStruct/{organizationId}")
public List<CascaderDTO> getWorkspaceUserRoleDataStruct(@PathVariable String organizationId) {
List<OrganizationMemberDTO> organizationList = organizationService.findIdAndNameByOrganizationId(organizationId);
List<WorkspaceDTO> workspaceDTOList = workspaceService.findIdAndNameByOrganizationId(organizationId);
if (!workspaceDTOList.isEmpty()) {
Map<String, List<WorkspaceDTO>> orgIdWorkspaceMap = workspaceDTOList.stream().collect(Collectors.groupingBy(WorkspaceDTO::getOrganizationId));
List<CascaderDTO> returnList = CascaderParse.parseUserRoleDataStruct(organizationList, orgIdWorkspaceMap, true);
return returnList;
} else {
return new ArrayList<>();
}
}
}

View File

@ -2,13 +2,10 @@ package io.metersphere.controller;
import io.metersphere.base.domain.UserKey;
import io.metersphere.commons.constants.OperLogConstants;
import io.metersphere.commons.constants.RoleConstants;
import io.metersphere.commons.utils.SessionUtils;
import io.metersphere.log.annotation.MsAuditLog;
import io.metersphere.security.ApiKeyHandler;
import io.metersphere.service.UserKeyService;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.apache.shiro.web.util.WebUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

View File

@ -1,38 +0,0 @@
package io.metersphere.controller;
import io.metersphere.base.domain.Role;
import io.metersphere.commons.constants.RoleConstants;
import io.metersphere.service.UserRoleService;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
@RequestMapping("userrole")
@RestController
public class UserRoleController {
@Resource
private UserRoleService userRoleService;
@GetMapping("/list/org/{orgId}/{userId}")
public List<Role> getOrganizationMemberRoles(@PathVariable String orgId, @PathVariable String userId) {
return userRoleService.getOrganizationMemberRoles(orgId, userId);
}
@GetMapping("/list/ws/{workspaceId}/{userId}")
public List<Role> getWorkspaceMemberRoles(@PathVariable String workspaceId, @PathVariable String userId) {
return userRoleService.getWorkspaceMemberRoles(workspaceId, userId);
}
@GetMapping("/all/{userId}")
public List<Map<String, Object>> getUserRole(@PathVariable("userId") String userId) {
return userRoleService.getUserRole(userId);
}
}

View File

@ -6,12 +6,11 @@ import io.metersphere.base.domain.Workspace;
import io.metersphere.commons.constants.OperLogConstants;
import io.metersphere.commons.utils.PageUtils;
import io.metersphere.commons.utils.Pager;
import io.metersphere.commons.utils.SessionUtils;
import io.metersphere.controller.request.WorkspaceRequest;
import io.metersphere.dto.WorkspaceDTO;
import io.metersphere.dto.WorkspaceMemberDTO;
import io.metersphere.dto.WorkspaceResource;
import io.metersphere.log.annotation.MsAuditLog;
import io.metersphere.service.OrganizationService;
import io.metersphere.service.UserService;
import io.metersphere.service.WorkspaceService;
import org.springframework.web.bind.annotation.*;
@ -25,14 +24,11 @@ public class WorkspaceController {
@Resource
private WorkspaceService workspaceService;
@Resource
private OrganizationService organizationService;
@Resource
private UserService userService;
@PostMapping("add")
@MsAuditLog(module = "system_workspace", type = OperLogConstants.CREATE, content = "#msClass.getLogDetails(#workspace.id)", msClass = WorkspaceService.class)
public Workspace addWorkspace(@RequestBody Workspace workspace) {
organizationService.checkOrgOwner(workspace.getOrganizationId());
return workspaceService.saveWorkspace(workspace);
}
@ -92,21 +88,14 @@ public class WorkspaceController {
return workspaceService.getWorkspaceListByUserId(userId);
}
@GetMapping("/list/orgworkspace/{userId}/{orgId}")
public List<Workspace> getWorkspaceListByOrgId(@PathVariable String userId, @PathVariable String orgId) {
return workspaceService.getWorkspaceListByOrgIdAndUserId(userId, orgId);
}
@PostMapping("/member/update")
@MsAuditLog(module = "workspace_member", type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#memberDTO)", content = "#msClass.getLogDetails(#memberDTO)", msClass = WorkspaceService.class)
public void updateOrgMember(@RequestBody WorkspaceMemberDTO memberDTO) {
workspaceService.updateWorkspaceMember(memberDTO);
}
@GetMapping("/list/{orgId}")
public List<Workspace> getWorkspaceByOrgId(@PathVariable String orgId) {
WorkspaceRequest request = new WorkspaceRequest();
request.setOrganizationId(orgId);
return workspaceService.getWorkspaceList(request);
@GetMapping("/list/resource/{groupId}/{type}")
public WorkspaceResource listResource(@PathVariable String groupId, @PathVariable String type) {
return workspaceService.listResource(groupId, type);
}
}

View File

@ -16,8 +16,6 @@ public class BaseQueryRequest {
private String workspaceId;
private String organizationId;
private List<String> ids;
private List<String> moduleIds;

View File

@ -7,5 +7,5 @@ import lombok.Setter;
@Setter
public class IntegrationRequest {
private String platform;
private String orgId;
private String workspaceId;
}

View File

@ -6,6 +6,5 @@ import lombok.Setter;
@Getter
@Setter
public class WorkspaceRequest {
private String organizationId;
private String name;
}

View File

@ -9,7 +9,6 @@ import java.util.List;
@Setter
public class AddOrgMemberRequest {
private String organizationId;
private List<String> userIds;
private List<String> roleIds;
private List<String> groupIds;

View File

@ -1,11 +0,0 @@
package io.metersphere.controller.request.organization;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class QueryOrgMemberRequest {
private String name;
private String organizationId;
}

View File

@ -19,7 +19,7 @@ public class UserBatchProcessRequest {
String projectId;
String batchType;
List<String> batchProcessValue;
String organizationId;
String workspaceId;
UserRequest condition;
}

View File

@ -1,108 +0,0 @@
package io.metersphere.dto;
import bsh.StringUtil;
import io.metersphere.commons.constants.RoleConstants;
import io.metersphere.i18n.Translator;
import org.apache.commons.lang3.StringUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* @author song.tianyang
* @Date 2021/3/4 2:47 下午
* @Description
*/
public class CascaderParse {
public static List<CascaderDTO> parseUserRoleDataStruct(List<OrganizationMemberDTO> organizationList, Map<String, List<WorkspaceDTO>> orgIdWorkspaceMap,boolean hideOrgRole) {
List<CascaderDTO> returnList = new ArrayList<>();
for (OrganizationMemberDTO orgDTO : organizationList) {
String orgId = orgDTO.getId();
List<WorkspaceDTO> workspaceDTOList = orgIdWorkspaceMap.get(orgId);
CascaderDTO orgCascader = generateCascaderDTO(orgDTO.getId(), orgDTO.getName(), null);
if (workspaceDTOList != null) {
List<CascaderDTO> children = new ArrayList<>();
for (WorkspaceDTO workspace : workspaceDTOList) {
String parentCascaderType = "workspace";
if(hideOrgRole){
parentCascaderType = "hideOrg";
}
List<CascaderDTO> cascaderDTOList = getUserRoleCascaderDTO(parentCascaderType, workspace.getId());
CascaderDTO workspaceCascader = generateCascaderDTO(workspace.getId(), workspace.getName(), cascaderDTOList);
children.add(workspaceCascader);
}
orgCascader.setChildren(children);
} else {
List<CascaderDTO> cascaderDTOList = getUserRoleCascaderDTO("org", orgDTO.getId());
orgCascader.setChildren(cascaderDTOList);
}
returnList.add(orgCascader);
}
return returnList;
}
private static List<CascaderDTO> getUserRoleCascaderDTO(String parentCascaderType, String parentID) {
String idPrefix = "";
String idSuffix = "<->" + parentCascaderType;
if (!StringUtils.isEmpty(parentID)) {
idPrefix = parentID + "<->";
}
CascaderDTO orgAdminCascasder = generateCascaderDTO(idPrefix + RoleConstants.ORG_ADMIN + idSuffix, Translator.get("org_admin"), null);
CascaderDTO orgMemberCascasder = generateCascaderDTO(idPrefix + RoleConstants.ORG_MEMBER + idSuffix, Translator.get("org_member"), null);
CascaderDTO testManagerCascasder = generateCascaderDTO(idPrefix + RoleConstants.TEST_MANAGER + idSuffix, Translator.get("test_manager"), null);
CascaderDTO testerCascasder = generateCascaderDTO(idPrefix + RoleConstants.TEST_USER + idSuffix, Translator.get("tester"), null);
CascaderDTO readOnlyUserCascasder = generateCascaderDTO(idPrefix + RoleConstants.TEST_VIEWER + idSuffix, Translator.get("read_only_user"), null);
//默认都要添加这两种类型
List<CascaderDTO> returnList = new ArrayList<>();
switch (parentCascaderType) {
case "workspace":
returnList.add(orgAdminCascasder);
returnList.add(orgMemberCascasder);
returnList.add(testManagerCascasder);
returnList.add(testerCascasder);
returnList.add(readOnlyUserCascasder);
break;
case "org":
returnList.add(orgAdminCascasder);
returnList.add(orgMemberCascasder);
break;
case "hideOrg":
returnList.add(testManagerCascasder);
returnList.add(testerCascasder);
returnList.add(readOnlyUserCascasder);
break;
}
return returnList;
}
public static List<CascaderDTO> parseWorkspaceDataStruct(List<OrganizationMemberDTO> organizationList, Map<String, List<WorkspaceDTO>> orgIdWorkspaceMap) {
List<CascaderDTO> returnList = new ArrayList<>();
for (OrganizationMemberDTO orgDTO : organizationList) {
String orgId = orgDTO.getId();
List<WorkspaceDTO> workspaceDTOList = orgIdWorkspaceMap.get(orgId);
if (workspaceDTOList != null) {
List<CascaderDTO> children = new ArrayList<>();
for (WorkspaceDTO workspace : workspaceDTOList) {
CascaderDTO workspaceCascader = generateCascaderDTO(workspace.getId(), workspace.getName(), null);
children.add(workspaceCascader);
}
CascaderDTO orgCascader = generateCascaderDTO(orgDTO.getId(), orgDTO.getName(), children);
returnList.add(orgCascader);
}
}
return returnList;
}
private static CascaderDTO generateCascaderDTO(String value, String lable, List<CascaderDTO> children) {
CascaderDTO cascaderDTO = new CascaderDTO();
cascaderDTO.setLabel(lable);
cascaderDTO.setValue(value);
if (children != null && !children.isEmpty()) {
cascaderDTO.setChildren(children);
}
return cascaderDTO;
}
}

View File

@ -1,24 +0,0 @@
package io.metersphere.dto;
import lombok.Getter;
import lombok.Setter;
import java.util.ArrayList;
import java.util.List;
@Getter
@Setter
public class OrganizationMemberDTO {
private String id;
private String name;
private String email;
private String phone;
private String status;
private Long createTime;
private Long updateTime;
private String language;
private String organizationId;
private List<String> roleIds = new ArrayList<>();
private List<String> groupIds = new ArrayList<>();
}

View File

@ -4,7 +4,6 @@ import lombok.Data;
@Data
public class RelatedSource {
private String organizationId;
private String workspaceId;
private String projectId;
}

View File

@ -0,0 +1,10 @@
package io.metersphere.dto;
import lombok.Data;
@Data
public class SystemStatisticData {
private long userSize = 0;
private long workspaceSize = 0;
private long projectSize = 0;
}

View File

@ -10,11 +10,6 @@ import java.util.List;
@Getter
@Setter
public class UserDTO extends User {
private List<Role> roles = new ArrayList<>();
private List<UserRole> userRoles = new ArrayList<>();
private List<UserGroup> userGroups = new ArrayList<>();
private List<Group> groups = new ArrayList<>();
private List<GroupResourceDTO> groupPermissions = new ArrayList<>();

View File

@ -1,19 +0,0 @@
package io.metersphere.dto;
import io.metersphere.base.domain.Role;
import io.metersphere.base.domain.UserRole;
import lombok.Getter;
import lombok.Setter;
import java.util.List;
@Getter
@Setter
public class UserRoleDTO {
private String userId;
private List<Role> roles;
private List<UserRole> userRoles;
private static final long serialVersionUID = 1L;
}

View File

@ -1,16 +0,0 @@
package io.metersphere.dto;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class UserRoleHelpDTO {
private String roleId;
private String roleName;
private String sourceId;
private String sourceName;
private String parentId;
}

View File

@ -9,8 +9,5 @@ public class WorkspaceDTO {
private String id;
private String name;
private String organizationId;
private String description;
private String organizationName;
}

View File

@ -1,6 +1,5 @@
package io.metersphere.dto;
import io.metersphere.base.domain.Organization;
import io.metersphere.base.domain.Project;
import io.metersphere.base.domain.Workspace;
import lombok.Data;
@ -9,8 +8,7 @@ import java.util.ArrayList;
import java.util.List;
@Data
public class OrganizationResource {
private List<Organization> organizations = new ArrayList<>();
public class WorkspaceResource {
private List<Workspace> workspaces = new ArrayList<>();
private List<Project> projects = new ArrayList<>();
}

View File

@ -21,14 +21,6 @@ public class UserExcelData {
@ExcelIgnore
private String userIsAdmin;
@ExcelIgnore
private String userIsOrgAdmin;
@ExcelIgnore
private String orgAdminOrganization;
@ExcelIgnore
private String userIsOrgMember;
@ExcelIgnore
private String orgMemberOrganization;
@ExcelIgnore
private String userIsTestManager;
@ExcelIgnore
private String testManagerWorkspace;

View File

@ -47,26 +47,6 @@ public class UserExcelDataCn extends UserExcelData {
@ExcelProperty("是否是系统管理员(是/否)")
private String userIsAdmin;
@NotBlank(message = "{cannot_be_null}")
@ColumnWidth(30)
@ExcelProperty("是否是组织管理员(是/否)")
private String userIsOrgAdmin;
@Length(max = 100)
@ColumnWidth(30)
@ExcelProperty("组织管理员组织名称")
private String orgAdminOrganization;
@NotBlank(message = "{cannot_be_null}")
@ExcelProperty("是否是组织成员(是/否)")
@ColumnWidth(30)
private String userIsOrgMember;
@Length(max = 100)
@ColumnWidth(30)
@ExcelProperty("组织成员组织名称")
private String orgMemberOrganization;
@NotBlank(message = "{cannot_be_null}")
@ExcelProperty("是否是工作空间管理员(是/否)")
@ColumnWidth(30)

View File

@ -47,26 +47,6 @@ public class UserExcelDataTw extends TestCaseExcelData {
@ExcelProperty("是否是系統管理員(是/否)")
private String userIsAdmin;
@NotBlank(message = "{cannot_be_null}")
@ColumnWidth(30)
@ExcelProperty("是否是組織管理員(是/否)")
private String userIsOrgAdmin;
@Length(max = 100)
@ColumnWidth(30)
@ExcelProperty("組織管理員組織名稱")
private String orgAdminOrganization;
@NotBlank(message = "{cannot_be_null}")
@ColumnWidth(30)
@ExcelProperty("是否是組織成員(是/否)")
private String userIsOrgMember;
@Length(max = 100)
@ColumnWidth(30)
@ExcelProperty("組織成員組織名稱")
private String orgMemberOrganization;
@NotBlank(message = "{cannot_be_null}")
@ColumnWidth(30)
@ExcelProperty("是否是工作空間管理員(是/否)")

View File

@ -48,26 +48,6 @@ public class UserExcelDataUs extends UserExcelData {
@ExcelProperty("User is administrator(Yes/No)")
private String userIsAdmin;
@NotBlank(message = "{cannot_be_null}")
@ColumnWidth(30)
@ExcelProperty("User is organization manager(Yes/No)")
private String userIsOrgAdmin;
@Length(max = 100)
@ColumnWidth(30)
@ExcelProperty("Manager in witch organization")
private String orgAdminOrganization;
@NotBlank(message = "{cannot_be_null}")
@ColumnWidth(30)
@ExcelProperty("User is organization member(Yes/No)")
private String userIsOrgMember;
@Length(max = 100)
@ColumnWidth(30)
@ExcelProperty("Member in witch organization")
private String orgMemberOrganization;
@NotBlank(message = "{cannot_be_null}")
@ColumnWidth(30)
@ExcelProperty("User is test manager(Yes/No)")

View File

@ -1,6 +1,5 @@
package io.metersphere.excel.listener;
import io.metersphere.commons.constants.RoleConstants;
import io.metersphere.commons.constants.UserGroupConstants;
import io.metersphere.commons.exception.MSException;
import io.metersphere.commons.utils.CommonBeanFactory;
@ -19,8 +18,6 @@ public class UserDataListener extends EasyExcelListener<UserExcelData> {
//key:workspace.name value:id
Map<String, String> workspaceNameMap;
//key:Organization.name value:id
Map<String, String> orgNameMap;
/**
* key:project.name value.id
*/
@ -47,10 +44,9 @@ public class UserDataListener extends EasyExcelListener<UserExcelData> {
return this.names;
}
public UserDataListener(Class clazz, Map<String, String> workspaceNameMap, Map<String, String> orgNameMap, Map<String, String> projectNameMap) {
public UserDataListener(Class clazz, Map<String, String> workspaceNameMap, Map<String, String> projectNameMap) {
this.clazz = clazz;
this.workspaceNameMap = workspaceNameMap;
this.orgNameMap = orgNameMap;
this.projectNameMap = projectNameMap;
this.userService = (UserService) CommonBeanFactory.getBean("userService");
savedUserId = userService.selectAllId();
@ -60,16 +56,6 @@ public class UserDataListener extends EasyExcelListener<UserExcelData> {
public String validate(UserExcelData data, String errMsg) {
StringBuilder stringBuilder = new StringBuilder(errMsg);
//判断组织管理员组织(系统)
String orgManagerOrgCheck = this.checkOrganization(data.getUserIsOrgAdmin(), data.getOrgAdminOrganization());
if (orgManagerOrgCheck != null) {
stringBuilder.append(orgManagerOrgCheck);
}
//判断组织成员组织(系统)
String orgMemberOrgCheck = this.checkOrganization(data.getUserIsOrgMember(), data.getOrgMemberOrganization());
if (orgMemberOrgCheck != null) {
stringBuilder.append(orgMemberOrgCheck);
}
//判断测试经理工作空间(系统)
String testManagerWorkspaceCheck = this.checkWorkSpace(data.getUserIsTestManager(), data.getTestManagerWorkspace());
if (testManagerWorkspaceCheck != null) {
@ -155,31 +141,6 @@ public class UserDataListener extends EasyExcelListener<UserExcelData> {
return result;
}
/**
* 检查组织
*
* @param userRoleInExcel excel表里的用户权限填写信息
* @param organizationInfoInExcel excel表中用户组织填写信息
* @return 报错信息
*/
private String checkOrganization(String userRoleInExcel, String organizationInfoInExcel) {
String result = null;
if (StringUtils.equalsIgnoreCase(Translator.get("options_yes"), userRoleInExcel)) {
String[] organizationArr = organizationInfoInExcel.split("\n");
for (String organization :
organizationArr) {
if (!orgNameMap.containsKey(organization)) {
if (result == null) {
result = new String(Translator.get("user_import_organization_not_fond") + "" + organization + "; ");
} else {
result += Translator.get("user_import_organization_not_fond") + "" + organization + "; ";
}
}
}
}
return result;
}
/**
* 检查项目
* @param userGroupInExcel excel表中用户组填写信息
@ -243,18 +204,6 @@ public class UserDataListener extends EasyExcelListener<UserExcelData> {
Map<String, Object> adminRoleMap = this.genGroupMap(UserGroupConstants.ADMIN, adminIdList);
groupMapList.add(adminRoleMap);
}
//判断组织管理员
List<String> orgManagerOrdIdList = this.getIdByExcelInfoAndIdDic(data.getUserIsOrgAdmin(), data.getOrgAdminOrganization(), orgNameMap);
if (!orgManagerOrdIdList.isEmpty()) {
Map<String, Object> orgAdminRoleMap = this.genGroupMap(UserGroupConstants.ORG_ADMIN, orgManagerOrdIdList);
groupMapList.add(orgAdminRoleMap);
}
//判断组织成员
List<String> orgMemberOrdIdList = this.getIdByExcelInfoAndIdDic(data.getUserIsOrgMember(), data.getOrgMemberOrganization(), orgNameMap);
if (!orgMemberOrdIdList.isEmpty()) {
Map<String, Object> orgMemberRoleMap = this.genGroupMap(UserGroupConstants.ORG_MEMBER, orgMemberOrdIdList);
groupMapList.add(orgMemberRoleMap);
}
//判断测试经理
List<String> testManagerWorkspaceIdList = this.getIdByExcelInfoAndIdDic(data.getUserIsTestManager(), data.getTestManagerWorkspace(), workspaceNameMap);
if (!testManagerWorkspaceIdList.isEmpty()) {

View File

@ -2,15 +2,11 @@ package io.metersphere.log.controller;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import io.metersphere.commons.constants.RoleConstants;
import io.metersphere.commons.utils.PageUtils;
import io.metersphere.commons.utils.Pager;
import io.metersphere.commons.utils.SessionUtils;
import io.metersphere.log.service.OperatingLogService;
import io.metersphere.log.vo.OperatingLogDTO;
import io.metersphere.log.vo.OperatingLogRequest;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;

View File

@ -16,7 +16,7 @@ public class NoticeController {
private NoticeService noticeService;
@PostMapping("save/message/task")
@MsAuditLog(module = "organization_message_settings", type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#messageDetail.id)", content = "#msClass.getLogDetails(#messageDetail.id)", msClass = NoticeService.class)
@MsAuditLog(module = "workspace_message_settings", type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#messageDetail.id)", content = "#msClass.getLogDetails(#messageDetail.id)", msClass = NoticeService.class)
public void saveMessage(@RequestBody MessageDetail messageDetail) {
noticeService.saveMessageTask(messageDetail);
}
@ -32,7 +32,7 @@ public class NoticeController {
}
@GetMapping("/delete/message/{identification}")
@MsAuditLog(module = "organization_message_settings", type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#identification)", msClass = NoticeService.class)
@MsAuditLog(module = "workspace_message_settings", type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#identification)", msClass = NoticeService.class)
public int deleteMessage(@PathVariable String identification) {
return noticeService.delMessage(identification);
}

View File

@ -14,7 +14,6 @@ public class MessageDetail {
private String webhook;
private String type;
private String identification;
private String organizationId;
private Boolean isSet;
private String testId;
private Long createTime;

View File

@ -15,6 +15,7 @@ import org.apache.commons.collections4.MapUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.RegExUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils;
import javax.annotation.Resource;
import java.io.IOException;
@ -100,7 +101,8 @@ public abstract class AbstractNoticeSender implements NoticeSender {
if (MapUtils.isNotEmpty(context)) {
for (String k : context.keySet()) {
if (context.get(k) != null) {
template = RegExUtils.replaceAll(template, "\\$\\{" + k + "}", context.get(k).toString());
String value = handleTime(k, context);
template = RegExUtils.replaceAll(template, "\\$\\{" + k + "}", value);
} else {
template = RegExUtils.replaceAll(template, "\\$\\{" + k + "}", "");
}
@ -109,6 +111,18 @@ public abstract class AbstractNoticeSender implements NoticeSender {
return template;
}
private String handleTime(String k, Map<String, Object> context) {
String value = context.get(k).toString();
if (StringUtils.endsWithIgnoreCase(k, "Time")) {
try {
long time = Long.parseLong(value);
value = DateFormatUtils.format(time, "yyyy-MM-dd HH:mm:ss");
} catch (Exception ignore) {
}
}
return value;
}
protected List<UserDetail> getUserDetails(List<String> userIds) {
return userService.queryTypeByIds(userIds);
}

View File

@ -1,7 +1,7 @@
package io.metersphere.notice.service;
import com.alibaba.nacos.client.utils.StringUtils;
import io.metersphere.base.domain.Organization;
import io.metersphere.base.domain.Project;
import io.metersphere.commons.constants.NoticeConstants;
import io.metersphere.commons.utils.LogUtil;
import io.metersphere.notice.domain.MessageDetail;
@ -113,7 +113,7 @@ public class NoticeSendService {
/**
* 后台触发的发送没有session
*/
public void send(Organization organization, String taskType, NoticeModel noticeModel) {
public void send(Project project, String taskType, NoticeModel noticeModel) {
try {
List<MessageDetail> messageDetails;
// switch (taskType) {
@ -127,7 +127,7 @@ public class NoticeSendService {
// default:
// break;
// }
messageDetails = noticeService.searchMessageByTypeAndOrganizationId(taskType, organization.getId());
messageDetails = noticeService.searchMessageByTypeAndWorkspaceId(taskType, project.getWorkspaceId());
// 异步发送通知
messageDetails.stream()

View File

@ -3,9 +3,9 @@ package io.metersphere.notice.service;
import com.alibaba.fastjson.JSON;
import io.metersphere.base.domain.MessageTask;
import io.metersphere.base.domain.MessageTaskExample;
import io.metersphere.base.domain.Organization;
import io.metersphere.base.domain.Project;
import io.metersphere.base.mapper.MessageTaskMapper;
import io.metersphere.base.mapper.ext.ExtProjectMapper;
import io.metersphere.base.mapper.ProjectMapper;
import io.metersphere.commons.exception.MSException;
import io.metersphere.commons.utils.LogUtil;
import io.metersphere.commons.utils.SessionUtils;
@ -31,7 +31,7 @@ public class NoticeService {
@Resource
private MessageTaskMapper messageTaskMapper;
@Resource
private ExtProjectMapper extProjectMapper;
private ProjectMapper projectMapper;
public void saveMessageTask(MessageDetail messageDetail) {
MessageTaskExample example = new MessageTaskExample();
@ -40,14 +40,14 @@ public class NoticeService {
if (messageTaskLists.size() > 0) {
delMessage(messageDetail.getIdentification());
}
String orgId = SessionUtils.getCurrentOrganizationId();
String workspaceId = SessionUtils.getCurrentWorkspaceId();
long time = System.currentTimeMillis();
String identification = messageDetail.getIdentification();
if (StringUtils.isBlank(identification)) {
identification = UUID.randomUUID().toString();
}
for (String userId : messageDetail.getUserIds()) {
checkUserIdExist(userId, messageDetail, orgId);
checkUserIdExist(userId, messageDetail, workspaceId);
MessageTask messageTask = new MessageTask();
messageTask.setId(UUID.randomUUID().toString());
messageTask.setEvent(messageDetail.getEvent());
@ -57,7 +57,7 @@ public class NoticeService {
messageTask.setWebhook(messageDetail.getWebhook());
messageTask.setIdentification(identification);
messageTask.setIsSet(false);
messageTask.setOrganizationId(orgId);
messageTask.setWorkspaceId(workspaceId);
messageTask.setTestId(messageDetail.getTestId());
messageTask.setCreateTime(time);
setTemplate(messageDetail, messageTask);
@ -72,7 +72,7 @@ public class NoticeService {
}
}
private void checkUserIdExist(String userId, MessageDetail list, String orgId) {
private void checkUserIdExist(String userId, MessageDetail list, String workspaceId) {
MessageTaskExample example = new MessageTaskExample();
if (StringUtils.isBlank(list.getTestId())) {
example.createCriteria()
@ -81,7 +81,7 @@ public class NoticeService {
.andTypeEqualTo(list.getType())
.andTaskTypeEqualTo(list.getTaskType())
.andWebhookEqualTo(list.getWebhook())
.andOrganizationIdEqualTo(orgId);
.andWorkspaceIdEqualTo(workspaceId);
} else {
example.createCriteria()
.andUserIdEqualTo(userId)
@ -90,7 +90,7 @@ public class NoticeService {
.andTaskTypeEqualTo(list.getTaskType())
.andWebhookEqualTo(list.getWebhook())
.andTestIdEqualTo(list.getTestId())
.andOrganizationIdEqualTo(orgId);
.andWorkspaceIdEqualTo(workspaceId);
}
if (messageTaskMapper.countByExample(example) > 0) {
MSException.throwException(Translator.get("message_task_already_exists"));
@ -113,8 +113,8 @@ public class NoticeService {
public List<MessageDetail> searchMessageByType(String type) {
try {
String orgId = SessionUtils.getCurrentOrganizationId();
return getMessageDetails(type, orgId);
String workspaceId = SessionUtils.getCurrentWorkspaceId();
return getMessageDetails(type, workspaceId);
} catch (Exception e) {
LogUtil.error(e.getMessage(), e);
return new ArrayList<>();
@ -122,9 +122,9 @@ public class NoticeService {
}
public List<MessageDetail> searchMessageByTypeAndOrganizationId(String type, String organizationId) {
public List<MessageDetail> searchMessageByTypeAndWorkspaceId(String type, String workspaceId) {
try {
return getMessageDetails(type, organizationId);
return getMessageDetails(type, workspaceId);
} catch (Exception e) {
LogUtil.error(e.getMessage(), e);
return new ArrayList<>();
@ -133,27 +133,27 @@ public class NoticeService {
public List<MessageDetail> searchMessageByTypeBySend(String type, String projectId) {
try {
String orgId = "";
String workspaceId = "";
if (null == SessionUtils.getUser()) {
Organization organization = extProjectMapper.getOrganizationByProjectId(projectId);
orgId = organization.getId();
Project project = projectMapper.selectByPrimaryKey(projectId);
workspaceId = project.getWorkspaceId();
} else {
orgId = SessionUtils.getCurrentOrganizationId();
workspaceId = SessionUtils.getCurrentWorkspaceId();
}
return getMessageDetails(type, orgId);
return getMessageDetails(type, workspaceId);
} catch (Exception e) {
LogUtil.error(e.getMessage(), e);
return new ArrayList<>();
}
}
private List<MessageDetail> getMessageDetails(String type, String orgId) {
private List<MessageDetail> getMessageDetails(String type, String workspaceId) {
List<MessageDetail> messageDetails = new ArrayList<>();
MessageTaskExample example = new MessageTaskExample();
example.createCriteria()
.andTaskTypeEqualTo(type)
.andOrganizationIdEqualTo(orgId);
.andWorkspaceIdEqualTo(workspaceId);
List<MessageTask> messageTaskLists = messageTaskMapper.selectByExampleWithBLOBs(example);
Map<String, List<MessageTask>> messageTaskMap = messageTaskLists.stream()

View File

@ -1,7 +1,7 @@
package io.metersphere.performance.notice;
import io.metersphere.base.domain.LoadTestReport;
import io.metersphere.base.domain.Organization;
import io.metersphere.base.domain.Project;
import io.metersphere.commons.constants.NoticeConstants;
import io.metersphere.commons.constants.PerformanceTestStatus;
import io.metersphere.commons.constants.ReportTriggerMode;
@ -41,19 +41,15 @@ public class PerformanceNoticeEvent implements LoadTestFinishEvent {
public void sendNotice(LoadTestReport loadTestReport) {
BaseSystemConfigDTO baseSystemConfigDTO = systemParameterService.getBaseInfo();
String url = baseSystemConfigDTO.getUrl() + "/#/performance/report/view/" + loadTestReport.getId();
String successContext = "";
String failedContext = "";
String reportUrl = baseSystemConfigDTO.getUrl() + "/#/performance/report/view/" + loadTestReport.getId();
String subject = "";
String event = "";
String successContext = "${operator}执行性能测试成功: ${name}, 报告: ${reportUrl}";
String failedContext = "${operator}执行性能测试失败: ${name}, 报告: ${reportUrl}";
if (StringUtils.equals(ReportTriggerMode.API.name(), loadTestReport.getTriggerMode())) {
successContext = "性能测试 API任务通知:" + loadTestReport.getName() + "执行成功" + "\n" + "请点击下面链接进入测试报告页面" + "\n" + url;
failedContext = "性能测试 API任务通知:" + loadTestReport.getName() + "执行失败" + "\n" + "请点击下面链接进入测试报告页面" + "\n" + url;
subject = Translator.get("task_notification_jenkins");
}
if (StringUtils.equals(ReportTriggerMode.SCHEDULE.name(), loadTestReport.getTriggerMode())) {
successContext = "性能测试定时任务通知:" + loadTestReport.getName() + "执行成功" + "\n" + "请点击下面链接进入测试报告页面" + "\n" + url;
failedContext = "性能测试定时任务通知:" + loadTestReport.getName() + "执行失败" + "\n" + "请点击下面链接进入测试报告页面" + "\n" + url;
subject = Translator.get("task_notification");
}
@ -71,6 +67,7 @@ public class PerformanceNoticeEvent implements LoadTestFinishEvent {
paramMap.put("operator", userDTO.getName());
paramMap.put("type", "performance");
paramMap.put("url", baseSystemConfigDTO.getUrl());
paramMap.put("reportUrl", reportUrl);
paramMap.putAll(new BeanMap(loadTestDTO));
@ -90,7 +87,7 @@ public class PerformanceNoticeEvent implements LoadTestFinishEvent {
.build();
noticeSendService.send(loadTestReport.getTriggerMode(), NoticeConstants.TaskType.PERFORMANCE_TEST_TASK, noticeModel);
} else {
Organization organization = projectService.getOrganizationByProjectId(loadTestReport.getProjectId());
Project project = projectService.getProjectById(loadTestReport.getProjectId());
String context = "${operator}执行性能测试完成: ${name}";
NoticeModel noticeModel2 = NoticeModel.builder()
.operator(loadTestReport.getUserId())
@ -102,7 +99,7 @@ public class PerformanceNoticeEvent implements LoadTestFinishEvent {
.event(NoticeConstants.Event.EXECUTE_COMPLETED)
.paramMap(paramMap)
.build();
noticeSendService.send(organization, NoticeConstants.TaskType.PERFORMANCE_TEST_TASK, noticeModel2);
noticeSendService.send(project, NoticeConstants.TaskType.PERFORMANCE_TEST_TASK, noticeModel2);
}
}

View File

@ -36,9 +36,6 @@ public class JmeterFileService {
}
EngineContext context = EngineFactory.createContext(loadTestReport, ratios, reportId, resourceIndex);
return zipFilesToByteArray(context);
} catch (MSException e) {
LogUtil.error(e.getMessage(), e);
throw e;
} catch (Exception e) {
LogUtil.error(e.getMessage(), e);
MSException.throwException(e);

View File

@ -1,7 +1,6 @@
package io.metersphere.security.realm;
import io.metersphere.base.domain.Role;
import io.metersphere.commons.constants.UserSource;
import io.metersphere.commons.user.SessionUser;
import io.metersphere.commons.utils.SessionUtils;
@ -11,15 +10,12 @@ import io.metersphere.service.UserService;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.*;
import org.apache.shiro.authz.AuthorizationInfo;
import org.apache.shiro.authz.SimpleAuthorizationInfo;
import org.apache.shiro.subject.PrincipalCollection;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.annotation.Resource;
import java.util.Arrays;
import java.util.Set;
import java.util.stream.Collectors;
/**
@ -48,16 +44,7 @@ public class LdapRealm extends BaseRealm {
@Override
protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principals) {
String userId = (String) principals.getPrimaryPrincipal();
return getAuthorizationInfo(userId, userService);
}
public static AuthorizationInfo getAuthorizationInfo(String userId, UserService userService) {
SimpleAuthorizationInfo authorizationInfo = new SimpleAuthorizationInfo();
// roles 内容填充
UserDTO userDTO = userService.getUserDTO(userId);
Set<String> roles = userDTO.getRoles().stream().map(Role::getId).collect(Collectors.toSet());
authorizationInfo.setRoles(roles);
return authorizationInfo;
return LocalRealm.getAuthorizationInfo(userId, userService);
}
/**

View File

@ -1,7 +1,6 @@
package io.metersphere.security.realm;
import io.metersphere.base.domain.Role;
import io.metersphere.commons.constants.UserSource;
import io.metersphere.commons.user.SessionUser;
import io.metersphere.commons.utils.SessionUtils;
@ -21,7 +20,6 @@ import org.springframework.beans.factory.annotation.Value;
import javax.annotation.Resource;
import java.util.Collections;
import java.util.Set;
import java.util.stream.Collectors;
/**
@ -57,10 +55,6 @@ public class LocalRealm extends BaseRealm {
public static AuthorizationInfo getAuthorizationInfo(String userId, UserService userService) {
SimpleAuthorizationInfo authorizationInfo = new SimpleAuthorizationInfo();
// roles 内容填充
UserDTO userDTO = userService.getUserDTO(userId);
Set<String> roles = userDTO.getRoles().stream().map(Role::getId).collect(Collectors.toSet());
authorizationInfo.setRoles(roles);
Set<String> userPermission = userService.getUserPermission(userId);
authorizationInfo.setStringPermissions(userPermission);
return authorizationInfo;

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