diff --git a/front/src/views/project/ShareConfig/index.vue b/front/src/views/project/ShareConfig/index.vue
index cb013f2251b94245914fe63d5f1956bbbccf0e9e..1500f497e609314dc389f8b1ef1f56b9b7c79e50 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 56ce8dde591d945ef08a8c1e4ecef4bd0f2d66d1..58fa7753cbbd23012b89446ea8e5c0735b463958 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 df02fec9f5dc853861610fed6d92c416d506dd58..7ad48f6da66082f3eea02c82596b75fe04962076 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 9a5c6431c882592256116f328e3168c622c87aa8..c0dcb4e724e578c162b35e84c04daef3ad232256 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 5baf4489323831f3c922a1920646a84e485aa79f..cb47b88cc5c40241cb385df1cef28294da2b08a2 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 fc33a1cd5c44b8f5f512ae4502798c31596d0020..1d01352a06c5299a19fa840fd5f9da268c3b2a91 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 0000000000000000000000000000000000000000..4f04989bb0938415ff578a958153f6697a2c9047
--- /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 0000000000000000000000000000000000000000..f7b367d4bf373765af674f9e331eeeeeef3b07ac
--- /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 d7d596607cb4a85eb5f302d6f7281501e06b0f65..93260feec9547cbf5a31963dd633c20e3459d25b 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 0000000000000000000000000000000000000000..a7a359f660aec13f1ca4887b68841ee8f10b1991
--- /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 556699a889b1f3ad29a35955be271c2d4156f982..15b7552b7c2219bd003a8d4e4b0af8a845ee5537 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 ddd019830e9da7351578c88a48d682cc5cd8b48f..989bb45328f0e514697b7a2e7dded7bfa6781a61 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 d1212a7d6bd4f5c6530d5e3204c7986937cdffa8..75afa2daa12470bd31d7887a53fb1836e4565bff 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 0000000000000000000000000000000000000000..17b944816c44089b3d69d5a2fe8b55a37cfc01d5
--- /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 9a5c6431c882592256116f328e3168c622c87aa8..746031547e80031d5b11fdc840f1bdc3f92cc0df 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`;