wiki权限判断

This commit is contained in:
暮光:城中城
2019-03-13 22:34:15 +08:00
parent 5096d242fd
commit 42ed560750
10 changed files with 193 additions and 91 deletions

View File

@@ -1,14 +1,12 @@
# zyplayer-doc
#### 说明
1. 本项目暂时只有swagger文档服务端的接口文档、dubbo文档、数据库文档数据库表、字段文档的查看修改功能
2. 如果需要类似文件夹、目录类的在线文档、文件管理访问权限控制暂时还没有可以提交Issues或评论说明具体需求整理需求后开发已有这方面打算最近接到比较多的这种需求
3. 欢迎加群讨论QQ群号466363173
#### 项目介绍
定位为所有文档的管理项目swagger文档、dubbo文档、数据库文档....等提供一整套的解决方案为开发者服务欢迎有想法的一起来写给个Star鼓励下呗您的一个Star是快速迭代的动力源泉
欢迎加群讨论QQ群号466363173
体验地址:[http://doc.zyplayer.com](http://doc.zyplayer.com/zyplayer-doc-manage/static/manage/home.html) 账号zyplayer 密码123456 未运行dubbo服务不能体验dubbo文档调试
体验地址:[http://doc.zyplayer.com](http://doc.zyplayer.com/zyplayer-doc-manage/static/manage/home.html) 需登录 账号zyplayer 密码123456 未运行dubbo服务不能体验dubbo文档调试
开放文档地址:[http://doc.zyplayer.com/zyplayer-doc-manage/open-wiki.html?pageId=1&space=23f3f59a60824d21af9f7c3bbc9bc3cb](http://doc.zyplayer.com/zyplayer-doc-manage/open-wiki.html?pageId=1&space=23f3f59a60824d21af9f7c3bbc9bc3cb) (无需登录)
#### 软件架构
##### 一、zyplayer-doc-core 一些核心、公用的类

View File

@@ -1,17 +1,17 @@
/*
Navicat Premium Data Transfer
Source Server : 127.0.0.1
Source Server : localhost
Source Server Type : MySQL
Source Server Version : 50724
Source Host : 127.0.0.1:3306
Source Server Version : 50725
Source Host : localhost:3306
Source Schema : zyplayer_doc_manage
Target Server Type : MySQL
Target Server Version : 50724
Target Server Version : 50725
File Encoding : 65001
Date: 13/03/2019 19:36:34
Date: 13/03/2019 22:25:47
*/
SET NAMES utf8mb4;
@@ -27,7 +27,7 @@ CREATE TABLE `auth_info` (
`auth_desc` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '权限说明',
`can_edit` tinyint(4) NULL DEFAULT 1 COMMENT '是否可编辑 0=否 1=是',
`create_uid` bigint(20) NULL DEFAULT NULL COMMENT '创建人用户ID',
`creation_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`creation_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '权限信息表' ROW_FORMAT = Compact;
@@ -50,8 +50,8 @@ CREATE TABLE `user_auth` (
`create_uid` bigint(20) NULL DEFAULT NULL COMMENT '创建用户ID',
`update_uid` bigint(20) NULL DEFAULT NULL COMMENT '更新用户ID',
`del_flag` tinyint(4) NULL DEFAULT 0 COMMENT '是否删除 0=未删除 1=已删除',
`creation_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
`creation_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
`update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 28 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用户权限表' ROW_FORMAT = Compact;
@@ -83,9 +83,9 @@ CREATE TABLE `user_info` (
`email` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '邮箱',
`avatar` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '头像',
`del_flag` tinyint(4) NULL DEFAULT 0 COMMENT '是否删除 0=未删除 1=已删除',
`creation_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`creation_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
`create_uid` bigint(20) NULL DEFAULT NULL COMMENT '创建人用户ID',
`update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
`update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `idx_userNo`(`user_no`) USING BTREE COMMENT '登录用户名'
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用户信息表' ROW_FORMAT = Compact;
@@ -110,10 +110,10 @@ CREATE TABLE `wiki_page` (
`edit_type` tinyint(4) NOT NULL DEFAULT 0 COMMENT '编辑类型 0=可编辑 1=不允许编辑',
`create_user_id` bigint(20) NULL DEFAULT NULL COMMENT '创建人ID',
`create_user_name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人名字',
`create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
`update_user_id` bigint(20) NULL DEFAULT NULL COMMENT '修改人ID',
`update_user_name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '修改人名字',
`update_time` datetime(0) NULL DEFAULT NULL COMMENT '修改时间',
`update_time` datetime NULL DEFAULT NULL COMMENT '修改时间',
`del_flag` tinyint(4) NOT NULL DEFAULT 0 COMMENT '0=有效 1=删除',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 9 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
@@ -121,13 +121,13 @@ CREATE TABLE `wiki_page` (
-- ----------------------------
-- Records of wiki_page
-- ----------------------------
INSERT INTO `wiki_page` VALUES (1, 1, '关于zyplayer-doc工具', 0, 0, 0, 0, 1, '暮光:城中城', '2019-03-09 14:01:41', 1, '暮光:城中城', '2019-03-09 15:30:22', 0);
INSERT INTO `wiki_page` VALUES (2, 1, '开发规划', 0, 0, 0, 0, 1, '暮光:城中城', '2019-03-09 14:14:02', 1, '暮光:城中城', '2019-03-09 15:43:58', 0);
INSERT INTO `wiki_page` VALUES (3, 1, '升级日志', 0, 0, 0, 0, 1, '暮光:城中城', '2019-03-09 14:16:20', 1, '暮光:城中城', '2019-03-09 15:46:05', 0);
INSERT INTO `wiki_page` VALUES (4, 1, '贡献人员列表', 0, 0, 0, 0, 1, '暮光:城中城', '2019-03-09 15:16:15', 1, '暮光:城中城', '2019-03-13 17:43:12', 0);
INSERT INTO `wiki_page` VALUES (5, 1, 'zyplayer-doc-swagger', 0, 0, 0, 0, 1, '暮光:城中城', '2019-03-09 15:33:14', NULL, NULL, NULL, 0);
INSERT INTO `wiki_page` VALUES (6, 1, '如何使用', 5, 0, 0, 0, 1, '暮光:城中城', '2019-03-09 15:33:33', 1, '暮光:城中城', '2019-03-09 15:33:46', 0);
INSERT INTO `wiki_page` VALUES (7, 2, '所有格式测试', 0, 0, 0, 0, 1, '暮光:城中城', '2019-03-12 12:21:26', NULL, NULL, NULL, 0);
INSERT INTO `wiki_page` VALUES (1, 1, '关于zyplayer-doc工具', 0, 0, 0, 0, 1, '暮光:城中城', '2019-03-09 14:24:30', 1, '暮光:城中城', '2019-03-09 14:24:30', 0);
INSERT INTO `wiki_page` VALUES (2, 1, '开发规划', 0, 0, 0, 0, 1, '暮光:城中城', '2019-03-09 14:24:30', 1, '暮光:城中城', '2019-03-09 14:24:30', 0);
INSERT INTO `wiki_page` VALUES (3, 1, '升级日志', 0, 0, 0, 0, 1, '暮光:城中城', '2019-03-09 14:24:30', 1, '暮光:城中城', '2019-03-09 14:24:30', 0);
INSERT INTO `wiki_page` VALUES (4, 1, '贡献人员列表', 0, 0, 0, 0, 1, '暮光:城中城', '2019-03-09 14:24:30', 1, '暮光:城中城', '2019-03-09 14:24:30', 0);
INSERT INTO `wiki_page` VALUES (5, 1, 'zyplayer-doc-swagger', 0, 0, 0, 0, 1, '暮光:城中城', '2019-03-09 14:24:30', NULL, NULL, NULL, 0);
INSERT INTO `wiki_page` VALUES (6, 1, '如何使用', 5, 0, 0, 0, 1, '暮光:城中城', '2019-03-09 14:24:30', 1, '暮光:城中城', '2019-03-09 14:24:30', 0);
INSERT INTO `wiki_page` VALUES (7, 2, '所有格式测试', 0, 0, 0, 0, 1, '暮光:城中城', '2019-03-09 14:24:30', 1, '暮光:城中城', '2019-03-09 14:24:30', 0);
-- ----------------------------
-- Table structure for wiki_page_comment
@@ -141,7 +141,7 @@ CREATE TABLE `wiki_page_comment` (
`zan_num` int(11) NOT NULL DEFAULT 0 COMMENT '赞的数量',
`create_user_id` bigint(20) NULL DEFAULT NULL COMMENT '创建人ID',
`create_user_name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人名字',
`create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
`del_flag` tinyint(4) NULL DEFAULT 0 COMMENT '0=有效 1=删除',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
@@ -156,10 +156,10 @@ CREATE TABLE `wiki_page_content` (
`content` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '内容',
`create_user_id` bigint(20) NULL DEFAULT NULL COMMENT '创建人ID',
`create_user_name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人名字',
`create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
`update_user_id` bigint(20) NULL DEFAULT NULL COMMENT '修改人ID',
`update_user_name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '修改人名字',
`update_time` datetime(0) NULL DEFAULT NULL COMMENT '修改时间',
`update_time` datetime NULL DEFAULT NULL COMMENT '修改时间',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `uk_page_id`(`page_id`) USING BTREE COMMENT '页面ID'
) ENGINE = InnoDB AUTO_INCREMENT = 9 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
@@ -167,14 +167,13 @@ CREATE TABLE `wiki_page_content` (
-- ----------------------------
-- Records of wiki_page_content
-- ----------------------------
INSERT INTO `wiki_page_content` VALUES (1, 1, '<p>一入开源深似海</p><br>源码地址:<a href=\"https://gitee.com/zyplayer/zyplayer-doc\" target=\"_blank\">https://gitee.com/zyplayer/zyplayer-doc</a><p>体验地址:<a href=\"http://doc.zyplayer.com/zyplayer-doc-manage/static/manage/home.html\" target=\"_blank\">http://doc.zyplayer.com/zyplayer-doc-manage/static/manage/home.html</a>&nbsp;账号zyplayer 密码123456</p><p><br></p><p>更多实用功能请提交评论或加群交流!谢谢!<br></p><p>QQ群466363173</p>tips想要编辑本文请修改表wiki_page的edit_type字段值为0才行哦~<p><br></p><p>有什么问题可以来评论本文章哦!当然,如果你是部署在你们自己本地的我肯定看不到此文章的评论</p><p>可以到本工具官网下评论此文章,我会随时去查看的!</p><p>唯一官网地址:<a href=\"http://doc.zyplayer.com\" target=\"_blank\">http://doc.zyplayer.com</a></p><p><br></p><p>欢迎提交各种变态无理的要求~</p>', 1, '暮光:城中城', '2019-03-09 14:01:41', 1, '暮光:城中城', '2019-03-09 15:30:22');
INSERT INTO `wiki_page_content` VALUES (2, 2, '<p>zyplayer-doc-manage</p><p>1、首页做大的调整优化希望使用element重构一下</p><p>2、人员导入方案权限优化人员管理细化</p><p>&nbsp;</p><p>zyplayer-doc-wiki</p><p><prefira code\';font-size:10.5pt;\"=\"\">1<spancourier new\';\"=\"\"></spancourier></prefira></p><p><prefira code\';font-size:10.5pt;\"=\"\"><spancourier new\';\"=\"\"><spancourier new\';\"=\"\">2<spancourier new\';\"=\"\">、</spancourier></spancourier></spancourier></prefira>支持把一个空间里的文档一键同步到git<spancourier new\';\"=\"\">的wiki上统一管理文档</spancourier></p><p><spancourier new\';\"=\"\">3</spancourier></p><p>4</p><p>5</p><p>6</p><p>7访</p><p>8url动态变动</p><p>9https://www.kancloud.cn</p><p><br></p><p></p><p>PR</p><p><a href=\"https://gitee.com/zyplayer/zyplayer-doc\" target=\"_blank\">https://gitee.com/zyplayer/zyplayer-doc</a></p><p><br></p><p></p><p>QQ群466363173</p>', 1, '', '2019-03-09 14:14:02', 1, '', '2019-03-09 15:43:58');
INSERT INTO `wiki_page_content` VALUES (3, 3, '<p><span style=\"color: rgb(249, 150, 59);\">V1.0.1 2019-03-09</span></p><p>1zyplayer-doc-wiki模块</p><ul><li><br></li><li><br></li><li>wiki顺序<br></li><li></li></ul><p><prefira code\';font-size:10.5pt;\"=\"\">2<spancourier new\';\"=\"\">、dubbo<spancourier new\';\"=\"\">使dubbo2.7.0</spancourier></spancourier></prefira></p><p><prefira code\';font-size:10.5pt;\"=\"\"><spancourier new\';\"=\"\"><spancourier new\';\"=\"\">3<spancourier new\';\"=\"\">、框架进行了大的拆分,表修改较多</spancourier></spancourier></spancourier></prefira></p><p><prefira code\';font-size:10.5pt;\"=\"\"><spancourier new\';\"=\"\"><spancourier new\';\"=\"\"><spancourier new\';\"=\"\">4<spancourier new\';\"=\"\"></spancourier></spancourier></spancourier></spancourier></prefira></p><p><prefira code\';font-size:10.5pt;\"=\"\"><spancourier new\';\"=\"\"><spancourier new\';\"=\"\"><spancourier new\';\"=\"\"><spancourier new\';\"=\"\">5<spancourier new\';\"=\"\"></spancourier></spancourier></spancourier></spancourier></spancourier></prefira></p><p><prefira code\';font-size:10.5pt;\"=\"\"><spancourier new\';\"=\"\"><spancourier new\';\"=\"\"><spancourier new\';\"=\"\"><spancourier new\';\"=\"\"><spancourier new\';\"=\"\"><br></spancourier></spancourier></spancourier></spancourier></spancourier></prefira></p><p><span style=\"color: rgb(249, 150, 59);\">V1.0.0 2019-02-15</span><br></p><p></p><p>1zyplayer-doc-swaggerswagger接口文档展示方案使访<br>2zyplayer-doc-dubbodubbo服务的自动扫描线zookeepernacos注册中心的服务扫描<br>3zyplayer-doc-db/mysql和sqlserver数据库<br>4zyplayer-doc-managespring boot项目spring security做权限管理</p>', 1, '', '2019-03-09 14:16:20', 1, '', '2019-03-09 15:46:05');
INSERT INTO `wiki_page_content` VALUES (4, 4, '<p></p><p><a href=\"http://www.zyplayer.com\" target=\"_blank\"></a><br></p>', 1, '', '2019-03-09 15:16:15', 1, '', '2019-03-13 17:43:12');
INSERT INTO `wiki_page_content` VALUES (5, 5, '<p>zyplayer-doc-swagger 使</p>', 1, '', '2019-03-09 15:33:14', NULL, NULL, NULL);
INSERT INTO `wiki_page_content` VALUES (6, 6, '<p></p>', 1, '', '2019-03-09 15:33:33', 1, '', '2019-03-09 15:33:46');
INSERT INTO `wiki_page_content` VALUES (7, 7, '<h2>H2</h2><p><span style=\"font-weight: bold;\"></span></p><p><span style=\"font-size: xx-large;\"></span><span style=\"font-weight: bold;\"><br></span></p><p><span style=\"font-family: 宋体;\"></span>&nbsp;</p><p><span style=\"font-style: italic;\"></span></p><p><span style=\"text-decoration-line: underline;\">线线线</span><span style=\"font-style: italic;\"><br></span></p><p><span style=\"text-decoration-line: line-through;\">线线线</span><span style=\"text-decoration-line: underline;\"><br></span></p><p><span style=\"color: rgb(249, 150, 59);\"></span><span style=\"text-decoration-line: line-through;\"><br></span></p><p><span style=\"background-color: rgb(194, 79, 74);\"></span></p><p><a href=\"http://www.baidu.com/\" target=\"_blank\"></a><br></p><ol><li></li><li>xxx</li><li>xxx</li></ol><ul><li></li><li>xxx</li><li>xxx</li></ul><p style=\"text-align: center;\"></p><p style=\"text-align: right;\"></p><blockquote style=\"font-size: medium;\">xxxxx</blockquote><p><img src=\"http://img.t.sinajs.cn/t4/appstyle/expression/ext/normal/50/pcmoren_huaixiao_org.png\" alt=\"[坏笑]\"><br></p><p></p><table border=\"0\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\"><tbody><tr><th>&nbsp;ID</th><th>&nbsp;</th><th>&nbsp;</th><th>&nbsp;</th><th>&nbsp;</th></tr><tr><td>&nbsp;xx</td><td>&nbsp;xx</td><td>&nbsp;xx</td><td>&nbsp;xx</td><td>&nbsp;xx</td></tr><tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr></tbody></table><p><br></p><pre><code>public static void main(String[] args) {<br> System.out.println(\"hello world\");<br>}</code></pre><p><br></p>', 1, '', '2019-03-12 12:21:26', NULL, NULL, NULL);
INSERT INTO `wiki_page_content` VALUES (1, 1, '<p>一入开源深似海</p><br>源码地址:<a href=\"https://gitee.com/zyplayer/zyplayer-doc\" target=\"_blank\">https://gitee.com/zyplayer/zyplayer-doc</a><p>体验地址:<a href=\"http://doc.zyplayer.com/zyplayer-doc-manage/static/manage/home.html\" target=\"_blank\">http://doc.zyplayer.com/zyplayer-doc-manage/static/manage/home.html</a>&nbsp;账号zyplayer 密码123456</p><p><br></p><p>更多实用功能请提交评论或加群交流!谢谢!<br></p><p>QQ群466363173</p>tips想要编辑本文请修改表wiki_page的edit_type字段值为0才行哦~<p><br></p><p>有什么问题可以来评论本文章哦!当然,如果你是部署在你们自己本地的我肯定看不到此文章的评论</p><p>可以到本工具官网下评论此文章,我会随时去查看的!</p><p>唯一官网地址:<a href=\"http://doc.zyplayer.com\" target=\"_blank\">http://doc.zyplayer.com</a></p><p><br></p><p>欢迎提交各种变态无理的要求~</p>', 1, '暮光:城中城', '2019-03-09 14:24:30', 1, '暮光:城中城', '2019-03-09 14:24:30');
INSERT INTO `wiki_page_content` VALUES (2, 2, '<p>zyplayer-doc-manage</p><p>1、首页做大的调整优化希望使用element重构一下</p><p>2、人员导入方案权限优化人员管理细化</p><p>&nbsp;</p><p>zyplayer-doc-wiki</p><p><prefira code\';font-size:10.5pt;\"=\"\">1<spancourier new\';\"=\"\"></spancourier></prefira></p><p><prefira code\';font-size:10.5pt;\"=\"\"><spancourier new\';\"=\"\"><spancourier new\';\"=\"\">2<spancourier new\';\"=\"\">、</spancourier></spancourier></spancourier></prefira>支持把一个空间里的文档一键同步到git<spancourier new\';\"=\"\">的wiki上统一管理文档</spancourier></p><p><spancourier new\';\"=\"\">3</spancourier></p><p>4</p><p>5</p><p>6</p><p>7访</p><p>8url动态变动</p><p>9https://www.kancloud.cn</p><p><br></p><p></p><p>PR</p><p><a href=\"https://gitee.com/zyplayer/zyplayer-doc\" target=\"_blank\">https://gitee.com/zyplayer/zyplayer-doc</a></p><p><br></p><p></p><p>QQ群466363173</p>', 1, '', '2019-03-09 14:24:30', 1, '', '2019-03-09 14:24:30');
INSERT INTO `wiki_page_content` VALUES (3, 3, '<p><span style=\"color: rgb(249, 150, 59);\">V1.0.1 2019-03-09</span></p><p>1zyplayer-doc-wiki模块</p><ul><li><br></li><li><br></li><li>wiki顺序<br></li><li></li></ul><p><prefira code\';font-size:10.5pt;\"=\"\">2<spancourier new\';\"=\"\">、dubbo<spancourier new\';\"=\"\">使dubbo2.7.0</spancourier></spancourier></prefira></p><p><prefira code\';font-size:10.5pt;\"=\"\"><spancourier new\';\"=\"\"><spancourier new\';\"=\"\">3<spancourier new\';\"=\"\">、框架进行了大的拆分,表修改较多</spancourier></spancourier></spancourier></prefira></p><p><prefira code\';font-size:10.5pt;\"=\"\"><spancourier new\';\"=\"\"><spancourier new\';\"=\"\"><spancourier new\';\"=\"\">4<spancourier new\';\"=\"\"></spancourier></spancourier></spancourier></spancourier></prefira></p><p><prefira code\';font-size:10.5pt;\"=\"\"><spancourier new\';\"=\"\"><spancourier new\';\"=\"\"><spancourier new\';\"=\"\"><spancourier new\';\"=\"\">5<spancourier new\';\"=\"\"></spancourier></spancourier></spancourier></spancourier></spancourier></prefira></p><p><prefira code\';font-size:10.5pt;\"=\"\"><spancourier new\';\"=\"\"><spancourier new\';\"=\"\"><spancourier new\';\"=\"\"><spancourier new\';\"=\"\"><spancourier new\';\"=\"\"><br></spancourier></spancourier></spancourier></spancourier></spancourier></prefira></p><p><span style=\"color: rgb(249, 150, 59);\">V1.0.0 2019-02-15</span><br></p><p></p><p>1zyplayer-doc-swaggerswagger接口文档展示方案使访<br>2zyplayer-doc-dubbodubbo服务的自动扫描线zookeepernacos注册中心的服务扫描<br>3zyplayer-doc-db/mysql和sqlserver数据库<br>4zyplayer-doc-managespring boot项目spring security做权限管理</p>', 1, '', '2019-03-09 14:24:30', 1, '', '2019-03-09 14:24:30');
INSERT INTO `wiki_page_content` VALUES (4, 4, '<p></p><p><a href=\"http://www.zyplayer.com\" target=\"_blank\"></a><br></p>', 1, '', '2019-03-09 14:24:30', 1, '', '2019-03-09 14:24:30');
INSERT INTO `wiki_page_content` VALUES (5, 5, '<p>zyplayer-doc-swagger 使</p>', 1, '', '2019-03-09 14:24:30', NULL, NULL, NULL);
INSERT INTO `wiki_page_content` VALUES (6, 6, '<p></p>', 1, '', '2019-03-09 14:24:30', 1, '', '2019-03-09 14:24:30');
INSERT INTO `wiki_page_content` VALUES (7, 7, '<h2>H2</h2><p><span style=\"font-weight: bold;\"></span></p><p><span style=\"font-size: xx-large;\"></span><span style=\"font-weight: bold;\"><br></span></p><p><span style=\"font-family: 宋体;\"></span>&nbsp;</p><p><span style=\"font-style: italic;\"></span></p><p><span style=\"text-decoration-line: underline;\">线线线</span><span style=\"font-style: italic;\"><br></span></p><p><span style=\"text-decoration-line: line-through;\">线线线</span><span style=\"text-decoration-line: underline;\"><br></span></p><p><span style=\"color: rgb(249, 150, 59);\"></span><span style=\"text-decoration-line: line-through;\"><br></span></p><p><span style=\"background-color: rgb(194, 79, 74);\"></span></p><p><a href=\"http://www.baidu.com/\" target=\"_blank\"></a><br></p><ol><li></li><li>xxx</li><li>xxx</li></ol><ul><li></li><li>xxx</li><li>xxx</li></ul><p style=\"text-align: center;\"></p><p style=\"text-align: right;\"></p><blockquote style=\"font-size: medium;\">xxxxx</blockquote><p><img src=\"http://img.t.sinajs.cn/t4/appstyle/expression/ext/normal/50/pcmoren_huaixiao_org.png\" alt=\"[坏笑]\"><br></p><p></p><table border=\"0\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\"><tbody><tr><th>&nbsp;ID</th><th>&nbsp;</th><th>&nbsp;</th><th>&nbsp;</th><th>&nbsp;</th></tr><tr><td>&nbsp;xx</td><td>&nbsp;xx</td><td>&nbsp;xx</td><td>&nbsp;xx</td><td>&nbsp;xx</td></tr><tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr></tbody></table><p><br></p><pre><code>public static void main(String[] args) {<br> System.out.println(\"hello world\");<br>}</code></pre><p><br></p>', 1, '', '2019-03-09 14:24:30', NULL, NULL, NULL);
-- ----------------------------
-- Table structure for wiki_page_file
@@ -188,10 +187,10 @@ CREATE TABLE `wiki_page_file` (
`uuid` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'UUID',
`create_user_id` bigint(20) NULL DEFAULT NULL COMMENT 'ID',
`create_user_name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '',
`create_time` datetime(0) NULL DEFAULT NULL COMMENT '',
`create_time` datetime NULL DEFAULT NULL COMMENT '',
`update_user_id` bigint(20) NULL DEFAULT NULL COMMENT 'ID',
`update_user_name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '',
`update_time` datetime(0) NULL DEFAULT NULL COMMENT '',
`update_time` datetime NULL DEFAULT NULL COMMENT '',
`del_flag` tinyint(4) NULL DEFAULT 0 COMMENT '0= 1=',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `uk_uuid`(`uuid`) USING BTREE COMMENT 'ID'
@@ -207,7 +206,7 @@ CREATE TABLE `wiki_page_zan` (
`comment_id` bigint(20) NULL DEFAULT NULL COMMENT 'ID',
`create_user_id` bigint(20) NULL DEFAULT NULL COMMENT 'ID',
`create_user_name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '',
`create_time` datetime(0) NULL DEFAULT NULL COMMENT '',
`create_time` datetime NULL DEFAULT NULL COMMENT '',
`yn` tinyint(4) NULL DEFAULT NULL COMMENT ' 0= 1=',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
@@ -215,7 +214,7 @@ CREATE TABLE `wiki_page_zan` (
-- ----------------------------
-- Records of wiki_page_zan
-- ----------------------------
INSERT INTO `wiki_page_zan` VALUES (1, 1, NULL, 1, '', '2019-03-09 22:19:44', 0);
INSERT INTO `wiki_page_zan` VALUES (1, 1, NULL, 1, '', '2019-03-09 14:24:30', 0);
-- ----------------------------
-- Table structure for wiki_space
@@ -232,7 +231,7 @@ CREATE TABLE `wiki_space` (
`uuid` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'UUID',
`create_user_id` bigint(20) NULL DEFAULT NULL COMMENT 'ID',
`create_user_name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '',
`create_time` datetime(0) NULL DEFAULT NULL COMMENT '',
`create_time` datetime NULL DEFAULT NULL COMMENT '',
`del_flag` tinyint(4) NOT NULL DEFAULT 0 COMMENT ' 0= 1=',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
@@ -240,9 +239,9 @@ CREATE TABLE `wiki_space` (
-- ----------------------------
-- Records of wiki_space
-- ----------------------------
INSERT INTO `wiki_space` VALUES (1, 'zyplayer-doc交流专用', 1, '', 0, 0, 1, '23f3f59a60824d21af9f7c3bbc9bc3cb', 1, '', '2019-03-09 13:59:14', 0);
INSERT INTO `wiki_space` VALUES (1, 'zyplayer-doc交流专用', 1, '', 0, 0, 1, '23f3f59a60824d21af9f7c3bbc9bc3cb', 1, '', '2019-03-09 14:24:30', 0);
INSERT INTO `wiki_space` VALUES (2, '', 2, '', 0, 0, 0, '91995a9a67bf45db9b5e58266517393e', 1, '', '2019-03-09 14:24:30', 0);
INSERT INTO `wiki_space` VALUES (3, 'xxx', 1, '', 0, 0, 0, 'cb2f5ff14d8d4066a79249d317eaa449', 1, '', '2019-03-13 17:44:53', 1);
INSERT INTO `wiki_space` VALUES (3, 'xxx', 1, '', 0, 0, 0, 'cb2f5ff14d8d4066a79249d317eaa449', 1, '', '2019-03-09 14:24:30', 1);
-- ----------------------------
-- Table structure for zyplayer_storage
@@ -251,12 +250,12 @@ DROP TABLE IF EXISTS `zyplayer_storage`;
CREATE TABLE `zyplayer_storage` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',
`doc_key` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '',
`doc_value` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '',
`creation_time` datetime(0) NULL DEFAULT NULL COMMENT '',
`update_time` datetime(0) NULL DEFAULT NULL COMMENT '',
`doc_value` varchar(2048) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '',
`creation_time` datetime NULL DEFAULT NULL COMMENT '',
`update_time` datetime NULL DEFAULT NULL COMMENT '',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `key`(`doc_key`) USING BTREE COMMENT 'key唯一索引'
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '' ROW_FORMAT = Compact;
) ENGINE = InnoDB AUTO_INCREMENT = 48 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '' ROW_FORMAT = Compact;
-- ----------------------------
-- Records of zyplayer_storage

View File

@@ -3,6 +3,8 @@ package com.zyplayer.doc.wiki.controller;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.zyplayer.doc.core.json.DocResponseJson;
import com.zyplayer.doc.core.json.ResponseJson;
import com.zyplayer.doc.data.config.security.DocUserDetails;
import com.zyplayer.doc.data.config.security.DocUserUtil;
import com.zyplayer.doc.data.repository.manage.entity.WikiPage;
import com.zyplayer.doc.data.repository.manage.entity.WikiPageContent;
import com.zyplayer.doc.data.repository.manage.entity.WikiPageFile;
@@ -48,6 +50,19 @@ public class WikiOpenApiController {
@Resource
Mapper mapper;
@PostMapping("/space/info")
public ResponseJson<WikiSpace> spaceInfo(String space) {
UpdateWrapper<WikiSpace> wrapper = new UpdateWrapper<>();
wrapper.eq("uuid", space);
wrapper.eq("del_flag", 0);
WikiSpace wikiSpace = wikiSpaceService.getOne(wrapper);
// 不存在或未开放
if (wikiSpace == null || wikiSpace.getOpenDoc() != 1) {
return DocResponseJson.warn("未找到该文档");
}
return DocResponseJson.ok(wikiSpace);
}
@PostMapping("/page/list")
public ResponseJson<List<WikiPageVo>> list(String space) {
UpdateWrapper<WikiSpace> wrapperSpace = new UpdateWrapper<>();

View File

@@ -5,8 +5,12 @@ import com.zyplayer.doc.core.json.DocResponseJson;
import com.zyplayer.doc.core.json.ResponseJson;
import com.zyplayer.doc.data.config.security.DocUserDetails;
import com.zyplayer.doc.data.config.security.DocUserUtil;
import com.zyplayer.doc.data.repository.manage.entity.WikiPage;
import com.zyplayer.doc.data.repository.manage.entity.WikiPageComment;
import com.zyplayer.doc.data.repository.manage.entity.WikiSpace;
import com.zyplayer.doc.data.service.manage.WikiPageCommentService;
import com.zyplayer.doc.data.service.manage.WikiPageService;
import com.zyplayer.doc.data.service.manage.WikiSpaceService;
import com.zyplayer.doc.wiki.controller.vo.WikiPageCommentVo;
import org.dozer.Mapper;
import org.slf4j.Logger;
@@ -19,6 +23,7 @@ import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
/**
@@ -35,13 +40,24 @@ public class WikiPageCommentController {
@Resource
WikiPageCommentService wikiPageCommentService;
@Resource
WikiSpaceService wikiSpaceService;
@Resource
WikiPageService wikiPageService;
@Resource
Mapper mapper;
@PostMapping("/list")
public ResponseJson<List<WikiPageCommentVo>> list(WikiPageComment wikiPageComment) {
public ResponseJson<List<WikiPageCommentVo>> list(WikiPageComment pageComment) {
DocUserDetails currentUser = DocUserUtil.getCurrentUser();
WikiPage wikiPageSel = wikiPageService.getById(pageComment.getPageId());
WikiSpace wikiSpaceSel = wikiSpaceService.getById(wikiPageSel.getSpaceId());
// 私人空间
if (Objects.equals(wikiSpaceSel.getType(), 3) && !currentUser.getUserId().equals(wikiSpaceSel.getCreateUserId())) {
return DocResponseJson.warn("您没有查看该空间的评论权!");
}
UpdateWrapper<WikiPageComment> wrapper = new UpdateWrapper<>();
wrapper.eq("page_id", wikiPageComment.getPageId());
wrapper.eq(wikiPageComment.getParentId() != null, "parent_id", wikiPageComment.getParentId());
wrapper.eq("page_id", pageComment.getPageId());
wrapper.eq(pageComment.getParentId() != null, "parent_id", pageComment.getParentId());
List<WikiPageComment> authList = wikiPageCommentService.list(wrapper);
Map<Long, List<WikiPageComment>> listMap = authList.stream().filter(val -> val.getParentId() != null)
.collect(Collectors.groupingBy(WikiPageComment::getParentId));
@@ -56,10 +72,17 @@ public class WikiPageCommentController {
@PostMapping("/update")
public ResponseJson<Object> update(WikiPageComment pageComment) {
Long id = pageComment.getId();
DocUserDetails currentUser = DocUserUtil.getCurrentUser();
WikiPage wikiPageSel = wikiPageService.getById(pageComment.getPageId());
WikiSpace wikiSpaceSel = wikiSpaceService.getById(wikiPageSel.getSpaceId());
// 私人空间
if (Objects.equals(wikiSpaceSel.getType(), 3) && !currentUser.getUserId().equals(wikiSpaceSel.getCreateUserId())) {
return DocResponseJson.warn("您没有该空间的评论权!");
}
if (id != null && id > 0) {
wikiPageCommentService.updateById(pageComment);
} else {
DocUserDetails currentUser = DocUserUtil.getCurrentUser();
pageComment.setCreateTime(new Date());
pageComment.setCreateUserId(currentUser.getUserId());
pageComment.setCreateUserName(currentUser.getUsername());

View File

@@ -5,14 +5,8 @@ import com.zyplayer.doc.core.json.DocResponseJson;
import com.zyplayer.doc.core.json.ResponseJson;
import com.zyplayer.doc.data.config.security.DocUserDetails;
import com.zyplayer.doc.data.config.security.DocUserUtil;
import com.zyplayer.doc.data.repository.manage.entity.WikiPage;
import com.zyplayer.doc.data.repository.manage.entity.WikiPageContent;
import com.zyplayer.doc.data.repository.manage.entity.WikiPageFile;
import com.zyplayer.doc.data.repository.manage.entity.WikiPageZan;
import com.zyplayer.doc.data.service.manage.WikiPageContentService;
import com.zyplayer.doc.data.service.manage.WikiPageFileService;
import com.zyplayer.doc.data.service.manage.WikiPageService;
import com.zyplayer.doc.data.service.manage.WikiPageZanService;
import com.zyplayer.doc.data.repository.manage.entity.*;
import com.zyplayer.doc.data.service.manage.*;
import com.zyplayer.doc.wiki.controller.vo.WikiPageContentVo;
import com.zyplayer.doc.wiki.controller.vo.WikiPageVo;
import org.apache.commons.lang3.StringUtils;
@@ -47,11 +41,18 @@ public class WikiPageController {
@Resource
WikiPageZanService wikiPageZanService;
@Resource
WikiSpaceService wikiSpaceService;
@Resource
Mapper mapper;
@PostMapping("/list")
public ResponseJson<List<WikiPageVo>> list(WikiPage wikiPage) {
// TODO 检查space是否开放访问
DocUserDetails currentUser = DocUserUtil.getCurrentUser();
WikiSpace wikiSpaceSel = wikiSpaceService.getById(wikiPage.getSpaceId());
// 私人空间
if (Objects.equals(wikiSpaceSel.getType(), 3) && !currentUser.getUserId().equals(wikiSpaceSel.getCreateUserId())) {
return DocResponseJson.warn("您没有查看该空间的文章列表!");
}
UpdateWrapper<WikiPage> wrapper = new UpdateWrapper<>();
wrapper.eq("del_flag", 0);
wrapper.eq("space_id", wikiPage.getSpaceId());
@@ -72,7 +73,11 @@ public class WikiPageController {
public ResponseJson<WikiPageContentVo> detail(WikiPage wikiPage) {
DocUserDetails currentUser = DocUserUtil.getCurrentUser();
WikiPage wikiPageSel = wikiPageService.getById(wikiPage.getId());
WikiSpace wikiSpaceSel = wikiSpaceService.getById(wikiPageSel.getSpaceId());
// 私人空间
if (Objects.equals(wikiSpaceSel.getType(), 3) && !currentUser.getUserId().equals(wikiSpaceSel.getCreateUserId())) {
return DocResponseJson.warn("您没有查看该空间的文章详情!");
}
UpdateWrapper<WikiPageContent> wrapper = new UpdateWrapper<>();
wrapper.eq("page_id", wikiPage.getId());
WikiPageContent pageContent = wikiPageContentService.getOne(wrapper);
@@ -101,6 +106,11 @@ public class WikiPageController {
@PostMapping("/update")
public ResponseJson<Object> update(WikiPage wikiPage, String content) {
DocUserDetails currentUser = DocUserUtil.getCurrentUser();
WikiSpace wikiSpaceSel = wikiSpaceService.getById(wikiPage.getSpaceId());
// 私人空间不允许调用接口获取文章
if (Objects.equals(wikiSpaceSel.getType(), 3) && !currentUser.getUserId().equals(wikiSpaceSel.getCreateUserId())) {
return DocResponseJson.warn("您没有修改该空间的文章权限!");
}
WikiPageContent pageContent = new WikiPageContent();
pageContent.setContent(content);
Integer delFlag = Optional.ofNullable(wikiPage.getDelFlag()).orElse(0);

View File

@@ -4,8 +4,12 @@ import com.zyplayer.doc.core.json.DocResponseJson;
import com.zyplayer.doc.core.json.ResponseJson;
import com.zyplayer.doc.data.config.security.DocUserDetails;
import com.zyplayer.doc.data.config.security.DocUserUtil;
import com.zyplayer.doc.data.repository.manage.entity.WikiPage;
import com.zyplayer.doc.data.repository.manage.entity.WikiPageFile;
import com.zyplayer.doc.data.repository.manage.entity.WikiSpace;
import com.zyplayer.doc.data.service.manage.WikiPageFileService;
import com.zyplayer.doc.data.service.manage.WikiPageService;
import com.zyplayer.doc.data.service.manage.WikiSpaceService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.PostMapping;
@@ -14,6 +18,7 @@ import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.Date;
import java.util.Objects;
/**
* 文档控制器
@@ -28,6 +33,10 @@ public class WikiPageFileController {
@Resource
WikiPageFileService wikiPageFileService;
@Resource
WikiSpaceService wikiSpaceService;
@Resource
WikiPageService wikiPageService;
// @PostMapping("/list")
// public ResponseJson<List<WikiPageFile>> list(WikiPageFile wikiPageFile) {
@@ -41,10 +50,16 @@ public class WikiPageFileController {
// }
// return DocResponseJson.ok(fileList);
// }
//
@PostMapping("/update")
public ResponseJson<Object> update(WikiPageFile wikiPageFile) {
DocUserDetails currentUser = DocUserUtil.getCurrentUser();
WikiPage wikiPageSel = wikiPageService.getById(wikiPageFile.getPageId());
WikiSpace wikiSpaceSel = wikiSpaceService.getById(wikiPageSel.getSpaceId());
// 私人空间
if (Objects.equals(wikiSpaceSel.getType(), 3) && !currentUser.getUserId().equals(wikiSpaceSel.getCreateUserId())) {
return DocResponseJson.warn("您没有该空间的文件上传权限!");
}
Long id = wikiPageFile.getId();
if (id != null && id > 0) {
wikiPageFile.setUpdateUserId(currentUser.getUserId());

View File

@@ -3,8 +3,14 @@ package com.zyplayer.doc.wiki.controller;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.zyplayer.doc.core.json.DocResponseJson;
import com.zyplayer.doc.core.json.ResponseJson;
import com.zyplayer.doc.data.config.security.DocUserDetails;
import com.zyplayer.doc.data.config.security.DocUserUtil;
import com.zyplayer.doc.data.repository.manage.entity.WikiPage;
import com.zyplayer.doc.data.repository.manage.entity.WikiPageZan;
import com.zyplayer.doc.data.repository.manage.entity.WikiSpace;
import com.zyplayer.doc.data.service.manage.WikiPageService;
import com.zyplayer.doc.data.service.manage.WikiPageZanService;
import com.zyplayer.doc.data.service.manage.WikiSpaceService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.PostMapping;
@@ -13,6 +19,7 @@ import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
import java.util.Objects;
/**
* 文档控制器
@@ -27,9 +34,20 @@ public class WikiPageZanController {
@Resource
WikiPageZanService wikiPageZanService;
@Resource
WikiSpaceService wikiSpaceService;
@Resource
WikiPageService wikiPageService;
@PostMapping("/list")
public ResponseJson<List<WikiPageZan>> list(WikiPageZan wikiPageZan) {
DocUserDetails currentUser = DocUserUtil.getCurrentUser();
WikiPage wikiPageSel = wikiPageService.getById(wikiPageZan.getPageId());
WikiSpace wikiSpaceSel = wikiSpaceService.getById(wikiPageSel.getSpaceId());
// 私人空间
if (Objects.equals(wikiSpaceSel.getType(), 3) && !currentUser.getUserId().equals(wikiSpaceSel.getCreateUserId())) {
return DocResponseJson.warn("您没有获取该空间的点赞列表权限!");
}
UpdateWrapper<WikiPageZan> wrapper = new UpdateWrapper<>();
wrapper.eq("page_id", wikiPageZan.getPageId());
wrapper.eq(wikiPageZan.getCommentId() != null, "comment_id", wikiPageZan.getCommentId());
@@ -40,6 +58,13 @@ public class WikiPageZanController {
@PostMapping("/update")
public ResponseJson<Object> update(WikiPageZan wikiPageZan) {
DocUserDetails currentUser = DocUserUtil.getCurrentUser();
WikiPage wikiPageSel = wikiPageService.getById(wikiPageZan.getPageId());
WikiSpace wikiSpaceSel = wikiSpaceService.getById(wikiPageSel.getSpaceId());
// 私人空间
if (Objects.equals(wikiSpaceSel.getType(), 3) && !currentUser.getUserId().equals(wikiSpaceSel.getCreateUserId())) {
return DocResponseJson.warn("您没有该空间的点赞权限!");
}
wikiPageZanService.zanPage(wikiPageZan);
return DocResponseJson.ok();
}

View File

@@ -38,8 +38,7 @@ public class WikiSpaceController {
DocUserDetails currentUser = DocUserUtil.getCurrentUser();
UpdateWrapper<WikiSpace> wrapper = new UpdateWrapper<>();
wrapper.eq("del_flag", 0);
wrapper.in("type", 1, 2);
//wrapper.or().eq("type", 3).eq("create_user_id", currentUser.getUserId());
wrapper.and(con -> con.and(conSub -> conSub.eq("type", 3).eq("create_user_id", currentUser.getUserId())).or().in("type", 1, 2));
List<WikiSpace> authList = wikiSpaceService.list(wrapper);
return DocResponseJson.ok(authList);
}
@@ -47,15 +46,19 @@ public class WikiSpaceController {
@PostMapping("/update")
public ResponseJson<WikiSpace> update(WikiSpace wikiSpace) {
Long id = wikiSpace.getId();
DocUserDetails currentUser = DocUserUtil.getCurrentUser();
if (id != null && id > 0) {
WikiSpace wikiSpaceSel = wikiSpaceService.getById(id);
if (Objects.equals(wikiSpaceSel.getEditType(), 1)) {
return DocResponseJson.warn("当前空间不允许编辑!");
}
if (Objects.equals(wikiSpaceSel.getType(), 3) && !currentUser.getUserId().equals(wikiSpaceSel.getCreateUserId())) {
return DocResponseJson.warn("您没有该空间的编辑权!");
}
wikiSpace.setUuid(null);
wikiSpaceService.updateById(wikiSpace);
} else {
DocUserDetails currentUser = DocUserUtil.getCurrentUser();
wikiSpace.setUuid(RandomUtil.simpleUUID());
wikiSpace.setCreateTime(new Date());
wikiSpace.setCreateUserId(currentUser.getUserId());

View File

@@ -176,22 +176,22 @@
<el-form-item label="目录加载:">
<el-switch v-model="newSpaceForm.treeLazyLoad" inactive-text="预先加载" :inactive-value="0" active-text="延迟加载" :active-value="1"></el-switch>
</el-form-item>
<!--<el-form-item label="空间类型:">-->
<!--<el-select v-model="newSpaceForm.type" filterable placeholder="选择类型" style="width: 100%;">-->
<!--<el-option :key="1" label="公共空间" :value="1">-->
<!--<span style="float: left">公共空间</span>-->
<!--<span style="float: right; color: #8492a6; font-size: 13px;">属于公共,登录用户可访问</span>-->
<!--</el-option>-->
<!--<el-option :key="2" label="个人空间" :value="2">-->
<!--<span style="float: left">个人空间</span>-->
<!--<span style="float: right; color: #8492a6; font-size: 13px;">属于个人,所有登录用户可访问</span>-->
<!--</el-option>-->
<!--<el-option :key="3" label="隐私空间" :value="3">-->
<!--<span style="float: left">隐私空间</span>-->
<!--<span style="float: right; color: #8492a6; font-size: 13px;">属于个人,仅创建者可访问</span>-->
<!--</el-option>-->
<!--</el-select>-->
<!--</el-form-item>-->
<el-form-item label="空间类型:">
<el-select v-model="newSpaceForm.type" filterable placeholder="选择类型" style="width: 100%;">
<el-option :key="1" label="公共空间" :value="1">
<span style="float: left">公共空间</span>
<span style="float: right; color: #8492a6; font-size: 13px;">属于公共,登录用户可访问</span>
</el-option>
<el-option :key="2" label="个人空间" :value="2">
<span style="float: left">个人空间</span>
<span style="float: right; color: #8492a6; font-size: 13px;">属于个人,所有登录用户可访问</span>
</el-option>
<el-option :key="3" label="隐私空间" :value="3">
<span style="float: left">隐私空间</span>
<span style="float: right; color: #8492a6; font-size: 13px;">属于个人,仅创建者可访问</span>
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" v-if="newSpaceForm.id > 0" @click="onNewSpaceSubmit('newSpaceForm')">保存修改</el-button>
<el-button type="primary" v-else @click="onNewSpaceSubmit('newSpaceForm')">立即创建</el-button>
@@ -200,14 +200,14 @@
</el-form>
</el-dialog>
<!--管理空间弹窗-->
<el-dialog title="管理空间" :visible.sync="manageSpaceDialogVisible" :close-on-click-modal="false">
<el-dialog title="管理空间" :visible.sync="manageSpaceDialogVisible" :close-on-click-modal="false" width="80%">
<el-table :data="spaceList" border style="width: 100%; margin-bottom: 5px;" max-height="500">
<el-table-column prop="id" label="ID" width="60"></el-table-column>
<el-table-column prop="name" label="名字"></el-table-column>
<el-table-column prop="spaceExplain" label="说明"></el-table-column>
<el-table-column label="开放地址">
<template slot-scope="scope">
<a target="_blank" :href="'open-wiki.html?space='+scope.row.uuid" v-if="scope.row.openDoc == 1">{{scope.row.uuid}}</a>
<a target="_blank" :href="'open-wiki.html?space='+scope.row.uuid" v-if="scope.row.openDoc == 1">{{scope.row.name}}</a>
<span v-else>暂未开放</span>
</template>
</el-table-column>
@@ -341,7 +341,7 @@
methods: {
filterPageNode(value, data) {
if (!value) return true;
return data.label.indexOf(value) !== -1;
return data.name.indexOf(value) !== -1;
},
editSpaceInfo(row) {
app.newSpaceForm = {

View File

@@ -11,8 +11,9 @@
<body>
<div id="app">
<el-container style="height: 100%;">
<el-aside width="280" style="height: 100%;background-color: #fafafa;">
<div style="padding: 0 10px 50px 10px;" v-show="leftCollapse">
<el-aside width="280px" style="height: 100%;background-color: #fafafa;" v-show="leftCollapse">
<div class="logo">{{nowSpaceShow.name}}</div>
<div style="padding: 0 10px 50px 10px;">
<el-input v-model="searchKeywords" @keyup.enter.native="searchByKeywords" placeholder="搜索文档" style="margin: 10px 0;">
<el-button slot="append" icon="el-icon-search" v-on:click="searchByKeywords"></el-button>
</el-input>
@@ -23,6 +24,7 @@
node-key="id"
style="background-color: #fafafa;">
</el-tree>
<!--请手下留情-->
<div class="build-info">本文档使用<span @click="aboutDialogVisible = true;">zyplayer-doc</span>构建</div>
</div>
</el-aside>
@@ -40,7 +42,8 @@
<div style="max-width: 950px;margin: 0 auto;">
<div class="wiki-title">{{wikiPage.name}}</div>
<div class="wiki-author">
<span><span v-show="wikiPage.updateTime">最后修改{{wikiPage.updateTime}}</span></span>
<span v-show="!wikiPage.updateTime">创建时间{{wikiPage.createTime}}</span>
<span v-show="wikiPage.updateTime">最后修改:{{wikiPage.updateTime}}</span>
</div>
<div class="wiki-files">
<el-table v-show="pageFileList.length > 0" :data="pageFileList" border style="width: 100%; margin-bottom: 5px;">
@@ -167,13 +170,14 @@
},
mounted: function () {
this.init();
this.getSpaceInfo();
this.doGetPageList(null);
this.initOver = true;
},
methods: {
filterPageNode(value, data) {
if (!value) return true;
return data.label.indexOf(value) !== -1;
return data.name.indexOf(value) !== -1;
},
notOpen() {
Toast.notOpen();
@@ -231,6 +235,14 @@
}
});
},
getSpaceInfo() {
var param = {space: this.urlParam.space};
ajaxTemp("zyplayer-doc-wiki/open-api/space/info", "post", "json", param, function (json) {
if (validateResult(json)) {
app.nowSpaceShow = json.data;
}
});
},
createNodePath(node, nodePath) {
if (!nodePath.endsWith("/")) {
nodePath += "/";
@@ -281,8 +293,10 @@
}
.el-tree{margin-right: 3px;}
.logo{
background: #409EFF; cursor: pointer;
width: 100%; height:40px;line-height:40px;font-size: 25px;color: #fff;text-align: center;
/*background: #409EFF; cursor: pointer;*/
border-bottom: 1px solid #f1f1f1;
overflow: hidden;white-space: nowrap;text-overflow: ellipsis; padding: 5px 10px;
width: 260px; height:40px;line-height:40px;font-size: 25px;color: #666;text-align: center;
}
.icon-collapse{float: left;font-size: 25px;color: #aaa;cursor: pointer;position: fixed;}
.icon-collapse:hover{color: #ccc;}
@@ -290,7 +304,7 @@
.wiki-author{font-size: 14px;color: #888;padding: 20px 0;height: 40px;line-height: 40px;}
.wiki-content{font-size: 14px;}
.wiki-content.w-e-text{overflow-y: auto;}
.upload-page-file .el-upload-list{display: none;}
.is-link{color: #1e88e5;cursor: pointer;}
/*编辑框高度*/