diff --git a/zyplayer-doc-data/src/main/java/com/zyplayer/doc/data/repository/manage/entity/WikiPage.java b/zyplayer-doc-data/src/main/java/com/zyplayer/doc/data/repository/manage/entity/WikiPage.java index 93fdc2b1..2a233590 100644 --- a/zyplayer-doc-data/src/main/java/com/zyplayer/doc/data/repository/manage/entity/WikiPage.java +++ b/zyplayer-doc-data/src/main/java/com/zyplayer/doc/data/repository/manage/entity/WikiPage.java @@ -12,7 +12,7 @@ import java.util.Date; *
* * @author 暮光:城中城 - * @since 2019-02-27 + * @since 2019-02-24 */ public class WikiPage implements Serializable { @@ -47,7 +47,12 @@ public class WikiPage implements Serializable { /** * 创建人ID */ - private Long createUid; + private Long createUserId; + + /** + * 创建人名字 + */ + private String createUserName; /** * 创建时间 @@ -57,7 +62,12 @@ public class WikiPage implements Serializable { /** * 修改人ID */ - private Long updateUid; + private Long updateUserId; + + /** + * 修改人名字 + */ + private String updateUserName; /** * 修改时间 @@ -104,12 +114,19 @@ public class WikiPage implements Serializable { public void setNodeType(Integer nodeType) { this.nodeType = nodeType; } - public Long getCreateUid() { - return createUid; + public Long getCreateUserId() { + return createUserId; } - public void setCreateUid(Long createUid) { - this.createUid = createUid; + 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; @@ -118,12 +135,19 @@ public class WikiPage implements Serializable { public void setCreateTime(Date createTime) { this.createTime = createTime; } - public Long getUpdateUid() { - return updateUid; + public Long getUpdateUserId() { + return updateUserId; } - public void setUpdateUid(Long updateUid) { - this.updateUid = updateUid; + public void setUpdateUserId(Long updateUserId) { + this.updateUserId = updateUserId; + } + public String getUpdateUserName() { + return updateUserName; + } + + public void setUpdateUserName(String updateUserName) { + this.updateUserName = updateUserName; } public Date getUpdateTime() { return updateTime; @@ -148,9 +172,11 @@ public class WikiPage implements Serializable { ", name=" + name + ", parentId=" + parentId + ", nodeType=" + nodeType + - ", createUid=" + createUid + + ", createUserId=" + createUserId + + ", createUserName=" + createUserName + ", createTime=" + createTime + - ", updateUid=" + updateUid + + ", updateUserId=" + updateUserId + + ", updateUserName=" + updateUserName + ", updateTime=" + updateTime + ", delFlag=" + delFlag + "}"; diff --git a/zyplayer-doc-data/src/main/java/com/zyplayer/doc/data/repository/manage/entity/WikiPageComment.java b/zyplayer-doc-data/src/main/java/com/zyplayer/doc/data/repository/manage/entity/WikiPageComment.java index 0f7c3d53..56f11c49 100644 --- a/zyplayer-doc-data/src/main/java/com/zyplayer/doc/data/repository/manage/entity/WikiPageComment.java +++ b/zyplayer-doc-data/src/main/java/com/zyplayer/doc/data/repository/manage/entity/WikiPageComment.java @@ -7,11 +7,11 @@ import java.io.Serializable; /** *- * + * *
* * @author 暮光:城中城 - * @since 2019-02-26 + * @since 2019-02-24 */ public class WikiPageComment implements Serializable { @@ -41,7 +41,12 @@ public class WikiPageComment implements Serializable { /** * 创建人ID */ - private Long createUid; + private Long createUserId; + + /** + * 创建人名字 + */ + private String createUserName; /** * 创建时间 @@ -81,12 +86,19 @@ public class WikiPageComment implements Serializable { public void setContent(String content) { this.content = content; } - public Long getCreateUid() { - return createUid; + public Long getCreateUserId() { + return createUserId; } - public void setCreateUid(Long createUid) { - this.createUid = createUid; + 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; @@ -110,7 +122,8 @@ public class WikiPageComment implements Serializable { ", pageId=" + pageId + ", parentId=" + parentId + ", content=" + content + - ", createUid=" + createUid + + ", createUserId=" + createUserId + + ", createUserName=" + createUserName + ", createTime=" + createTime + ", delFlag=" + delFlag + "}"; diff --git a/zyplayer-doc-data/src/main/java/com/zyplayer/doc/data/repository/manage/entity/WikiPageContent.java b/zyplayer-doc-data/src/main/java/com/zyplayer/doc/data/repository/manage/entity/WikiPageContent.java index 6cbe4e2d..7c8d734e 100644 --- a/zyplayer-doc-data/src/main/java/com/zyplayer/doc/data/repository/manage/entity/WikiPageContent.java +++ b/zyplayer-doc-data/src/main/java/com/zyplayer/doc/data/repository/manage/entity/WikiPageContent.java @@ -7,11 +7,11 @@ import java.io.Serializable; /** *- * + * *
* * @author 暮光:城中城 - * @since 2019-02-26 + * @since 2019-02-24 */ public class WikiPageContent implements Serializable { @@ -36,7 +36,12 @@ public class WikiPageContent implements Serializable { /** * 创建人ID */ - private Long createUid; + private Long createUserId; + + /** + * 创建人名字 + */ + private String createUserName; /** * 创建时间 @@ -46,7 +51,12 @@ public class WikiPageContent implements Serializable { /** * 修改人ID */ - private Long updateUid; + private Long updateUserId; + + /** + * 修改人名字 + */ + private String updateUserName; /** * 修改时间 @@ -74,12 +84,19 @@ public class WikiPageContent implements Serializable { public void setContent(String content) { this.content = content; } - public Long getCreateUid() { - return createUid; + public Long getCreateUserId() { + return createUserId; } - public void setCreateUid(Long createUid) { - this.createUid = createUid; + 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; @@ -88,12 +105,19 @@ public class WikiPageContent implements Serializable { public void setCreateTime(Date createTime) { this.createTime = createTime; } - public Long getUpdateUid() { - return updateUid; + public Long getUpdateUserId() { + return updateUserId; } - public void setUpdateUid(Long updateUid) { - this.updateUid = updateUid; + public void setUpdateUserId(Long updateUserId) { + this.updateUserId = updateUserId; + } + public String getUpdateUserName() { + return updateUserName; + } + + public void setUpdateUserName(String updateUserName) { + this.updateUserName = updateUserName; } public Date getUpdateTime() { return updateTime; @@ -109,9 +133,11 @@ public class WikiPageContent implements Serializable { "id=" + id + ", pageId=" + pageId + ", content=" + content + - ", createUid=" + createUid + + ", createUserId=" + createUserId + + ", createUserName=" + createUserName + ", createTime=" + createTime + - ", updateUid=" + updateUid + + ", updateUserId=" + updateUserId + + ", updateUserName=" + updateUserName + ", updateTime=" + updateTime + "}"; } diff --git a/zyplayer-doc-data/src/main/java/com/zyplayer/doc/data/repository/manage/entity/WikiPageFile.java b/zyplayer-doc-data/src/main/java/com/zyplayer/doc/data/repository/manage/entity/WikiPageFile.java index 4273949c..d303b9c7 100644 --- a/zyplayer-doc-data/src/main/java/com/zyplayer/doc/data/repository/manage/entity/WikiPageFile.java +++ b/zyplayer-doc-data/src/main/java/com/zyplayer/doc/data/repository/manage/entity/WikiPageFile.java @@ -12,7 +12,7 @@ import java.util.Date; * * * @author 暮光:城中城 - * @since 2019-02-26 + * @since 2019-02-24 */ public class WikiPageFile implements Serializable { @@ -29,6 +29,11 @@ public class WikiPageFile implements Serializable { */ private Long pageId; + /** + * 文件名 + */ + private String fileName; + /** * 文件URL */ @@ -37,7 +42,12 @@ public class WikiPageFile implements Serializable { /** * 创建人ID */ - private Long createUid; + private Long createUserId; + + /** + * 创建人名字 + */ + private String createUserName; /** * 创建时间 @@ -47,7 +57,12 @@ public class WikiPageFile implements Serializable { /** * 修改人ID */ - private Long updateUid; + private Long updateUserId; + + /** + * 修改人名字 + */ + private String updateUserName; /** * 修改时间 @@ -73,6 +88,13 @@ public class WikiPageFile implements Serializable { public void setPageId(Long pageId) { this.pageId = pageId; } + public String getFileName() { + return fileName; + } + + public void setFileName(String fileName) { + this.fileName = fileName; + } public String getFileUrl() { return fileUrl; } @@ -80,12 +102,19 @@ public class WikiPageFile implements Serializable { public void setFileUrl(String fileUrl) { this.fileUrl = fileUrl; } - public Long getCreateUid() { - return createUid; + public Long getCreateUserId() { + return createUserId; } - public void setCreateUid(Long createUid) { - this.createUid = createUid; + 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; @@ -94,12 +123,19 @@ public class WikiPageFile implements Serializable { public void setCreateTime(Date createTime) { this.createTime = createTime; } - public Long getUpdateUid() { - return updateUid; + public Long getUpdateUserId() { + return updateUserId; } - public void setUpdateUid(Long updateUid) { - this.updateUid = updateUid; + public void setUpdateUserId(Long updateUserId) { + this.updateUserId = updateUserId; + } + public String getUpdateUserName() { + return updateUserName; + } + + public void setUpdateUserName(String updateUserName) { + this.updateUserName = updateUserName; } public Date getUpdateTime() { return updateTime; @@ -121,10 +157,13 @@ public class WikiPageFile implements Serializable { return "WikiPageFile{" + "id=" + id + ", pageId=" + pageId + + ", fileName=" + fileName + ", fileUrl=" + fileUrl + - ", createUid=" + createUid + + ", createUserId=" + createUserId + + ", createUserName=" + createUserName + ", createTime=" + createTime + - ", updateUid=" + updateUid + + ", updateUserId=" + updateUserId + + ", updateUserName=" + updateUserName + ", updateTime=" + updateTime + ", delFlag=" + delFlag + "}"; diff --git a/zyplayer-doc-data/src/main/java/com/zyplayer/doc/data/repository/manage/entity/WikiPageZan.java b/zyplayer-doc-data/src/main/java/com/zyplayer/doc/data/repository/manage/entity/WikiPageZan.java index 80b7143d..4a5dd49a 100644 --- a/zyplayer-doc-data/src/main/java/com/zyplayer/doc/data/repository/manage/entity/WikiPageZan.java +++ b/zyplayer-doc-data/src/main/java/com/zyplayer/doc/data/repository/manage/entity/WikiPageZan.java @@ -1,10 +1,9 @@ package com.zyplayer.doc.data.repository.manage.entity; import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; - -import java.io.Serializable; import java.util.Date; +import com.baomidou.mybatisplus.annotation.TableId; +import java.io.Serializable; /** *@@ -12,7 +11,7 @@ import java.util.Date; *
* * @author 暮光:城中城 - * @since 2019-02-26 + * @since 2019-02-24 */ public class WikiPageZan implements Serializable { @@ -37,7 +36,12 @@ public class WikiPageZan implements Serializable { /** * 创建人ID */ - private Long createUid; + private Long createUserId; + + /** + * 创建人名字 + */ + private String createUserName; /** * 创建时间 @@ -65,12 +69,19 @@ public class WikiPageZan implements Serializable { public void setCommentId(Long commentId) { this.commentId = commentId; } - public Long getCreateUid() { - return createUid; + public Long getCreateUserId() { + return createUserId; } - public void setCreateUid(Long createUid) { - this.createUid = createUid; + 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; @@ -86,7 +97,8 @@ public class WikiPageZan implements Serializable { "id=" + id + ", pageId=" + pageId + ", commentId=" + commentId + - ", createUid=" + createUid + + ", createUserId=" + createUserId + + ", createUserName=" + createUserName + ", createTime=" + createTime + "}"; } diff --git a/zyplayer-doc-data/src/main/java/com/zyplayer/doc/data/repository/manage/entity/WikiSpace.java b/zyplayer-doc-data/src/main/java/com/zyplayer/doc/data/repository/manage/entity/WikiSpace.java index 78943152..e02fe603 100644 --- a/zyplayer-doc-data/src/main/java/com/zyplayer/doc/data/repository/manage/entity/WikiSpace.java +++ b/zyplayer-doc-data/src/main/java/com/zyplayer/doc/data/repository/manage/entity/WikiSpace.java @@ -1,10 +1,9 @@ package com.zyplayer.doc.data.repository.manage.entity; import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; - -import java.io.Serializable; import java.util.Date; +import com.baomidou.mybatisplus.annotation.TableId; +import java.io.Serializable; /** *@@ -12,7 +11,7 @@ import java.util.Date; *
* * @author 暮光:城中城 - * @since 2019-02-26 + * @since 2019-02-24 */ public class WikiSpace implements Serializable { @@ -42,7 +41,12 @@ public class WikiSpace implements Serializable { /** * 创建人ID */ - private Long createUid; + private Long createUserId; + + /** + * 创建人名字 + */ + private String createUserName; /** * 创建时间 @@ -77,12 +81,19 @@ public class WikiSpace implements Serializable { public void setExplain(String explain) { this.explain = explain; } - public Long getCreateUid() { - return createUid; + public Long getCreateUserId() { + return createUserId; } - public void setCreateUid(Long createUid) { - this.createUid = createUid; + 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; @@ -99,7 +110,8 @@ public class WikiSpace implements Serializable { ", name=" + name + ", type=" + type + ", explain=" + explain + - ", createUid=" + createUid + + ", createUserId=" + createUserId + + ", createUserName=" + createUserName + ", createTime=" + createTime + "}"; } diff --git a/zyplayer-doc-data/src/main/java/com/zyplayer/doc/data/repository/manage/mapper/WikiPageCommentMapper.java b/zyplayer-doc-data/src/main/java/com/zyplayer/doc/data/repository/manage/mapper/WikiPageCommentMapper.java index 7429a0c9..4d3801a4 100644 --- a/zyplayer-doc-data/src/main/java/com/zyplayer/doc/data/repository/manage/mapper/WikiPageCommentMapper.java +++ b/zyplayer-doc-data/src/main/java/com/zyplayer/doc/data/repository/manage/mapper/WikiPageCommentMapper.java @@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; * * * @author 暮光:城中城 - * @since 2019-02-26 + * @since 2019-02-24 */ public interface WikiPageCommentMapper extends BaseMapper测试1测试1测试1测试1测试1
', 1, NULL, '2019-02-24 17:51:56', 1, NULL, '2019-02-24 17:51:56'); +INSERT INTO `wiki_page_content` VALUES (2, 8, '测试2测试2测试2测试2
', 1, NULL, '2019-02-24 17:51:56', 1, NULL, '2019-02-24 17:51:56'); +INSERT INTO `wiki_page_content` VALUES (3, 9, '测试3测试3测试3测试3测试3
', 1, NULL, '2019-02-24 17:51:56', 1, NULL, '2019-02-24 17:51:56'); +INSERT INTO `wiki_page_content` VALUES (4, 10, '测试4测试4测试4测试4测试4
', 1, NULL, '2019-02-24 17:51:56', 1, NULL, '2019-02-24 17:51:56'); +INSERT INTO `wiki_page_content` VALUES (5, 11, '测试5测试5测试5测试5
', 1, NULL, '2019-02-24 17:51:56', 1, NULL, '2019-02-24 17:51:56'); +INSERT INTO `wiki_page_content` VALUES (6, 12, '测试6测试6测试6测试6测试6
', 1, NULL, '2019-02-24 17:51:56', 1, NULL, '2019-02-24 17:51:56'); +INSERT INTO `wiki_page_content` VALUES (7, 13, '欢迎使用 wangEditor 富文本编辑器
测试7
', 1, NULL, '2019-02-24 17:51:56', NULL, NULL, '2019-02-24 17:51:56'); +INSERT INTO `wiki_page_content` VALUES (8, 14, '测试7 测试7测试7测试7
', 1, NULL, '2019-02-24 17:51:56', 1, NULL, '2019-02-24 17:51:56'); -- ---------------------------- -- Table structure for wiki_page_file @@ -150,14 +187,22 @@ 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_url` varchar(50) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL COMMENT '文件URL', - `create_uid` 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', + `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_uid` bigint(20) NULL DEFAULT NULL COMMENT '修改人ID', + `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=删除', PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic; +) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of wiki_page_file +-- ---------------------------- +INSERT INTO `wiki_page_file` VALUES (1, 7, '开发规范.doc', 'http://www.baidu.com', 1, '暮光:城中城', '2019-02-24 17:51:56', NULL, NULL, NULL, 0); -- ---------------------------- -- Table structure for wiki_page_zan @@ -167,7 +212,8 @@ 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_uid` bigint(20) NULL DEFAULT NULL COMMENT '创建人ID', + `create_user_id` bigint(20) NULL DEFAULT NULL COMMENT '创建人ID', + `create_user_name` varchar(20) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL COMMENT '创建人名字', `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic; @@ -178,13 +224,19 @@ CREATE TABLE `wiki_page_zan` ( DROP TABLE IF EXISTS `wiki_space`; CREATE TABLE `wiki_space` ( `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键自增ID', - `name` varchar(50) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL COMMENT '空间名', + `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '空间名', `type` tinyint(4) NULL DEFAULT 1 COMMENT '空间类型 1=公司 2=个人 3=私人', - `explain` varchar(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL COMMENT '描述', - `create_uid` bigint(20) NULL DEFAULT NULL COMMENT '创建人ID', + `explain` varchar(255) 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 latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL COMMENT '创建人名字', `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic; +) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of wiki_space +-- ---------------------------- +INSERT INTO `wiki_space` VALUES (1, '研发中心', 1, NULL, 1, NULL, '2019-02-24 17:51:56'); -- ---------------------------- -- Table structure for zyplayer_storage @@ -193,11 +245,14 @@ 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 utf8 COLLATE utf8_general_ci 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 = 43 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '存储网页上相关的数据' ROW_FORMAT = Compact; +-- ---------------------------- +-- Records of zyplayer_storage +-- ---------------------------- SET FOREIGN_KEY_CHECKS = 1; diff --git a/zyplayer-doc-manage/src/test/java/com/zyplayer/doc/test/CreateIdTest.java b/zyplayer-doc-manage/src/test/java/com/zyplayer/doc/test/CreateIdTest.java new file mode 100644 index 00000000..aeb43b68 --- /dev/null +++ b/zyplayer-doc-manage/src/test/java/com/zyplayer/doc/test/CreateIdTest.java @@ -0,0 +1,54 @@ +package com.zyplayer.doc.test; + +/** + * 生成6位字符的ID + * + * @author 暮光:城中城 + * @since 2019年2月17日 + */ +public class CreateIdTest { + private static String convertStr = ""; + private static String[] convertArr = {"e", "6", "1", "5", "r", "Q", "W", "j", "Y", "d", "D", "m", "a", "p", "B", "C", "l", "8", "E", "t", "h", "s", "S", "u", "M", "R", "z", "g", "H", "X", "y", "L", "T", "7", "K", "I", "O", "4", "k", "o", "b", "P", "i", "U", "n", "v", "f", "3", "Z", "9", "c", "G", "w", "A", "N", "0", "x", "q", "J", "V", "F", "2"}; + // 可到这个网站把顺序打乱,就成一个新的了,http://www.fuhaoku.com/tool/daluan.html + + public static void main(String[] args) { + long baseNum = 916132832L + 100000000; + convertStr = String.join("", convertArr); + // 1 6位数 + String to62 = convert10To62(1L); + System.out.println((baseNum + 1L) + ":" + to62); + System.out.println(to62 + ":" + convert62To10(to62)); + // 555亿 6位数 + to62 = convert10To62(55555555555L); + System.out.println((baseNum + 55555555555L) + ":" + to62); + System.out.println(to62 + ":" + convert62To10(to62)); + // 5555亿 7位数 + to62 = convert10To62(555555555555L); + System.out.println((baseNum + 555555555555L) + ":" + to62); + System.out.println(to62 + ":" + convert62To10(to62)); + } + + private static String convert10To62(Long num) { + long base = 916132832L + 100000000 + num; + StringBuilder sb = new StringBuilder(); + while (base != 0) { + sb.append(convertArr[(int) (base % 62)]); + base = base / 62; + } + return sb.reverse().toString(); + } + + private static long convert62To10(String number) { + char[] charArr = number.toCharArray(); + int len = charArr.length; + long result = 0; + long base = 1; + for (int i = len - 1; i >= 0; i--) { + int index = convertStr.indexOf(charArr[i]); + result += index * base; + base *= 62; + } + return result; + } + +} diff --git a/zyplayer-doc-wiki/src/main/java/com/zyplayer/doc/wiki/controller/WikiPageCommentController.java b/zyplayer-doc-wiki/src/main/java/com/zyplayer/doc/wiki/controller/WikiPageCommentController.java index b6e251de..5cd8d003 100644 --- a/zyplayer-doc-wiki/src/main/java/com/zyplayer/doc/wiki/controller/WikiPageCommentController.java +++ b/zyplayer-doc-wiki/src/main/java/com/zyplayer/doc/wiki/controller/WikiPageCommentController.java @@ -48,7 +48,7 @@ public class WikiPageCommentController { } else { DocUserDetails currentUser = DocUserUtil.getCurrentUser(); pageComment.setCreateTime(new Date()); - pageComment.setCreateUid(currentUser.getUserId()); + pageComment.setCreateUserId(currentUser.getUserId()); wikiPageCommentService.save(pageComment); } return DocResponseJson.ok(); diff --git a/zyplayer-doc-wiki/src/main/java/com/zyplayer/doc/wiki/controller/WikiPageController.java b/zyplayer-doc-wiki/src/main/java/com/zyplayer/doc/wiki/controller/WikiPageController.java index e455c018..b00b0d36 100644 --- a/zyplayer-doc-wiki/src/main/java/com/zyplayer/doc/wiki/controller/WikiPageController.java +++ b/zyplayer-doc-wiki/src/main/java/com/zyplayer/doc/wiki/controller/WikiPageController.java @@ -7,8 +7,11 @@ 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.service.manage.WikiPageContentService; +import com.zyplayer.doc.data.service.manage.WikiPageFileService; import com.zyplayer.doc.data.service.manage.WikiPageService; +import com.zyplayer.doc.wiki.controller.vo.WikiPageContentVo; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.web.bind.annotation.PostMapping; @@ -34,6 +37,8 @@ public class WikiPageController { WikiPageService wikiPageService; @Resource WikiPageContentService wikiPageContentService; + @Resource + WikiPageFileService wikiPageFileService; @PostMapping("/list") public ResponseJson