wiki增加历史版本功能,原创使用git方式管理wiki历史版本和查看,修改评论展示区域,修改布局

This commit is contained in:
暮光:城中城
2020-09-06 10:32:31 +08:00
parent 85bbfd1233
commit 5cd766762a
33 changed files with 1225 additions and 133 deletions

View File

@@ -0,0 +1,118 @@
package com.zyplayer.doc.data.repository.manage.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
/**
* <p>
*
* </p>
*
* @author 暮光:城中城
* @since 2020-09-05
*/
public class WikiPageHistory implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键自增ID
*/
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 页面ID
*/
private Long pageId;
/**
* 创建人ID
*/
private Long createUserId;
/**
* 创建人名字
*/
private String createUserName;
/**
* 创建时间
*/
private Date createTime;
/**
* 删除标记 0=正常 1=已删除
*/
private Integer delFlag;
/**
* git提交记录ID
*/
private String gitCommitId;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getPageId() {
return pageId;
}
public void setPageId(Long pageId) {
this.pageId = pageId;
}
public Long getCreateUserId() {
return createUserId;
}
public void setCreateUserId(Long createUserId) {
this.createUserId = createUserId;
}
public String getCreateUserName() {
return createUserName;
}
public void setCreateUserName(String createUserName) {
this.createUserName = createUserName;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Integer getDelFlag() {
return delFlag;
}
public void setDelFlag(Integer delFlag) {
this.delFlag = delFlag;
}
public String getGitCommitId() {
return gitCommitId;
}
public void setGitCommitId(String gitCommitId) {
this.gitCommitId = gitCommitId;
}
@Override
public String toString() {
return "WikiPageHistory{" +
"id=" + id +
", pageId=" + pageId +
", createUserId=" + createUserId +
", createUserName=" + createUserName +
", createTime=" + createTime +
", delFlag=" + delFlag +
", gitCommitId=" + gitCommitId +
"}";
}
}

View File

@@ -0,0 +1,16 @@
package com.zyplayer.doc.data.repository.manage.mapper;
import com.zyplayer.doc.data.repository.manage.entity.WikiPageHistory;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* Mapper 接口
* </p>
*
* @author 暮光:城中城
* @since 2020-09-05
*/
public interface WikiPageHistoryMapper extends BaseMapper<WikiPageHistory> {
}

View File

