From 2e08636f9700a1da8870915929afb132d64a5ac9 Mon Sep 17 00:00:00 2001
From: chenqi <1535985458@qq.com>
Date: Sun, 17 Apr 2022 17:41:32 +0800
Subject: [PATCH] =?UTF-8?q?feat(*):=20=E6=96=B0=E5=A2=9E=E5=88=86=E4=BA=AB?=
=?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=97=B6=E5=8F=AF=E9=80=89=E8=B0=83=E8=AF=95?=
=?UTF-8?q?=E7=8E=AF=E5=A2=83?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
front/src/views/project/ShareConfig/index.vue | 69 +++++++++++-
front/src/views/share/index.vue | 9 +-
mysql-clean.sql | 15 +++
mysql.sql | 15 +++
mysql_compat.sql | 16 +++
.../java/cn/torna/dao/entity/ShareConfig.java | 5 +
.../cn/torna/dao/entity/ShareEnvironment.java | 36 +++++++
.../dao/mapper/ShareEnvironmentMapper.java | 14 +++
.../cn/torna/service/ShareConfigService.java | 100 +++++++++++++++++-
.../service/ShareEnvironmentService.java | 17 +++
.../cn/torna/service/dto/ShareConfigDTO.java | 11 ++
.../controller/doc/ShareConfigController.java | 27 ++++-
.../web/controller/doc/vo/ShareConfigVO.java | 6 ++
.../controller/doc/vo/ShareEnvironmentVO.java | 33 ++++++
torna-docker-compose/mysql.sql | 16 +++
15 files changed, 379 insertions(+), 10 deletions(-)
create mode 100644 server/server-dao/src/main/java/cn/torna/dao/entity/ShareEnvironment.java
create mode 100644 server/server-dao/src/main/java/cn/torna/dao/mapper/ShareEnvironmentMapper.java
create mode 100644 server/server-service/src/main/java/cn/torna/service/ShareEnvironmentService.java
create mode 100644 server/server-web/src/main/java/cn/torna/web/controller/doc/vo/ShareEnvironmentVO.java
diff --git a/front/src/views/project/ShareConfig/index.vue b/front/src/views/project/ShareConfig/index.vue
index cb013f22..1500f497 100644
--- a/front/src/views/project/ShareConfig/index.vue
+++ b/front/src/views/project/ShareConfig/index.vue
@@ -91,6 +91,7 @@
@close="() => {
resetForm('dialogForm')
$refs.docTreeRef.setCheckedKeys([])
+ clearDialogForm()
}"
>
+
+ 全选
+
+ {{ env.name }}
+
+
@@ -175,13 +182,38 @@ export default {
moduleId: '',
isAll: 0,
remark: '',
- isShowDebug: 1
+ isShowDebug: 1,
+ moduleEnvironmentIdList: []
},
autoAppend: 1,
+ moduleEnvironmentList: [],
dialogFormRules: {
}
}
},
+ computed: {
+ isIndeterminate() {
+ const checkedCount = this.dialogFormData.moduleEnvironmentIdList.length
+ return checkedCount > 0 && checkedCount < this.moduleEnvironmentList.length
+ },
+ checkAll: {
+ get() {
+ return this.dialogFormData.moduleEnvironmentIdList.length === this.moduleEnvironmentList.length
+ },
+ set(val) {
+ this.$set(this.dialogFormData, 'moduleEnvironmentIdList', val ? this.moduleEnvironmentList.map(item => item.id) : [])
+ }
+ }
+ },
+ watch: {
+ 'dialogFormData.isShowDebug': {
+ handler(newVal, oldVal) {
+ console.log(newVal)
+ console.log(oldVal)
+ },
+ deep: true
+ }
+ },
methods: {
reload(moduleId) {
if (moduleId) {
@@ -200,22 +232,49 @@ export default {
onAdd() {
this.dialogTitle = this.$ts('newShare')
this.dialogVisible = true
+ this.loadDebugEnvs(this.moduleId)
this.dialogFormData = {
id: '',
type: 1,
+ isShowDebug: 0,
moduleId: '',
isAll: 0,
- remark: ''
+ remark: '',
+ moduleEnvironmentList: [],
+ moduleEnvironmentIdList: []
}
this.$nextTick(() => {
this.reloadDocTree()
})
},
+ loadDebugEnvs(moduleId, shareConfigId) {
+ this.get('/module/environment/list', { moduleId: moduleId }, resp => {
+ this.moduleEnvironmentList = resp.data
+ })
+ if (!shareConfigId) {
+ return
+ }
+ this.get('/doc/share/listEnvironment', { id: shareConfigId }, resp => {
+ this.$set(this.dialogFormData, 'moduleEnvironmentIdList', resp.data.map(item => item.moduleEnvironmentId))
+ })
+ },
+
+ clearDialogForm() {
+ if (!this.dialogFormData) {
+ return
+ }
+ this.dialogFormData = this.$data.dialogFormData
+ },
onTableUpdate(row) {
this.dialogTitle = this.$ts('updateShare')
this.dialogVisible = true
this.$nextTick(() => {
Object.assign(this.dialogFormData, row)
+
+ if (row.isShowDebug) {
+ this.loadDebugEnvs(row.moduleId, row.id)
+ }
+
if (!row.isAll) {
this.get('/doc/share/listContent', { id: row.id }, resp => {
const contentList = resp.data
@@ -301,7 +360,11 @@ export default {
append(node, node.isShareFolder)
}
data.content = content
+ data.isAllSelectedDebug = this.checkAll
const uri = this.dialogFormData.id ? '/doc/share/update' : '/doc/share/add'
+ if (this.checkAll) {
+ this.dialogFormData.moduleEnvironmentIdList = []
+ }
this.post(uri, this.dialogFormData, () => {
this.dialogVisible = false
this.reload()
@@ -323,7 +386,7 @@ export default {
this.$refs.docTreeViewRef.load(this.moduleId, beforeFun, afterFun)
},
buildUrl(row) {
- return `${this.getBaseUrl()}/#/share/${row.id}`
+ return `${window.location.origin}/#/share/${row.id}`
},
viewDoc(row) {
this.dialogViewVisible = true
diff --git a/front/src/views/share/index.vue b/front/src/views/share/index.vue
index 56ce8dde..58fa7753 100644
--- a/front/src/views/share/index.vue
+++ b/front/src/views/share/index.vue
@@ -2,11 +2,11 @@
- {{ $ts('apiInfo') }}
+ {{ $ts('apiInfo') }}
-
- {{ $ts('debugApi') }}
+
+ {{ $ts('debugApi') }}
@@ -31,9 +31,10 @@ export default {
},
created() {
const docId = this.$route.params.docId
+ const shareId = this.$route.params.shareId
this.$nextTick(() => {
if (docId) {
- this.get('/doc/view', { id: docId }, function(resp) {
+ this.get('/doc/share/view', { docId: docId, shareConfigId: shareId }, function(resp) {
this.load = true
const data = resp.data
this.initDocInfoView(data)
diff --git a/mysql-clean.sql b/mysql-clean.sql
index df02fec9..7ad48f6d 100644
--- a/mysql-clean.sql
+++ b/mysql-clean.sql
@@ -433,6 +433,7 @@ CREATE TABLE `share_config` (
`remark` varchar(128) NOT NULL DEFAULT '' COMMENT '备注',
`creator_name` varchar(64) NOT NULL DEFAULT '' COMMENT '创建人',
`is_show_debug` tinyint(4) NOT NULL DEFAULT '1' COMMENT '是否显示调试',
+ `is_all_selected_debug` tinyint(4) NOT NULL DEFAULT '1' COMMENT '调试环境是否全选, 1-全选, 0-不选',
`gmt_create` datetime DEFAULT CURRENT_TIMESTAMP,
`gmt_modified` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`) USING BTREE,
@@ -456,6 +457,20 @@ CREATE TABLE `share_content` (
KEY `idx_shareconfigid_docid` (`share_config_id`,`doc_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='分享详情';
+
+DROP TABLE IF EXISTS `share_environment`;
+create table `share_environment`
+(
+ `id` bigint(20) unsigned auto_increment
+ primary key,
+ `share_config_id` bigint(20) unsigned default 0 null comment '分享配置id',
+ `module_environment_id` bigint(20) unsigned default 0 null comment '模块环境id',
+ KEY `share_environment_share_config_id_index` (`share_config_id`) USING BTREE
+) ENGINE = InnoDB
+ DEFAULT CHARSET = utf8mb4
+ ROW_FORMAT = DYNAMIC COMMENT = '分享环境关联表';
+
+
/*Table structure for table `space` */
DROP TABLE IF EXISTS `space`;
diff --git a/mysql.sql b/mysql.sql
index 9a5c6431..c0dcb4e7 100644
--- a/mysql.sql
+++ b/mysql.sql
@@ -483,6 +483,7 @@ CREATE TABLE `share_config` (
`remark` varchar(128) NOT NULL DEFAULT '' COMMENT '备注',
`creator_name` varchar(64) NOT NULL DEFAULT '' COMMENT '创建人',
`is_show_debug` tinyint(4) NOT NULL DEFAULT '1' COMMENT '是否显示调试',
+ `is_all_selected_debug` tinyint(4) NOT NULL DEFAULT '1' COMMENT '调试环境是否全选, 1-全选, 0-不选',
`gmt_create` datetime DEFAULT CURRENT_TIMESTAMP,
`gmt_modified` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`) USING BTREE,
@@ -508,6 +509,20 @@ CREATE TABLE `share_content` (
KEY `idx_shareconfigid_docid` (`share_config_id`,`doc_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='分享详情';
+
+DROP TABLE IF EXISTS `share_environment`;
+create table `share_environment`
+(
+ `id` bigint(20) unsigned auto_increment
+ primary key,
+ `share_config_id` bigint(20) unsigned default 0 null comment '分享配置id',
+ `module_environment_id` bigint(20) unsigned default 0 null comment '模块环境id',
+ KEY `share_environment_share_config_id_index` (`share_config_id`) USING BTREE
+) ENGINE = InnoDB
+ DEFAULT CHARSET = utf8mb4
+ ROW_FORMAT = DYNAMIC COMMENT = '分享环境关联表';
+
+
/*Data for the table `share_content` */
/*Table structure for table `space` */
diff --git a/mysql_compat.sql b/mysql_compat.sql
index 5baf4489..cb47b88c 100644
--- a/mysql_compat.sql
+++ b/mysql_compat.sql
@@ -483,6 +483,7 @@ CREATE TABLE `share_config` (
`remark` varchar(128) NOT NULL DEFAULT '' COMMENT '备注',
`creator_name` varchar(64) NOT NULL DEFAULT '' COMMENT '创建人',
`is_show_debug` tinyint(4) NOT NULL DEFAULT '1' COMMENT '是否显示调试',
+ `is_all_selected_debug` tinyint(4) NOT NULL DEFAULT '1' COMMENT '调试环境是否全选, 1-全选, 0-不选',
`gmt_create` datetime ,
`gmt_modified` datetime ,
PRIMARY KEY (`id`) USING BTREE,
@@ -510,6 +511,21 @@ CREATE TABLE `share_content` (
/*Data for the table `share_content` */
+
+DROP TABLE IF EXISTS `share_environment`;
+create table `share_environment`
+(
+ `id` bigint(20) unsigned auto_increment
+ primary key,
+ `share_config_id` bigint(20) unsigned default 0 null comment '分享配置id',
+ `module_environment_id` bigint(20) unsigned default 0 null comment '模块环境id',
+ KEY `share_environment_share_config_id_index` (`share_config_id`) USING BTREE
+) ENGINE = InnoDB
+ DEFAULT CHARSET = utf8mb4
+ ROW_FORMAT = DYNAMIC COMMENT = '分享环境关联表';
+
+
+
/*Table structure for table `space` */
DROP TABLE IF EXISTS `space`;
diff --git a/server/server-dao/src/main/java/cn/torna/dao/entity/ShareConfig.java b/server/server-dao/src/main/java/cn/torna/dao/entity/ShareConfig.java
index fc33a1cd..1d01352a 100644
--- a/server/server-dao/src/main/java/cn/torna/dao/entity/ShareConfig.java
+++ b/server/server-dao/src/main/java/cn/torna/dao/entity/ShareConfig.java
@@ -41,6 +41,11 @@ public class ShareConfig {
@com.gitee.fastmybatis.annotation.Column(logicDelete = true)
private Byte isDeleted;
+ /**
+ * 调试环境是否全选, 1-全选, 0-不选
+ */
+ private Byte isAllSelectedDebug;
+
/** 备注, 数据库字段:remark */
private String remark;
diff --git a/server/server-dao/src/main/java/cn/torna/dao/entity/ShareEnvironment.java b/server/server-dao/src/main/java/cn/torna/dao/entity/ShareEnvironment.java
new file mode 100644
index 00000000..4f04989b
--- /dev/null
+++ b/server/server-dao/src/main/java/cn/torna/dao/entity/ShareEnvironment.java
@@ -0,0 +1,36 @@
+package cn.torna.dao.entity;
+
+import com.gitee.fastmybatis.annotation.Pk;
+import com.gitee.fastmybatis.annotation.PkStrategy;
+import com.gitee.fastmybatis.annotation.Table;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 分享环境
+ *
+ * @author Joker
+ * @since 1.0.0
+ * @return
+ */
+@Table(name = "share_environment", pk = @Pk(name = "id", strategy = PkStrategy.INCREMENT))
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class ShareEnvironment {
+
+ /** 数据库字段:id */
+ private Long id;
+
+
+ /**
+ * 分享配置id
+ */
+ private Long shareConfigId;
+
+ /**
+ * 模块环境id
+ */
+ private Long moduleEnvironmentId;
+}
diff --git a/server/server-dao/src/main/java/cn/torna/dao/mapper/ShareEnvironmentMapper.java b/server/server-dao/src/main/java/cn/torna/dao/mapper/ShareEnvironmentMapper.java
new file mode 100644
index 00000000..f7b367d4
--- /dev/null
+++ b/server/server-dao/src/main/java/cn/torna/dao/mapper/ShareEnvironmentMapper.java
@@ -0,0 +1,14 @@
+package cn.torna.dao.mapper;
+
+import cn.torna.dao.entity.ShareEnvironment;
+import com.gitee.fastmybatis.core.mapper.CrudMapper;
+
+/**
+ * 表名:share_environment
+ * 备注:分享模块调试环境关联表
+ *
+ * @author Joker
+ */
+public interface ShareEnvironmentMapper extends CrudMapper {
+
+}
\ No newline at end of file
diff --git a/server/server-service/src/main/java/cn/torna/service/ShareConfigService.java b/server/server-service/src/main/java/cn/torna/service/ShareConfigService.java
index d7d59660..93260fee 100644
--- a/server/server-service/src/main/java/cn/torna/service/ShareConfigService.java
+++ b/server/server-service/src/main/java/cn/torna/service/ShareConfigService.java
@@ -4,19 +4,25 @@ import cn.torna.common.bean.Booleans;
import cn.torna.common.bean.User;
import cn.torna.common.enums.ShareConfigTypeEnum;
import cn.torna.common.enums.StatusEnum;
+import cn.torna.common.exception.BizException;
import cn.torna.common.support.BaseService;
import cn.torna.common.util.PasswordUtil;
+import cn.torna.dao.entity.ModuleEnvironment;
import cn.torna.dao.entity.ShareConfig;
import cn.torna.dao.entity.ShareContent;
+import cn.torna.dao.entity.ShareEnvironment;
import cn.torna.dao.mapper.ShareConfigMapper;
+import cn.torna.service.dto.DocInfoDTO;
+import cn.torna.service.dto.ModuleEnvironmentDTO;
import cn.torna.service.dto.ShareConfigDTO;
import com.gitee.fastmybatis.core.query.Query;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.CollectionUtils;
-import java.util.Date;
-import java.util.List;
+import java.util.*;
import java.util.stream.Collectors;
/**
@@ -27,7 +33,14 @@ public class ShareConfigService extends BaseService moduleEnvironmentIdSet = shareConfigDTO.getModuleEnvironmentIdList();
+ if (CollectionUtils.isEmpty(moduleEnvironmentIdSet)) {
+ return;
+ }
+
+ List environmentList = moduleEnvironmentIdSet.stream().map(envId -> {
+ ShareEnvironment shareEnvironment = new ShareEnvironment();
+ shareEnvironment.setModuleEnvironmentId(envId);
+ shareEnvironment.setShareConfigId(shareConfig.getId());
+ return shareEnvironment;
+ }).collect(Collectors.toList());
+
+ shareEnvironmentService.saveBatch(environmentList);
+ }
+
+ private void deleteEnvironment(ShareConfig shareConfig) {
+ shareEnvironmentService.getMapper().deleteByQuery(new Query().eq("share_config_id", shareConfig.getId()));
}
public List listContent(long id) {
return shareContentService.list("share_config_id", id);
}
+ public List listEnvironment(long id) {
+
+ ShareConfig config = this.getMapper().getById(id);
+ Byte isShowDebug = config.getIsShowDebug();
+ Byte isAllSelectedDebug = config.getIsAllSelectedDebug();
+
+ if (Booleans.TRUE == isShowDebug && Booleans.TRUE == isAllSelectedDebug) {
+ Long moduleId = config.getModuleId();
+ List moduleEnvironments = moduleEnvironmentService.listModuleEnvironment(moduleId);
+ return moduleEnvironments.stream().map(env -> new ShareEnvironment(null, id, env.getId())).collect(Collectors.toList());
+ }
+ return shareEnvironmentService.list("share_config_id", id);
+ }
+
private void saveContent(ShareConfig shareConfig, ShareConfigDTO shareConfigDTO) {
// 先删除之前的
@@ -108,5 +175,34 @@ public class ShareConfigService extends BaseService new BizException("此文档不存在"));
+ Optional.ofNullable(config).orElseThrow(() -> new BizException("此分享配置不存在"));
+
+ List debugEnvs = docDetail.getDebugEnvs();
+ if (CollectionUtils.isEmpty(debugEnvs)) {
+ return docDetail;
+ }
+
+ List shareEnvironments = this.listEnvironment(shareConfigId);
+ if (CollectionUtils.isEmpty(shareEnvironments)) {
+ docDetail.setDebugEnvs(Collections.emptyList());
+ return docDetail;
+ }
+ Set envIdSet = shareEnvironments.stream().map(ShareEnvironment::getModuleEnvironmentId).collect(Collectors.toSet());
+ List dtoList = debugEnvs.stream().filter(env -> envIdSet.contains(env.getId())).collect(Collectors.toList());
+ docDetail.setDebugEnvs(dtoList);
+ return docDetail;
+ }
+
+
}
\ No newline at end of file
diff --git a/server/server-service/src/main/java/cn/torna/service/ShareEnvironmentService.java b/server/server-service/src/main/java/cn/torna/service/ShareEnvironmentService.java
new file mode 100644
index 00000000..a7a359f6
--- /dev/null
+++ b/server/server-service/src/main/java/cn/torna/service/ShareEnvironmentService.java
@@ -0,0 +1,17 @@
+package cn.torna.service;
+
+import cn.torna.common.support.BaseService;
+import cn.torna.dao.entity.ShareContent;
+import cn.torna.dao.entity.ShareEnvironment;
+import cn.torna.dao.mapper.ShareContentMapper;
+import cn.torna.dao.mapper.ShareEnvironmentMapper;
+import org.springframework.stereotype.Service;
+
+/**
+ * 分享配置环境关联
+ * @author Joker
+ */
+@Service
+public class ShareEnvironmentService extends BaseService {
+
+}
\ No newline at end of file
diff --git a/server/server-service/src/main/java/cn/torna/service/dto/ShareConfigDTO.java b/server/server-service/src/main/java/cn/torna/service/dto/ShareConfigDTO.java
index 556699a8..15b7552b 100644
--- a/server/server-service/src/main/java/cn/torna/service/dto/ShareConfigDTO.java
+++ b/server/server-service/src/main/java/cn/torna/service/dto/ShareConfigDTO.java
@@ -23,6 +23,17 @@ public class ShareConfigDTO {
/** 是否显示调试 */
private Byte isShowDebug;
+ /**
+ * 调试环境是否全选, 1-全选, 0-不选
+ */
+ private Byte isAllSelectedDebug;
+
+ /**
+ * 模块环境id
+ */
+ @JSONField(serializeUsing = IdCodec.class, deserializeUsing = IdCodec.class)
+ private List moduleEnvironmentIdList;
+
@Data
public static class Content {
@JSONField(serializeUsing = IdCodec.class, deserializeUsing = IdCodec.class)
diff --git a/server/server-web/src/main/java/cn/torna/web/controller/doc/ShareConfigController.java b/server/server-web/src/main/java/cn/torna/web/controller/doc/ShareConfigController.java
index ddd01983..989bb453 100644
--- a/server/server-web/src/main/java/cn/torna/web/controller/doc/ShareConfigController.java
+++ b/server/server-web/src/main/java/cn/torna/web/controller/doc/ShareConfigController.java
@@ -8,11 +8,15 @@ import cn.torna.common.enums.StatusEnum;
import cn.torna.common.util.CopyUtil;
import cn.torna.dao.entity.ShareConfig;
import cn.torna.dao.entity.ShareContent;
+import cn.torna.dao.entity.ShareEnvironment;
import cn.torna.service.ShareConfigService;
+import cn.torna.service.ShareEnvironmentService;
+import cn.torna.service.dto.DocInfoDTO;
import cn.torna.service.dto.ShareConfigDTO;
import cn.torna.web.controller.doc.param.ShareConfigParam;
import cn.torna.web.controller.doc.vo.ShareConfigVO;
import cn.torna.web.controller.doc.vo.ShareContentVO;
+import cn.torna.web.controller.doc.vo.ShareEnvironmentVO;
import com.gitee.fastmybatis.core.query.Sort;
import com.gitee.fastmybatis.core.support.PageEasyui;
import com.gitee.fastmybatis.core.util.MapperUtil;
@@ -69,6 +73,12 @@ public class ShareConfigController {
List list = CopyUtil.copyList(shareContents, ShareContentVO::new);
return Result.ok(list);
}
+ @GetMapping("listEnvironment")
+ public Result> listEnvironment(@HashId Long id) {
+ List shareEnvironments = shareConfigService.listEnvironment(id);
+ List list = CopyUtil.copyList(shareEnvironments, ShareEnvironmentVO::new);
+ return Result.ok(list);
+ }
@PostMapping("enable")
@@ -86,5 +96,20 @@ public class ShareConfigController {
shareConfigService.update(shareConfig);
return Result.ok();
}
-
+
+
+ /**
+ * 查询分享文档详细信息
+ *
+ * @param docId 主键
+ * @param shareConfigId 主键
+ * @return 返回记录,没有返回null
+ */
+ @GetMapping("view")
+ public Result view(@HashId Long docId, @HashId Long shareConfigId) {
+ DocInfoDTO docInfoDTO = shareConfigService.getShareDocDetail(docId, shareConfigId);
+ return Result.ok(docInfoDTO);
+ }
+
+
}
\ No newline at end of file
diff --git a/server/server-web/src/main/java/cn/torna/web/controller/doc/vo/ShareConfigVO.java b/server/server-web/src/main/java/cn/torna/web/controller/doc/vo/ShareConfigVO.java
index d1212a7d..75afa2da 100644
--- a/server/server-web/src/main/java/cn/torna/web/controller/doc/vo/ShareConfigVO.java
+++ b/server/server-web/src/main/java/cn/torna/web/controller/doc/vo/ShareConfigVO.java
@@ -25,6 +25,7 @@ public class ShareConfigVO {
private Byte status;
/** module.id, 数据库字段:module_id */
+ @JSONField(serializeUsing = IdCodec.class, deserializeUsing = IdCodec.class)
private Long moduleId;
/** 是否为全部文档, 数据库字段:is_all */
@@ -33,6 +34,11 @@ public class ShareConfigVO {
/** 备注, 数据库字段:remark */
private String remark;
+ /**
+ * 调试环境是否全选, 1-全选, 0-不选
+ */
+ private Byte isAllSelectedDebug;
+
/** 是否显示调试 */
private Byte isShowDebug;
diff --git a/server/server-web/src/main/java/cn/torna/web/controller/doc/vo/ShareEnvironmentVO.java b/server/server-web/src/main/java/cn/torna/web/controller/doc/vo/ShareEnvironmentVO.java
new file mode 100644
index 00000000..17b94481
--- /dev/null
+++ b/server/server-web/src/main/java/cn/torna/web/controller/doc/vo/ShareEnvironmentVO.java
@@ -0,0 +1,33 @@
+package cn.torna.web.controller.doc.vo;
+
+import cn.torna.common.support.IdCodec;
+import com.alibaba.fastjson.annotation.JSONField;
+import lombok.Data;
+
+/**
+ * 分享环境
+ *
+ * @author Joker
+ * @since 1.0.0
+ * @return
+ */
+@Data
+public class ShareEnvironmentVO {
+
+ /** 数据库字段:id */
+ @JSONField(serializeUsing = IdCodec.class, deserializeUsing = IdCodec.class)
+ private Long id;
+
+
+ /**
+ * 分享配置id
+ */
+ @JSONField(serializeUsing = IdCodec.class, deserializeUsing = IdCodec.class)
+ private Long shareConfigId;
+
+ /**
+ * 模块环境id
+ */
+ @JSONField(serializeUsing = IdCodec.class, deserializeUsing = IdCodec.class)
+ private Long moduleEnvironmentId;
+}
diff --git a/torna-docker-compose/mysql.sql b/torna-docker-compose/mysql.sql
index 9a5c6431..74603154 100644
--- a/torna-docker-compose/mysql.sql
+++ b/torna-docker-compose/mysql.sql
@@ -483,6 +483,7 @@ CREATE TABLE `share_config` (
`remark` varchar(128) NOT NULL DEFAULT '' COMMENT '备注',
`creator_name` varchar(64) NOT NULL DEFAULT '' COMMENT '创建人',
`is_show_debug` tinyint(4) NOT NULL DEFAULT '1' COMMENT '是否显示调试',
+ `is_all_selected_debug` tinyint(4) NOT NULL DEFAULT '1' COMMENT '调试环境是否全选, 1-全选, 0-不选',
`gmt_create` datetime DEFAULT CURRENT_TIMESTAMP,
`gmt_modified` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`) USING BTREE,
@@ -510,6 +511,21 @@ CREATE TABLE `share_content` (
/*Data for the table `share_content` */
+
+DROP TABLE IF EXISTS `share_environment`;
+create table `share_environment`
+(
+ `id` bigint(20) unsigned auto_increment
+ primary key,
+ `share_config_id` bigint(20) unsigned default 0 null comment '分享配置id',
+ `module_environment_id` bigint(20) unsigned default 0 null comment '模块环境id',
+ KEY `share_environment_share_config_id_index` (`share_config_id`) USING BTREE
+) ENGINE = InnoDB
+ DEFAULT CHARSET = utf8mb4
+ ROW_FORMAT = DYNAMIC COMMENT = '分享环境关联表';
+
+
+
/*Table structure for table `space` */
DROP TABLE IF EXISTS `space`;
--
Gitee