用户支持分组,wiki空间支持按分组授权,细节优化
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
package com.zyplayer.doc.data.config.security;
|
||||
|
||||
import com.zyplayer.doc.data.utils.CachePrefix;
|
||||
import com.zyplayer.doc.data.utils.CacheUtil;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 用户工具类
|
||||
* @author 暮光:城中城
|
||||
@@ -54,6 +57,21 @@ public class DocUserUtil {
|
||||
public static void setCurrentUser(String accessToken, DocUserDetails docUser) {
|
||||
DOC_USER_DETAILS.set(docUser);
|
||||
CacheUtil.put(accessToken, docUser);
|
||||
CacheUtil.put(CachePrefix.LOGIN_USER_ID_TOKEN + docUser.getUserId(), accessToken);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置当前用户权限
|
||||
*/
|
||||
public static void setUserAuth(Long userId, Set<String> userAuthSet) {
|
||||
String userToken = CacheUtil.get(CachePrefix.LOGIN_USER_ID_TOKEN + userId);
|
||||
if (userToken != null) {
|
||||
DocUserDetails docUser = CacheUtil.get(userToken);
|
||||
if (docUser != null) {
|
||||
docUser.setAuthorities(userAuthSet);
|
||||
CacheUtil.put(userToken, docUser);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,106 @@
|
||||
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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户组
|
||||
* </p>
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2021-02-08
|
||||
*/
|
||||
public class UserGroup implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键自增ID
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 分组名
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 创建人ID
|
||||
*/
|
||||
private Long createUserId;
|
||||
|
||||
/**
|
||||
* 创建人名字
|
||||
*/
|
||||
private String createUserName;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 删除标记 0=正常 1=已删除
|
||||
*/
|
||||
private Integer delFlag;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "UserGroup{" +
|
||||
"id=" + id +
|
||||
", name=" + name +
|
||||
", createUserId=" + createUserId +
|
||||
", createUserName=" + createUserName +
|
||||
", createTime=" + createTime +
|
||||
", delFlag=" + delFlag +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,145 @@
|
||||
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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户组在各项目内的授权关系
|
||||
* </p>
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2021-02-09
|
||||
*/
|
||||
public class UserGroupAuth implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键自增ID
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 群ID
|
||||
*/
|
||||
private Long groupId;
|
||||
|
||||
/**
|
||||
* 授权数据的ID
|
||||
*/
|
||||
private Long dataId;
|
||||
|
||||
/**
|
||||
* 授权类型,依据各项目自己定义
|
||||
*/
|
||||
private Integer authType;
|
||||
|
||||
/**
|
||||
* 项目类型 1=WIKI模块 2=数据库模块
|
||||
*/
|
||||
private Integer projectType;
|
||||
|
||||
/**
|
||||
* 创建人ID
|
||||
*/
|
||||
private Long createUserId;
|
||||
|
||||
/**
|
||||
* 创建人名字
|
||||
*/
|
||||
private String createUserName;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 删除标记 0=正常 1=已删除
|
||||
*/
|
||||
private Integer delFlag;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
public Long getGroupId() {
|
||||
return groupId;
|
||||
}
|
||||
|
||||
public void setGroupId(Long groupId) {
|
||||
this.groupId = groupId;
|
||||
}
|
||||
public Long getDataId() {
|
||||
return dataId;
|
||||
}
|
||||
|
||||
public void setDataId(Long dataId) {
|
||||
this.dataId = dataId;
|
||||
}
|
||||
public Integer getProjectType() {
|
||||
return projectType;
|
||||
}
|
||||
|
||||
public void setProjectType(Integer projectType) {
|
||||
this.projectType = projectType;
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "UserGroupAuth{" +
|
||||
"id=" + id +
|
||||
", groupId=" + groupId +
|
||||
", dataId=" + dataId +
|
||||
", projectType=" + projectType +
|
||||
", createUserId=" + createUserId +
|
||||
", createUserName=" + createUserName +
|
||||
", createTime=" + createTime +
|
||||
", delFlag=" + delFlag +
|
||||
"}";
|
||||
}
|
||||
|
||||
public Integer getAuthType() {
|
||||
return authType;
|
||||
}
|
||||
|
||||
public void setAuthType(Integer authType) {
|
||||
this.authType = authType;
|
||||
}
|
||||
}
|
||||
@@ -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 2021-02-08
|
||||
*/
|
||||
public class UserGroupRelation implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键自增ID
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 群ID
|
||||
*/
|
||||
private Long groupId;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 创建人ID
|
||||
*/
|
||||
private Long createUserId;
|
||||
|
||||
/**
|
||||
* 创建人名字
|
||||
*/
|
||||
private String createUserName;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 删除标记 0=正常 1=已删除
|
||||
*/
|
||||
private Integer delFlag;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
public Long getGroupId() {
|
||||
return groupId;
|
||||
}
|
||||
|
||||
public void setGroupId(Long groupId) {
|
||||
this.groupId = groupId;
|
||||
}
|
||||
public Long getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(Long userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "UserGroupRelation{" +
|
||||
"id=" + id +
|
||||
", groupId=" + groupId +
|
||||
", userId=" + userId +
|
||||
", createUserId=" + createUserId +
|
||||
", createUserName=" + createUserName +
|
||||
", createTime=" + createTime +
|
||||
", delFlag=" + delFlag +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
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 2021-02-09
|
||||
*/
|
||||
public class UserSetting implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键自增ID
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 设置的名字
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 设置的值
|
||||
*/
|
||||
private String value;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 删除标记 0=正常 1=已删除
|
||||
*/
|
||||
private Integer delFlag;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
public Long getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(Long userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "UserSetting{" +
|
||||
"id=" + id +
|
||||
", userId=" + userId +
|
||||
", name=" + name +
|
||||
", value=" + value +
|
||||
", createTime=" + createTime +
|
||||
", delFlag=" + delFlag +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
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 2021-02-09
|
||||
*/
|
||||
public class WikiSpaceFavorite implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键自增ID
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 空间ID
|
||||
*/
|
||||
private Long spaceId;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 删除标记 0=正常 1=已删除
|
||||
*/
|
||||
private Integer delFlag;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
public Long getSpaceId() {
|
||||
return spaceId;
|
||||
}
|
||||
|
||||
public void setSpaceId(Long spaceId) {
|
||||
this.spaceId = spaceId;
|
||||
}
|
||||
public Long getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(Long userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "WikiSpaceFavorite{" +
|
||||
"id=" + id +
|
||||
", spaceId=" + spaceId +
|
||||
", userId=" + userId +
|
||||
", createTime=" + createTime +
|
||||
", delFlag=" + delFlag +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.zyplayer.doc.data.repository.manage.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.zyplayer.doc.data.repository.manage.entity.UserGroupAuth;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户组在各项目内的授权关系 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2021-02-09
|
||||
*/
|
||||
public interface UserGroupAuthMapper extends BaseMapper<UserGroupAuth> {
|
||||
|
||||
@Select("select a.id from user_group_auth a join user_group_relation b on a.group_id=b.group_id and b.user_id=#{userId} " +
|
||||
"where a.project_type=#{projectType} and a.auth_type=#{authType} and a.data_id=#{spaceId} and b.del_flag=0")
|
||||
Long haveAuth(Long spaceId, Integer projectType, Integer authType, Long userId);
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.zyplayer.doc.data.repository.manage.mapper;
|
||||
|
||||
import com.zyplayer.doc.data.repository.manage.entity.UserGroup;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.zyplayer.doc.data.repository.manage.entity.UserInfo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户组 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2021-02-08
|
||||
*/
|
||||
public interface UserGroupMapper extends BaseMapper<UserGroup> {
|
||||
|
||||
@Select("select b.id, b.user_no, b.email, b.phone, b.sex, b.user_name, b.avatar from user_group_relation a join user_info b on b.id=a.user_id where a.group_id=#{groupId} and a.del_flag=0 and b.del_flag=0")
|
||||
List<UserInfo> groupUserList(@Param("groupId") Long groupId);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.zyplayer.doc.data.repository.manage.mapper;
|
||||
|
||||
import com.zyplayer.doc.data.repository.manage.entity.UserGroupRelation;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户和用户组关系表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2021-02-08
|
||||
*/
|
||||
public interface UserGroupRelationMapper extends BaseMapper<UserGroupRelation> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.zyplayer.doc.data.repository.manage.mapper;
|
||||
|
||||
import com.zyplayer.doc.data.repository.manage.entity.UserSetting;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户设置表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2021-02-09
|
||||
*/
|
||||
public interface UserSettingMapper extends BaseMapper<UserSetting> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.zyplayer.doc.data.repository.manage.mapper;
|
||||
|
||||
import com.zyplayer.doc.data.repository.manage.entity.WikiSpaceFavorite;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户空间收藏记录表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2021-02-09
|
||||
*/
|
||||
public interface WikiSpaceFavoriteMapper extends BaseMapper<WikiSpaceFavorite> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.zyplayer.doc.data.repository.support.consts;
|
||||
|
||||
public class UserSettingConst {
|
||||
public static final String WIKI_ONLY_SHOW_FAVORITE = "wiki_only_show_favorite";
|
||||
}
|
||||
@@ -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 = { "wiki_page_history" };
|
||||
final String[] tableName = { "wiki_space_favorite", "user_setting" };
|
||||
|
||||
// 代码生成器
|
||||
AutoGenerator mpg = new AutoGenerator();
|
||||
|
||||
@@ -3,6 +3,8 @@ package com.zyplayer.doc.data.service.manage;
|
||||
import com.zyplayer.doc.data.repository.manage.entity.UserAuth;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户权限表 服务类
|
||||
@@ -13,4 +15,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
*/
|
||||
public interface UserAuthService extends IService<UserAuth> {
|
||||
|
||||
Set<String> getUserAuthSet(Long id);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.zyplayer.doc.data.service.manage;
|
||||
|
||||
import com.zyplayer.doc.data.repository.manage.entity.UserGroupAuth;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户组在各项目内的授权关系 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2021-02-09
|
||||
*/
|
||||
public interface UserGroupAuthService extends IService<UserGroupAuth> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.zyplayer.doc.data.service.manage;
|
||||
|
||||
import com.zyplayer.doc.data.repository.manage.entity.UserGroupRelation;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户和用户组关系表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2021-02-08
|
||||
*/
|
||||
public interface UserGroupRelationService extends IService<UserGroupRelation> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.zyplayer.doc.data.service.manage;
|
||||
|
||||
import com.zyplayer.doc.data.repository.manage.entity.UserGroup;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户组 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2021-02-08
|
||||
*/
|
||||
public interface UserGroupService extends IService<UserGroup> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.zyplayer.doc.data.service.manage;
|
||||
|
||||
import com.zyplayer.doc.data.repository.manage.entity.UserSetting;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户设置表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2021-02-09
|
||||
*/
|
||||
public interface UserSettingService extends IService<UserSetting> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.zyplayer.doc.data.service.manage;
|
||||
|
||||
import com.zyplayer.doc.data.repository.manage.entity.WikiSpaceFavorite;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户空间收藏记录表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2021-02-09
|
||||
*/
|
||||
public interface WikiSpaceFavoriteService extends IService<WikiSpaceFavorite> {
|
||||
|
||||
}
|
||||
@@ -1,11 +1,18 @@
|
||||
package com.zyplayer.doc.data.service.manage.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.zyplayer.doc.data.repository.manage.entity.AuthInfo;
|
||||
import com.zyplayer.doc.data.repository.manage.entity.UserAuth;
|
||||
import com.zyplayer.doc.data.repository.manage.mapper.UserAuthMapper;
|
||||
import com.zyplayer.doc.data.service.manage.AuthInfoService;
|
||||
import com.zyplayer.doc.data.service.manage.UserAuthService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户权限表 服务实现类
|
||||
@@ -17,4 +24,24 @@ import org.springframework.stereotype.Service;
|
||||
@Service
|
||||
public class UserAuthServiceImpl extends ServiceImpl<UserAuthMapper, UserAuth> implements UserAuthService {
|
||||
|
||||
@Resource
|
||||
AuthInfoService authInfoService;
|
||||
|
||||
@Override
|
||||
public Set<String> getUserAuthSet(Long id) {
|
||||
QueryWrapper<UserAuth> authWrapper = new QueryWrapper<>();
|
||||
authWrapper.eq("user_id", id).eq("del_flag", "0");
|
||||
List<UserAuth> userAuthList = this.list(authWrapper);
|
||||
Set<String> userAuthSet = Collections.emptySet();
|
||||
if (userAuthList != null && userAuthList.size() > 0) {
|
||||
List<Long> authIdList = userAuthList.stream().map(UserAuth::getAuthId).collect(Collectors.toList());
|
||||
Collection<AuthInfo> authInfoList = authInfoService.listByIds(authIdList);
|
||||
Map<Long, String> authNameMap = authInfoList.stream().collect(Collectors.toMap(AuthInfo::getId, AuthInfo::getAuthName));
|
||||
userAuthSet = userAuthList.stream().map(val -> {
|
||||
String authName = Optional.ofNullable(authNameMap.get(val.getAuthId())).orElse("");
|
||||
return authName + Optional.ofNullable(val.getAuthCustomSuffix()).orElse("");
|
||||
}).collect(Collectors.toSet());
|
||||
}
|
||||
return userAuthSet;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.zyplayer.doc.data.service.manage.impl;
|
||||
|
||||
import com.zyplayer.doc.data.repository.manage.entity.UserGroupAuth;
|
||||
import com.zyplayer.doc.data.repository.manage.mapper.UserGroupAuthMapper;
|
||||
import com.zyplayer.doc.data.service.manage.UserGroupAuthService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户组在各项目内的授权关系 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2021-02-09
|
||||
*/
|
||||
@Service
|
||||
public class UserGroupAuthServiceImpl extends ServiceImpl<UserGroupAuthMapper, UserGroupAuth> implements UserGroupAuthService {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.zyplayer.doc.data.service.manage.impl;
|
||||
|
||||
import com.zyplayer.doc.data.repository.manage.entity.UserGroupRelation;
|
||||
import com.zyplayer.doc.data.repository.manage.mapper.UserGroupRelationMapper;
|
||||
import com.zyplayer.doc.data.service.manage.UserGroupRelationService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户和用户组关系表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2021-02-08
|
||||
*/
|
||||
@Service
|
||||
public class UserGroupRelationServiceImpl extends ServiceImpl<UserGroupRelationMapper, UserGroupRelation> implements UserGroupRelationService {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.zyplayer.doc.data.service.manage.impl;
|
||||
|
||||
import com.zyplayer.doc.data.repository.manage.entity.UserGroup;
|
||||
import com.zyplayer.doc.data.repository.manage.mapper.UserGroupMapper;
|
||||
import com.zyplayer.doc.data.service.manage.UserGroupService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户组 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2021-02-08
|
||||
*/
|
||||
@Service
|
||||
public class UserGroupServiceImpl extends ServiceImpl<UserGroupMapper, UserGroup> implements UserGroupService {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.zyplayer.doc.data.service.manage.impl;
|
||||
|
||||
import com.zyplayer.doc.data.repository.manage.entity.UserSetting;
|
||||
import com.zyplayer.doc.data.repository.manage.mapper.UserSettingMapper;
|
||||
import com.zyplayer.doc.data.service.manage.UserSettingService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户设置表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2021-02-09
|
||||
*/
|
||||
@Service
|
||||
public class UserSettingServiceImpl extends ServiceImpl<UserSettingMapper, UserSetting> implements UserSettingService {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.zyplayer.doc.data.service.manage.impl;
|
||||
|
||||
import com.zyplayer.doc.data.repository.manage.entity.WikiSpaceFavorite;
|
||||
import com.zyplayer.doc.data.repository.manage.mapper.WikiSpaceFavoriteMapper;
|
||||
import com.zyplayer.doc.data.service.manage.WikiSpaceFavoriteService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户空间收藏记录表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2021-02-09
|
||||
*/
|
||||
@Service
|
||||
public class WikiSpaceFavoriteServiceImpl extends ServiceImpl<WikiSpaceFavoriteMapper, WikiSpaceFavorite> implements WikiSpaceFavoriteService {
|
||||
|
||||
}
|
||||
@@ -3,4 +3,5 @@ package com.zyplayer.doc.data.utils;
|
||||
public class CachePrefix {
|
||||
public static final String WIKI_LOCK_PAGE = "WIKI_LOCK_PAGE_";
|
||||
public static final String DB_EDITOR_DATA_CACHE = "DB_EDITOR_DATA_CACHE_";
|
||||
public static final String LOGIN_USER_ID_TOKEN = "LOGIN_USER_ID_TOKEN_";
|
||||
}
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
package com.zyplayer.doc.data.web.generator;
|
||||
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户消息表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2020-06-23
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/user-message")
|
||||
public class GeneratorUserMessageController {
|
||||
|
||||
}
|
||||
@@ -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.UserGroupAuthMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -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.UserGroupMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -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.UserGroupRelationMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -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.UserSettingMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -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.WikiSpaceFavoriteMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -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-db.png><title>数据库文档管理</title><link href=css/app.1c916a62.css rel=preload as=style><link href=css/chunk-vendors.8924efc6.css rel=preload as=style><link href=js/app.31930228.js rel=preload as=script><link href=js/chunk-vendors.306ce2df.js rel=preload as=script><link href=css/chunk-vendors.8924efc6.css rel=stylesheet><link href=css/app.1c916a62.css rel=stylesheet></head><body><noscript><strong>We're sorry but zyplayer-db-ui doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=js/chunk-vendors.306ce2df.js></script><script src=js/app.31930228.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-db.png><title>数据库文档管理</title><link href=css/app.1c916a62.css rel=preload as=style><link href=css/chunk-vendors.8924efc6.css rel=preload as=style><link href=js/app.26e84e5d.js rel=preload as=script><link href=js/chunk-vendors.306ce2df.js rel=preload as=script><link href=css/chunk-vendors.8924efc6.css rel=stylesheet><link href=css/app.1c916a62.css rel=stylesheet></head><body><noscript><strong>We're sorry but zyplayer-db-ui doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=js/chunk-vendors.306ce2df.js></script><script src=js/app.26e84e5d.js></script></body></html>
|
||||
File diff suppressed because one or more lines are too long
@@ -5,8 +5,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.zyplayer.doc.core.json.DocResponseJson;
|
||||
import com.zyplayer.doc.data.config.security.DocUserDetails;
|
||||
import com.zyplayer.doc.data.config.security.DocUserUtil;
|
||||
import com.zyplayer.doc.data.repository.manage.entity.AuthInfo;
|
||||
import com.zyplayer.doc.data.repository.manage.entity.UserAuth;
|
||||
import com.zyplayer.doc.data.repository.manage.entity.UserInfo;
|
||||
import com.zyplayer.doc.data.service.manage.AuthInfoService;
|
||||
import com.zyplayer.doc.data.service.manage.UserAuthService;
|
||||
@@ -18,8 +16,8 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.servlet.http.Cookie;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
|
||||
@RestController
|
||||
public class LoginController {
|
||||
@@ -44,19 +42,7 @@ public class LoginController {
|
||||
if (!Objects.equals(userInfo.getPassword(), pwdMd5)) {
|
||||
return DocResponseJson.warn("密码错误");
|
||||
}
|
||||
QueryWrapper<UserAuth> authWrapper = new QueryWrapper<>();
|
||||
authWrapper.eq("user_id", userInfo.getId()).eq("del_flag", "0");
|
||||
List<UserAuth> userAuthList = userAuthService.list(authWrapper);
|
||||
Set<String> userAuthSet = Collections.emptySet();
|
||||
if (userAuthList != null && userAuthList.size() > 0) {
|
||||
List<Long> authIdList = userAuthList.stream().map(UserAuth::getAuthId).collect(Collectors.toList());
|
||||
Collection<AuthInfo> authInfoList = authInfoService.listByIds(authIdList);
|
||||
Map<Long, String> authNameMap = authInfoList.stream().collect(Collectors.toMap(AuthInfo::getId, AuthInfo::getAuthName));
|
||||
userAuthSet = userAuthList.stream().map(val -> {
|
||||
String authName = Optional.ofNullable(authNameMap.get(val.getAuthId())).orElse("");
|
||||
return authName + Optional.ofNullable(val.getAuthCustomSuffix()).orElse("");
|
||||
}).collect(Collectors.toSet());
|
||||
}
|
||||
Set<String> userAuthSet = userAuthService.getUserAuthSet(userInfo.getId());
|
||||
String accessToken = RandomUtil.simpleUUID();
|
||||
DocUserDetails userDetails = new DocUserDetails(userInfo.getId(), userInfo.getUserName(), userInfo.getPassword(), true, userAuthSet);
|
||||
DocUserUtil.setCurrentUser(accessToken, userDetails);
|
||||
|
||||
@@ -0,0 +1,113 @@
|
||||
package com.zyplayer.doc.manage.web.manage;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
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.UserGroup;
|
||||
import com.zyplayer.doc.data.repository.manage.entity.UserGroupRelation;
|
||||
import com.zyplayer.doc.data.repository.manage.entity.UserInfo;
|
||||
import com.zyplayer.doc.data.repository.manage.mapper.UserGroupMapper;
|
||||
import com.zyplayer.doc.data.repository.support.consts.DocAuthConst;
|
||||
import com.zyplayer.doc.data.service.manage.UserGroupRelationService;
|
||||
import com.zyplayer.doc.data.service.manage.UserGroupService;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
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.Date;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/user/group")
|
||||
public class UserGroupController {
|
||||
|
||||
@Resource
|
||||
UserGroupService userGroupService;
|
||||
@Resource
|
||||
UserGroupMapper userGroupMapper;
|
||||
@Resource
|
||||
UserGroupRelationService userGroupRelationService;
|
||||
|
||||
@AuthMan
|
||||
@PostMapping("/list")
|
||||
public ResponseJson<Object> list() {
|
||||
QueryWrapper<UserGroup> wrapper = new QueryWrapper<>();
|
||||
wrapper.select("id", "name");
|
||||
wrapper.eq("del_flag", 0);
|
||||
List<UserGroup> userGroupList = userGroupService.list(wrapper);
|
||||
return DocResponseJson.ok(userGroupList);
|
||||
}
|
||||
|
||||
@PostMapping("/update")
|
||||
@AuthMan(DocAuthConst.USER_MANAGE)
|
||||
public ResponseJson<Object> update(Long id, String name) {
|
||||
if (StringUtils.isBlank(name)) {
|
||||
return DocResponseJson.warn("分组名不能为空");
|
||||
}
|
||||
UserGroup userGroup = new UserGroup();
|
||||
userGroup.setId(id);
|
||||
userGroup.setName(name);
|
||||
if (userGroup.getId() == null) {
|
||||
DocUserDetails currentUser = DocUserUtil.getCurrentUser();
|
||||
userGroup.setCreateTime(new Date());
|
||||
userGroup.setCreateUserId(currentUser.getUserId());
|
||||
userGroup.setCreateUserName(currentUser.getUsername());
|
||||
}
|
||||
userGroupService.saveOrUpdate(userGroup);
|
||||
return DocResponseJson.ok();
|
||||
}
|
||||
|
||||
@PostMapping("/delete")
|
||||
@AuthMan(DocAuthConst.USER_MANAGE)
|
||||
public ResponseJson<Object> delete(Long id) {
|
||||
UserGroup userGroupUp = new UserGroup();
|
||||
userGroupUp.setId(id);
|
||||
userGroupUp.setDelFlag(1);
|
||||
userGroupService.updateById(userGroupUp);
|
||||
return DocResponseJson.ok();
|
||||
}
|
||||
|
||||
@PostMapping("/relation/update")
|
||||
@AuthMan(DocAuthConst.USER_MANAGE)
|
||||
public ResponseJson<Object> relationUpdate(Long groupId, Long userId) {
|
||||
QueryWrapper<UserGroupRelation> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("group_id", groupId).eq("user_id", userId);
|
||||
UserGroupRelation userGroupRelation = userGroupRelationService.getOne(wrapper);
|
||||
if (userGroupRelation == null) {
|
||||
DocUserDetails currentUser = DocUserUtil.getCurrentUser();
|
||||
userGroupRelation = new UserGroupRelation();
|
||||
userGroupRelation.setCreateTime(new Date());
|
||||
userGroupRelation.setCreateUserId(currentUser.getUserId());
|
||||
userGroupRelation.setCreateUserName(currentUser.getUsername());
|
||||
userGroupRelation.setGroupId(groupId);
|
||||
userGroupRelation.setUserId(userId);
|
||||
}
|
||||
userGroupRelation.setDelFlag(0);
|
||||
userGroupRelationService.saveOrUpdate(userGroupRelation);
|
||||
return DocResponseJson.ok();
|
||||
}
|
||||
|
||||
@PostMapping("/relation/remove")
|
||||
@AuthMan(DocAuthConst.USER_MANAGE)
|
||||
public ResponseJson<Object> relationRemove(Long groupId, Long userId) {
|
||||
QueryWrapper<UserGroupRelation> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("group_id", groupId).eq("user_id", userId);
|
||||
UserGroupRelation relationUp = new UserGroupRelation();
|
||||
relationUp.setDelFlag(1);
|
||||
userGroupRelationService.update(relationUp, wrapper);
|
||||
return DocResponseJson.ok();
|
||||
}
|
||||
|
||||
@PostMapping("/relation/list")
|
||||
@AuthMan(DocAuthConst.USER_MANAGE)
|
||||
public ResponseJson<Object> groupUserList(Long groupId) {
|
||||
List<UserInfo> userInfoList = userGroupMapper.groupUserList(groupId);
|
||||
return DocResponseJson.ok(userInfoList);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,6 +2,8 @@ package com.zyplayer.doc.manage.web.manage;
|
||||
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.zyplayer.doc.core.annotation.AuthMan;
|
||||
@@ -18,8 +20,8 @@ import com.zyplayer.doc.data.service.manage.UserAuthService;
|
||||
import com.zyplayer.doc.data.service.manage.UserInfoService;
|
||||
import com.zyplayer.doc.manage.web.manage.param.UserListParam;
|
||||
import com.zyplayer.doc.manage.web.manage.vo.AuthInfoVo;
|
||||
import com.zyplayer.doc.manage.web.manage.vo.UserInfoAuthVo;
|
||||
import com.zyplayer.doc.manage.web.manage.vo.UserAuthVo;
|
||||
import com.zyplayer.doc.manage.web.manage.vo.UserInfoAuthVo;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.dozer.Mapper;
|
||||
import org.springframework.util.DigestUtils;
|
||||
@@ -68,8 +70,24 @@ public class UserInfoController {
|
||||
return DocResponseJson.ok(selfInfoVo);
|
||||
}
|
||||
|
||||
@PostMapping("/search")
|
||||
@AuthMan(DocAuthConst.USER_MANAGE)
|
||||
public ResponseJson<Object> search(String search) {
|
||||
if (StringUtils.isBlank(search)) {
|
||||
return DocResponseJson.ok();
|
||||
}
|
||||
QueryWrapper<UserInfo> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.and(con -> con.and(conSub -> conSub.like("user_name", search).or().like("user_no", search)
|
||||
.or().like("email", search)).and(conSub -> conSub.eq("del_flag", 0)));
|
||||
queryWrapper.select("id", "user_name");
|
||||
// 搜索最多返回20条
|
||||
IPage<UserInfo> page = new Page<>(1, 20, false);
|
||||
userInfoService.page(page, queryWrapper);
|
||||
return DocResponseJson.ok(page);
|
||||
}
|
||||
|
||||
@PostMapping("/list")
|
||||
@AuthMan(DocAuthConst.USER_MANAGE)
|
||||
public ResponseJson<Object> list(UserListParam param) {
|
||||
QueryWrapper<UserInfo> queryWrapper = new QueryWrapper<>();
|
||||
if (StringUtils.isNotBlank(param.getKeyword())) {
|
||||
|
||||
482
zyplayer-doc-manage/src/main/resources/sql/全量建表语句.sql
Normal file
482
zyplayer-doc-manage/src/main/resources/sql/全量建表语句.sql
Normal file
@@ -0,0 +1,482 @@
|
||||
-- ==导出注意==
|
||||
-- 1. datetime(0) 低版本不支持此语法,改为datetime
|
||||
-- 2. utf8mb4 低版本不支持此字符集,改为utf8
|
||||
-- 3. 加字段后记得排查是否有insert语句,需要同步修改
|
||||
--
|
||||
-- ------------------------全新的库------------------------
|
||||
/*
|
||||
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 utf8;
|
||||
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 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) NULL DEFAULT NULL COMMENT '数据源驱动类',
|
||||
`source_url` varchar(512) NULL DEFAULT NULL COMMENT '数据源地址',
|
||||
`source_name` varchar(50) NULL DEFAULT NULL COMMENT '数据源用户名',
|
||||
`source_password` varchar(50) NULL DEFAULT NULL COMMENT '数据源密码',
|
||||
`create_user_id` bigint(20) NULL DEFAULT NULL COMMENT '创建人ID',
|
||||
`create_user_name` varchar(20) NULL DEFAULT NULL COMMENT '创建人名字',
|
||||
`create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
|
||||
`yn` tinyint(4) NULL DEFAULT NULL COMMENT '是否有效 0=无效 1=有效',
|
||||
`name` varchar(50) NULL DEFAULT NULL COMMENT '数据源名称',
|
||||
`group_name` varchar(50) DEFAULT NULL COMMENT '数据源分组名',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8 COLLATE = utf8_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) NULL DEFAULT NULL COMMENT '收藏标题',
|
||||
`content` varchar(10000) NULL DEFAULT NULL COMMENT '收藏内容',
|
||||
`create_user_id` bigint(20) NULL DEFAULT NULL COMMENT '创建人ID',
|
||||
`create_user_name` varchar(20) NULL DEFAULT NULL COMMENT '创建人名字',
|
||||
`create_time` datetime 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 = utf8 COLLATE = utf8_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) NULL DEFAULT NULL COMMENT 'sql内容',
|
||||
`create_user_id` bigint(20) NULL DEFAULT NULL COMMENT '创建人ID',
|
||||
`create_user_name` varchar(20) NULL DEFAULT NULL COMMENT '创建人名字',
|
||||
`create_time` datetime 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 = utf8 COLLATE = utf8_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) NULL DEFAULT NULL COMMENT '数据源名称',
|
||||
`host_port` varchar(512) NULL DEFAULT NULL COMMENT '地址和端口',
|
||||
`scheme` varchar(512) NULL DEFAULT NULL COMMENT 'scheme,http或其他',
|
||||
`create_user_id` bigint(20) NULL DEFAULT NULL COMMENT '创建人ID',
|
||||
`create_user_name` varchar(20) NULL DEFAULT NULL COMMENT '创建人名字',
|
||||
`create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
|
||||
`yn` tinyint(4) NULL DEFAULT NULL COMMENT '是否有效 0=无效 1=有效',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8 COLLATE = utf8_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 NULL DEFAULT NULL COMMENT '创建时间',
|
||||
`update_time` datetime 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 NULL DEFAULT NULL COMMENT '创建时间',
|
||||
`create_uid` bigint(20) NULL DEFAULT NULL COMMENT '创建人用户ID',
|
||||
`update_time` datetime 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) 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) NULL DEFAULT NULL COMMENT '创建人名字',
|
||||
`create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
|
||||
`update_user_id` bigint(20) NULL DEFAULT NULL COMMENT '修改人ID',
|
||||
`update_user_name` varchar(20) NULL DEFAULT NULL COMMENT '修改人名字',
|
||||
`update_time` datetime 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 = utf8 COLLATE = utf8_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, 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, 1);
|
||||
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, 1);
|
||||
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, 1);
|
||||
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, 1);
|
||||
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, 1);
|
||||
INSERT INTO `wiki_page` VALUES (7, 2, '所有格式测试', 0, 0, 0, 0, 1, '暮光:城中城', '2019-03-12 12:21:26', NULL, NULL, NULL, 0, 13, 13, 1);
|
||||
|
||||
-- ----------------------------
|
||||
-- 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) 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) NULL DEFAULT NULL COMMENT '创建人名字',
|
||||
`create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
|
||||
`del_flag` tinyint(4) NULL DEFAULT 0 COMMENT '0=有效 1=删除',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 7 CHARACTER SET = utf8 COLLATE = utf8_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 NULL COMMENT '内容',
|
||||
`create_user_id` bigint(20) NULL DEFAULT NULL COMMENT '创建人ID',
|
||||
`create_user_name` varchar(20) NULL DEFAULT NULL COMMENT '创建人名字',
|
||||
`create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
|
||||
`update_user_id` bigint(20) NULL DEFAULT NULL COMMENT '修改人ID',
|
||||
`update_user_name` varchar(20) NULL DEFAULT NULL COMMENT '修改人名字',
|
||||
`update_time` datetime NULL DEFAULT NULL COMMENT '修改时间',
|
||||
`preview` varchar(16000) 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 = utf8 COLLATE = utf8_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> 账号: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 账号: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> </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>8、url动态变动,这样就可以复制指定文章的地址了</p><p>9、参考https://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-manage:1、首页做大的调整优化,希望使用element重构一下2、人员导入方案,权限优化,人员管理细化 zyplayer-doc-wiki:1、支持页面权限控制,包括查看、编辑、删除、评论的权限2、支持把一个空间里的文档一键同步到git的wiki上,统一管理文档3、支持微信文章拉取保存4、支持历史记录查看5、支持提供多种编辑器选择,更大的选择空间6、支持全...');
|
||||
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>1、增加zyplayer-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>1、zyplayer-doc-swagger,swagger接口文档展示方案,在之前的项目中有许多改进,坚持文档生成和展示分离,有较多需要服务端支持的功能,不对各项目做过多的入侵即可使用,可动态对文档进行开放访问<br>2、zyplayer-doc-dubbo,支持对dubbo服务的自动扫描,直观展示所有的服务,文档的展示、文档编辑和在线接口调试,不需要对已有的服务做任何改动,支持zookeeper、nacos注册中心的服务扫描<br>3、zyplayer-doc-db,数据库文档工具,具有数据库表、字段文档的查看/修改,文档导出等功能,支持mysql和sqlserver数据库<br>4、zyplayer-doc-manage,管理以上几个服务,spring boot项目,spring security做权限管理,可直接运行</p>', 1, '暮光:城中城', '2019-03-09 14:16:20', 1, '暮光:城中城', '2019-06-14 16:49:30', 'V1.0.1 2019-03-091、增加zyplayer-doc-wiki模块支持空间隔离支持附件上传拖动可以改变wiki顺序基本的文档创建、编辑、评论、删除、搜索等功能2、dubbo文档支持使用元数据生成参数和返回值,dubbo2.7.0新特性3、框架进行了大的拆分,表修改较多4、增加升级通知5、细节优化V1.0.0 2019-02-15第一个版本发布1、zyplayer-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> </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> ID</th><th> 名字</th><th> 邮箱</th><th> 说明</th><th> 时间</th></tr><tr><td> xx</td><td> xx</td><td> xx</td><td> xx</td><td> xx</td></tr><tr><td> </td><td> </td><td> </td><td> </td><td> </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) NULL DEFAULT NULL COMMENT '文件名',
|
||||
`file_url` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '文件URL',
|
||||
`uuid` varchar(40) NULL DEFAULT NULL COMMENT '文件UUID',
|
||||
`create_user_id` bigint(20) NULL DEFAULT NULL COMMENT '创建人ID',
|
||||
`create_user_name` varchar(20) NULL DEFAULT NULL COMMENT '创建人名字',
|
||||
`create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
|
||||
`update_user_id` bigint(20) NULL DEFAULT NULL COMMENT '修改人ID',
|
||||
`update_user_name` varchar(20) NULL DEFAULT NULL COMMENT '修改人名字',
|
||||
`update_time` datetime NULL DEFAULT NULL COMMENT '修改时间',
|
||||
`del_flag` tinyint(4) NULL DEFAULT 0 COMMENT '0=有效 1=删除',
|
||||
`download_num` int(11) NOT NULL DEFAULT 0 COMMENT '下载次数',
|
||||
`file_size` bigint NULL COMMENT '文件大小',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
UNIQUE INDEX `uk_uuid`(`uuid`) USING BTREE COMMENT '文件ID'
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 15 CHARACTER SET = utf8 COLLATE = utf8_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) NULL DEFAULT NULL COMMENT '创建人名字',
|
||||
`create_time` datetime 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 = utf8 COLLATE = utf8_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) NULL DEFAULT NULL COMMENT '创建人名字',
|
||||
`create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
|
||||
`yn` tinyint(4) NULL DEFAULT NULL COMMENT '是否有效 0=无效 1=有效',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_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) NULL DEFAULT NULL COMMENT '空间名',
|
||||
`type` tinyint(4) NULL DEFAULT 1 COMMENT '空间类型 1=公司 2=个人 3=私人',
|
||||
`space_explain` varchar(255) 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) NULL DEFAULT NULL COMMENT '唯一UUID',
|
||||
`create_user_id` bigint(20) NULL DEFAULT NULL COMMENT '创建人ID',
|
||||
`create_user_name` varchar(20) NULL DEFAULT NULL COMMENT '创建人名字',
|
||||
`create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
|
||||
`del_flag` tinyint(4) NOT NULL DEFAULT 0 COMMENT '删除标记 0=正常 1=已删除',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8 COLLATE = utf8_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 NULL COMMENT '参数值',
|
||||
`creation_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
|
||||
`update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
UNIQUE INDEX `key`(`doc_key`) USING BTREE COMMENT 'key唯一索引'
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 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=utf8 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 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;
|
||||
|
||||
DROP TABLE IF EXISTS `user_group`;
|
||||
CREATE TABLE `user_group` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键自增ID',
|
||||
`name` varchar(50) 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 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='用户组';
|
||||
|
||||
DROP TABLE IF EXISTS `user_group_relation`;
|
||||
CREATE TABLE `user_group_relation` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键自增ID',
|
||||
`group_id` bigint(20) DEFAULT NULL COMMENT '群ID',
|
||||
`user_id` bigint(20) DEFAULT NULL COMMENT '用户ID',
|
||||
`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 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='用户和用户组关系表';
|
||||
|
||||
DROP TABLE IF EXISTS `user_group_auth`;
|
||||
CREATE TABLE `user_group_auth` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键自增ID',
|
||||
`group_id` bigint(20) DEFAULT NULL COMMENT '群ID',
|
||||
`data_id` bigint(20) DEFAULT NULL COMMENT '授权数据的ID',
|
||||
`auth_type` tinyint(4) DEFAULT NULL COMMENT '授权类型,依据各系统自己定义',
|
||||
`project_type` tinyint(4) DEFAULT NULL COMMENT '项目类型 1=manage 2=wiki 3=db',
|
||||
`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 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='用户组在各项目内的授权关系';
|
||||
|
||||
DROP TABLE IF EXISTS `wiki_space_favorite`;
|
||||
CREATE TABLE `wiki_space_favorite` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键自增ID',
|
||||
`space_id` bigint(20) DEFAULT NULL COMMENT '空间ID',
|
||||
`user_id` bigint(20) DEFAULT NULL COMMENT '用户ID',
|
||||
`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 COMMENT='用户空间收藏记录表';
|
||||
|
||||
DROP TABLE IF EXISTS `wiki_space_favorite`;
|
||||
CREATE TABLE `user_setting` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键自增ID',
|
||||
`user_id` bigint(20) DEFAULT NULL COMMENT '用户ID',
|
||||
`name` varchar(100) DEFAULT NULL COMMENT '设置的名字',
|
||||
`value` varchar(100) 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 COMMENT='用户设置表';
|
||||
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
61
zyplayer-doc-manage/src/main/resources/sql/增量更新语句.sql
Normal file
61
zyplayer-doc-manage/src/main/resources/sql/增量更新语句.sql
Normal file
@@ -0,0 +1,61 @@
|
||||
-- ==导出注意==
|
||||
-- 1. datetime(0) 低版本不支持此语法,改为datetime
|
||||
-- 2. utf8mb4 低版本不支持此字符集,改为utf8
|
||||
-- 3. 加字段后记得排查是否有insert语句,需要同步修改
|
||||
--
|
||||
-- ------------------------从1.0.7版本升级------------------------
|
||||
|
||||
CREATE TABLE `user_group` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键自增ID',
|
||||
`name` varchar(50) 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 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='用户组';
|
||||
|
||||
CREATE TABLE `user_group_relation` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键自增ID',
|
||||
`group_id` bigint(20) DEFAULT NULL COMMENT '群ID',
|
||||
`user_id` bigint(20) DEFAULT NULL COMMENT '用户ID',
|
||||
`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 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='用户和用户组关系表';
|
||||
|
||||
CREATE TABLE `user_group_auth` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键自增ID',
|
||||
`group_id` bigint(20) DEFAULT NULL COMMENT '群ID',
|
||||
`data_id` bigint(20) DEFAULT NULL COMMENT '授权数据的ID',
|
||||
`auth_type` tinyint(4) DEFAULT NULL COMMENT '授权类型,依据各系统自己定义',
|
||||
`project_type` tinyint(4) DEFAULT NULL COMMENT '项目类型 1=manage 2=wiki 3=db',
|
||||
`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 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='用户组在各项目内的授权关系';
|
||||
|
||||
CREATE TABLE `wiki_space_favorite` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键自增ID',
|
||||
`space_id` bigint(20) DEFAULT NULL COMMENT '空间ID',
|
||||
`user_id` bigint(20) DEFAULT NULL COMMENT '用户ID',
|
||||
`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 COMMENT='用户空间收藏记录表';
|
||||
|
||||
CREATE TABLE `user_setting` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键自增ID',
|
||||
`user_id` bigint(20) DEFAULT NULL COMMENT '用户ID',
|
||||
`name` varchar(100) DEFAULT NULL COMMENT '设置的名字',
|
||||
`value` varchar(100) 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 COMMENT='用户设置表';
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
body,html{margin:0;padding:0}#app,.el-container,.el-menu,body,html{height:100%}.el-header{background-color:#1d4e89!important}.header-right-user-name{color:#fff;padding-right:5px}.el-menu-vertical{border-right:0}.el-menu-vertical,.el-menu-vertical .el-menu{background:#fafafa}.el-header{background-color:#409eff;color:#333;line-height:40px;text-align:right;height:40px!important}
|
||||
body,html{margin:0;padding:0}#app,.el-container,.el-menu,body,html{height:100%}.el-header{background-color:#1d4e89!important}.header-right-user-name{color:#fff;padding-right:5px}.el-menu-vertical{border-right:0}.el-menu-vertical,.el-menu-vertical .el-menu{background:#fafafa}.el-header{background-color:#409eff;color:#333;line-height:40px;text-align:right;height:40px!important}.menu-box{padding:10px;height:100%;-webkit-box-sizing:border-box;box-sizing:border-box;background:#fafafa}.menu-box .i-icon{line-height:1;margin-right:5px}
|
||||
@@ -0,0 +1 @@
|
||||
.user-group-vue .search-form-box{padding:10px}.user-group-vue .page-info-box{text-align:right;margin:20px 0 50px 0}.user-group-vue .el-button+.el-button{margin-left:5px}.user-group-vue .page-scroll-box{padding:10px;height:calc(100vh - 200px);overflow:auto}.user-group-vue .group-box .group-item{width:100%;margin-bottom:10px;cursor:pointer}.user-group-vue .group-box .group-item .el-icon-close{float:right;top:6px}.user-group-vue .group-box .group-item .group-name-input{width:calc(100% - 30px)}.user-group-vue .group-box .group-item .group-name-input input{border:0;padding-left:5px}
|
||||
File diff suppressed because one or more lines are too long
@@ -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-console.png><title>文档管理系统</title><link href=css/chunk-0741282a.cbb897f6.css rel=prefetch><link href=css/chunk-30126bdc.ee6e60f7.css rel=prefetch><link href=css/chunk-32cc5643.5a5b2ca1.css rel=prefetch><link href=css/chunk-35c34f90.938e4b31.css rel=prefetch><link href=css/chunk-4582ecc6.ee6e60f7.css rel=prefetch><link href=css/chunk-7349f4ef.be15d6a0.css rel=prefetch><link href=js/chunk-0741282a.225ac580.js rel=prefetch><link href=js/chunk-2d207ece.471a6eef.js rel=prefetch><link href=js/chunk-30126bdc.0c65330c.js rel=prefetch><link href=js/chunk-32cc5643.522aafd7.js rel=prefetch><link href=js/chunk-35c34f90.bb1dbae1.js rel=prefetch><link href=js/chunk-4582ecc6.34ccd545.js rel=prefetch><link href=js/chunk-7349f4ef.84d79223.js rel=prefetch><link href=css/app.740554a0.css rel=preload as=style><link href=css/chunk-vendors.7be40bfc.css rel=preload as=style><link href=js/app.0e559f7f.js rel=preload as=script><link href=js/chunk-vendors.f3be2a33.js rel=preload as=script><link href=css/chunk-vendors.7be40bfc.css rel=stylesheet><link href=css/app.740554a0.css rel=stylesheet></head><body><noscript><strong>We're sorry but zyplayer-console-ui doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=js/chunk-vendors.f3be2a33.js></script><script src=js/app.0e559f7f.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-console.png><title>文档管理系统</title><link href=css/chunk-073e4e5b.e7241bfc.css rel=prefetch><link href=css/chunk-0741282a.cbb897f6.css rel=prefetch><link href=css/chunk-30126bdc.ee6e60f7.css rel=prefetch><link href=css/chunk-32cc5643.5a5b2ca1.css rel=prefetch><link href=css/chunk-35c34f90.938e4b31.css rel=prefetch><link href=css/chunk-4582ecc6.ee6e60f7.css rel=prefetch><link href=css/chunk-7349f4ef.be15d6a0.css rel=prefetch><link href=js/chunk-073e4e5b.13b274e6.js rel=prefetch><link href=js/chunk-0741282a.98963f5a.js rel=prefetch><link href=js/chunk-2d207ece.d0b4b38c.js rel=prefetch><link href=js/chunk-30126bdc.94211e34.js rel=prefetch><link href=js/chunk-32cc5643.4bacf0e9.js rel=prefetch><link href=js/chunk-35c34f90.092a4b5d.js rel=prefetch><link href=js/chunk-4582ecc6.7591cd98.js rel=prefetch><link href=js/chunk-7349f4ef.2306d709.js rel=prefetch><link href=css/app.0b085a20.css rel=preload as=style><link href=css/chunk-vendors.8924efc6.css rel=preload as=style><link href=js/app.859254cb.js rel=preload as=script><link href=js/chunk-vendors.14026b60.js rel=preload as=script><link href=css/chunk-vendors.8924efc6.css rel=stylesheet><link href=css/app.0b085a20.css rel=stylesheet></head><body><noscript><strong>We're sorry but zyplayer-console-ui doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=js/chunk-vendors.14026b60.js></script><script src=js/app.859254cb.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
53
zyplayer-doc-ui/console-ui/package-lock.json
generated
53
zyplayer-doc-ui/console-ui/package-lock.json
generated
@@ -919,6 +919,15 @@
|
||||
"@hapi/hoek": "^8.3.0"
|
||||
}
|
||||
},
|
||||
"@icon-park/vue": {
|
||||
"version": "1.2.6",
|
||||
"resolved": "https://registry.npm.taobao.org/@icon-park/vue/download/@icon-park/vue-1.2.6.tgz",
|
||||
"integrity": "sha1-bAV9BAa3JVYvIIXmlHvLXKBMHO0=",
|
||||
"requires": {
|
||||
"@vue/babel-helper-vue-jsx-merge-props": "^1.0.0",
|
||||
"csstype": "^3.0.3"
|
||||
}
|
||||
},
|
||||
"@intervolga/optimize-cssnano-plugin": {
|
||||
"version": "1.0.6",
|
||||
"resolved": "http://registry.npm.taobao.org/@intervolga/optimize-cssnano-plugin/download/@intervolga/optimize-cssnano-plugin-1.0.6.tgz",
|
||||
@@ -1049,8 +1058,7 @@
|
||||
"@vue/babel-helper-vue-jsx-merge-props": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npm.taobao.org/@vue/babel-helper-vue-jsx-merge-props/download/@vue/babel-helper-vue-jsx-merge-props-1.0.0.tgz",
|
||||
"integrity": "sha1-BI/leZWNpAj7eosqPsBQtQpmEEA=",
|
||||
"dev": true
|
||||
"integrity": "sha1-BI/leZWNpAj7eosqPsBQtQpmEEA="
|
||||
},
|
||||
"@vue/babel-plugin-transform-vue-jsx": {
|
||||
"version": "1.1.2",
|
||||
@@ -1971,6 +1979,14 @@
|
||||
"integrity": "sha1-3TeelPDbgxCwgpH51kwyCXZmF/0=",
|
||||
"dev": true
|
||||
},
|
||||
"async-validator": {
|
||||
"version": "1.8.5",
|
||||
"resolved": "https://registry.npm.taobao.org/async-validator/download/async-validator-1.8.5.tgz?cache=0&sync_timestamp=1605749896979&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fasync-validator%2Fdownload%2Fasync-validator-1.8.5.tgz",
|
||||
"integrity": "sha1-3D4I7B/Q3dtn5ghC8CwM0c7G1/A=",
|
||||
"requires": {
|
||||
"babel-runtime": "6.x"
|
||||
}
|
||||
},
|
||||
"asynckit": {
|
||||
"version": "0.4.0",
|
||||
"resolved": "http://registry.npm.taobao.org/asynckit/download/asynckit-0.4.0.tgz",
|
||||
@@ -2057,7 +2073,7 @@
|
||||
},
|
||||
"babel-helper-vue-jsx-merge-props": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "http://registry.npm.taobao.org/babel-helper-vue-jsx-merge-props/download/babel-helper-vue-jsx-merge-props-2.0.3.tgz",
|
||||
"resolved": "https://registry.npm.taobao.org/babel-helper-vue-jsx-merge-props/download/babel-helper-vue-jsx-merge-props-2.0.3.tgz",
|
||||
"integrity": "sha1-Iq69OzOQIyjlEyk6jkmSs4T58bY="
|
||||
},
|
||||
"babel-loader": {
|
||||
@@ -2096,7 +2112,7 @@
|
||||
},
|
||||
"babel-runtime": {
|
||||
"version": "6.26.0",
|
||||
"resolved": "http://registry.npm.taobao.org/babel-runtime/download/babel-runtime-6.26.0.tgz",
|
||||
"resolved": "https://registry.npm.taobao.org/babel-runtime/download/babel-runtime-6.26.0.tgz",
|
||||
"integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=",
|
||||
"requires": {
|
||||
"core-js": "^2.4.0",
|
||||
@@ -2104,9 +2120,9 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"core-js": {
|
||||
"version": "2.6.10",
|
||||
"resolved": "https://registry.npm.taobao.org/core-js/download/core-js-2.6.10.tgz?cache=0&sync_timestamp=1573985371469&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcore-js%2Fdownload%2Fcore-js-2.6.10.tgz",
|
||||
"integrity": "sha1-iluDkfjMcBPacDQRzltYVwYwDX8="
|
||||
"version": "2.6.12",
|
||||
"resolved": "https://registry.npm.taobao.org/core-js/download/core-js-2.6.12.tgz?cache=0&sync_timestamp=1611038902573&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcore-js%2Fdownload%2Fcore-js-2.6.12.tgz",
|
||||
"integrity": "sha1-2TM9+nsGXjR8xWgiGdb2kIWcwuw="
|
||||
},
|
||||
"regenerator-runtime": {
|
||||
"version": "0.11.1",
|
||||
@@ -3580,6 +3596,11 @@
|
||||
"css-tree": "1.0.0-alpha.37"
|
||||
}
|
||||
},
|
||||
"csstype": {
|
||||
"version": "3.0.6",
|
||||
"resolved": "https://registry.npm.taobao.org/csstype/download/csstype-3.0.6.tgz?cache=0&sync_timestamp=1610107098407&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcsstype%2Fdownload%2Fcsstype-3.0.6.tgz",
|
||||
"integrity": "sha1-hl0LWDPX2NQPTluKbXauo95HJe8="
|
||||
},
|
||||
"current-script-polyfill": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npm.taobao.org/current-script-polyfill/download/current-script-polyfill-1.0.0.tgz",
|
||||
@@ -4110,9 +4131,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"element-ui": {
|
||||
"version": "2.13.1",
|
||||
"resolved": "https://registry.npm.taobao.org/element-ui/download/element-ui-2.13.1.tgz?cache=0&sync_timestamp=1586761028754&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Felement-ui%2Fdownload%2Felement-ui-2.13.1.tgz",
|
||||
"integrity": "sha1-DLGkXPJ6phxgHe++GSdArFy533w=",
|
||||
"version": "2.15.0",
|
||||
"resolved": "https://registry.npm.taobao.org/element-ui/download/element-ui-2.15.0.tgz?cache=0&sync_timestamp=1610713839122&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Felement-ui%2Fdownload%2Felement-ui-2.15.0.tgz",
|
||||
"integrity": "sha1-3ptzqNHj47UOgrkjpfqVKVI5vUE=",
|
||||
"requires": {
|
||||
"async-validator": "~1.8.1",
|
||||
"babel-helper-vue-jsx-merge-props": "^2.0.0",
|
||||
@@ -4120,16 +4141,6 @@
|
||||
"normalize-wheel": "^1.0.1",
|
||||
"resize-observer-polyfill": "^1.5.0",
|
||||
"throttle-debounce": "^1.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"async-validator": {
|
||||
"version": "1.8.5",
|
||||
"resolved": "https://registry.npm.taobao.org/async-validator/download/async-validator-1.8.5.tgz",
|
||||
"integrity": "sha1-3D4I7B/Q3dtn5ghC8CwM0c7G1/A=",
|
||||
"requires": {
|
||||
"babel-runtime": "6.x"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"elliptic": {
|
||||
@@ -7497,7 +7508,7 @@
|
||||
},
|
||||
"normalize-wheel": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npm.taobao.org/normalize-wheel/download/normalize-wheel-1.0.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fnormalize-wheel%2Fdownload%2Fnormalize-wheel-1.0.1.tgz",
|
||||
"resolved": "https://registry.npm.taobao.org/normalize-wheel/download/normalize-wheel-1.0.1.tgz",
|
||||
"integrity": "sha1-rsiGr/2wRQcNhWRH32Ls+GFG7EU="
|
||||
},
|
||||
"npm-run-path": {
|
||||
|
||||
@@ -7,18 +7,19 @@
|
||||
"build": "vue-cli-service build --mode production"
|
||||
},
|
||||
"dependencies": {
|
||||
"@icon-park/vue": "^1.2.6",
|
||||
"axios": "^0.19.0",
|
||||
"core-js": "^3.3.2",
|
||||
"echarts": "^4.5.0",
|
||||
"element-ui": "^2.15.0",
|
||||
"js-cookie": "^2.2.1",
|
||||
"pouchdb": "^7.1.1",
|
||||
"sql-formatter": "^2.3.3",
|
||||
"vue": "^2.6.10",
|
||||
"vue-axios": "^2.1.5",
|
||||
"vue-hljs": "^1.1.2",
|
||||
"vue-router": "^3.1.3",
|
||||
"vuex": "^3.1.2",
|
||||
"element-ui": "^2.10.0",
|
||||
"sql-formatter": "^2.3.3",
|
||||
"wangeditor": "^3.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
</template>
|
||||
<el-container v-else>
|
||||
<el-aside>
|
||||
<div style="padding: 10px;height: 100%;box-sizing: border-box;background: #fafafa;">
|
||||
<div class="menu-box">
|
||||
<el-menu default-active="1-4-1" :router="true" class="el-menu-vertical" @open="handleOpen" @close="handleClose" :collapse="isCollapse">
|
||||
<el-menu-item index="/"><i class="el-icon-s-home"></i>控制台</el-menu-item>
|
||||
<el-submenu index="1" v-if="userAuth.userManage">
|
||||
@@ -13,9 +13,14 @@
|
||||
<i class="el-icon-s-platform"></i>
|
||||
<span slot="title">系统管理</span>
|
||||
</template>
|
||||
<el-menu-item index="/console/userList"><i class="el-icon-user-solid"></i>用户管理</el-menu-item>
|
||||
<!-- <el-menu-item index="/console/roleList"><i class="el-icon-s-custom"></i>角色管理</el-menu-item>-->
|
||||
<!-- <el-menu-item index="/console/authList"><i class="el-icon-s-claim"></i>权限列表</el-menu-item>-->
|
||||
<el-menu-item index="/console/userList">
|
||||
<people theme="filled" size="16" fill="#909399"></people>
|
||||
<span>用户管理</span>
|
||||
</el-menu-item>
|
||||
<el-menu-item index="/console/userGroupList">
|
||||
<peoples theme="filled" size="16" fill="#909399"></peoples>
|
||||
<span>分组管理</span>
|
||||
</el-menu-item>
|
||||
</el-submenu>
|
||||
</el-menu>
|
||||
</div>
|
||||
@@ -65,6 +70,7 @@
|
||||
|
||||
<script>
|
||||
import consoleApi from './common/api/console'
|
||||
import {Peoples, People} from '@icon-park/vue';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
@@ -79,6 +85,10 @@
|
||||
upgradeInfo: {},
|
||||
}
|
||||
},
|
||||
components: {
|
||||
"peoples": Peoples,
|
||||
"people": People,
|
||||
},
|
||||
computed: {
|
||||
fullscreen () {
|
||||
return this.$store.state.global.fullscreen;
|
||||
@@ -158,4 +168,7 @@
|
||||
.el-menu-vertical{border-right: 0;background: #fafafa;}
|
||||
.el-menu-vertical .el-menu{background: #fafafa;}
|
||||
.el-header {background-color: #409EFF; color: #333; line-height: 40px; text-align: right;height: 40px !important;}
|
||||
|
||||
.menu-box{padding: 10px;height: 100%;box-sizing: border-box;background: #fafafa;}
|
||||
.menu-box .i-icon{line-height: 1;margin-right: 5px;}
|
||||
</style>
|
||||
|
||||
@@ -19,6 +19,9 @@ export default {
|
||||
},
|
||||
getUserInfoList: data => {
|
||||
return request({url: '/user/info/list', method: 'post', data: Qs.stringify(data)});
|
||||
},
|
||||
searchUserInfoList: data => {
|
||||
return request({url: '/user/info/search', method: 'post', data: Qs.stringify(data)});
|
||||
},
|
||||
updateUserInfo: data => {
|
||||
return request({url: '/user/info/update', method: 'post', data: Qs.stringify(data)});
|
||||
@@ -35,4 +38,22 @@ export default {
|
||||
resetPassword: data => {
|
||||
return request({url: '/user/info/resetPassword', method: 'post', data: Qs.stringify(data)});
|
||||
},
|
||||
userGroupList: data => {
|
||||
return request({url: '/user/group/list', method: 'post', data: Qs.stringify(data)});
|
||||
},
|
||||
updateUserGroup: data => {
|
||||
return request({url: '/user/group/update', method: 'post', data: Qs.stringify(data)});
|
||||
},
|
||||
deleteUserGroup: data => {
|
||||
return request({url: '/user/group/delete', method: 'post', data: Qs.stringify(data)});
|
||||
},
|
||||
updateUserGroupRelation: data => {
|
||||
return request({url: '/user/group/relation/update', method: 'post', data: Qs.stringify(data)});
|
||||
},
|
||||
removeUserGroupRelation: data => {
|
||||
return request({url: '/user/group/relation/remove', method: 'post', data: Qs.stringify(data)});
|
||||
},
|
||||
userGroupRelationList: data => {
|
||||
return request({url: '/user/group/relation/list', method: 'post', data: Qs.stringify(data)});
|
||||
},
|
||||
};
|
||||
|
||||
@@ -29,6 +29,7 @@ let routes = [
|
||||
{path: 'userList', name: '用户管理', component: () => import('@/views/console/UserList.vue')},
|
||||
{path: 'roleList', name: '权限管理', component: () => import('@/views/console/AuthList.vue')},
|
||||
{path: 'authList', name: '角色列表', component: () => import('@/views/console/RoleList.vue')},
|
||||
{path: 'userGroupList', name: '分组管理', component: () => import('@/views/console/UserGroupList.vue')},
|
||||
]
|
||||
}, {
|
||||
path: '/common',
|
||||
|
||||
217
zyplayer-doc-ui/console-ui/src/views/console/UserGroupList.vue
Normal file
217
zyplayer-doc-ui/console-ui/src/views/console/UserGroupList.vue
Normal file
@@ -0,0 +1,217 @@
|
||||
<template>
|
||||
<div class="user-group-vue">
|
||||
<el-breadcrumb separator-class="el-icon-arrow-right" style="padding: 20px 10px;">
|
||||
<el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
|
||||
<el-breadcrumb-item>系统管理</el-breadcrumb-item>
|
||||
<el-breadcrumb-item>分组管理</el-breadcrumb-item>
|
||||
</el-breadcrumb>
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
<div class="group-box page-scroll-box">
|
||||
<el-popover placement="bottom" width="300" trigger="click" v-model="createUserGroupVisible">
|
||||
<el-tag slot="reference" class="group-item" @click="">
|
||||
<div style="text-align: center;"><i class="el-icon-plus"></i> 创建分组</div>
|
||||
</el-tag>
|
||||
<div>
|
||||
<el-input v-model="editGroupName" placeholder="请输入新的分组名称" style="width: 220px;margin-right: 10px;"></el-input>
|
||||
<el-button plain type="primary" v-on:click="createUserGroup">创建</el-button>
|
||||
</div>
|
||||
</el-popover>
|
||||
<el-tag :type="item.id==checkedUserGroupId?'warning':'info'" class="group-item" @click="loadUserGroupRelation(item.id)" @dblclick.native="item.edit = true" v-for="item in userGroupList">
|
||||
<el-input v-if="item.edit" size="mini" v-model="item.editName" @keyup.enter.native="updateUserGroup(item)" @blur="updateUserGroup(item)" class="group-name-input">{{item.name}}</el-input>
|
||||
<span v-else>{{item.name}}</span>
|
||||
<el-popconfirm title="确定要删除此分组吗?" @confirm="removeUserGroup(item.id)">
|
||||
<i slot="reference" class="el-tag__close el-icon-close"></i>
|
||||
</el-popconfirm>
|
||||
</el-tag>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="18">
|
||||
<div v-if="checkedUserGroupId > 0" class="page-scroll-box" v-loading="searchLoading">
|
||||
<div style="margin-bottom: 10px;">
|
||||
<el-button size="mini" plain type="primary" @click="showChoiceUserDialog" icon="el-icon-plus">添加用户</el-button>
|
||||
</div>
|
||||
<el-table :data="userGroupRelationList" border style="width: 100%; margin-bottom: 5px;" :max-height="tableHeight">
|
||||
<el-table-column prop="id" label="编号" width="60"></el-table-column>
|
||||
<el-table-column prop="userNo" label="账号"></el-table-column>
|
||||
<el-table-column prop="email" label="邮箱"></el-table-column>
|
||||
<el-table-column prop="userName" label="用户名"></el-table-column>
|
||||
<el-table-column prop="phone" label="手机号"></el-table-column>
|
||||
<el-table-column label="性别">
|
||||
<template slot-scope="scope">{{scope.row.sex==0?'女':'男'}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="300">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" plain type="danger" v-on:click="removeUserRelationFromList(scope.row.id)">移除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!--添加用户到分组弹窗-->
|
||||
<el-dialog title="添加用户到分组" :visible.sync="choiceUserVisible" width="600px" @close="closeChoiceUserDialog">
|
||||
<el-row>
|
||||
<el-select v-model="searchAddNewUser" filterable remote reserve-keyword autoComplete="new-password"
|
||||
placeholder="请输入名字、邮箱、账号搜索用户" :remote-method="getSearchUserList"
|
||||
:loading="searchUserLoading" style="width: 450px;margin-right: 10px;">
|
||||
<el-option v-for="item in searchUserList" :key="item.id" :label="item.userName" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
<el-button v-on:click="addSearchChoiceUser">添加</el-button>
|
||||
</el-row>
|
||||
<div style="margin: 10px 0;">
|
||||
<el-tag v-for="item in searchAddUserList" :key="item.userId" closable type="info" style="margin-right: 10px;" @close="removeUserRelationFromSearch(item.userId)">
|
||||
{{item.userName}}
|
||||
</el-tag>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import consoleApi from '../../common/api/console'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
searchLoading: false,
|
||||
editUserDialogVisible: false,
|
||||
editUserAuthDialogVisible: false,
|
||||
totalCount: 0,
|
||||
searchParam: {
|
||||
type: 1,
|
||||
keyword: '',
|
||||
},
|
||||
searchResultList: [],
|
||||
roleOptions: [
|
||||
{value: '管理员'}
|
||||
],
|
||||
editUserForm: {},
|
||||
allUserAuth: [],
|
||||
editUserAuth: [],
|
||||
|
||||
userGroupRelationList: [],
|
||||
userGroupList: [],
|
||||
editGroupName: '',
|
||||
checkedUserGroupId: '',
|
||||
createUserGroupVisible: false,
|
||||
choiceUserVisible: false,
|
||||
// 添加用户
|
||||
searchAddUserList: [],
|
||||
searchUserList: [],
|
||||
searchAddNewUser: "",
|
||||
searchUserLoading: false,
|
||||
tableHeight: (document.body.clientHeight - 250),
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.getUserGroupList();
|
||||
},
|
||||
methods: {
|
||||
getUserGroupList() {
|
||||
this.userGroupList = [];
|
||||
consoleApi.userGroupList().then(json => {
|
||||
let userGroupList = json.data || [];
|
||||
userGroupList.forEach(item => {
|
||||
item.edit = false;
|
||||
item.checked = false;
|
||||
item.editName = item.name;
|
||||
});
|
||||
this.userGroupList = userGroupList;
|
||||
});
|
||||
},
|
||||
loadUserGroupRelation(groupId, force) {
|
||||
if (!force && groupId == this.checkedUserGroupId) return;
|
||||
this.checkedUserGroupId = groupId;
|
||||
this.searchLoading = true;
|
||||
consoleApi.userGroupRelationList({groupId: groupId}).then(json => {
|
||||
this.searchLoading = false;
|
||||
this.userGroupRelationList = json.data || [];
|
||||
});
|
||||
},
|
||||
updateUserGroup(item) {
|
||||
if (item.name == item.editName) {
|
||||
item.edit = false;
|
||||
return;
|
||||
}
|
||||
let param = {id: item.id, name: item.editName};
|
||||
consoleApi.updateUserGroup(param).then(json => {
|
||||
item.edit = false;
|
||||
item.name = item.editName;
|
||||
});
|
||||
},
|
||||
createUserGroup() {
|
||||
let param = {name: this.editGroupName};
|
||||
consoleApi.updateUserGroup(param).then(json => {
|
||||
this.editGroupName = '';
|
||||
this.createUserGroupVisible = false;
|
||||
this.getUserGroupList();
|
||||
});
|
||||
},
|
||||
removeUserGroup(id) {
|
||||
consoleApi.deleteUserGroup({id: id}).then(json => {
|
||||
this.checkedUserGroupId = '';
|
||||
this.getUserGroupList();
|
||||
});
|
||||
},
|
||||
closeChoiceUserDialog() {
|
||||
this.loadUserGroupRelation(this.checkedUserGroupId, true);
|
||||
},
|
||||
showChoiceUserDialog() {
|
||||
this.choiceUserVisible = true;
|
||||
this.searchAddUserList = [];
|
||||
this.userGroupRelationList.forEach(item => {
|
||||
this.searchAddUserList.push({userName: item.userName, userId: item.id});
|
||||
});
|
||||
},
|
||||
getSearchUserList(query) {
|
||||
if (!query) return;
|
||||
this.searchUserLoading = true;
|
||||
consoleApi.searchUserInfoList({search: query}).then(json => {
|
||||
this.searchUserList = json.data || [];
|
||||
this.searchUserLoading = false;
|
||||
});
|
||||
},
|
||||
removeUserRelationFromSearch(userId) {
|
||||
let param = {groupId: this.checkedUserGroupId, userId: userId};
|
||||
consoleApi.removeUserGroupRelation(param).then(json => {
|
||||
this.searchAddUserList = this.searchAddUserList.filter(item => item.userId != userId);
|
||||
});
|
||||
},
|
||||
removeUserRelationFromList(userId) {
|
||||
let param = {groupId: this.checkedUserGroupId, userId: userId};
|
||||
consoleApi.removeUserGroupRelation(param).then(json => {
|
||||
this.loadUserGroupRelation(this.checkedUserGroupId, true);
|
||||
});
|
||||
},
|
||||
addSearchChoiceUser() {
|
||||
if (this.searchAddNewUser.length <= 0) {
|
||||
this.$message.warning("请先选择用户");
|
||||
return;
|
||||
}
|
||||
if (!!this.searchAddUserList.find(item => item.userId == this.searchAddNewUser)) {
|
||||
this.searchAddNewUser = "";
|
||||
return;
|
||||
}
|
||||
let userName = this.searchUserList.find(item => item.id == this.searchAddNewUser).userName;
|
||||
let param = {groupId: this.checkedUserGroupId, userId: this.searchAddNewUser};
|
||||
consoleApi.updateUserGroupRelation(param).then(json => {
|
||||
this.searchAddUserList.push({userName: userName, userId: this.searchAddNewUser});
|
||||
});
|
||||
this.searchAddNewUser = "";
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
.user-group-vue .search-form-box{padding: 10px;}
|
||||
.user-group-vue .page-info-box{text-align: right;margin: 20px 0 50px 0;}
|
||||
.user-group-vue .el-button+.el-button{margin-left: 5px;}
|
||||
|
||||
.user-group-vue .page-scroll-box{padding: 10px;height: calc(100vh - 200px);overflow: auto;}
|
||||
.user-group-vue .group-box .group-item{width: 100%;margin-bottom: 10px;cursor: pointer;}
|
||||
.user-group-vue .group-box .group-item .el-icon-close{float: right; top: 6px;}
|
||||
.user-group-vue .group-box .group-item .group-name-input{width: calc(100% - 30px);}
|
||||
.user-group-vue .group-box .group-item .group-name-input input{border: 0;padding-left: 5px;}
|
||||
</style>
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
<el-col :span="24">
|
||||
<span class="label">表注释:</span>
|
||||
<span v-if="tableInfo.inEdit == 1">
|
||||
<el-input v-model="tableInfo.newDesc" placeholder="输入表注释" @keyup.enter="saveTableDescription" v-on:blur="saveTableDescription" style="width: 500px;"></el-input>
|
||||
<el-input v-model="tableInfo.newDesc" placeholder="输入表注释" @keyup.enter.native="saveTableDescription" v-on:blur="saveTableDescription" style="width: 500px;"></el-input>
|
||||
</span>
|
||||
<span v-else>{{tableInfo.description || '暂无注释'}} <i class="el-icon-edit edit-table-desc" v-on:click="tableInfo.inEdit = 1"></i></span>
|
||||
</el-col>
|
||||
@@ -68,7 +68,7 @@
|
||||
<el-table-column label="注释">
|
||||
<template slot-scope="scope">
|
||||
<div v-if="scope.row.inEdit == 1">
|
||||
<el-input v-model="scope.row.newDesc" placeholder="输入字段注释" @keyup.enter="saveColumnDescription(scope.row)" v-on:blur="saveColumnDescription(scope.row)"></el-input>
|
||||
<el-input v-model="scope.row.newDesc" placeholder="输入字段注释" @keyup.enter.native="saveColumnDescription(scope.row)" v-on:blur="saveColumnDescription(scope.row)"></el-input>
|
||||
</div>
|
||||
<div v-else class="description" v-on:click="descBoxClick(scope.row)">{{scope.row.description}}</div>
|
||||
</template>
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
36
zyplayer-doc-ui/wiki-ui/package-lock.json
generated
36
zyplayer-doc-ui/wiki-ui/package-lock.json
generated
@@ -1971,6 +1971,14 @@
|
||||
"integrity": "sha1-3TeelPDbgxCwgpH51kwyCXZmF/0=",
|
||||
"dev": true
|
||||
},
|
||||
"async-validator": {
|
||||
"version": "1.8.5",
|
||||
"resolved": "https://registry.npm.taobao.org/async-validator/download/async-validator-1.8.5.tgz?cache=0&sync_timestamp=1605749896979&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fasync-validator%2Fdownload%2Fasync-validator-1.8.5.tgz",
|
||||
"integrity": "sha1-3D4I7B/Q3dtn5ghC8CwM0c7G1/A=",
|
||||
"requires": {
|
||||
"babel-runtime": "6.x"
|
||||
}
|
||||
},
|
||||
"asynckit": {
|
||||
"version": "0.4.0",
|
||||
"resolved": "http://registry.npm.taobao.org/asynckit/download/asynckit-0.4.0.tgz",
|
||||
@@ -2057,7 +2065,7 @@
|
||||
},
|
||||
"babel-helper-vue-jsx-merge-props": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "http://registry.npm.taobao.org/babel-helper-vue-jsx-merge-props/download/babel-helper-vue-jsx-merge-props-2.0.3.tgz",
|
||||
"resolved": "https://registry.npm.taobao.org/babel-helper-vue-jsx-merge-props/download/babel-helper-vue-jsx-merge-props-2.0.3.tgz",
|
||||
"integrity": "sha1-Iq69OzOQIyjlEyk6jkmSs4T58bY="
|
||||
},
|
||||
"babel-loader": {
|
||||
@@ -2096,7 +2104,7 @@
|
||||
},
|
||||
"babel-runtime": {
|
||||
"version": "6.26.0",
|
||||
"resolved": "http://registry.npm.taobao.org/babel-runtime/download/babel-runtime-6.26.0.tgz",
|
||||
"resolved": "https://registry.npm.taobao.org/babel-runtime/download/babel-runtime-6.26.0.tgz",
|
||||
"integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=",
|
||||
"requires": {
|
||||
"core-js": "^2.4.0",
|
||||
@@ -2104,9 +2112,9 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"core-js": {
|
||||
"version": "2.6.10",
|
||||
"resolved": "https://registry.npm.taobao.org/core-js/download/core-js-2.6.10.tgz?cache=0&sync_timestamp=1573985371469&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcore-js%2Fdownload%2Fcore-js-2.6.10.tgz",
|
||||
"integrity": "sha1-iluDkfjMcBPacDQRzltYVwYwDX8="
|
||||
"version": "2.6.12",
|
||||
"resolved": "https://registry.npm.taobao.org/core-js/download/core-js-2.6.12.tgz?cache=0&sync_timestamp=1611038902573&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcore-js%2Fdownload%2Fcore-js-2.6.12.tgz",
|
||||
"integrity": "sha1-2TM9+nsGXjR8xWgiGdb2kIWcwuw="
|
||||
},
|
||||
"regenerator-runtime": {
|
||||
"version": "0.11.1",
|
||||
@@ -4114,9 +4122,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"element-ui": {
|
||||
"version": "2.13.1",
|
||||
"resolved": "https://registry.npm.taobao.org/element-ui/download/element-ui-2.13.1.tgz?cache=0&sync_timestamp=1586761028754&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Felement-ui%2Fdownload%2Felement-ui-2.13.1.tgz",
|
||||
"integrity": "sha1-DLGkXPJ6phxgHe++GSdArFy533w=",
|
||||
"version": "2.15.0",
|
||||
"resolved": "https://registry.npm.taobao.org/element-ui/download/element-ui-2.15.0.tgz?cache=0&sync_timestamp=1610713839122&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Felement-ui%2Fdownload%2Felement-ui-2.15.0.tgz",
|
||||
"integrity": "sha1-3ptzqNHj47UOgrkjpfqVKVI5vUE=",
|
||||
"requires": {
|
||||
"async-validator": "~1.8.1",
|
||||
"babel-helper-vue-jsx-merge-props": "^2.0.0",
|
||||
@@ -4124,16 +4132,6 @@
|
||||
"normalize-wheel": "^1.0.1",
|
||||
"resize-observer-polyfill": "^1.5.0",
|
||||
"throttle-debounce": "^1.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"async-validator": {
|
||||
"version": "1.8.5",
|
||||
"resolved": "https://registry.npm.taobao.org/async-validator/download/async-validator-1.8.5.tgz",
|
||||
"integrity": "sha1-3D4I7B/Q3dtn5ghC8CwM0c7G1/A=",
|
||||
"requires": {
|
||||
"babel-runtime": "6.x"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"elliptic": {
|
||||
@@ -7521,7 +7519,7 @@
|
||||
},
|
||||
"normalize-wheel": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npm.taobao.org/normalize-wheel/download/normalize-wheel-1.0.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fnormalize-wheel%2Fdownload%2Fnormalize-wheel-1.0.1.tgz",
|
||||
"resolved": "https://registry.npm.taobao.org/normalize-wheel/download/normalize-wheel-1.0.1.tgz",
|
||||
"integrity": "sha1-rsiGr/2wRQcNhWRH32Ls+GFG7EU="
|
||||
},
|
||||
"npm-run-path": {
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
"axios": "^0.19.0",
|
||||
"core-js": "^3.3.2",
|
||||
"echarts": "^4.5.0",
|
||||
"element-ui": "^2.10.0",
|
||||
"element-ui": "^2.15.0",
|
||||
"jquery": "^3.5.1",
|
||||
"js-cookie": "^2.2.1",
|
||||
"mavon-editor": "^2.9.0",
|
||||
|
||||
@@ -37,6 +37,21 @@ export default {
|
||||
},
|
||||
pageUnlock: data => {
|
||||
return request({url: '/zyplayer-doc-wiki/page/unlock', method: 'post', data: Qs.stringify(data)});
|
||||
},
|
||||
spaceFavoriteUpdate: data => {
|
||||
return request({url: '/zyplayer-doc-wiki/space/favorite/update', method: 'post', data: Qs.stringify(data)});
|
||||
},
|
||||
spaceAuthAssign: data => {
|
||||
return request({url: '/zyplayer-doc-wiki/space/auth/assign', method: 'post', data: Qs.stringify(data)});
|
||||
},
|
||||
spaceAuthList: data => {
|
||||
return request({url: '/zyplayer-doc-wiki/space/auth/list', method: 'post', data: Qs.stringify(data)});
|
||||
},
|
||||
spaceSettingList: data => {
|
||||
return request({url: '/zyplayer-doc-wiki/space/setting/list', method: 'post', data: Qs.stringify(data)});
|
||||
},
|
||||
spaceSettingUpdate: data => {
|
||||
return request({url: '/zyplayer-doc-wiki/space/setting/update', method: 'post', data: Qs.stringify(data)});
|
||||
},
|
||||
spaceList: data => {
|
||||
return request({url: '/zyplayer-doc-wiki/space/list', method: 'post', data: Qs.stringify(data)});
|
||||
|
||||
@@ -17,6 +17,9 @@ export default {
|
||||
getUserBaseInfo: data => {
|
||||
return request({url: '/zyplayer-doc-wiki/common/user/base', method: 'post', data: Qs.stringify(data)});
|
||||
},
|
||||
userGroupList: data => {
|
||||
return request({url: '/user/group/list', method: 'post', data: Qs.stringify(data)});
|
||||
},
|
||||
getUserMessageList: data => {
|
||||
return request({url: '/user/message/list', method: 'post', data: Qs.stringify(data)});
|
||||
},
|
||||
|
||||
@@ -84,72 +84,13 @@
|
||||
<router-view @loadPageList="loadPageList"
|
||||
@changeExpandedKeys="changeWikiPageExpandedKeys"
|
||||
@switchSpace="switchSpacePage"
|
||||
@loadSpace="loadSpaceList"
|
||||
:spaceId="choiceSpace"
|
||||
:spaceInfo="getSpaceInfo(choiceSpace)">
|
||||
</router-view>
|
||||
</el-main>
|
||||
</el-container>
|
||||
</el-container>
|
||||
<!--新建空间弹窗-->
|
||||
<el-dialog title="创建空间" :visible.sync="newSpaceDialogVisible" width="600px" :close-on-click-modal="false">
|
||||
<el-form label-width="100px" :model="newSpaceForm" :rules="newSpaceFormRules" ref="newSpaceForm">
|
||||
<el-form-item label="空间名:" prop="name">
|
||||
<el-input v-model="newSpaceForm.name"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="空间描述:" prop="spaceExplain">
|
||||
<el-input v-model="newSpaceForm.spaceExplain"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="空间开放:">
|
||||
<el-switch v-model="newSpaceForm.openDoc" inactive-text="需要登录" :inactive-value="0" active-text="开放访问" :active-value="1"></el-switch>
|
||||
</el-form-item>
|
||||
<el-form-item label="目录加载:">
|
||||
<el-switch v-model="newSpaceForm.treeLazyLoad" inactive-text="预先加载" :inactive-value="0" active-text="延迟加载" :active-value="1"></el-switch>
|
||||
</el-form-item>
|
||||
<el-form-item label="空间类型:">
|
||||
<el-select v-model="newSpaceForm.type" filterable placeholder="选择类型" style="width: 100%;">
|
||||
<el-option :key="1" label="公共空间" :value="1">
|
||||
<span style="float: left">公共空间</span>
|
||||
<span style="float: right; color: #8492a6; font-size: 13px;">属于公共,登录用户可访问、编辑</span>
|
||||
</el-option>
|
||||
<el-option :key="2" label="个人空间" :value="2">
|
||||
<span style="float: left">个人空间</span>
|
||||
<span style="float: right; color: #8492a6; font-size: 13px;">属于个人,所有登录用户可访问</span>
|
||||
</el-option>
|
||||
<el-option :key="3" label="隐私空间" :value="3">
|
||||
<span style="float: left">隐私空间</span>
|
||||
<span style="float: right; color: #8492a6; font-size: 13px;">属于个人,仅创建者可访问</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" v-if="newSpaceForm.id > 0" @click="onNewSpaceSubmit('newSpaceForm')">保存修改</el-button>
|
||||
<el-button type="primary" v-else @click="onNewSpaceSubmit('newSpaceForm')">立即创建</el-button>
|
||||
<el-button @click="onNewSpaceCancel">取消</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-dialog>
|
||||
<!--管理空间弹窗-->
|
||||
<el-dialog title="管理空间" :visible.sync="manageSpaceDialogVisible" :close-on-click-modal="false" width="80%">
|
||||
<el-table :data="spaceList" border style="width: 100%; margin-bottom: 5px;" max-height="500">
|
||||
<el-table-column prop="id" label="ID" width="60"></el-table-column>
|
||||
<el-table-column prop="name" label="名字"></el-table-column>
|
||||
<el-table-column prop="spaceExplain" label="说明"></el-table-column>
|
||||
<el-table-column label="开放地址">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" @click="showOpenSpace(scope.row.uuid)" v-if="scope.row.openDoc == 1">{{scope.row.name}}</el-button>
|
||||
<span v-else>暂未开放</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="createUserName" label="创建人"></el-table-column>
|
||||
<el-table-column prop="createTime" label="创建时间"></el-table-column>
|
||||
<el-table-column label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="small" type="primary" v-on:click="editSpaceInfo(scope.row)">编辑</el-button>
|
||||
<el-button size="small" type="danger" v-on:click="deleteSpaceInfo(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
<!--关于弹窗-->
|
||||
<el-dialog title="关于zyplayer-doc-wiki" :visible.sync="aboutDialogVisible" width="600px">
|
||||
<el-form>
|
||||
@@ -168,12 +109,14 @@
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-dialog>
|
||||
<create-space ref="createSpace" @success="loadSpaceList"></create-space>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import userApi from '../../common/api/user'
|
||||
import pageApi from '../../common/api/page'
|
||||
import CreateSpace from '../space/CreateSpace'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
@@ -191,15 +134,6 @@
|
||||
spaceList:[],
|
||||
choiceSpace: "",
|
||||
nowSpaceShow: {},
|
||||
newSpaceDialogVisible: false,
|
||||
manageSpaceDialogVisible: false,
|
||||
newSpaceForm: {id: '', name: '', spaceExplain: '', treeLazyLoad: 0, openDoc: 0, uuid: '', type: 1},
|
||||
newSpaceFormRules: {
|
||||
name: [
|
||||
{required: true, message: '请输入空间名', trigger: 'blur'},
|
||||
{min: 2, max: 25, message: '长度在 2 到 25 个字符', trigger: 'blur'}
|
||||
],
|
||||
},
|
||||
nowPageId: '',
|
||||
// 依据目录树存储的map全局对象
|
||||
treePathDataMap: new Map(),
|
||||
@@ -223,6 +157,9 @@
|
||||
},
|
||||
}
|
||||
},
|
||||
components: {
|
||||
"create-space": CreateSpace,
|
||||
},
|
||||
computed: {
|
||||
},
|
||||
mounted: function () {
|
||||
@@ -323,38 +260,14 @@
|
||||
// issues:I2CG72 忽略大小写
|
||||
let name = data.name.toLowerCase();
|
||||
return name.indexOf(value.toLowerCase()) !== -1;
|
||||
},
|
||||
showOpenSpace(space) {
|
||||
let routeUrl = this.$router.resolve({path: '/page/share/home', query: {space: space}});
|
||||
window.open(routeUrl.href, '_blank');
|
||||
},
|
||||
editSpaceInfo(row) {
|
||||
this.newSpaceForm = {
|
||||
id: row.id, name: row.name, spaceExplain: row.spaceExplain,
|
||||
treeLazyLoad: row.treeLazyLoad, openDoc: row.openDoc, type: row.type
|
||||
};
|
||||
this.newSpaceDialogVisible = true;
|
||||
},
|
||||
deleteSpaceInfo(row) {
|
||||
this.$confirm('确定要删除此空间及下面的所有文档吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
let param = {id: row.id, delFlag: 1};
|
||||
pageApi.updateSpace(param).then(() => {
|
||||
this.loadSpaceList();
|
||||
});
|
||||
});
|
||||
},
|
||||
spaceChangeEvents(data) {
|
||||
if (data == 0) {
|
||||
// 新建空间
|
||||
this.newSpaceForm = {id: '', name: '', spaceExplain: '', treeLazyLoad: 0, openDoc: 0, uuid: '', type: 1};
|
||||
this.newSpaceDialogVisible = true;
|
||||
this.$refs.createSpace.show();
|
||||
} else if (data == -1) {
|
||||
// 管理空间
|
||||
this.manageSpaceDialogVisible = true;
|
||||
this.$router.push({path: '/space/manage'});
|
||||
} else {
|
||||
this.choiceSpace = data;
|
||||
for (let i = 0; i < this.spaceList.length; i++) {
|
||||
@@ -368,26 +281,27 @@
|
||||
this.$router.push({path: '/home', query: {spaceId: data}});
|
||||
}
|
||||
},
|
||||
loadSpaceList() {
|
||||
loadSpaceList(spaceId) {
|
||||
pageApi.spaceList({}).then(json => {
|
||||
this.spaceList = json.data || [];
|
||||
let spaceOptions = [];
|
||||
for (let i = 0; i < this.spaceList.length; i++) {
|
||||
spaceOptions.push({
|
||||
label: this.spaceList[i].name, value: this.spaceList[i].id
|
||||
});
|
||||
}
|
||||
this.spaceList.forEach(item => spaceOptions.push({label: item.name, value: item.id}));
|
||||
this.spaceOptions = spaceOptions;
|
||||
if (this.spaceList.length > 0) {
|
||||
let spaceId = this.spaceList[0].id;
|
||||
this.nowSpaceShow = this.spaceList[0];
|
||||
this.choiceSpace = spaceId;
|
||||
if (this.spaceList.length > 0) {
|
||||
let nowSpaceId = spaceId;
|
||||
let nowSpaceShow = this.spaceList.find(item => item.id == spaceId);
|
||||
if (!nowSpaceShow) {
|
||||
nowSpaceShow = this.spaceList[0];
|
||||
nowSpaceId = nowSpaceShow.id;
|
||||
}
|
||||
this.nowSpaceShow = nowSpaceShow;
|
||||
this.choiceSpace = nowSpaceId;
|
||||
this.nowPageId = '';
|
||||
this.doGetPageList(null);
|
||||
// TODO 在首页时跳转
|
||||
try {
|
||||
if (this.$router.app._route.path == "/home") {
|
||||
this.$router.push({path: '/home', query: {spaceId: spaceId}});
|
||||
this.$router.push({path: '/home', query: {spaceId: nowSpaceId}});
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
@@ -452,38 +366,6 @@
|
||||
}
|
||||
return {};
|
||||
},
|
||||
onNewSpaceSubmit(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
let param = {
|
||||
id: this.newSpaceForm.id,
|
||||
name: this.newSpaceForm.name,
|
||||
type: this.newSpaceForm.type,
|
||||
openDoc: this.newSpaceForm.openDoc,
|
||||
spaceExplain: this.newSpaceForm.spaceExplain,
|
||||
treeLazyLoad: this.newSpaceForm.treeLazyLoad,
|
||||
};
|
||||
pageApi.updateSpace(param).then(json => {
|
||||
if (param.id > 0) {
|
||||
this.loadSpaceList();
|
||||
} else {
|
||||
this.spaceList.push(json.data);
|
||||
this.spaceOptions.push({
|
||||
label: json.data.name, value: json.data.id
|
||||
});
|
||||
this.nowSpaceShow = json.data;
|
||||
this.choiceSpace = json.data.id;
|
||||
this.doGetPageList(null);
|
||||
}
|
||||
this.newSpaceForm = {id: '', name: '', spaceExplain: '', treeLazyLoad: 0, openDoc: 0, uuid: '', type: 1};
|
||||
this.newSpaceDialogVisible = false;
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
onNewSpaceCancel() {
|
||||
this.newSpaceDialogVisible = false;
|
||||
},
|
||||
checkSystemUpgrade() {
|
||||
userApi.systemUpgradeInfo({}).then(json => {
|
||||
if (!!json.data) {
|
||||
|
||||
121
zyplayer-doc-ui/wiki-ui/src/components/space/CreateSpace.vue
Normal file
121
zyplayer-doc-ui/wiki-ui/src/components/space/CreateSpace.vue
Normal file
@@ -0,0 +1,121 @@
|
||||
<template>
|
||||
<div class="create-space-vue">
|
||||
<!--新建空间弹窗-->
|
||||
<el-dialog title="创建空间" :visible.sync="newSpaceDialogVisible" width="600px" :close-on-click-modal="false">
|
||||
<el-form label-width="100px" :model="newSpaceForm" :rules="newSpaceFormRules" ref="newSpaceForm">
|
||||
<el-form-item label="空间名:" prop="name">
|
||||
<el-input v-model="newSpaceForm.name"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="空间描述:" prop="spaceExplain">
|
||||
<el-input v-model="newSpaceForm.spaceExplain"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="空间开放:">
|
||||
<el-switch v-model="newSpaceForm.openDoc" inactive-text="需要登录" :inactive-value="0" active-text="开放访问" :active-value="1"></el-switch>
|
||||
</el-form-item>
|
||||
<el-form-item label="目录加载:">
|
||||
<el-switch v-model="newSpaceForm.treeLazyLoad" inactive-text="预先加载" :inactive-value="0" active-text="延迟加载" :active-value="1"></el-switch>
|
||||
</el-form-item>
|
||||
<el-form-item label="空间类型:">
|
||||
<el-select v-model="newSpaceForm.type" filterable placeholder="选择类型" style="width: 100%;">
|
||||
<el-option :key="1" label="公共空间" :value="1">
|
||||
<span style="float: left">公共空间</span>
|
||||
<span style="float: right; color: #8492a6; font-size: 13px;">属于公共,登录用户可访问、编辑</span>
|
||||
</el-option>
|
||||
<el-option :key="2" label="个人空间" :value="2">
|
||||
<span style="float: left">个人空间</span>
|
||||
<span style="float: right; color: #8492a6; font-size: 13px;">属于个人,所有登录用户可访问</span>
|
||||
</el-option>
|
||||
<el-option :key="3" label="隐私空间" :value="3">
|
||||
<span style="float: left">隐私空间</span>
|
||||
<span style="float: right; color: #8492a6; font-size: 13px;">属于个人,仅创建者可访问</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" v-if="newSpaceForm.id > 0" @click="onNewSpaceSubmit('newSpaceForm')">保存修改</el-button>
|
||||
<el-button type="primary" v-else @click="onNewSpaceSubmit('newSpaceForm')">立即创建</el-button>
|
||||
<el-button @click="onNewSpaceCancel">取消</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import pageApi from '../../common/api/page'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
newSpaceDialogVisible: false,
|
||||
manageSpaceDialogVisible: false,
|
||||
newSpaceForm: {id: '', name: '', spaceExplain: '', treeLazyLoad: 0, openDoc: 0, uuid: '', type: 1},
|
||||
newSpaceFormRules: {
|
||||
name: [
|
||||
{required: true, message: '请输入空间名', trigger: 'blur'},
|
||||
{min: 2, max: 25, message: '长度在 2 到 25 个字符', trigger: 'blur'}
|
||||
],
|
||||
},
|
||||
editSpaceId: ''
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
show(spaceId) {
|
||||
this.newSpaceForm = {id: '', name: '', spaceExplain: '', treeLazyLoad: 0, openDoc: 0, uuid: '', type: 1};
|
||||
this.editSpaceId = spaceId || '';
|
||||
if (!!this.editSpaceId) {
|
||||
pageApi.spaceList({id: this.editSpaceId}).then(json => {
|
||||
let spaceList = json.data || [];
|
||||
if (spaceList.length > 0) {
|
||||
this.newSpaceForm = spaceList[0];
|
||||
}
|
||||
});
|
||||
}
|
||||
this.newSpaceDialogVisible = true;
|
||||
},
|
||||
onNewSpaceSubmit(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
let param = {
|
||||
id: this.newSpaceForm.id,
|
||||
name: this.newSpaceForm.name,
|
||||
type: this.newSpaceForm.type,
|
||||
openDoc: this.newSpaceForm.openDoc,
|
||||
spaceExplain: this.newSpaceForm.spaceExplain,
|
||||
treeLazyLoad: this.newSpaceForm.treeLazyLoad,
|
||||
};
|
||||
pageApi.updateSpace(param).then(json => {
|
||||
this.$message.success("创建成功");
|
||||
this.newSpaceDialogVisible = false;
|
||||
this.$emit("success", json.data.id);
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
onNewSpaceCancel() {
|
||||
this.newSpaceDialogVisible = false;
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
.create-space-vue .empty-news{text-align: center;padding: 100px;}
|
||||
|
||||
.create-space-vue .text-link {
|
||||
color: #444;
|
||||
/*cursor: pointer;*/
|
||||
/*font-weight: bold;*/
|
||||
}
|
||||
.create-space-vue .line-box{color: #666;border-bottom: 1px solid #eee;padding: 20px 0;}
|
||||
.create-space-vue .line-title{font-size: 14px;}
|
||||
.create-space-vue .page-preview-box{}
|
||||
.create-space-vue .page-preview-title{font-size: 18px;margin: 10px 0 5px 0;color: #3a8ee6;cursor: pointer;}
|
||||
.create-space-vue .page-preview-content{font-size: 16px;margin-bottom: 5px;}
|
||||
.create-space-vue .zan-img{vertical-align: middle;margin-top: -3px;}
|
||||
.create-space-vue .view-img{font-size: 16px;color: #666;}
|
||||
|
||||
.create-space-vue .page-info-box{text-align: right;margin: 20px 0 50px 0;}
|
||||
</style>
|
||||
|
||||
@@ -15,6 +15,7 @@ let routes = [
|
||||
{path: '/user/myInfo', name: 'WIKI-我的信息', component: () => import('@/views/user/MyInfo')},
|
||||
{path: '/page/show', name: 'WIKI-内容展示', component: () => import('@/views/page/Show')},
|
||||
{path: '/page/edit', name: 'WIKI-编辑内容', component: () => import('@/views/page/Edit')},
|
||||
{path: '/space/manage', name: 'WIKI-空间管理', component: () => import('@/views/space/Manage')},
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="createTime" label="创建时间" width="180px"></el-table-column>
|
||||
<el-table-column prop="downloadNum" label="下载次数" width="80px"></el-table-column>
|
||||
<el-table-column label="操作" width="100px" v-if="wikiPageAuth.canUploadFile==1">
|
||||
<el-table-column label="操作" width="100px" v-if="wikiPageAuth.canDeleteFile==1">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="small" v-on:click="deletePageFile(scope.row)">删除</el-button>
|
||||
</template>
|
||||
@@ -168,7 +168,7 @@
|
||||
<!--人员权限弹窗-->
|
||||
<el-dialog title="页面权限" :visible.sync="pageAuthDialogVisible" width="900px">
|
||||
<el-row>
|
||||
<el-select v-model="pageAuthNewUser" filterable remote reserve-keyword
|
||||
<el-select v-model="pageAuthNewUser" filterable remote reserve-keyword autoComplete="new-password"
|
||||
placeholder="请输入名字、邮箱、账号搜索用户" :remote-method="getSearchUserList"
|
||||
:loading="pageAuthUserLoading" style="width: 750px;margin-right: 10px;">
|
||||
<el-option v-for="item in searchUserList" :key="item.id" :label="item.userName" :value="item.id"></el-option>
|
||||
@@ -272,12 +272,9 @@
|
||||
});
|
||||
},
|
||||
getSearchUserList(query) {
|
||||
if (query == '') {
|
||||
return;
|
||||
}
|
||||
if (query == '') return;
|
||||
this.pageAuthUserLoading = true;
|
||||
var param = {search: query};
|
||||
userApi.getUserBaseInfo(param).then(json => {
|
||||
userApi.getUserBaseInfo({search: query}).then(json => {
|
||||
this.searchUserList = json.data || [];
|
||||
this.pageAuthUserLoading = false;
|
||||
});
|
||||
@@ -306,6 +303,10 @@
|
||||
this.$message.warning("请先选择用户");
|
||||
return;
|
||||
}
|
||||
if (!!this.searchUserList.find(item => item.userId == this.pageAuthNewUser)) {
|
||||
this.pageAuthNewUser = "";
|
||||
return;
|
||||
}
|
||||
var userName = "";
|
||||
for (var i = 0; i < this.searchUserList.length; i++) {
|
||||
if (this.pageAuthNewUser == this.searchUserList[i].id) {
|
||||
@@ -483,6 +484,7 @@
|
||||
canEdit: result.canEdit,
|
||||
canDelete: result.canDelete,
|
||||
canUploadFile: result.canUploadFile,
|
||||
canDeleteFile: result.canDeleteFile,
|
||||
canConfigAuth: result.canConfigAuth,
|
||||
};
|
||||
if (this.wikiPage.editorType === 2) {
|
||||
|
||||
253
zyplayer-doc-ui/wiki-ui/src/views/space/Manage.vue
Normal file
253
zyplayer-doc-ui/wiki-ui/src/views/space/Manage.vue
Normal file
@@ -0,0 +1,253 @@
|
||||
<template>
|
||||
<div style="min-height: 100%;" class="space-manage-vue">
|
||||
<el-breadcrumb separator-class="el-icon-arrow-right" style="padding: 20px 10px;">
|
||||
<el-breadcrumb-item>WIKI文档</el-breadcrumb-item>
|
||||
<el-breadcrumb-item>空间管理</el-breadcrumb-item>
|
||||
</el-breadcrumb>
|
||||
<div style="max-width: 1200px;margin: 0 auto;background: #fff;padding: 20px;min-height: 100%;box-sizing: border-box;">
|
||||
<div style="text-align: right;margin-bottom: 10px;">
|
||||
<span style="float:left;line-height: 40px;">
|
||||
仅展示我收藏的空间:
|
||||
<el-switch v-model="userSetting.wiki_only_show_favorite" inactive-value="0" active-value="1" @change="wikiOnlyShowFavoriteChange"></el-switch>
|
||||
<el-tooltip class="item" effect="dark" content="控制左上角空间下拉列表仅展示我收藏的空间" placement="top-start">
|
||||
<i class="el-icon-warning-outline" style="vertical-align: middle;margin-left: 10px;color: #999;"></i>
|
||||
</el-tooltip>
|
||||
</span>
|
||||
<el-button @click="loadSpaceList" icon="refresh" :loading="spaceListLoading">刷新</el-button>
|
||||
<el-button type="primary" @click="showCreateSpace" icon="el-icon-plus">创建空间</el-button>
|
||||
</div>
|
||||
<el-table :data="spaceList" border style="width: 100%; margin-bottom: 5px;">
|
||||
<el-table-column prop="id" label="ID" width="60"></el-table-column>
|
||||
<el-table-column prop="name" label="名字"></el-table-column>
|
||||
<el-table-column prop="spaceExplain" label="说明"></el-table-column>
|
||||
<el-table-column label="开放地址">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" @click="showOpenSpace(scope.row.uuid)" v-if="scope.row.openDoc == 1">{{scope.row.name}}</el-button>
|
||||
<span v-else>暂未开放</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="createUserName" label="创建人"></el-table-column>
|
||||
<el-table-column prop="createTime" label="创建时间"></el-table-column>
|
||||
<el-table-column prop="favorite" label="收藏" width="60">
|
||||
<template slot-scope="scope">
|
||||
<i class="el-icon-star-on favorite-icon" v-if="scope.row.favorite == 1" @click="updateSpaceFavorite(scope.row)"></i>
|
||||
<i class="el-icon-star-off favorite-icon" v-else @click="updateSpaceFavorite(scope.row)"></i>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="220">
|
||||
<template slot-scope="scope" v-if="userSelfInfo.id == scope.row.createUserId">
|
||||
<el-button size="small" type="primary" v-on:click="editSpaceInfo(scope.row)">编辑</el-button>
|
||||
<el-button size="small" type="warning" v-on:click="editSpaceAuth(scope.row)">授权</el-button>
|
||||
<el-button size="small" type="danger" v-on:click="deleteSpaceInfo(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<!--分组权限弹窗-->
|
||||
<el-dialog title="权限管理" :visible.sync="spaceAuthDialogVisible" width="900px">
|
||||
<el-row>
|
||||
<el-select v-model="spaceAuthNewGroupId" filterable placeholder="请选择分组" style="width: 750px;margin-right: 10px;">
|
||||
<el-option v-for="item in searchGroupList" :key="item.id" :label="searchGroupMap[item.id]" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
<el-button v-on:click="addSpaceAuthUserGroup">添加</el-button>
|
||||
</el-row>
|
||||
<el-table :data="spaceAuthGroupList" border style="width: 100%; margin: 10px 0;">
|
||||
<el-table-column prop="groupId" label="分组名" width="150">
|
||||
<template slot-scope="scope">{{searchGroupMap[scope.row.groupId]}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="权限">
|
||||
<template slot-scope="scope">
|
||||
<el-checkbox :true-label="1" :false-label="0" v-model="scope.row.editPage">编辑</el-checkbox>
|
||||
<el-checkbox :true-label="1" :false-label="0" v-model="scope.row.deletePage">删除</el-checkbox>
|
||||
<el-checkbox :true-label="1" :false-label="0" v-model="scope.row.pageFileUpload">文件上传</el-checkbox>
|
||||
<el-checkbox :true-label="1" :false-label="0" v-model="scope.row.pageFileDelete">文件删除</el-checkbox>
|
||||
<el-checkbox :true-label="1" :false-label="0" v-model="scope.row.pageAuthManage">权限管理</el-checkbox>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="80">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="small" type="danger" plain @click="deleteGroupSpaceAuth(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div style="text-align: right;">
|
||||
<el-button v-on:click="manageUserGroup">分组管理</el-button>
|
||||
<el-button type="primary" v-on:click="saveGroupSpaceAuth">保存配置</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<create-space ref="createSpace" @success="loadSpaceList"></create-space>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import pageApi from '../../common/api/page'
|
||||
import userApi from '../../common/api/user'
|
||||
import CreateSpace from '../../components/space/CreateSpace'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
spaceListLoading: false,
|
||||
spaceOptions: [],
|
||||
spaceList:[],
|
||||
choiceSpace: "",
|
||||
nowSpaceShow: {},
|
||||
newSpaceDialogVisible: false,
|
||||
manageSpaceDialogVisible: false,
|
||||
newSpaceForm: {id: '', name: '', spaceExplain: '', treeLazyLoad: 0, openDoc: 0, uuid: '', type: 1},
|
||||
newSpaceFormRules: {
|
||||
name: [
|
||||
{required: true, message: '请输入空间名', trigger: 'blur'},
|
||||
{min: 2, max: 25, message: '长度在 2 到 25 个字符', trigger: 'blur'}
|
||||
],
|
||||
},
|
||||
userSelfInfo: {},
|
||||
// 空间授权
|
||||
editSpaceId: '',
|
||||
spaceAuthDialogVisible: false,
|
||||
spaceAuthNewGroupId: '',
|
||||
spaceAuthGroupLoading: false,
|
||||
searchGroupList: [],
|
||||
searchGroupMap: {},
|
||||
spaceAuthGroupList: [],
|
||||
// 设置
|
||||
userSetting: {
|
||||
wiki_only_show_favorite: 0,
|
||||
},
|
||||
};
|
||||
},
|
||||
components: {
|
||||
"create-space": CreateSpace,
|
||||
},
|
||||
mounted() {
|
||||
this.loadSpaceList();
|
||||
this.getSelfUserInfo();
|
||||
this.getSpaceSettingList();
|
||||
},
|
||||
methods: {
|
||||
showOpenSpace(space) {
|
||||
let routeUrl = this.$router.resolve({path: '/page/share/home', query: {space: space}});
|
||||
window.open(routeUrl.href, '_blank');
|
||||
},
|
||||
showCreateSpace() {
|
||||
this.$refs.createSpace.show();
|
||||
},
|
||||
editSpaceInfo(row) {
|
||||
this.$refs.createSpace.show(row.id);
|
||||
},
|
||||
addSpaceAuthUserGroup() {
|
||||
if (!this.spaceAuthNewGroupId) {
|
||||
this.$message.warning("请先选择分组");
|
||||
return;
|
||||
}
|
||||
if (!!this.spaceAuthGroupList.find(item => item.groupId == this.spaceAuthNewGroupId)) {
|
||||
this.spaceAuthNewGroupId = "";
|
||||
return;
|
||||
}
|
||||
this.spaceAuthGroupList.push({
|
||||
groupId: this.spaceAuthNewGroupId,
|
||||
editPage: 0,
|
||||
commentPage: 0,
|
||||
deletePage: 0,
|
||||
pageFileUpload: 0,
|
||||
pageFileDelete: 0,
|
||||
pageAuthManage: 0,
|
||||
});
|
||||
this.spaceAuthNewGroupId = '';
|
||||
},
|
||||
updateSpaceFavorite(row) {
|
||||
let delFlag = (row.favorite == 1) ? 1 : 0;
|
||||
pageApi.spaceFavoriteUpdate({spaceId: row.id, delFlag: delFlag}).then(json => {
|
||||
row.favorite = (row.favorite == 1) ? 0 : 1;
|
||||
});
|
||||
},
|
||||
saveGroupSpaceAuth() {
|
||||
let param = {spaceId: this.editSpaceId, authList: JSON.stringify(this.spaceAuthGroupList)};
|
||||
pageApi.spaceAuthAssign(param).then(json => {
|
||||
this.$message.success("授权成功!");
|
||||
});
|
||||
},
|
||||
manageUserGroup() {
|
||||
let manageUrl = location.href.substring(0, location.href.indexOf("/doc-wiki")) + '#/console/userGroupList';
|
||||
window.open(manageUrl, '_blank');
|
||||
},
|
||||
deleteGroupSpaceAuth(row) {
|
||||
this.spaceAuthGroupList = this.spaceAuthGroupList.filter(item => item.groupId != row.groupId);
|
||||
},
|
||||
editSpaceAuth(row) {
|
||||
this.editSpaceId = row.id;
|
||||
this.spaceAuthNewGroupId = '';
|
||||
this.spaceAuthGroupList = [];
|
||||
userApi.userGroupList().then(json => {
|
||||
this.searchGroupList = json.data || [];
|
||||
this.searchGroupList.forEach(item => this.searchGroupMap[item.id] = item.name);
|
||||
});
|
||||
pageApi.spaceAuthList({spaceId: row.id}).then(json => {
|
||||
this.spaceAuthGroupList = json.data || [];
|
||||
this.spaceAuthDialogVisible = true;
|
||||
});
|
||||
},
|
||||
deleteSpaceInfo(row) {
|
||||
this.$confirm('确定要删除此空间及下面的所有文档吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
let param = {id: row.id, delFlag: 1};
|
||||
pageApi.updateSpace(param).then(() => {
|
||||
this.$message.success("删除成功");
|
||||
this.loadSpaceList();
|
||||
this.$emit('loadSpace');
|
||||
});
|
||||
});
|
||||
},
|
||||
loadSpaceList() {
|
||||
this.spaceListLoading = true;
|
||||
pageApi.spaceList({ignoreFavorite: 1}).then(json => {
|
||||
this.spaceList = json.data || [];
|
||||
setTimeout(() => this.spaceListLoading = false, 500);
|
||||
});
|
||||
},
|
||||
wikiOnlyShowFavoriteChange() {
|
||||
let param = {name: 'wiki_only_show_favorite', value: this.userSetting.wiki_only_show_favorite};
|
||||
pageApi.spaceSettingUpdate(param).then(json => {
|
||||
this.$emit('loadSpace');
|
||||
});
|
||||
},
|
||||
getSpaceSettingList() {
|
||||
pageApi.spaceSettingList().then(json => {
|
||||
let result = json.data || {};
|
||||
this.userSetting = {
|
||||
wiki_only_show_favorite: result.wiki_only_show_favorite || 0,
|
||||
};
|
||||
});
|
||||
},
|
||||
getSelfUserInfo() {
|
||||
userApi.getSelfUserInfo().then(json=>{
|
||||
this.userSelfInfo = json.data;
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
.space-manage-vue .empty-news{text-align: center;padding: 100px;}
|
||||
|
||||
.space-manage-vue .text-link {
|
||||
color: #444;
|
||||
/*cursor: pointer;*/
|
||||
/*font-weight: bold;*/
|
||||
}
|
||||
.space-manage-vue .line-box{color: #666;border-bottom: 1px solid #eee;padding: 20px 0;}
|
||||
.space-manage-vue .line-title{font-size: 14px;}
|
||||
.space-manage-vue .page-preview-box{}
|
||||
.space-manage-vue .page-preview-title{font-size: 18px;margin: 10px 0 5px 0;color: #3a8ee6;cursor: pointer;}
|
||||
.space-manage-vue .page-preview-content{font-size: 16px;margin-bottom: 5px;}
|
||||
.space-manage-vue .zan-img{vertical-align: middle;margin-top: -3px;}
|
||||
.space-manage-vue .view-img{font-size: 16px;color: #666;}
|
||||
|
||||
.space-manage-vue .page-info-box{text-align: right;margin: 20px 0 50px 0;}
|
||||
.space-manage-vue .favorite-icon{cursor: pointer; font-size: 20px;}
|
||||
.space-manage-vue .favorite-icon.el-icon-star-on{color: #E6A23C; font-size: 24px;}
|
||||
</style>
|
||||
|
||||
@@ -65,8 +65,8 @@ public class WikiCommonController {
|
||||
return DocResponseJson.ok();
|
||||
}
|
||||
QueryWrapper<UserInfo> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.like("user_name", search).or().like("user_no", search)
|
||||
.or().like("email", search);
|
||||
queryWrapper.and(con -> con.and(conSub -> conSub.like("user_name", search).or().like("user_no", search)
|
||||
.or().like("email", search)).and(conSub -> conSub.eq("del_flag", 0)));
|
||||
queryWrapper.select("id", "user_name");
|
||||
// 搜索最多返回20条
|
||||
IPage<UserInfo> page = new Page<>(1, 20, false);
|
||||
|
||||
@@ -8,6 +8,7 @@ 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.manage.mapper.UserGroupAuthMapper;
|
||||
import com.zyplayer.doc.data.repository.support.consts.DocAuthConst;
|
||||
import com.zyplayer.doc.data.repository.support.consts.UserMsgSysType;
|
||||
import com.zyplayer.doc.data.repository.support.consts.UserMsgType;
|
||||
@@ -55,18 +56,14 @@ public class WikiPageAuthController {
|
||||
WikiPageAuthService wikiPageAuthService;
|
||||
@Resource
|
||||
UserMessageService userMessageService;
|
||||
@Resource
|
||||
UserGroupAuthMapper userGroupAuthMapper;
|
||||
|
||||
@PostMapping("/assign")
|
||||
public ResponseJson<List<WikiPageZan>> assign(Long pageId, String authList) {
|
||||
DocUserDetails currentUser = DocUserUtil.getCurrentUser();
|
||||
WikiPage wikiPageSel = wikiPageService.getById(pageId);
|
||||
WikiSpace wikiSpaceSel = wikiSpaceService.getById(wikiPageSel.getSpaceId());
|
||||
// if (SpaceType.isPrivate(wikiSpaceSel.getType())) {
|
||||
// return DocResponseJson.warn("私人空间不可以编辑权限");
|
||||
// }
|
||||
// if (SpaceType.isPublic(wikiSpaceSel.getType())) {
|
||||
// return DocResponseJson.warn("公共空间不需要编辑权限");
|
||||
// }
|
||||
String canConfigAuth = wikiPageAuthService.canConfigAuth(wikiSpaceSel, pageId, currentUser.getUserId());
|
||||
if (canConfigAuth != null) {
|
||||
return DocResponseJson.warn(canConfigAuth);
|
||||
@@ -127,6 +124,9 @@ public class WikiPageAuthController {
|
||||
userMessage.setAffectUserId(userInfo.getId());
|
||||
userMessage.setAffectUserName(userInfo.getUserName());
|
||||
userMessageService.addWikiMessage(userMessage);
|
||||
// 刷新用户权限
|
||||
Set<String> userAuthSet = userAuthService.getUserAuthSet(authVo.getUserId());
|
||||
DocUserUtil.setUserAuth(authVo.getUserId(), userAuthSet);
|
||||
}
|
||||
return DocResponseJson.ok();
|
||||
}
|
||||
@@ -136,10 +136,9 @@ public class WikiPageAuthController {
|
||||
DocUserDetails currentUser = DocUserUtil.getCurrentUser();
|
||||
WikiPage wikiPageSel = wikiPageService.getById(pageId);
|
||||
WikiSpace wikiSpaceSel = wikiSpaceService.getById(wikiPageSel.getSpaceId());
|
||||
if (!Objects.equals(currentUser.getUserId(), wikiSpaceSel.getCreateUserId())) {
|
||||
if (!DocUserUtil.haveCustomAuth(WikiAuthType.PAGE_AUTH_MANAGE.getName(), DocAuthConst.WIKI + pageId)) {
|
||||
return DocResponseJson.warn("您没有权限管理该页面的权限");
|
||||
}
|
||||
String canConfigAuth = wikiPageAuthService.canConfigAuth(wikiSpaceSel, pageId, currentUser.getUserId());
|
||||
if (canConfigAuth != null) {
|
||||
return DocResponseJson.warn(canConfigAuth);
|
||||
}
|
||||
QueryWrapper<UserAuth> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("auth_custom_suffix", DocAuthConst.WIKI + pageId);
|
||||
|
||||
@@ -146,9 +146,11 @@ public class WikiPageController {
|
||||
String canEdit = wikiPageAuthService.canEdit(wikiSpaceSel, wikiPageSel.getEditType(), wikiPageSel.getId(), currentUser.getUserId());
|
||||
String canDelete = wikiPageAuthService.canDelete(wikiSpaceSel, wikiPageSel.getEditType(), wikiPageSel.getId(), currentUser.getUserId());
|
||||
String canUploadFile = wikiPageAuthService.canUploadFile(wikiSpaceSel, wikiPageSel.getId(), currentUser.getUserId());
|
||||
String canDeleteFile = wikiPageAuthService.canDeleteFile(wikiSpaceSel, wikiPageSel.getId(), currentUser.getUserId());
|
||||
String canConfigAuth = wikiPageAuthService.canConfigAuth(wikiSpaceSel, wikiPageSel.getId(), currentUser.getUserId());
|
||||
vo.setCanEdit((canEdit == null) ? 1 : 0);
|
||||
vo.setCanDelete((canDelete == null) ? 1 : 0);
|
||||
vo.setCanDeleteFile((canDeleteFile == null) ? 1 : 0);
|
||||
vo.setCanUploadFile((canUploadFile == null) ? 1 : 0);
|
||||
vo.setCanConfigAuth((canConfigAuth == null) ? 1 : 0);
|
||||
// 高并发下会有覆盖问题,但不重要~
|
||||
|
||||
@@ -83,9 +83,9 @@ public class WikiPageFileController {
|
||||
WikiPage wikiPageSel = wikiPageService.getById(pageFileSel.getPageId());
|
||||
WikiSpace wikiSpaceSel = wikiSpaceService.getById(wikiPageSel.getSpaceId());
|
||||
// 权限判断
|
||||
String canUploadFile = wikiPageAuthService.canUploadFile(wikiSpaceSel, pageFileSel.getPageId(), currentUser.getUserId());
|
||||
if (canUploadFile != null) {
|
||||
return DocResponseJson.warn(canUploadFile);
|
||||
String canDeleteFile = wikiPageAuthService.canDeleteFile(wikiSpaceSel, pageFileSel.getPageId(), currentUser.getUserId());
|
||||
if (canDeleteFile != null) {
|
||||
return DocResponseJson.warn(canDeleteFile);
|
||||
}
|
||||
wikiPageFile.setDelFlag(1);
|
||||
wikiPageFile.setUpdateUserId(currentUser.getUserId());
|
||||
|
||||
@@ -1,15 +1,29 @@
|
||||
package com.zyplayer.doc.wiki.controller;
|
||||
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
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.core.annotation.AuthMan;
|
||||
import com.zyplayer.doc.data.config.security.DocUserDetails;
|
||||
import com.zyplayer.doc.data.config.security.DocUserUtil;
|
||||
import com.zyplayer.doc.data.repository.manage.entity.UserGroupAuth;
|
||||
import com.zyplayer.doc.data.repository.manage.entity.UserSetting;
|
||||
import com.zyplayer.doc.data.repository.manage.entity.WikiSpace;
|
||||
import com.zyplayer.doc.data.repository.manage.entity.WikiSpaceFavorite;
|
||||
import com.zyplayer.doc.data.repository.support.consts.UserMsgSysType;
|
||||
import com.zyplayer.doc.data.repository.support.consts.UserSettingConst;
|
||||
import com.zyplayer.doc.data.service.manage.UserGroupAuthService;
|
||||
import com.zyplayer.doc.data.service.manage.UserSettingService;
|
||||
import com.zyplayer.doc.data.service.manage.WikiSpaceFavoriteService;
|
||||
import com.zyplayer.doc.data.service.manage.WikiSpaceService;
|
||||
import com.zyplayer.doc.wiki.framework.consts.SpaceType;
|
||||
import com.zyplayer.doc.wiki.controller.vo.UserSpaceAuthVo;
|
||||
import com.zyplayer.doc.wiki.controller.vo.WikiSpaceVo;
|
||||
import com.zyplayer.doc.wiki.framework.consts.WikiAuthType;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.dozer.Mapper;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
@@ -17,9 +31,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 文档控制器
|
||||
@@ -35,31 +48,56 @@ public class WikiSpaceController {
|
||||
|
||||
@Resource
|
||||
WikiSpaceService wikiSpaceService;
|
||||
@Resource
|
||||
UserGroupAuthService userGroupAuthService;
|
||||
@Resource
|
||||
WikiSpaceFavoriteService wikiSpaceFavoriteService;
|
||||
@Resource
|
||||
UserSettingService userSettingService;
|
||||
@Resource
|
||||
Mapper mapper;
|
||||
|
||||
@PostMapping("/list")
|
||||
public ResponseJson<List<WikiSpace>> list(WikiSpace wikiSpace) {
|
||||
public ResponseJson<List<WikiSpaceVo>> list(WikiSpace wikiSpace, Integer ignoreFavorite) {
|
||||
DocUserDetails currentUser = DocUserUtil.getCurrentUser();
|
||||
UpdateWrapper<WikiSpace> wrapper = new UpdateWrapper<>();
|
||||
wrapper.eq("del_flag", 0);
|
||||
wrapper.eq(wikiSpace.getId() != null, "id", wikiSpace.getId());
|
||||
wrapper.and(con -> con.and(conSub -> conSub.eq("type", 3).eq("create_user_id", currentUser.getUserId())).or().in("type", 1, 2));
|
||||
List<WikiSpace> authList = wikiSpaceService.list(wrapper);
|
||||
return DocResponseJson.ok(authList);
|
||||
List<WikiSpace> spaceList = wikiSpaceService.list(wrapper);
|
||||
List<WikiSpaceVo> spaceVoList = spaceList.stream().map(item -> mapper.map(item, WikiSpaceVo.class)).collect(Collectors.toList());
|
||||
// 收藏
|
||||
QueryWrapper<WikiSpaceFavorite> favoriteWrapper = new QueryWrapper<>();
|
||||
favoriteWrapper.eq("user_id", currentUser.getUserId());
|
||||
favoriteWrapper.eq("del_flag", 0);
|
||||
List<WikiSpaceFavorite> favoriteList = wikiSpaceFavoriteService.list(favoriteWrapper);
|
||||
Set<Long> spaceFavoriteMap = favoriteList.stream().map(WikiSpaceFavorite::getSpaceId).collect(Collectors.toSet());
|
||||
for (WikiSpaceVo spaceVo : spaceVoList) {
|
||||
spaceVo.setFavorite(spaceFavoriteMap.contains(spaceVo.getId()) ? 1 : 0);
|
||||
}
|
||||
// 设置
|
||||
if (!Objects.equals(ignoreFavorite, 1)) {
|
||||
QueryWrapper<UserSetting> settingWrapper = new QueryWrapper<>();
|
||||
settingWrapper.eq("user_id", currentUser.getUserId());
|
||||
settingWrapper.eq("name", UserSettingConst.WIKI_ONLY_SHOW_FAVORITE);
|
||||
settingWrapper.eq("del_flag", 0);
|
||||
UserSetting userSetting = userSettingService.getOne(settingWrapper);
|
||||
if (userSetting != null && Objects.equals(userSetting.getValue(), "1")) {
|
||||
List<WikiSpaceVo> onlySpaceVoList = spaceVoList.stream().filter(item -> Objects.equals(item.getFavorite(), 1)).collect(Collectors.toList());
|
||||
return DocResponseJson.ok(onlySpaceVoList);
|
||||
}
|
||||
}
|
||||
return DocResponseJson.ok(spaceVoList);
|
||||
}
|
||||
|
||||
@PostMapping("/update")
|
||||
public ResponseJson<WikiSpace> update(WikiSpace wikiSpace) {
|
||||
Long id = wikiSpace.getId();
|
||||
DocUserDetails currentUser = DocUserUtil.getCurrentUser();
|
||||
|
||||
if (id != null && id > 0) {
|
||||
WikiSpace wikiSpaceSel = wikiSpaceService.getById(id);
|
||||
if (Objects.equals(wikiSpaceSel.getEditType(), 1)) {
|
||||
return DocResponseJson.warn("当前空间不允许编辑!");
|
||||
}
|
||||
if (SpaceType.isOthersPrivate(wikiSpaceSel.getType(), currentUser.getUserId(), wikiSpaceSel.getCreateUserId())) {
|
||||
return DocResponseJson.warn("您没有该空间的编辑权!");
|
||||
}
|
||||
if (SpaceType.isOthersPersonal(wikiSpaceSel.getType(), currentUser.getUserId(), wikiSpaceSel.getCreateUserId())) {
|
||||
// 不是创建人不能修改空间
|
||||
if (!Objects.equals(currentUser.getUserId(), wikiSpaceSel.getCreateUserId())) {
|
||||
return DocResponseJson.warn("您没有该空间的编辑权!");
|
||||
}
|
||||
wikiSpace.setUuid(null);
|
||||
@@ -74,5 +112,147 @@ public class WikiSpaceController {
|
||||
}
|
||||
return DocResponseJson.ok(wikiSpace);
|
||||
}
|
||||
|
||||
@PostMapping("/setting/update")
|
||||
public ResponseJson<WikiSpace> settingUpdate(String name, String value) {
|
||||
DocUserDetails currentUser = DocUserUtil.getCurrentUser();
|
||||
QueryWrapper<UserSetting> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("user_id", currentUser.getUserId());
|
||||
wrapper.eq("name", name);
|
||||
UserSetting userSettingSel = userSettingService.getOne(wrapper);
|
||||
UserSetting userSettingUp = new UserSetting();
|
||||
if (userSettingSel != null) {
|
||||
userSettingUp.setId(userSettingSel.getId());
|
||||
} else {
|
||||
userSettingUp.setCreateTime(new Date());
|
||||
}
|
||||
userSettingUp.setName(name);
|
||||
userSettingUp.setValue(value);
|
||||
userSettingUp.setDelFlag(0);
|
||||
userSettingUp.setUserId(currentUser.getUserId());
|
||||
userSettingService.saveOrUpdate(userSettingUp);
|
||||
return DocResponseJson.ok();
|
||||
}
|
||||
|
||||
@PostMapping("/setting/list")
|
||||
public ResponseJson<WikiSpace> settingList() {
|
||||
DocUserDetails currentUser = DocUserUtil.getCurrentUser();
|
||||
QueryWrapper<UserSetting> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("user_id", currentUser.getUserId());
|
||||
wrapper.eq("name", UserSettingConst.WIKI_ONLY_SHOW_FAVORITE);
|
||||
wrapper.eq("del_flag", 0);
|
||||
List<UserSetting> settingList = userSettingService.list(wrapper);
|
||||
if (CollectionUtils.isEmpty(settingList)) {
|
||||
return DocResponseJson.ok();
|
||||
}
|
||||
Map<String, String> userSettingMap = settingList.stream().collect(Collectors.toMap(UserSetting::getName, UserSetting::getValue));
|
||||
return DocResponseJson.ok(userSettingMap);
|
||||
}
|
||||
|
||||
@PostMapping("/favorite/update")
|
||||
public ResponseJson<Object> groupAuth(Long spaceId, Integer delFlag) {
|
||||
DocUserDetails currentUser = DocUserUtil.getCurrentUser();
|
||||
QueryWrapper<WikiSpaceFavorite> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("space_id", spaceId);
|
||||
wrapper.eq("user_id", currentUser.getUserId());
|
||||
WikiSpaceFavorite favoriteSel = wikiSpaceFavoriteService.getOne(wrapper);
|
||||
WikiSpaceFavorite favoriteUp = new WikiSpaceFavorite();
|
||||
if (favoriteSel != null) {
|
||||
favoriteUp.setId(favoriteSel.getId());
|
||||
} else {
|
||||
favoriteUp.setCreateTime(new Date());
|
||||
}
|
||||
favoriteUp.setDelFlag(delFlag);
|
||||
favoriteUp.setUserId(currentUser.getUserId());
|
||||
favoriteUp.setSpaceId(spaceId);
|
||||
wikiSpaceFavoriteService.saveOrUpdate(favoriteUp);
|
||||
return DocResponseJson.ok();
|
||||
}
|
||||
|
||||
@PostMapping("/auth/assign")
|
||||
public ResponseJson<Object> authAssign(Long spaceId, String authList) {
|
||||
// 判断是否具有授权的权限
|
||||
DocUserDetails currentUser = DocUserUtil.getCurrentUser();
|
||||
WikiSpace wikiSpaceSel = wikiSpaceService.getById(spaceId);
|
||||
// 只有空间创建人可以管理该空间对用户组的授权
|
||||
if (!Objects.equals(currentUser.getUserId(), wikiSpaceSel.getCreateUserId())) {
|
||||
return DocResponseJson.warn("您没有权限管理该空间的权限");
|
||||
}
|
||||
// 先删除页面的所有用户的权限
|
||||
QueryWrapper<UserGroupAuth> updateWrapper = new QueryWrapper<>();
|
||||
updateWrapper.eq("data_id", spaceId);
|
||||
updateWrapper.eq("project_type", UserMsgSysType.WIKI.getType());
|
||||
userGroupAuthService.remove(updateWrapper);
|
||||
// 在创建权限
|
||||
List<UserSpaceAuthVo> authVoList = JSON.parseArray(authList, UserSpaceAuthVo.class);
|
||||
for (UserSpaceAuthVo authVo : authVoList) {
|
||||
List<UserGroupAuth> userAuthList = new LinkedList<>();
|
||||
this.createUserAuth(userAuthList, authVo.getEditPage(), spaceId, WikiAuthType.EDIT_PAGE, authVo.getGroupId());
|
||||
this.createUserAuth(userAuthList, authVo.getCommentPage(), spaceId, WikiAuthType.COMMENT_PAGE, authVo.getGroupId());
|
||||
this.createUserAuth(userAuthList, authVo.getDeletePage(), spaceId, WikiAuthType.DELETE_PAGE, authVo.getGroupId());
|
||||
this.createUserAuth(userAuthList, authVo.getPageFileUpload(), spaceId, WikiAuthType.PAGE_FILE_UPLOAD, authVo.getGroupId());
|
||||
this.createUserAuth(userAuthList, authVo.getPageFileDelete(), spaceId, WikiAuthType.PAGE_FILE_DELETE, authVo.getGroupId());
|
||||
this.createUserAuth(userAuthList, authVo.getPageAuthManage(), spaceId, WikiAuthType.PAGE_AUTH_MANAGE, authVo.getGroupId());
|
||||
if (userAuthList.size() > 0) {
|
||||
userGroupAuthService.saveBatch(userAuthList);
|
||||
}
|
||||
}
|
||||
return DocResponseJson.ok();
|
||||
}
|
||||
|
||||
@PostMapping("/auth/list")
|
||||
public ResponseJson<Object> authList(Long spaceId) {
|
||||
// 判断是否具有授权的权限
|
||||
DocUserDetails currentUser = DocUserUtil.getCurrentUser();
|
||||
WikiSpace wikiSpaceSel = wikiSpaceService.getById(spaceId);
|
||||
// 只有空间创建人可以管理该空间对用户组的授权
|
||||
if (!Objects.equals(currentUser.getUserId(), wikiSpaceSel.getCreateUserId())) {
|
||||
return DocResponseJson.warn("您没有权限管理该空间的权限");
|
||||
}
|
||||
QueryWrapper<UserGroupAuth> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("data_id", spaceId);
|
||||
queryWrapper.eq("project_type", UserMsgSysType.WIKI.getType());
|
||||
List<UserGroupAuth> authList = userGroupAuthService.list(queryWrapper);
|
||||
if (CollectionUtils.isEmpty(authList)) {
|
||||
return DocResponseJson.ok();
|
||||
}
|
||||
// 查询用户信息
|
||||
Map<Long, List<UserGroupAuth>> userAuthGroup = authList.stream().collect(Collectors.groupingBy(UserGroupAuth::getGroupId));
|
||||
List<UserSpaceAuthVo> authVoList = new LinkedList<>();
|
||||
// 组装结果集
|
||||
userAuthGroup.forEach((key, value) -> {
|
||||
Set<Integer> authNameSet = value.stream().map(UserGroupAuth::getAuthType).collect(Collectors.toSet());
|
||||
UserSpaceAuthVo authVo = new UserSpaceAuthVo();
|
||||
authVo.setEditPage(this.haveAuth(authNameSet, WikiAuthType.EDIT_PAGE));
|
||||
authVo.setCommentPage(this.haveAuth(authNameSet, WikiAuthType.COMMENT_PAGE));
|
||||
authVo.setDeletePage(this.haveAuth(authNameSet, WikiAuthType.DELETE_PAGE));
|
||||
authVo.setPageFileUpload(this.haveAuth(authNameSet, WikiAuthType.PAGE_FILE_UPLOAD));
|
||||
authVo.setPageFileDelete(this.haveAuth(authNameSet, WikiAuthType.PAGE_FILE_DELETE));
|
||||
authVo.setPageAuthManage(this.haveAuth(authNameSet, WikiAuthType.PAGE_AUTH_MANAGE));
|
||||
authVo.setGroupId(key);
|
||||
authVoList.add(authVo);
|
||||
});
|
||||
return DocResponseJson.ok(authVoList);
|
||||
}
|
||||
|
||||
private Integer haveAuth(Set<Integer> authNameSet, WikiAuthType wikiAuthType) {
|
||||
return authNameSet.contains(wikiAuthType.getType()) ? 1 : 0;
|
||||
}
|
||||
|
||||
private void createUserAuth(List<UserGroupAuth> userAuthList, Integer authValue, Long spaceId, WikiAuthType authType, Long groupId) {
|
||||
if (Objects.equals(authValue, 1)) {
|
||||
DocUserDetails currentUser = DocUserUtil.getCurrentUser();
|
||||
UserGroupAuth userAuth = new UserGroupAuth();
|
||||
userAuth.setDataId(spaceId);
|
||||
userAuth.setAuthType(authType.getType());
|
||||
userAuth.setGroupId(groupId);
|
||||
userAuth.setCreateTime(new Date());
|
||||
userAuth.setCreateUserId(currentUser.getUserId());
|
||||
userAuth.setCreateUserName(currentUser.getUsername());
|
||||
userAuth.setProjectType(UserMsgSysType.WIKI.getType());
|
||||
userAuth.setDelFlag(0);
|
||||
userAuthList.add(userAuth);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
package com.zyplayer.doc.wiki.controller.vo;
|
||||
|
||||
public class UserSpaceAuthVo {
|
||||
private Long groupId;
|
||||
private Integer editPage;
|
||||
private Integer commentPage;
|
||||
private Integer deletePage;
|
||||
private Integer pageFileUpload;
|
||||
private Integer pageFileDelete;
|
||||
private Integer pageAuthManage;
|
||||
|
||||
public Integer getCommentPage() {
|
||||
return commentPage;
|
||||
}
|
||||
|
||||
public void setCommentPage(Integer commentPage) {
|
||||
this.commentPage = commentPage;
|
||||
}
|
||||
|
||||
public Integer getDeletePage() {
|
||||
return deletePage;
|
||||
}
|
||||
|
||||
public void setDeletePage(Integer deletePage) {
|
||||
this.deletePage = deletePage;
|
||||
}
|
||||
|
||||
public Integer getPageFileUpload() {
|
||||
return pageFileUpload;
|
||||
}
|
||||
|
||||
public void setPageFileUpload(Integer pageFileUpload) {
|
||||
this.pageFileUpload = pageFileUpload;
|
||||
}
|
||||
|
||||
public Integer getPageFileDelete() {
|
||||
return pageFileDelete;
|
||||
}
|
||||
|
||||
public void setPageFileDelete(Integer pageFileDelete) {
|
||||
this.pageFileDelete = pageFileDelete;
|
||||
}
|
||||
|
||||
public Integer getPageAuthManage() {
|
||||
return pageAuthManage;
|
||||
}
|
||||
|
||||
public void setPageAuthManage(Integer pageAuthManage) {
|
||||
this.pageAuthManage = pageAuthManage;
|
||||
}
|
||||
|
||||
public Integer getEditPage() {
|
||||
return editPage;
|
||||
}
|
||||
|
||||
public void setEditPage(Integer editPage) {
|
||||
this.editPage = editPage;
|
||||
}
|
||||
|
||||
public Long getGroupId() {
|
||||
return groupId;
|
||||
}
|
||||
|
||||
public void setGroupId(Long groupId) {
|
||||
this.groupId = groupId;
|
||||
}
|
||||
}
|
||||
@@ -15,6 +15,7 @@ public class WikiPageContentVo {
|
||||
private Integer canEdit;
|
||||
private Integer canDelete;
|
||||
private Integer canUploadFile;
|
||||
private Integer canDeleteFile;
|
||||
private Integer canConfigAuth;
|
||||
|
||||
public WikiPage getWikiPage() {
|
||||
@@ -88,4 +89,12 @@ public class WikiPageContentVo {
|
||||
public void setCanUploadFile(Integer canUploadFile) {
|
||||
this.canUploadFile = canUploadFile;
|
||||
}
|
||||
|
||||
public Integer getCanDeleteFile() {
|
||||
return canDeleteFile;
|
||||
}
|
||||
|
||||
public void setCanDeleteFile(Integer canDeleteFile) {
|
||||
this.canDeleteFile = canDeleteFile;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.zyplayer.doc.wiki.controller.vo;
|
||||
|
||||
import com.zyplayer.doc.data.repository.manage.entity.WikiSpace;
|
||||
|
||||
public class WikiSpaceVo extends WikiSpace {
|
||||
|
||||
private Integer favorite;
|
||||
|
||||
public Integer getFavorite() {
|
||||
return favorite;
|
||||
}
|
||||
|
||||
public void setFavorite(Integer favorite) {
|
||||
this.favorite = favorite;
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,15 @@
|
||||
package com.zyplayer.doc.wiki.framework.consts;
|
||||
|
||||
public enum WikiAuthType {
|
||||
@Deprecated
|
||||
CREATE_PAGE(1, "WIKI_CREATE_PAGE_"),
|
||||
EDIT_PAGE(1, "WIKI_EDIT_PAGE_"),
|
||||
COMMENT_PAGE(1, "WIKI_COMMENT_PAGE_"),
|
||||
DELETE_PAGE(1, "WIKI_DELETE_PAGE_"),
|
||||
PAGE_FILE_UPLOAD(1, "WIKI_PAGE_FILE_UPLOAD_"),
|
||||
PAGE_FILE_DELETE(1, "WIKI_PAGE_FILE_DELETE_"),
|
||||
PAGE_AUTH_MANAGE(1, "WIKI_PAGE_AUTH_MANAGE_"),
|
||||
EDIT_PAGE(2, "WIKI_EDIT_PAGE_"),
|
||||
@Deprecated
|
||||
COMMENT_PAGE(3, "WIKI_COMMENT_PAGE_"),
|
||||
DELETE_PAGE(4, "WIKI_DELETE_PAGE_"),
|
||||
PAGE_FILE_UPLOAD(5, "WIKI_PAGE_FILE_UPLOAD_"),
|
||||
PAGE_FILE_DELETE(6, "WIKI_PAGE_FILE_DELETE_"),
|
||||
PAGE_AUTH_MANAGE(7, "WIKI_PAGE_AUTH_MANAGE_"),
|
||||
;
|
||||
private Integer type;
|
||||
private String name;
|
||||
|
||||
@@ -2,16 +2,22 @@ package com.zyplayer.doc.wiki.service.common;
|
||||
|
||||
import com.zyplayer.doc.data.config.security.DocUserUtil;
|
||||
import com.zyplayer.doc.data.repository.manage.entity.WikiSpace;
|
||||
import com.zyplayer.doc.data.repository.manage.mapper.UserGroupAuthMapper;
|
||||
import com.zyplayer.doc.data.repository.support.consts.DocAuthConst;
|
||||
import com.zyplayer.doc.data.repository.support.consts.UserMsgSysType;
|
||||
import com.zyplayer.doc.wiki.framework.consts.SpaceType;
|
||||
import com.zyplayer.doc.wiki.framework.consts.WikiAuthType;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Objects;
|
||||
|
||||
@Service
|
||||
public class WikiPageAuthService {
|
||||
|
||||
@Resource
|
||||
UserGroupAuthMapper userGroupAuthMapper;
|
||||
|
||||
/**
|
||||
* 是否具有编辑权限
|
||||
* @param wikiSpaceSel
|
||||
@@ -32,7 +38,11 @@ public class WikiPageAuthService {
|
||||
if (SpaceType.isOthersPersonal(wikiSpaceSel.getType(), currentUserId, wikiSpaceSel.getCreateUserId())) {
|
||||
boolean pageAuth = DocUserUtil.haveCustomAuth(WikiAuthType.EDIT_PAGE.getName(), DocAuthConst.WIKI + pageId);
|
||||
if (!pageAuth) {
|
||||
return "您没有修改该文章的权限!";
|
||||
// 在空间上直接授权了分组的权限,在这个分组里就具有权限
|
||||
Long authId = userGroupAuthMapper.haveAuth(wikiSpaceSel.getId(), UserMsgSysType.WIKI.getType(), WikiAuthType.EDIT_PAGE.getType(), currentUserId);
|
||||
if (authId == null) {
|
||||
return "您没有修改该文章的权限!";
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
@@ -51,7 +61,11 @@ public class WikiPageAuthService {
|
||||
}
|
||||
if (!Objects.equals(currentUserId, wikiSpaceSel.getCreateUserId())) {
|
||||
if (!DocUserUtil.haveCustomAuth(WikiAuthType.PAGE_AUTH_MANAGE.getName(), DocAuthConst.WIKI + pageId)) {
|
||||
return "您不是创建人或没有权限修改";
|
||||
// 在空间上直接授权了分组的权限,在这个分组里就具有权限
|
||||
Long authId = userGroupAuthMapper.haveAuth(wikiSpaceSel.getId(), UserMsgSysType.WIKI.getType(), WikiAuthType.PAGE_AUTH_MANAGE.getType(), currentUserId);
|
||||
if (authId == null) {
|
||||
return "您不是创建人或没有权限";
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
@@ -73,7 +87,37 @@ public class WikiPageAuthService {
|
||||
if (SpaceType.isOthersPersonal(wikiSpaceSel.getType(), currentUserId, wikiSpaceSel.getCreateUserId())) {
|
||||
boolean pageAuth = DocUserUtil.haveCustomAuth(WikiAuthType.PAGE_FILE_UPLOAD.getName(), DocAuthConst.WIKI + pageId);
|
||||
if (!pageAuth) {
|
||||
return "您没有修改该文章附件的权限!";
|
||||
// 在空间上直接授权了分组的权限,在这个分组里就具有权限
|
||||
Long authId = userGroupAuthMapper.haveAuth(wikiSpaceSel.getId(), UserMsgSysType.WIKI.getType(), WikiAuthType.PAGE_FILE_UPLOAD.getType(), currentUserId);
|
||||
if (authId == null) {
|
||||
return "您没有上传该文章附件的权限!";
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否具有附件删除权限
|
||||
* @param wikiSpaceSel
|
||||
* @param pageId
|
||||
* @param currentUserId
|
||||
* @return
|
||||
*/
|
||||
public String canDeleteFile(WikiSpace wikiSpaceSel, Long pageId, Long currentUserId) {
|
||||
// 私人空间
|
||||
if (SpaceType.isOthersPrivate(wikiSpaceSel.getType(), currentUserId, wikiSpaceSel.getCreateUserId())) {
|
||||
return "您没有该空间的文件上传权限!";
|
||||
}
|
||||
// 空间不是自己的,也没有权限
|
||||
if (SpaceType.isOthersPersonal(wikiSpaceSel.getType(), currentUserId, wikiSpaceSel.getCreateUserId())) {
|
||||
boolean pageAuth = DocUserUtil.haveCustomAuth(WikiAuthType.PAGE_FILE_DELETE.getName(), DocAuthConst.WIKI + pageId);
|
||||
if (!pageAuth) {
|
||||
// 在空间上直接授权了分组的权限,在这个分组里就具有权限
|
||||
Long authId = userGroupAuthMapper.haveAuth(wikiSpaceSel.getId(), UserMsgSysType.WIKI.getType(), WikiAuthType.PAGE_FILE_DELETE.getType(), currentUserId);
|
||||
if (authId == null) {
|
||||
return "您没有删除该文章附件的权限!";
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
@@ -99,7 +143,11 @@ public class WikiPageAuthService {
|
||||
if (SpaceType.isOthersPersonal(wikiSpaceSel.getType(), currentUserId, wikiSpaceSel.getCreateUserId())) {
|
||||
boolean pageAuth = DocUserUtil.haveCustomAuth(WikiAuthType.DELETE_PAGE.getName(), DocAuthConst.WIKI + pageId);
|
||||
if (!pageAuth) {
|
||||
return "您没有删除该文章的权限!";
|
||||
// 在空间上直接授权了分组的权限,在这个分组里就具有权限
|
||||
Long authId = userGroupAuthMapper.haveAuth(wikiSpaceSel.getId(), UserMsgSysType.WIKI.getType(), WikiAuthType.DELETE_PAGE.getType(), currentUserId);
|
||||
if (authId == null) {
|
||||
return "您没有删除该文章的权限!";
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
::-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}.header-right-user-name{color:#fff;padding-right:5px}.el-header{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-51ce7152],body[data-v-51ce7152],html[data-v-51ce7152]{margin:0;padding:0;height:100%}pre[data-v-51ce7152]{margin:0;white-space:pre-wrap;font-size:14px;font-family:auto}.el-menu[data-v-51ce7152]{-webkit-box-sizing:border-box;box-sizing:border-box;border-right:0;margin-right:3px}.el-header[data-v-51ce7152]{background-color:#409eff;color:#333;line-height:40px;text-align:right;height:40px!important}.doc-body-box[data-v-51ce7152]{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-51ce7152]{margin-right:3px}.logo[data-v-51ce7152]{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-51ce7152]{float:left;font-size:25px;color:#aaa;cursor:pointer;position:fixed}.icon-collapse[data-v-51ce7152]:hover{color:#ccc}.comment-box .head[data-v-51ce7152]{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-51ce7152]{position:fixed;bottom:0;left:0;background:#fafafa;width:240px;text-align:center;padding:5px 0;color:#aaa;font-size:12px}.build-info a[data-v-51ce7152]{color:#4183c4;cursor:pointer;text-decoration:none}
|
||||
@@ -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}.create-space-vue .empty-news{text-align:center;padding:100px}.create-space-vue .text-link{color:#444}.create-space-vue .line-box{color:#666;border-bottom:1px solid #eee;padding:20px 0}.create-space-vue .line-title{font-size:14px}.create-space-vue .page-preview-title{font-size:18px;margin:10px 0 5px 0;color:#3a8ee6;cursor:pointer}.create-space-vue .page-preview-content{font-size:16px;margin-bottom:5px}.create-space-vue .zan-img{vertical-align:middle;margin-top:-3px}.create-space-vue .view-img{font-size:16px;color:#666}.create-space-vue .page-info-box{text-align:right;margin:20px 0 50px 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}.header-right-user-name{color:#fff;padding-right:5px}.el-header{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-51ce7152],body[data-v-51ce7152],html[data-v-51ce7152]{margin:0;padding:0;height:100%}pre[data-v-51ce7152]{margin:0;white-space:pre-wrap;font-size:14px;font-family:auto}.el-menu[data-v-51ce7152]{-webkit-box-sizing:border-box;box-sizing:border-box;border-right:0;margin-right:3px}.el-header[data-v-51ce7152]{background-color:#409eff;color:#333;line-height:40px;text-align:right;height:40px!important}.doc-body-box[data-v-51ce7152]{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-51ce7152]{margin-right:3px}.logo[data-v-51ce7152]{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-51ce7152]{float:left;font-size:25px;color:#aaa;cursor:pointer;position:fixed}.icon-collapse[data-v-51ce7152]:hover{color:#ccc}.comment-box .head[data-v-51ce7152]{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-51ce7152]{position:fixed;bottom:0;left:0;background:#fafafa;width:240px;text-align:center;padding:5px 0;color:#aaa;font-size:12px}.build-info a[data-v-51ce7152]{color:#4183c4;cursor:pointer;text-decoration:none}
|
||||
@@ -0,0 +1 @@
|
||||
.space-manage-vue .empty-news{text-align:center;padding:100px}.space-manage-vue .text-link{color:#444}.space-manage-vue .line-box{color:#666;border-bottom:1px solid #eee;padding:20px 0}.space-manage-vue .line-title{font-size:14px}.space-manage-vue .page-preview-title{font-size:18px;margin:10px 0 5px 0;color:#3a8ee6;cursor:pointer}.space-manage-vue .page-preview-content{font-size:16px;margin-bottom:5px}.space-manage-vue .zan-img{vertical-align:middle;margin-top:-3px}.space-manage-vue .view-img{font-size:16px;color:#666}.space-manage-vue .page-info-box{text-align:right;margin:20px 0 50px 0}.space-manage-vue .favorite-icon{cursor:pointer;font-size:20px}.space-manage-vue .favorite-icon.el-icon-star-on{color:#e6a23c;font-size:24px}
|
||||
File diff suppressed because one or more lines are too long
@@ -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-1ca8e011.d9272d9c.css rel=prefetch><link href=css/chunk-213012a0.46d1a39a.css rel=prefetch><link href=css/chunk-2e5083a6.d0c31182.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-49c0ba36.ec6236ec.css rel=prefetch><link href=css/chunk-4cdf76bb.bb45a557.css rel=prefetch><link href=css/chunk-5544a2b8.b3d0f39b.css rel=prefetch><link href=css/chunk-55738a8b.a38bf186.css rel=prefetch><link href=css/chunk-578c28a7.83c6d32d.css rel=prefetch><link href=js/chunk-1ca8e011.09e03fc5.js rel=prefetch><link href=js/chunk-213012a0.535d4abf.js rel=prefetch><link href=js/chunk-2d207ece.20edf665.js rel=prefetch><link href=js/chunk-2e5083a6.8ac3bd20.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-49c0ba36.9cc34b7e.js rel=prefetch><link href=js/chunk-4cdf76bb.8e528c95.js rel=prefetch><link href=js/chunk-5544a2b8.6714a421.js rel=prefetch><link href=js/chunk-55738a8b.cc569cb9.js rel=prefetch><link href=js/chunk-578c28a7.6a10864d.js rel=prefetch><link href=css/app.347dea9c.css rel=preload as=style><link href=css/chunk-vendors.43fc3011.css rel=preload as=style><link href=js/app.4037425f.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.347dea9c.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.4037425f.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-1ca8e011.d9272d9c.css rel=prefetch><link href=css/chunk-213012a0.46d1a39a.css rel=prefetch><link href=css/chunk-2e5083a6.d0c31182.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-49c0ba36.ec6236ec.css rel=prefetch><link href=css/chunk-4cdf76bb.bb45a557.css rel=prefetch><link href=css/chunk-5544a2b8.b3d0f39b.css rel=prefetch><link href=css/chunk-55738a8b.a38bf186.css rel=prefetch><link href=css/chunk-578c28a7.83c6d32d.css rel=prefetch><link href=css/chunk-7ecd39ac.52f4ee05.css rel=prefetch><link href=js/chunk-1ca8e011.3f1e4d9b.js rel=prefetch><link href=js/chunk-213012a0.a5549743.js rel=prefetch><link href=js/chunk-2d207ece.fc1414f7.js rel=prefetch><link href=js/chunk-2e5083a6.8aff58fe.js rel=prefetch><link href=js/chunk-32cc5643.775b8c1d.js rel=prefetch><link href=js/chunk-34407190.9fef71c3.js rel=prefetch><link href=js/chunk-49c0ba36.545f6e3c.js rel=prefetch><link href=js/chunk-4cdf76bb.8e528c95.js rel=prefetch><link href=js/chunk-5544a2b8.f0d91aae.js rel=prefetch><link href=js/chunk-55738a8b.481cbc8a.js rel=prefetch><link href=js/chunk-578c28a7.a8921ac1.js rel=prefetch><link href=js/chunk-7ecd39ac.872cdc90.js rel=prefetch><link href=css/app.cd797063.css rel=preload as=style><link href=css/chunk-vendors.1019b600.css rel=preload as=style><link href=js/app.5d668ffb.js rel=preload as=script><link href=js/chunk-vendors.fde1116c.js rel=preload as=script><link href=css/chunk-vendors.1019b600.css rel=stylesheet><link href=css/app.cd797063.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.fde1116c.js></script><script src=js/app.5d668ffb.js></script></body></html>
|
||||
File diff suppressed because one or more lines are too long
1
zyplayer-doc-wiki/src/main/resources/js/app.5d668ffb.js
Normal file
1
zyplayer-doc-wiki/src/main/resources/js/app.5d668ffb.js
Normal file
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
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user