@@ -20,7 +20,7 @@ public class CodeGenerator {
// final String[] tableName = { "zyplayer_storage", "auth_info", "user_auth", "user_info", "db_datasource" };
// final String[] tableName = { "wiki_space", "wiki_page", "wiki_page_content", "wiki_page_file", "wiki_page_comment", "wiki_page_zan" };
// final String[] tableName = { "db_datasource", "es_datasource", "db_favorite" };
final String[] tableName = { "user_message" };
final String[] tableName = { "wiki_page_history" };
// 代码生成器
AutoGenerator mpg = new AutoGenerator();

View File

@@ -0,0 +1,16 @@
package com.zyplayer.doc.data.service.manage;
import com.zyplayer.doc.data.repository.manage.entity.WikiPageHistory;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 服务类
* </p>
*
* @author 暮光:城中城
* @since 2020-09-05
*/
public interface WikiPageHistoryService extends IService<WikiPageHistory> {
}

View File

@@ -0,0 +1,20 @@
package com.zyplayer.doc.data.service.manage.impl;
import com.zyplayer.doc.data.repository.manage.entity.WikiPageHistory;
import com.zyplayer.doc.data.repository.manage.mapper.WikiPageHistoryMapper;
import com.zyplayer.doc.data.service.manage.WikiPageHistoryService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 服务实现类
* </p>
*
* @author 暮光:城中城
* @since 2020-09-05
*/
@Service
public class WikiPageHistoryServiceImpl extends ServiceImpl<WikiPageHistoryMapper, WikiPageHistory> implements WikiPageHistoryService {
}

View File

@@ -0,0 +1,5 @@
<?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="com.zyplayer.doc.data.repository.manage.mapper.WikiPageHistoryMapper">
</mapper>

View File

@@ -45,6 +45,8 @@ zyplayer:
upload-path: d:/zyplayerDoc/wikiFiles
# 是否检查目录有被系统定期清理的风险,强烈建议开启
upload-path-check: true
# git本地仓库地址用于管理WIKI的历史版本
git-file-path: d:/zyplayerDoc/wikiGitFiles
# ------swagger相关配置------
swagger:
proxy-request:

View File

@@ -0,0 +1,429 @@
--
-- !!重要说明!!
-- 1、本sql文件分为从1.0.6版本升级 和 全新的库,即增量和全量的区分,请选择性执行
-- 2、建议数据库版本5.7.25
--
-- ------------------------从1.0.6版本升级:------------------------
ALTER TABLE `wiki_page_history`
DROP COLUMN `content`,
ADD COLUMN `git_commit_id` varchar(50) NULL COMMENT 'git提交记录ID';
-- ------------------------全新的库:------------------------
/*
Navicat Premium Data Transfer
Source Server : 127.0.0.1
Source Server Type : MySQL
Source Server Version : 50724
Source Host : 127.0.0.1:3306
Source Schema : zyplayer_doc_manage
Target Server Type : MySQL
Target Server Version : 50724
File Encoding : 65001
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for auth_info
-- ----------------------------
DROP TABLE IF EXISTS `auth_info`;
CREATE TABLE `auth_info` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键自增ID',
`auth_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '权限名',
`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 '创建时间',
`auth_type` tinyint(4) NOT NULL DEFAULT 0 COMMENT '权限类型 0=隐藏权限 1=可使用',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 18 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '权限信息表' ROW_FORMAT = Compact;
-- ----------------------------
-- Records of auth_info
-- ----------------------------
INSERT INTO `auth_info` VALUES (3, 'AUTH_ASSIGN', '权限分配权', 0, 1, '2018-12-01 11:40:42', 1);
INSERT INTO `auth_info` VALUES (4, 'USER_MANAGE', '用户管理权', 0, 1, '2018-12-01 11:40:42', 1);
INSERT INTO `auth_info` VALUES (5, 'WIKI_EDIT_PAGE_', '编辑wiki文档', 0, 1, '2019-06-04 13:01:20', 0);
INSERT INTO `auth_info` VALUES (6, 'WIKI_VIEW_PAGE_', '查看wiki文档', 0, 1, '2019-06-04 13:01:20', 0);
INSERT INTO `auth_info` VALUES (7, 'WIKI_COMMENT_PAGE_', '评论wiki文档', 0, 1, '2019-06-04 13:01:20', 0);
INSERT INTO `auth_info` VALUES (8, 'WIKI_DELETE_PAGE_', '删除wiki文档', 0, 1, '2019-06-04 13:01:20', 0);
INSERT INTO `auth_info` VALUES (9, 'WIKI_PAGE_FILE_UPLOAD_', '上传wiki文档附件', 0, 1, '2019-06-04 13:01:20', 0);
INSERT INTO `auth_info` VALUES (10, 'WIKI_PAGE_FILE_DELETE_', '删除wiki文档附件', 0, 1, '2019-06-04 13:01:20', 0);
INSERT INTO `auth_info` VALUES (11, 'WIKI_PAGE_AUTH_MANAGE_', 'wiki权限管理', 0, 1, '2019-06-04 13:01:20', 0);
INSERT INTO `auth_info` VALUES (12, 'DB_DATASOURCE_MANAGE', 'DB数据源管理权', 0, 1, '2019-06-29 13:01:20', 1);
INSERT INTO `auth_info` VALUES (13, 'ES_DATASOURCE_MANAGE', 'ES数据源管理权', 0, 1, '2019-07-27 00:39:20', 1);
INSERT INTO `auth_info` VALUES (14, 'DB_VIEW_', '数据源查看权', 0, 1, '2019-08-18 23:25:17', 0);
INSERT INTO `auth_info` VALUES (15, 'DB_SELECT_', '数据源查询权', 0, 1, '2019-08-18 23:25:17', 0);
INSERT INTO `auth_info` VALUES (16, 'DB_UPDATE_', '数据源增删改查权', 0, 1, '2019-08-18 23:25:17', 0);
INSERT INTO `auth_info` VALUES (17, 'DB_DESC_EDIT_', '表字段注释修改权', 0, 1, '2019-08-18 23:25:17', 0);
-- ----------------------------
-- Table structure for db_datasource
-- ----------------------------
DROP TABLE IF EXISTS `db_datasource`;
CREATE TABLE `db_datasource` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键自增ID',
`driver_class_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '数据源驱动类',
`source_url` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '数据源地址',
`source_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '数据源用户名',
`source_password` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 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 '创建时间',
`yn` tinyint(4) NULL DEFAULT NULL COMMENT '是否有效 0=无效 1=有效',
`name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '数据源名称',
`source_group` varchar(50) DEFAULT NULL COMMENT '数据源分组名',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of db_datasource
-- ----------------------------
-- ----------------------------
-- Table structure for db_favorite
-- ----------------------------
DROP TABLE IF EXISTS `db_favorite`;
CREATE TABLE `db_favorite` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键自增ID',
`name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '收藏标题',
`content` varchar(10000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 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 '创建时间',
`yn` tinyint(4) NULL DEFAULT NULL COMMENT '是否有效 0=无效 1=有效',
`datasource_id` bigint(20) NULL DEFAULT NULL COMMENT '数据源ID',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 9 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of db_favorite
-- ----------------------------
-- ----------------------------
-- Table structure for db_history
-- ----------------------------
DROP TABLE IF EXISTS `db_history`;
CREATE TABLE `db_history` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键自增ID',
`content` varchar(10000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'sql内容',
`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 '创建时间',
`yn` tinyint(4) NULL DEFAULT NULL COMMENT '是否有效 0=无效 1=有效',
`datasource_id` bigint(20) NULL DEFAULT NULL COMMENT '数据源ID',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 135 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of db_history
-- ----------------------------
-- ----------------------------
-- Table structure for es_datasource
-- ----------------------------
DROP TABLE IF EXISTS `es_datasource`;
CREATE TABLE `es_datasource` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键自增ID',
`name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '数据源名称',
`host_port` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '地址和端口',
`scheme` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'schemehttp或其他',
`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 '创建时间',
`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;
-- ----------------------------
-- Records of es_datasource
-- ----------------------------
-- ----------------------------
-- Table structure for user_auth
-- ----------------------------
DROP TABLE IF EXISTS `user_auth`;
CREATE TABLE `user_auth` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键自增ID',
`user_id` bigint(20) NULL DEFAULT NULL COMMENT '用户ID',
`auth_id` bigint(20) NULL DEFAULT NULL COMMENT '权限ID',
`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 '更新时间',
`auth_custom_suffix` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '自定义权限结尾',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 73 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用户权限表' ROW_FORMAT = Compact;
-- ----------------------------
-- Records of user_auth
-- ----------------------------
INSERT INTO `user_auth` VALUES (9, 2, 1, 1, NULL, 0, '2018-12-15 22:19:59', NULL, NULL);
INSERT INTO `user_auth` VALUES (10, 2, 2, 1, NULL, 0, '2018-12-15 22:19:59', NULL, NULL);
INSERT INTO `user_auth` VALUES (11, 2, 3, 1, NULL, 0, '2018-12-15 22:19:59', NULL, NULL);
INSERT INTO `user_auth` VALUES (12, 2, 4, 1, NULL, 0, '2018-12-15 22:19:59', NULL, NULL);
INSERT INTO `user_auth` VALUES (31, 3, 1, 1, NULL, 0, '2019-06-21 15:19:51', NULL, NULL);
INSERT INTO `user_auth` VALUES (32, 3, 2, 1, NULL, 0, '2019-06-21 15:19:51', NULL, NULL);
INSERT INTO `user_auth` VALUES (33, 3, 3, 1, NULL, 0, '2019-06-21 15:19:51', NULL, NULL);
INSERT INTO `user_auth` VALUES (34, 3, 4, 1, NULL, 0, '2019-06-21 15:19:51', NULL, NULL);
INSERT INTO `user_auth` VALUES (44, 1, 3, 1, NULL, 0, '2019-08-12 13:10:11', NULL, NULL);
INSERT INTO `user_auth` VALUES (45, 1, 4, 1, NULL, 0, '2019-08-12 13:10:11', NULL, NULL);
INSERT INTO `user_auth` VALUES (46, 1, 12, 1, NULL, 0, '2019-08-12 13:10:11', NULL, NULL);
INSERT INTO `user_auth` VALUES (47, 1, 13, 1, NULL, 0, '2019-08-12 13:10:11', NULL, NULL);
-- ----------------------------
-- Table structure for user_info
-- ----------------------------
DROP TABLE IF EXISTS `user_info`;
CREATE TABLE `user_info` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键自增ID',
`user_no` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户编号,用于登录等',
`password` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '密码',
`user_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户名',
`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=已删除 2=已停用',
`creation_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`create_uid` bigint(20) NULL DEFAULT NULL COMMENT '创建人用户ID',
`update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
`phone` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '手机号',
`sex` tinyint(4) NOT NULL DEFAULT 0 COMMENT '性别 0=女 1=男',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `idx_userNo`(`user_no`) USING BTREE COMMENT '登录用户名'
) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用户信息表' ROW_FORMAT = Compact;
-- ----------------------------
-- Records of user_info
-- ----------------------------
INSERT INTO `user_info` VALUES (1, 'zyplayer', 'e10adc3949ba59abbe56e057f20f883e', '暮光:城中城', '806783409@qq.com', NULL, 0, '2018-12-01 11:37:39', NULL, '2018-12-15 20:32:08', NULL, 0);
-- ----------------------------
-- Table structure for wiki_page
-- ----------------------------
DROP TABLE IF EXISTS `wiki_page`;
CREATE TABLE `wiki_page` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键自增ID',
`space_id` bigint(20) NULL DEFAULT NULL COMMENT '空间ID',
`name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '名字',
`parent_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '父ID',
`node_type` tinyint(4) NULL DEFAULT 0 COMMENT '节点类型 0=有子节点 1=终节点',
`zan_num` int(11) NOT NULL DEFAULT 0 COMMENT '赞的数量',
`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 '创建时间',
`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 '修改时间',
`del_flag` tinyint(4) NOT NULL DEFAULT 0 COMMENT '0=有效 1=删除',
`view_num` int(11) NOT NULL DEFAULT 0 COMMENT '阅读数',
`seq_no` int(11) NOT NULL DEFAULT 0 COMMENT '顺序',
`editor_type` tinyint(4) NOT NULL DEFAULT 1 COMMENT '编辑框类型 1=HTML 2=Markdown',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 15 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- 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-07-16 21:00:00', 0, 42, 1);
INSERT INTO `wiki_page` VALUES (2, 1, '开发规划', 0, 0, 0, 0, 1, '暮光:城中城', '2019-03-09 14:14:02', 1, '暮光:城中城', '2019-06-14 13:30:22', 0, 122, 4);
INSERT INTO `wiki_page` VALUES (3, 1, '升级日志', 0, 0, 0, 0, 1, '暮光:城中城', '2019-03-09 14:16:20', 1, '暮光:城中城', '2019-06-14 16:49:30', 0, 29, 5);
INSERT INTO `wiki_page` VALUES (4, 1, '贡献人员列表', 0, 0, 0, 0, 1, '暮光:城中城', '2019-03-09 15:16:15', 1, '暮光:城中城', '2019-06-14 13:20:43', 0, 13, 7);
INSERT INTO `wiki_page` VALUES (5, 1, 'zyplayer-doc-swagger', 0, 0, 1, 0, 1, '暮光:城中城', '2019-03-09 15:33:14', NULL, NULL, NULL, 0, 20, 9);
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, 3, 14);
INSERT INTO `wiki_page` VALUES (7, 2, '所有格式测试', 0, 0, 0, 0, 1, '暮光:城中城', '2019-03-12 12:21:26', NULL, NULL, NULL, 0, 13, 13);
-- ----------------------------
-- Table structure for wiki_page_comment
-- ----------------------------
DROP TABLE IF EXISTS `wiki_page_comment`;
CREATE TABLE `wiki_page_comment` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键自增ID',
`page_id` bigint(20) NULL DEFAULT NULL COMMENT '页面ID',
`parent_id` bigint(20) NULL DEFAULT NULL COMMENT '父评论ID',
`content` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL 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 '创建时间',
`del_flag` tinyint(4) NULL DEFAULT 0 COMMENT '0=有效 1=删除',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 7 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of wiki_page_comment
-- ----------------------------
-- ----------------------------
-- Table structure for wiki_page_content
-- ----------------------------
DROP TABLE IF EXISTS `wiki_page_content`;
CREATE TABLE `wiki_page_content` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键自增ID',
`page_id` bigint(20) NULL DEFAULT NULL COMMENT '页面ID',
`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 '创建时间',
`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 '修改时间',
`preview` varchar(16000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '预览内容',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `uk_page_id`(`page_id`) USING BTREE COMMENT '页面ID'
) ENGINE = InnoDB AUTO_INCREMENT = 15 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- 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-07-12 18:11:44', '一入开源深似海源码地址https://gitee.com/zyplayer/zyplayer-doc体验地址http://doc.zyplayer.com/zyplayer-doc-manage/static/manage/home.html&nbsp;账号zyplayer 密码123456更多实用功能请提交评论或加群交流谢谢QQ群466363173tips想要编辑本文请修改表wiki_page的edit_type字段值为0才行哦~有什么问题可以来评论本文章哦当然如果你是部署在你们自己本地的我肯定看不到此文章的评论可以到本工具官网下评论此文章我会随时去查看的唯一官网地址http://doc.zyplayer.com欢迎提交各种变态无理的要求~');
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-06-14 13:30:22', 'zyplayer-doc-manage1使element重构一下2&nbsp;zyplayer-doc-wiki12git的wiki上3456...');
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-06-14 16:49:30', 'V1.0.1 2019-03-091zyplayer-doc-wiki模块支持空间隔离支持附件上传拖动可以改变wiki顺序基本的文档创建2dubbo文档支持使用元数据生成参数和返回值dubbo2.7.0345V1.0.0 2019-02-151zyplayer-doc-swagge...');
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-06-14 13:20:43', '');
INSERT INTO `wiki_page_content` VALUES (5, 5, '<p>zyplayer-doc-swagger 使</p>', 1, '', '2019-03-09 15:33:14', NULL, 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', NULL);
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, NULL);
-- ----------------------------
-- Table structure for wiki_page_file
-- ----------------------------
DROP TABLE IF EXISTS `wiki_page_file`;
CREATE TABLE `wiki_page_file` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
`page_id` bigint(20) NULL DEFAULT NULL COMMENT 'ID',
`file_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '',
`file_url` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'URL',
`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 '',
`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 '',
`del_flag` tinyint(4) NULL DEFAULT 0 COMMENT '0= 1=',
`download_num` int(11) NOT NULL DEFAULT 0 COMMENT '',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `uk_uuid`(`uuid`) USING BTREE COMMENT 'ID'
) ENGINE = InnoDB AUTO_INCREMENT = 15 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of wiki_page_file
-- ----------------------------
-- ----------------------------
-- Table structure for wiki_page_history
-- ----------------------------
DROP TABLE IF EXISTS `wiki_page_history`;
CREATE TABLE `wiki_page_history` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
`page_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 '',
`del_flag` tinyint(4) NOT NULL DEFAULT 0 COMMENT ' 0= 1=',
`git_commit_id` varchar(50) NULL COMMENT 'git提交记录ID',
PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_page_id`(`page_id`) USING BTREE COMMENT 'ID索引'
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for wiki_page_zan
-- ----------------------------
DROP TABLE IF EXISTS `wiki_page_zan`;
CREATE TABLE `wiki_page_zan` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
`page_id` bigint(20) NULL DEFAULT NULL COMMENT 'ID',
`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 '',
`yn` tinyint(4) NULL DEFAULT NULL COMMENT ' 0= 1=',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for wiki_space
-- ----------------------------
DROP TABLE IF EXISTS `wiki_space`;
CREATE TABLE `wiki_space` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
`name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '',
`type` tinyint(4) NULL DEFAULT 1 COMMENT ' 1= 2= 3=',
`space_explain` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '',
`edit_type` tinyint(4) NOT NULL DEFAULT 0 COMMENT ' 0= 1=',
`tree_lazy_load` tinyint(4) NOT NULL DEFAULT 0 COMMENT ' 0= 1=',
`open_doc` tinyint(4) NOT NULL DEFAULT 0 COMMENT ' 0= 1=',
`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 '',
`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;
-- ----------------------------
-- 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 (2, '', 2, '', 0, 0, 0, '91995a9a67bf45db9b5e58266517393e', 1, '', '2019-03-09 14:24:30', 0);
-- ----------------------------
-- Table structure for zyplayer_storage
-- ----------------------------
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 '',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `key`(`doc_key`) USING BTREE COMMENT 'key唯一索引'
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '' ROW_FORMAT = Compact;
DROP TABLE IF EXISTS `db_transfer_task`;
CREATE TABLE `db_transfer_task` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
`name` varchar(100) DEFAULT NULL COMMENT '',
`query_datasource_id` bigint(20) DEFAULT NULL COMMENT 'ID',
`storage_datasource_id` bigint(20) DEFAULT NULL COMMENT 'ID',
`query_sql` varchar(2048) DEFAULT NULL COMMENT 'sql',
`storage_sql` varchar(2048) DEFAULT NULL COMMENT 'sql',
`need_count` tinyint(4) NOT NULL DEFAULT '0' COMMENT ' 0= 1=',
`last_execute_status` tinyint(4) NOT NULL DEFAULT '0' COMMENT ' 0= 1= 2= 3= 4=',
`last_execute_time` datetime DEFAULT NULL COMMENT '',
`last_execute_info` text DEFAULT NULL COMMENT '',
`create_user_id` bigint(20) DEFAULT NULL COMMENT 'ID',
`create_user_name` varchar(20) DEFAULT NULL COMMENT '',
`create_time` datetime DEFAULT NULL COMMENT '',
`del_flag` tinyint(4) NOT NULL DEFAULT '0' COMMENT ' 0= 1=',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
DROP TABLE IF EXISTS `user_message`;
CREATE TABLE `user_message` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
`sys_type` tinyint(4) NOT NULL DEFAULT 1 COMMENT ' 1=manage 2=wiki 3=db',
`msg_type` int NOT NULL DEFAULT 1 COMMENT ' 1= 2=wiki文档创建 3=wiki文档删除 4=wiki文档编辑 5=wiki文档权限修改 6=wiki文档评论 7=wiki文档删除评论 8=wiki文档上传附件',
`data_id` bigint(20) NULL DEFAULT NULL COMMENT 'ID',
`data_desc` varchar(100) NULL DEFAULT NULL COMMENT '',
`msg_content` varchar(255) NULL DEFAULT NULL COMMENT '',
`msg_status` tinyint(4) NOT NULL DEFAULT 0 COMMENT ' 0= 1= 2=',
`operator_user_id` bigint(20) NULL DEFAULT NULL COMMENT 'ID',
`operator_user_name` varchar(20) NULL DEFAULT NULL COMMENT '',
`affect_user_id` bigint(20) NULL DEFAULT NULL COMMENT 'ID',
`affect_user_name` varchar(20) NULL DEFAULT NULL COMMENT '',
`accept_user_id` bigint(20) NULL DEFAULT NULL COMMENT 'ID',
`creation_time` datetime(0) NULL DEFAULT NULL COMMENT '',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '' ROW_FORMAT = Compact;
SET FOREIGN_KEY_CHECKS = 1;

View File

@@ -2,8 +2,8 @@
ENV = 'development'
# base api
# VUE_APP_BASE_API = 'http://local.zyplayer.com:8083/zyplayer-doc-manage'
VUE_APP_BASE_API = 'http://doc.zyplayer.com/zyplayer-doc-manage'
VUE_APP_BASE_API = 'http://local.zyplayer.com:8083/zyplayer-doc-manage'
# VUE_APP_BASE_API = 'http://doc.zyplayer.com/zyplayer-doc-manage'
VUE_CLI_BABEL_TRANSPILE_MODULES = true

View File

@@ -25,4 +25,16 @@
#app, .el-container, .el-menu {
height: 100%;
}
::-webkit-scrollbar {
width: 6px;
height: 9px;
-webkit-appearance: none;
}
::-webkit-scrollbar-thumb {
background: #ddd;
border-radius: 10px;
}
::-webkit-scrollbar-track-piece {
background: #eee;
}
</style>

View File

@@ -19,6 +19,12 @@ export default {
},
pageDelete: data => {
return request({url: '/zyplayer-doc-wiki/page/delete', method: 'post', data: Qs.stringify(data)});
},
pageHistoryList: data => {
return request({url: '/zyplayer-doc-wiki/page/history/list', method: 'post', data: Qs.stringify(data)});
},
pageHistoryDetail: data => {
return request({url: '/zyplayer-doc-wiki/page/history/detail', method: 'post', data: Qs.stringify(data)});
},
pageNews: data => {
return request({url: '/zyplayer-doc-wiki/page/news', method: 'post', data: Qs.stringify(data)});

View File

@@ -59,7 +59,7 @@
@current-change="handleCurrentChange"
:page-size="userMsgParam.pageSize"
:current-page="userMsgParam.pageNum"
layout="prev, pager, next, jumper, total"
layout="prev, pager, next, total"
:total="userMsgTotalCount"
>
</el-pagination>

View File

@@ -1,14 +1,15 @@
<template>
<div class="page-show-vue">
<el-row type="border-card">
<div class="wiki-title">
{{wikiPage.name}}
</div>
<el-row type="border-card" style="height: 100%;">
<el-col :span="actionTabVisible?18:24" style="padding: 20px;border-right: 1px solid #f1f1f1;height: 100%;overflow: auto;">
<div style="max-width: 1000px;margin: 0 auto;">
<div class="wiki-title">{{wikiPage.name}}</div>
<div class="wiki-author">
<div>
<span class="create-user-time">创建{{wikiPage.createUserName}} {{wikiPage.createTime}}</span>
<span v-show="wikiPage.updateUserName">修改{{wikiPage.updateUserName}} {{wikiPage.updateTime}}</span>
<div style="float: right;">
<el-button type="text" icon="el-icon-chat-line-round" @click="showCommentWiki" style="margin-right: 10px;">评论</el-button>
<el-upload v-if="wikiPageAuth.canUploadFile==1"
class="upload-page-file" :action="uploadFileUrl"
:with-credentials="true"
@@ -23,6 +24,7 @@
更多<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="showPageHistory" icon="el-icon-time">查看历史版本</el-dropdown-item>
<el-dropdown-item command="deletePage" v-if="wikiPageAuth.canDelete==1" icon="el-icon-delete">删除</el-dropdown-item>
<el-dropdown-item command="editAuth" v-if="wikiPageAuth.canConfigAuth==1" icon="el-icon-s-check">权限设置</el-dropdown-item>
<el-dropdown-item command="showOpenPage" v-if="spaceInfo.openDoc == 1" icon="el-icon-share">查看开放文档</el-dropdown-item>
@@ -49,7 +51,8 @@
</el-table>
</div>
<div class="wiki-content w-e-text">
<div v-html="pageContent.content"></div>
<div v-html="pageHistoryDetail" v-if="!!pageHistoryDetail"></div>
<div v-html="pageContent.content" v-else></div>
</div>
<div style="margin-top: 40px; font-size: 14px;">
<span style="vertical-align: top;" class="is-link">
@@ -66,39 +69,90 @@
<i class="el-icon-view" style="font-size: 16px;color: #666;"></i> {{wikiPage.viewNum}}次阅读
</span>
</div>
<div v-show="commentList.length > 0" class="comment-box" style="margin-top: 20px;">
<div style="border-bottom: 1px solid #67C23A;padding-bottom: 10px;">评论列表</div>
<div v-for="(comment,index) in commentList" :key="comment.id" :data-id="comment.id" :data-index="index" style="border-bottom: 1px solid #eee;padding: 10px;">
<div>
</div>
<!-- <div v-show="commentList.length > 0" class="comment-box" style="margin-top: 20px;">-->
<!-- <div style="border-bottom: 1px solid #67C23A;padding-bottom: 10px;">评论列表</div>-->
<!-- <div v-for="(comment,index) in commentList" :key="comment.id" :data-id="comment.id" :data-index="index" style="border-bottom: 1px solid #eee;padding: 10px;">-->
<!-- <div>-->
<!-- <div :style="'background-color: '+comment.color" class="head">{{comment.createUserName.substr(0,1)}}</div>-->
<!-- </div>-->
<!-- <div style="padding-left: 55px;">-->
<!-- {{comment.createUserName}}-->
<!-- <span style="color: #888;font-size: 13px;padding-left: 10px;">{{comment.createTime}}</span>-->
<!-- <span style="color: #888;font-size: 13px;margin-left: 10px;cursor: pointer;" @click="recommentUser(comment.id, index)">回复</span>-->
<!-- <span style="color: #888;font-size: 13px;margin-left: 10px;cursor: pointer;" @click="deleteComment(comment.id)" v-if="canDeleteComment(comment)">删除</span>-->
<!-- </div>-->
<!-- <pre style="padding: 10px 0 0 55px;">{{comment.content}}</pre>-->
<!-- <div v-for="(commentSub,indexSub) in comment.commentList" :key="commentSub.id" :data-id="commentSub.id" :data-index="indexSub" style="border-bottom: 1px solid #eee;padding: 10px;margin-left: 40px;">-->
<!-- <div>-->
<!-- <div :style="'background-color: '+commentSub.color" class="head">{{commentSub.createUserName.substr(0,1)}}</div>-->
<!-- </div>-->
<!-- <div style="padding-left: 55px;">-->
<!-- {{commentSub.createUserName}}-->
<!-- <span style="color: #888;font-size: 13px;padding-left: 10px;">{{commentSub.createTime}}</span>-->
<!-- <span style="color: #888;font-size: 13px;margin-left: 10px;cursor: pointer;" @click="deleteComment(commentSub.id)" v-if="canDeleteComment(commentSub)">删除</span>-->
<!-- </div>-->
<!-- <pre style="padding: 10px 0 0 55px;">{{commentSub.content}}</pre>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div style="margin: 20px 0 50px 0;">-->
<!-- <el-input type="textarea" v-model="commentTextInput" :rows="5" :placeholder="recommentInfo.placeholder || '请输入评论内容'"></el-input>-->
<!-- <div align="right" style="margin-top: 5px;">-->
<!-- <el-button type="primary" v-on:click="submitPageComment">提交评论</el-button>-->
<!-- <el-button v-on:click="cancelCommentUser" v-show="recommentInfo.id > 0">取消回复</el-button>-->
<!-- </div>-->
<!-- </div>-->
</el-col>
<el-col :span="6" style="height: 100%;" v-show="actionTabVisible">
<i class="el-icon-close close-action-tab" @click="closeActionTab"></i>
<el-tabs v-model="actionTabActiveName" @tab-click="actionTabClick">
<el-tab-pane label="评论" name="comment">
<div class="action-tab-box" ref="actionTabComment" style="padding-bottom: 130px;box-sizing: border-box;height: calc(100vh - 80px);">
<div v-if="commentList.length <= 0" class="action-box-empty">暂无评论</div>
<el-timeline v-else>
<el-timeline-item :timestamp="comment.createTime" placement="top" v-for="comment in commentList">
<el-card class="box-card comment-card" :body-style="{ padding: '10px' }">
<div :style="'background-color: '+comment.color" class="head">{{comment.createUserName.substr(0,1)}}</div>
</div>
<div style="padding-left: 55px;">
<div class="comment-user-name">
{{comment.createUserName}}
<span style="color: #888;font-size: 13px;padding-left: 10px;">{{comment.createTime}}</span>
<span style="color: #888;font-size: 13px;margin-left: 10px;cursor: pointer;" @click="recommentUser(comment.id, index)">回复</span>
<span style="color: #888;font-size: 13px;margin-left: 10px;cursor: pointer;" @click="deleteComment(comment.id)" v-if="canDeleteComment(comment)">删除</span>
<el-popover placement="top" width="160" v-model="comment.visible" v-if="canDeleteComment(comment)">
<p>确定要除删此评论吗</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="comment.visible=false">取消</el-button>
<el-button type="primary" size="mini" @click="deleteComment(comment.id)">确定</el-button>
</div>
<pre style="padding: 10px 0 0 55px;">{{comment.content}}</pre>
<div v-for="(commentSub,indexSub) in comment.commentList" :key="commentSub.id" :data-id="commentSub.id" :data-index="indexSub" style="border-bottom: 1px solid #eee;padding: 10px;margin-left: 40px;">
<div>
<div :style="'background-color: '+commentSub.color" class="head">{{commentSub.createUserName.substr(0,1)}}</div>
<i slot="reference" class="el-icon-delete"></i>
</el-popover>
</div>
<div style="padding-left: 55px;">
{{commentSub.createUserName}}
<span style="color: #888;font-size: 13px;padding-left: 10px;">{{commentSub.createTime}}</span>
<span style="color: #888;font-size: 13px;margin-left: 10px;cursor: pointer;" @click="deleteComment(commentSub.id)" v-if="canDeleteComment(commentSub)">删除</span>
<pre class="comment-content">{{comment.content}}</pre>
</el-card>
</el-timeline-item>
</el-timeline>
</div>
<pre style="padding: 10px 0 0 55px;">{{commentSub.content}}</pre>
</div>
</div>
</div>
<div style="margin: 20px 0 50px 0;">
<el-input type="textarea" v-model="commentTextInput" :rows="5" :placeholder="recommentInfo.placeholder || '请输入评论内容'"></el-input>
<div align="right" style="margin-top: 5px;">
<el-button type="primary" v-on:click="submitPageComment">提交评论</el-button>
<el-button v-on:click="cancelCommentUser" v-show="recommentInfo.id > 0">取消回复</el-button>
<div class="comment-input-box">
<textarea rows="5" placeholder="发表评论" v-model="commentTextInput"></textarea>
<el-button style="float: right;margin: 2px 5px;" type="primary" size="mini" v-on:click="submitPageComment">发送</el-button>
</div>
</el-tab-pane>
<el-tab-pane label="修改历史" name="history">
<div class="action-tab-box">
<div v-if="pageHistoryList.length <= 0" class="action-box-empty">暂无修改历史记录</div>
<el-timeline v-else>
<el-timeline-item v-for="history in pageHistoryList">
<el-tag :type="pageHistoryChoice.id == history.id ? 'success':'info'" class="history-item" @click="historyClick(history)">
<div>{{history.createUserName}}</div>
<div>{{history.createTime}}</div>
</el-tag>
<i class="el-icon-loading history-loading-status" v-show="history.loading==1"></i>
<i class="el-icon-circle-check history-loading-status" v-show="history.loading==2"></i>
</el-timeline-item>
</el-timeline>
<!-- <div v-for="i in 100">{{i}}</div>-->
</div>
</el-tab-pane>
</el-tabs>
</el-col>
</el-row>
<!--点赞人员弹窗-->
<el-dialog title="赞了它的人" :visible.sync="zanUserDialogVisible" width="600px">
@@ -178,6 +232,12 @@
searchUserList: [],
pageAuthNewUser: "",
pageAuthUserLoading: false,
// 右侧标签页
actionTabVisible: false,
actionTabActiveName: 'comment',
pageHistoryDetail: '',
pageHistoryChoice: {},
pageHistoryList: [],
};
},
beforeRouteUpdate(to, from, next) {
@@ -210,6 +270,8 @@
this.editWikiAuth();
} else if (val == 'deletePage') {
this.deleteWikiPage();
} else if (val == 'showPageHistory') {
this.showPageHistory();
} else if (val == 'showOpenPage') {
if (this.spaceInfo.openDoc != 1) {
this.$message.warning("该空间未开放,无法查看开放文档地址");
@@ -288,11 +350,66 @@
});
}).catch(()=>{});
},
actionTabClick(tab) {
if (tab.name == 'comment') {
this.showCommentWiki();
} else if (tab.name == 'history') {
this.showPageHistory();
}
},
closeActionTab() {
this.actionTabVisible = false;
this.clearHistory();
},
showCommentWiki() {
this.actionTabVisible = true;
this.actionTabActiveName = 'comment';
this.scrollActionTabComment();
},
showPageHistory() {
this.actionTabVisible = true;
this.actionTabActiveName = 'history';
this.clearHistory();
},
getPageHistory(pageId) {
this.pageHistoryList = [];
let param = {pageId: pageId, pageNum: 1};
pageApi.pageHistoryList(param).then(json => {
let pageHistoryList = json.data || [];
pageHistoryList.forEach(item => item.loading = 0);
this.pageHistoryList = pageHistoryList;
});
},
historyClick(history) {
if (this.pageHistoryChoice.id == history.id && !!this.pageHistoryDetail) {
return;
}
this.pageHistoryChoice.loading = 0;
this.pageHistoryChoice = history;
// 缓存一下,但如果历史页面多了而且很大就占内存,也可以每次去拉取,先这样吧
if (history.content) {
history.loading = 2;
this.pageHistoryDetail = history.content || '内容为空';
} else {
history.loading = 1;
pageApi.pageHistoryDetail({id: history.id}).then(json => {
history.loading = 2;
this.pageHistoryDetail = json.data || '内容为空';
history.content = json.data || '内容为空';
});
}
},
clearHistory() {
this.pageHistoryChoice.loading = 0;
this.pageHistoryDetail = '';
this.pageHistoryChoice = {};
this.pageHistoryList.forEach(item => item.loading = 0);
},
loadPageDetail(pageId) {
var param = {id: pageId};
pageApi.pageDetail(param).then(json => {
this.clearHistory();
pageApi.pageDetail({id: pageId}).then(json => {
let result = json.data || {};
var wikiPage = result.wikiPage || {};
let wikiPage = result.wikiPage || {};
wikiPage.selfZan = result.selfZan || 0;
this.wikiPage = wikiPage;
this.pageContent = result.pageContent || {};
@@ -320,25 +437,32 @@
this.$emit('changeExpandedKeys', pageId);
});
this.loadCommentList(pageId);
this.getPageHistory(pageId);
},
loadCommentList(pageId) {
this.commentList = [];
this.cancelCommentUser();
var param = {pageId: pageId};
pageApi.pageCommentList(param).then(json => {
var commentList = json.data || [];
for (var i = 0; i < commentList.length; i++) {
pageApi.pageCommentList({pageId: pageId}).then(json => {
let commentList = json.data || [];
for (let i = 0; i < commentList.length; i++) {
commentList[i].color = this.getUserHeadBgColor(commentList[i].createUserId);
var subCommentList = commentList[i].commentList || [];
for (var j = 0; j < subCommentList.length; j++) {
var subItem = subCommentList[j];
let subCommentList = commentList[i].commentList || [];
for (let j = 0; j < subCommentList.length; j++) {
let subItem = subCommentList[j];
subItem.color = this.getUserHeadBgColor(subItem.createUserId);
}
commentList[i].commentList = subCommentList;
commentList[i].visible = false;
}
this.commentList = commentList;
this.scrollActionTabComment();
});
},
scrollActionTabComment() {
setTimeout(() => {
let actionTabComment = this.$refs.actionTabComment;
actionTabComment.scrollTop = actionTabComment.scrollHeight;
}, 0);
},
zanPage(yn) {
var param = {yn: yn, pageId: this.wikiPage.id};
pageApi.updatePageZan(param).then(() => {
@@ -361,16 +485,10 @@
return this.selfUserId == row.createUserId || this.wikiPage.createUserId == this.selfUserId;
},
deleteComment(id) {
this.$confirm('确定要除删此评论吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
pageApi.deletePageComment({id: id}).then(() => {
this.$message.success("删除成功!");
// this.$message.success("删除成功!");
this.loadCommentList(this.parentPath.pageId);
});
});
},
cancelCommentUser() {
this.recommentInfo = {};
@@ -436,7 +554,7 @@
}
</script>
<style>
.page-show-vue {width: 80%; margin: 0 auto; padding: 20px 0;}
.page-show-vue {height: 100%;}
.page-show-vue .icon-collapse{float: left;font-size: 25px;color: #aaa;margin-top: 8px;cursor: pointer;}
.page-show-vue .icon-collapse:hover{color: #eee;}
.page-show-vue .wiki-title{font-size: 20px;text-align: center;font-weight: bold;}
@@ -452,9 +570,54 @@
/*编辑框高度*/
.page-show-vue #newPageContentDiv .w-e-text-container{height: 600px !important;}
/*评论*/
.page-show-vue .comment-box .head{
.page-show-vue .head{
float: left;background-color: #ccc;border-radius: 50%;margin-right: 10px;
width: 45px; height: 45px; line-height: 45px;text-align: center;color: #fff;
}
.page-show-vue .el-tabs__header{
margin: 0;
}
.page-show-vue .el-tabs__nav-wrap{
padding: 0 20px;
}
.page-show-vue .close-action-tab{
position: absolute;right: 15px;top: 12px;cursor: pointer;z-index: 1;
}
.page-show-vue .action-tab-box{
height: calc(100vh - 120px);overflow: auto;padding: 20px 10px;
}
.page-show-vue .action-box-empty{
text-align: center;padding-top: 30px;color: #888;font-size: 14px;
}
.page-show-vue .history-item{
height: 55px;line-height: 25px;cursor: pointer;vertical-align: middle;
}
.page-show-vue .history-loading-status{
margin-left: 5px;color: #888;
}
.page-show-vue .el-timeline{
padding-inline-start: 0;
}
.page-show-vue .comment-user-name{
margin-bottom: 10px;
}
.page-show-vue .comment-content{
padding: 0;color: #666;margin: 0;white-space: pre-wrap;word-wrap: break-word;line-height: 20px;
}
.page-show-vue .comment-input-box{
position: absolute;bottom: 0;width: 100%;background: #fff;border-top: 1px solid #f1f1f1;
}
.page-show-vue .comment-input-box textarea{
resize: none;width: 100%;box-sizing: border-box;border: 0;outline:none !important;padding: 10px;
}
.page-show-vue .comment-card .comment-user-name .el-icon-delete{
color: #888;font-size: 13px;cursor: pointer;float: right;display: none;
}
.page-show-vue .comment-card .comment-user-name .el-icon-delete{
color: #888;font-size: 13px;cursor: pointer;float: right;display: none;
}
.page-show-vue .comment-card:hover .comment-user-name .el-icon-delete{
display: inline-block;
}
</style>

View File

@@ -58,6 +58,11 @@
<artifactId>zyplayer-doc-core</artifactId>
<version>${zyplayer.doc.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jgit</groupId>
<artifactId>org.eclipse.jgit</artifactId>
<version>5.8.1.202007141445-r</version>
</dependency>
</dependencies>
<licenses>
<license>

View File

@@ -14,7 +14,7 @@ import com.zyplayer.doc.data.repository.support.consts.UserMsgType;
import com.zyplayer.doc.data.service.manage.*;
import com.zyplayer.doc.wiki.controller.vo.UserPageAuthVo;
import com.zyplayer.doc.wiki.framework.consts.WikiAuthType;
import com.zyplayer.doc.wiki.service.WikiPageAuthService;
import com.zyplayer.doc.wiki.service.common.WikiPageAuthService;
import org.apache.commons.collections.CollectionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

View File

@@ -68,15 +68,16 @@ public class WikiPageCommentController {
wrapper.eq("del_flag", 0);
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));
List<WikiPageCommentVo> commentList = authList.stream().filter(val -> val.getParentId() == null)
.map(val -> mapper.map(val, WikiPageCommentVo.class)).collect(Collectors.toList());
for (WikiPageCommentVo commentVo : commentList) {
commentVo.setCommentList(listMap.get(commentVo.getId()));
}
return DocResponseJson.ok(commentList);
List<WikiPageComment> pageCommentList = wikiPageCommentService.list(wrapper);
// 取消二级评论,全展示在一级
// Map<Long, List<WikiPageComment>> listMap = pageCommentList.stream().filter(val -> val.getParentId() != null)
// .collect(Collectors.groupingBy(WikiPageComment::getParentId));
// List<WikiPageCommentVo> commentList = pageCommentList.stream().filter(val -> val.getParentId() == null)
// .map(val -> mapper.map(val, WikiPageCommentVo.class)).collect(Collectors.toList());
// for (WikiPageCommentVo commentVo : commentList) {
// commentVo.setCommentList(listMap.get(commentVo.getId()));
// }
return DocResponseJson.ok(pageCommentList);
}
@PostMapping("/delete")

View File

@@ -25,7 +25,8 @@ import com.zyplayer.doc.data.utils.CacheUtil;
import com.zyplayer.doc.wiki.controller.vo.WikiPageContentVo;
import com.zyplayer.doc.wiki.controller.vo.WikiPageVo;
import com.zyplayer.doc.wiki.framework.consts.SpaceType;
import com.zyplayer.doc.wiki.service.WikiPageAuthService;
import com.zyplayer.doc.wiki.service.common.WikiPageAuthService;
import com.zyplayer.doc.wiki.service.git.GitService;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.dozer.Mapper;
@@ -73,6 +74,8 @@ public class WikiPageController {
@Resource
UserMessageService userMessageService;
@Resource
GitService gitService;
@Resource
Mapper mapper;
@Autowired(required = false)
EsWikiPageService esWikiPageService;
@@ -278,6 +281,8 @@ public class WikiPageController {
} else {
logger.warn("未开启elasticsearch服务建议开启");
}
// 提交历史版本记录
gitService.commitAndAddHistory(wikiPage.getId(), content);
return DocResponseJson.ok(wikiPage);
}

View File

@@ -2,7 +2,6 @@ package com.zyplayer.doc.wiki.controller;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.util.RandomUtil;
import com.alibaba.fastjson.JSON;
import com.zyplayer.doc.core.annotation.AuthMan;
import com.zyplayer.doc.core.json.DocResponseJson;
import com.zyplayer.doc.core.json.ResponseJson;
@@ -18,7 +17,7 @@ import com.zyplayer.doc.data.service.manage.UserMessageService;
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 com.zyplayer.doc.wiki.service.WikiPageAuthService;
import com.zyplayer.doc.wiki.service.common.WikiPageAuthService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;

View File

@@ -0,0 +1,81 @@
package com.zyplayer.doc.wiki.controller;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zyplayer.doc.core.annotation.AuthMan;
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.*;
import com.zyplayer.doc.data.repository.support.consts.UserMsgSysType;
import com.zyplayer.doc.data.repository.support.consts.UserMsgType;
import com.zyplayer.doc.data.service.manage.*;
import com.zyplayer.doc.wiki.framework.consts.SpaceType;
import com.zyplayer.doc.wiki.service.git.GitService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
/**
* 文档控制器
*
* @author 暮光:城中城
* @since 2019年2月17日
*/
@AuthMan
@RestController
@RequestMapping("/zyplayer-doc-wiki/page/history")
public class WikiPageHistoryController {
private static Logger logger = LoggerFactory.getLogger(WikiPageHistoryController.class);
@Resource
WikiPageHistoryService wikiPageHistoryService;
@Resource
WikiSpaceService wikiSpaceService;
@Resource
WikiPageService wikiPageService;
@Resource
GitService gitService;
@PostMapping("/list")
public ResponseJson<List<WikiPageHistory>> list(Long pageId, Integer pageNum) {
DocUserDetails currentUser = DocUserUtil.getCurrentUser();
WikiPage wikiPageSel = wikiPageService.getById(pageId);
WikiSpace wikiSpaceSel = wikiSpaceService.getById(wikiPageSel.getSpaceId());
// 私人空间
if (SpaceType.isOthersPrivate(wikiSpaceSel.getType(), currentUser.getUserId(), wikiSpaceSel.getCreateUserId())) {
return DocResponseJson.warn("您没有权限查看该空间的文章详情!");
}
UpdateWrapper<WikiPageHistory> wrapper = new UpdateWrapper<>();
wrapper.eq("page_id", pageId);
wrapper.eq("del_flag", 0);
IPage<WikiPageHistory> page = new Page<>(pageNum, 20, false);
wikiPageHistoryService.page(page, wrapper);
return DocResponseJson.ok(page);
}
@PostMapping("/detail")
public ResponseJson<Object> detail(Long id) {
WikiPageHistory wikiPageHistory = wikiPageHistoryService.getById(id);
if (wikiPageHistory == null) {
return DocResponseJson.warn("未找到相关记录");
}
DocUserDetails currentUser = DocUserUtil.getCurrentUser();
WikiPage wikiPageSel = wikiPageService.getById(wikiPageHistory.getPageId());
WikiSpace wikiSpaceSel = wikiSpaceService.getById(wikiPageSel.getSpaceId());
// 私人空间
if (SpaceType.isOthersPrivate(wikiSpaceSel.getType(), currentUser.getUserId(), wikiSpaceSel.getCreateUserId())) {
return DocResponseJson.warn("您没有权限查看该空间的文章详情!");
}
String pageHistory = gitService.getPageHistory(wikiPageHistory.getGitCommitId(), wikiPageHistory.getPageId());
return DocResponseJson.ok(pageHistory);
}
}

View File

@@ -1,4 +1,4 @@
package com.zyplayer.doc.wiki.service;
package com.zyplayer.doc.wiki.service.common;
import com.zyplayer.doc.data.config.security.DocUserUtil;
import com.zyplayer.doc.data.repository.manage.entity.WikiSpace;

View File

@@ -0,0 +1,133 @@
package com.zyplayer.doc.wiki.service.git;
import cn.hutool.core.io.FileUtil;
import com.zyplayer.doc.data.config.security.DocUserDetails;
import com.zyplayer.doc.data.config.security.DocUserUtil;
import com.zyplayer.doc.data.repository.manage.entity.WikiPageHistory;
import com.zyplayer.doc.data.service.manage.WikiPageHistoryService;
import org.apache.commons.collections.CollectionUtils;
import org.eclipse.jgit.api.Git;
import org.eclipse.jgit.api.Status;
import org.eclipse.jgit.api.errors.GitAPIException;
import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.ObjectLoader;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.revwalk.RevCommit;
import org.eclipse.jgit.revwalk.RevWalk;
import org.eclipse.jgit.treewalk.TreeWalk;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import java.io.File;
import java.io.IOException;
import java.util.Date;
import java.util.Set;
/**
* git管理相关服务
*
* @author 暮光:城中城
* @since 2020年9月5日
*/
@Service
public class GitService {
private static Logger logger = LoggerFactory.getLogger(GitService.class);
@Value("${zyplayer.doc.wiki.git-file-path:''}")
private String gitFilePath;
@Resource
WikiPageHistoryService wikiPageHistoryService;
/**
* 提交和写历史记录
*/
public void commitAndAddHistory(Long pageId, String content) {
String commitId = this.writeAndCommit(pageId, content);
// 保存历史记录
if (commitId != null) {
DocUserDetails currentUser = DocUserUtil.getCurrentUser();
WikiPageHistory entity = new WikiPageHistory();
entity.setPageId(pageId);
entity.setCreateTime(new Date());
entity.setDelFlag(0);
entity.setGitCommitId(commitId);
entity.setCreateUserId(currentUser.getUserId());
entity.setCreateUserName(currentUser.getUsername());
wikiPageHistoryService.save(entity);
}
}
/**
* 把内容写入文件并提交git
*/
private synchronized String writeAndCommit(Long pageId, String content) {
try {
// 初始化git仓库
File dirFile = new File(this.getGitPath());
Git git = Git.init().setGitDir(dirFile).setDirectory(dirFile.getParentFile()).call();
// 修改文件内容
FileUtil.writeString(content, this.getGitPagePath(pageId), "utf-8");
// git提交
if (git.status().call().isClean()) {
logger.info("no changed");
return null;
}
git.add().addFilepattern(".").call();
Status status = git.status().call();
Set<String> missing = status.getMissing();
if (CollectionUtils.isNotEmpty(missing)) {
for (String f : missing) {
logger.info("missing file: {}", f);
git.rm().addFilepattern(f).call();
}
}
Set<String> removed = status.getRemoved();
if (CollectionUtils.isNotEmpty(removed)) {
for (String f : removed) {
logger.info("remove file: {}", f);
git.rm().addFilepattern(f).call();
}
}
RevCommit commit = git.commit().setMessage("commit").call();
logger.info("commit id: {}", commit.getName());
return commit.getName();
} catch (Exception e) {
logger.error("git仓库提交失败", e);
}
return null;
}
public String getPageHistory(String objId, Long pageId) {
try {
Git git = Git.open(new File(this.getGitPath()));
Repository repository = git.getRepository();
RevCommit revCommit = new RevWalk(repository).parseCommit(ObjectId.fromString(objId));
TreeWalk treeWalk = TreeWalk.forPath(repository, this.getGitPageFile(pageId), revCommit.getTree());
treeWalk.setRecursive(false);
ObjectId blobId = treeWalk.getObjectId(0);
ObjectLoader loader = repository.open(blobId);
return new String(loader.getBytes());
} catch (Exception e) {
logger.error("获取git文件内容失败", e);
return null;
}
}
private String getGitPath() {
return gitFilePath + "/.git";
}
private String getGitPageFile(Long pageId) {
return pageId + ".txt";
}
private String getGitPagePath(Long pageId) {
return gitFilePath + "/" + this.getGitPageFile(pageId);
}
}

View File

@@ -0,0 +1,81 @@
//package com.zyplayer.doc.wiki.service.git;
//
//import org.apache.commons.collections.CollectionUtils;
//import org.eclipse.jgit.api.Git;
//import org.eclipse.jgit.api.Status;
//import org.eclipse.jgit.api.errors.GitAPIException;
//import org.eclipse.jgit.lib.ObjectId;
//import org.eclipse.jgit.lib.ObjectLoader;
//import org.eclipse.jgit.lib.Repository;
//import org.eclipse.jgit.revwalk.RevCommit;
//import org.eclipse.jgit.revwalk.RevWalk;
//import org.eclipse.jgit.treewalk.TreeWalk;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//
//import java.io.File;
//import java.util.Set;
//
//public class GitTest {
// private static Logger logger = LoggerFactory.getLogger(GitTest.class);
//
// private static final String LOCAL_PATH = "d:/zyplayerDoc/wikiGitFiles/.git";
//
// /**
// * 提交
// */
// private static String commitFiles() {
// try {
// Git git = Git.open(new File(LOCAL_PATH));
// if (git.status().call().isClean()) {
// logger.info("no changed");
// return null;
// }
// git.add().addFilepattern(".").call();
// Status status = git.status().call();
// Set<String> missing = status.getMissing();
// if (CollectionUtils.isNotEmpty(missing)) {
// for (String f : missing) {
// logger.info("missing file: {}", f);
// git.rm().addFilepattern(f).call();
// }
// }
// Set<String> removed = status.getRemoved();
// if (CollectionUtils.isNotEmpty(removed)) {
// for (String f : removed) {
// logger.info("remove file: {}", f);
// git.rm().addFilepattern(f).call();
// }
// }
// RevCommit commit = git.commit().setMessage("commit").call();
// logger.info("commit id: {}", commit.getName());
// return commit.getName();
// } catch (Exception e) {
// e.printStackTrace();
// }
// return null;
// }
//
// private static void init() throws GitAPIException {
// File dirFile = new File(LOCAL_PATH);
// Git.init().setGitDir(dirFile).setDirectory(dirFile.getParentFile()).call();
// }
//
// private static void getFile(String objId, String entryPath) throws Exception {
// Git git = Git.open(new File(LOCAL_PATH));
// Repository repository = git.getRepository();
// RevCommit revCommit = new RevWalk(repository).parseCommit(ObjectId.fromString(objId));
// TreeWalk treeWalk = TreeWalk.forPath(repository, entryPath, revCommit.getTree());
// treeWalk.setRecursive(false);
// ObjectId blobId = treeWalk.getObjectId(0);
// ObjectLoader loader = repository.open(blobId);
// String fileContent = new String(loader.getBytes());
// logger.info("fileContent: {}", fileContent);
// }
//
// public static void main(String[] args) throws Exception {
//// init();
//// commitFiles();
// getFile("b47305c88251b7473928640b1f5346b40bb7387e", "14.txt");
// }
//}

View File

@@ -1 +0,0 @@
body,html{margin:0;padding:0}#app,.el-container,.el-menu,.global-layout-vue,body,html{height:100%}.el-header{background-color:#1d4e89!important;color:#333;line-height:40px;text-align:right;height:40px!important}.icon-collapse{float:left;font-size:25px;color:#aaa;margin-top:8px;cursor:pointer}.icon-collapse:hover{color:#eee}.head-icon{margin-right:15px;font-size:16px;cursor:pointer;color:#fff}.header-user-message .page-info-box{text-align:right;margin-top:10px}#app[data-v-8f7ddbbc],body[data-v-8f7ddbbc],html[data-v-8f7ddbbc]{margin:0;padding:0;height:100%}pre[data-v-8f7ddbbc]{margin:0;white-space:pre-wrap;font-size:14px;font-family:auto}.el-menu[data-v-8f7ddbbc]{-webkit-box-sizing:border-box;box-sizing:border-box;border-right:0;margin-right:3px}.el-header[data-v-8f7ddbbc]{background-color:#409eff;color:#333;line-height:40px;text-align:right;height:40px!important}.doc-body-box[data-v-8f7ddbbc]{overflow-x:hidden;overflow-y:auto;width:100%;padding:10px;border-left:1px solid #f1f1f1;-webkit-box-sizing:border-box;box-sizing:border-box}.el-tree[data-v-8f7ddbbc]{margin-right:3px}.logo[data-v-8f7ddbbc]{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[data-v-8f7ddbbc]{float:left;font-size:25px;color:#aaa;cursor:pointer;position:fixed}.icon-collapse[data-v-8f7ddbbc]:hover{color:#ccc}.comment-box .head[data-v-8f7ddbbc]{float:left;background-color:#ccc;border-radius:50%;margin-right:10px;width:45px;height:45px;line-height:45px;text-align:center;color:#fff}.build-info[data-v-8f7ddbbc]{position:fixed;bottom:0;left:0;background:#fafafa;width:240px;text-align:center;padding:5px 0;color:#aaa;font-size:12px}.build-info span[data-v-8f7ddbbc]{color:#4183c4;cursor:pointer}

View File

@@ -0,0 +1 @@
::-webkit-scrollbar{width:6px;height:9px;-webkit-appearance:none}::-webkit-scrollbar-thumb{background:#ddd;border-radius:10px}::-webkit-scrollbar-track-piece{background:#eee}body,html{margin:0;padding:0}#app,.el-container,.el-menu,.global-layout-vue,body,html{height:100%}.el-header{background-color:#1d4e89!important;color:#333;line-height:40px;text-align:right;height:40px!important}.icon-collapse{float:left;font-size:25px;color:#aaa;margin-top:8px;cursor:pointer}.icon-collapse:hover{color:#eee}.head-icon{margin-right:15px;font-size:16px;cursor:pointer;color:#fff}.header-user-message .page-info-box{text-align:right;margin-top:10px}#app[data-v-8f7ddbbc],body[data-v-8f7ddbbc],html[data-v-8f7ddbbc]{margin:0;padding:0;height:100%}pre[data-v-8f7ddbbc]{margin:0;white-space:pre-wrap;font-size:14px;font-family:auto}.el-menu[data-v-8f7ddbbc]{-webkit-box-sizing:border-box;box-sizing:border-box;border-right:0;margin-right:3px}.el-header[data-v-8f7ddbbc]{background-color:#409eff;color:#333;line-height:40px;text-align:right;height:40px!important}.doc-body-box[data-v-8f7ddbbc]{overflow-x:hidden;overflow-y:auto;width:100%;padding:10px;border-left:1px solid #f1f1f1;-webkit-box-sizing:border-box;box-sizing:border-box}.el-tree[data-v-8f7ddbbc]{margin-right:3px}.logo[data-v-8f7ddbbc]{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[data-v-8f7ddbbc]{float:left;font-size:25px;color:#aaa;cursor:pointer;position:fixed}.icon-collapse[data-v-8f7ddbbc]:hover{color:#ccc}.comment-box .head[data-v-8f7ddbbc]{float:left;background-color:#ccc;border-radius:50%;margin-right:10px;width:45px;height:45px;line-height:45px;text-align:center;color:#fff}.build-info[data-v-8f7ddbbc]{position:fixed;bottom:0;left:0;background:#fafafa;width:240px;text-align:center;padding:5px 0;color:#aaa;font-size:12px}.build-info span[data-v-8f7ddbbc]{color:#4183c4;cursor:pointer}

View File

@@ -1 +0,0 @@
.page-show-vue{width:80%;margin:0 auto;padding:20px 0}.page-show-vue .icon-collapse{float:left;font-size:25px;color:#aaa;margin-top:8px;cursor:pointer}.page-show-vue .icon-collapse:hover{color:#eee}.page-show-vue .wiki-title{font-size:20px;text-align:center;font-weight:700}.page-show-vue .create-user-time{margin-right:20px}.page-show-vue .wiki-author{font-size:14px;color:#888;padding:20px 0;height:40px;line-height:40px}.page-show-vue .wiki-content{font-size:14px}.page-show-vue .wiki-content.w-e-text{overflow-y:auto}.page-show-vue .wiki-content.w-e-text img{cursor:auto}.page-show-vue .wiki-content.w-e-text img:hover{-webkit-box-shadow:unset;box-shadow:unset}.page-show-vue .upload-page-file .el-upload-list{display:none}.page-show-vue .is-link{color:#1e88e5;cursor:pointer}.page-show-vue #newPageContentDiv .w-e-text-container{height:600px!important}.page-show-vue .comment-box .head{float:left;background-color:#ccc;border-radius:50%;margin-right:10px;width:45px;height:45px;line-height:45px;text-align:center;color:#fff}

View File

@@ -0,0 +1 @@
.page-show-vue{height:100%}.page-show-vue .icon-collapse{float:left;font-size:25px;color:#aaa;margin-top:8px;cursor:pointer}.page-show-vue .icon-collapse:hover{color:#eee}.page-show-vue .wiki-title{font-size:20px;text-align:center;font-weight:700}.page-show-vue .create-user-time{margin-right:20px}.page-show-vue .wiki-author{font-size:14px;color:#888;padding:20px 0;height:40px;line-height:40px}.page-show-vue .wiki-content{font-size:14px}.page-show-vue .wiki-content.w-e-text{overflow-y:auto}.page-show-vue .wiki-content.w-e-text img{cursor:auto}.page-show-vue .wiki-content.w-e-text img:hover{-webkit-box-shadow:unset;box-shadow:unset}.page-show-vue .upload-page-file .el-upload-list{display:none}.page-show-vue .is-link{color:#1e88e5;cursor:pointer}.page-show-vue #newPageContentDiv .w-e-text-container{height:600px!important}.page-show-vue .head{float:left;background-color:#ccc;border-radius:50%;margin-right:10px;width:45px;height:45px;line-height:45px;text-align:center;color:#fff}.page-show-vue .el-tabs__header{margin:0}.page-show-vue .el-tabs__nav-wrap{padding:0 20px}.page-show-vue .close-action-tab{position:absolute;right:15px;top:12px;cursor:pointer;z-index:1}.page-show-vue .action-tab-box{height:calc(100vh - 120px);overflow:auto;padding:20px 10px}.page-show-vue .action-box-empty{text-align:center;padding-top:30px;color:#888;font-size:14px}.page-show-vue .history-item{height:55px;line-height:25px;cursor:pointer;vertical-align:middle}.page-show-vue .history-loading-status{margin-left:5px;color:#888}.page-show-vue .el-timeline{-webkit-padding-start:0;padding-inline-start:0}.page-show-vue .comment-user-name{margin-bottom:10px}.page-show-vue .comment-content{padding:0;color:#666;margin:0;white-space:pre-wrap;word-wrap:break-word;line-height:20px}.page-show-vue .comment-input-box{position:absolute;bottom:0;width:100%;background:#fff;border-top:1px solid #f1f1f1}.page-show-vue .comment-input-box textarea{resize:none;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box;border:0;outline:none!important;padding:10px}.page-show-vue .comment-card .comment-user-name .el-icon-delete{color:#888;font-size:13px;cursor:pointer;float:right;display:none}.page-show-vue .comment-card:hover .comment-user-name .el-icon-delete{display:inline-block}

View File

@@ -1 +1 @@
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=favicon-wiki.png><title>WIKI文档管理系统</title><link href=css/chunk-009efa60.c1509684.css rel=prefetch><link href=css/chunk-0741282a.1750663f.css rel=prefetch><link href=css/chunk-27da65ce.80051123.css rel=prefetch><link href=css/chunk-32cc5643.5a5b2ca1.css rel=prefetch><link href=css/chunk-34407190.57bbfb51.css rel=prefetch><link href=css/chunk-4b763d50.7e74e765.css rel=prefetch><link href=css/chunk-5544a2b8.17d2b8a1.css rel=prefetch><link href=css/chunk-578c28a7.83c6d32d.css rel=prefetch><link href=css/chunk-5dc97978.ec6236ec.css rel=prefetch><link href=js/chunk-009efa60.dbe73c24.js rel=prefetch><link href=js/chunk-0741282a.d128d142.js rel=prefetch><link href=js/chunk-27da65ce.e6f0653d.js rel=prefetch><link href=js/chunk-2d207ece.20edf665.js rel=prefetch><link href=js/chunk-2d20f55a.217546ad.js rel=prefetch><link href=js/chunk-32cc5643.fcf57a84.js rel=prefetch><link href=js/chunk-34407190.69ced152.js rel=prefetch><link href=js/chunk-4b763d50.80332c84.js rel=prefetch><link href=js/chunk-5544a2b8.8d8ead6e.js rel=prefetch><link href=js/chunk-578c28a7.54a578cc.js rel=prefetch><link href=js/chunk-5dc97978.1238356c.js rel=prefetch><link href=css/app.027f7b0c.css rel=preload as=style><link href=css/chunk-vendors.43fc3011.css rel=preload as=style><link href=js/app.f824fe0e.js rel=preload as=script><link href=js/chunk-vendors.4d2ae4cf.js rel=preload as=script><link href=css/chunk-vendors.43fc3011.css rel=stylesheet><link href=css/app.027f7b0c.css rel=stylesheet></head><body><noscript><strong>We're sorry but zyplayer-wiki-ui doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=js/chunk-vendors.4d2ae4cf.js></script><script src=js/app.f824fe0e.js></script></body></html>
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=favicon-wiki.png><title>WIKI文档管理系统</title><link href=css/chunk-009efa60.c1509684.css rel=prefetch><link href=css/chunk-0741282a.1750663f.css rel=prefetch><link href=css/chunk-27da65ce.febce5f7.css rel=prefetch><link href=css/chunk-32cc5643.5a5b2ca1.css rel=prefetch><link href=css/chunk-34407190.57bbfb51.css rel=prefetch><link href=css/chunk-4b763d50.7e74e765.css rel=prefetch><link href=css/chunk-5544a2b8.17d2b8a1.css rel=prefetch><link href=css/chunk-578c28a7.83c6d32d.css rel=prefetch><link href=css/chunk-5dc97978.ec6236ec.css rel=prefetch><link href=js/chunk-009efa60.9b21a8c7.js rel=prefetch><link href=js/chunk-0741282a.d128d142.js rel=prefetch><link href=js/chunk-27da65ce.08eb4051.js rel=prefetch><link href=js/chunk-2d207ece.20edf665.js rel=prefetch><link href=js/chunk-2d20f55a.217546ad.js rel=prefetch><link href=js/chunk-32cc5643.fcf57a84.js rel=prefetch><link href=js/chunk-34407190.69ced152.js rel=prefetch><link href=js/chunk-4b763d50.80332c84.js rel=prefetch><link href=js/chunk-5544a2b8.a272f03c.js rel=prefetch><link href=js/chunk-578c28a7.54a578cc.js rel=prefetch><link href=js/chunk-5dc97978.1238356c.js rel=prefetch><link href=css/app.d1dc89b9.css rel=preload as=style><link href=css/chunk-vendors.43fc3011.css rel=preload as=style><link href=js/app.8b362cf3.js rel=preload as=script><link href=js/chunk-vendors.4d2ae4cf.js rel=preload as=script><link href=css/chunk-vendors.43fc3011.css rel=stylesheet><link href=css/app.d1dc89b9.css rel=stylesheet></head><body><noscript><strong>We're sorry but zyplayer-wiki-ui doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=js/chunk-vendors.4d2ae4cf.js></script><script src=js/app.8b362cf3.js></script></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long