删除不需要的代码,优化结构
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
<packaging>war</packaging>
|
||||
|
||||
<name>zyplayer-doc-manage</name>
|
||||
<description>定位为所有文档的管理项目,API接口文档、dubbo文档、数据库文档、、、、等</description>
|
||||
<description>定位为所有文档的管理项目,API接口文档、数据库文档、、、、等</description>
|
||||
|
||||
<parent>
|
||||
<groupId>com.zyplayer</groupId>
|
||||
@@ -45,10 +45,6 @@
|
||||
<groupId>com.zyplayer</groupId>
|
||||
<artifactId>zyplayer-doc-db</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.zyplayer</groupId>
|
||||
<artifactId>zyplayer-doc-dubbo</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.zyplayer</groupId>
|
||||
<artifactId>zyplayer-doc-wiki</artifactId>
|
||||
|
||||
@@ -1,72 +0,0 @@
|
||||
package com.zyplayer.doc.manage.framework.config;
|
||||
|
||||
import com.github.dozermapper.core.DozerBeanMapperBuilder;
|
||||
import com.github.dozermapper.core.DozerConverter;
|
||||
import com.github.dozermapper.core.Mapper;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.text.DateFormat;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* mapper配置类
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2018年12月15日
|
||||
*/
|
||||
@Configuration
|
||||
public class MapperConfig {
|
||||
|
||||
@Bean
|
||||
public Mapper dozerBeanMapper() {
|
||||
DozerBeanMapperBuilder builder = DozerBeanMapperBuilder.create()
|
||||
.withCustomConverter(new DateStringConvert(Date.class, String.class))
|
||||
.withCustomConverter(new BigdecimalToStringConvert(BigDecimal.class, String.class));
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
private class DateStringConvert extends DozerConverter<Date, String> {
|
||||
private DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
public DateStringConvert(Class<Date> prototypeA, Class<String> prototypeB) {
|
||||
super(prototypeA, prototypeB);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String convertTo(Date source, String destination) {
|
||||
destination = dateFormat.format(source);
|
||||
return destination;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Date convertFrom(String source, Date destination) {
|
||||
try {
|
||||
destination = dateFormat.parse(source);
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return destination;
|
||||
}
|
||||
}
|
||||
|
||||
private class BigdecimalToStringConvert extends DozerConverter<BigDecimal, String> {
|
||||
|
||||
public BigdecimalToStringConvert(Class<BigDecimal> prototypeA, Class<String> prototypeB) {
|
||||
super(prototypeA, prototypeB);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String convertTo(BigDecimal source, String destination) {
|
||||
return source.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal convertFrom(String source, BigDecimal destination) {
|
||||
return BigDecimal.valueOf(Double.parseDouble(source));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -63,7 +63,7 @@ public class WebMvcConfig implements WebMvcConfigurer {
|
||||
@Override
|
||||
public void addInterceptors(InterceptorRegistry registry) {
|
||||
registry.addInterceptor(userLoginInterceptor)
|
||||
.excludePathPatterns("/", "/doc-wiki", "/doc-db", "/doc-swagger-plus", "/doc-dubbo")
|
||||
.excludePathPatterns("/", "/doc-wiki", "/doc-db", "/doc-swagger-plus")
|
||||
.excludePathPatterns("/**/*.js", "/**/*.css", "/**/*.png", "/**/*.gif", "/**/*.jpg", "/**/*.jpeg", "/**/fonts/*");
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
package com.zyplayer.doc.manage.framework.config;
|
||||
|
||||
import com.zyplayer.doc.db.framework.configuration.EnableDocDb;
|
||||
import com.zyplayer.doc.dubbo.framework.config.EnableDocDubbo;
|
||||
import com.zyplayer.doc.api.framework.config.EnableDocApi;
|
||||
import com.zyplayer.doc.db.framework.configuration.EnableDocDb;
|
||||
import com.zyplayer.doc.wiki.framework.config.EnableDocWiki;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@@ -19,10 +18,6 @@ public class ZyplayerDocConfig {
|
||||
public class enableDocWiki {
|
||||
}
|
||||
|
||||
@EnableDocDubbo
|
||||
public class enableDocDubbo {
|
||||
}
|
||||
|
||||
@EnableDocDb
|
||||
public class enableDocDb {
|
||||
}
|
||||
|
||||
@@ -1,82 +0,0 @@
|
||||
package com.zyplayer.doc.manage.framework.config.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.zyplayer.doc.data.repository.manage.entity.ZyplayerStorage;
|
||||
import com.zyplayer.doc.data.service.manage.ZyplayerStorageService;
|
||||
import com.zyplayer.doc.dubbo.framework.service.MgDubboStorage;
|
||||
import com.zyplayer.doc.dubbo.framework.service.MgDubboStorageService;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* dubbo相关的文档存储服务
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2018年8月19日
|
||||
*/
|
||||
@Service
|
||||
public class MgDubboStorageServiceImpl implements MgDubboStorageService {
|
||||
@Resource
|
||||
ZyplayerStorageService zyplayerStorageService;
|
||||
|
||||
/**
|
||||
* 使用数据库来存储,例: storageMapper.select(key);
|
||||
*/
|
||||
@Override
|
||||
public String get(String key) {
|
||||
QueryWrapper<ZyplayerStorage> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("doc_key", key);
|
||||
ZyplayerStorage zyplayerStorage = zyplayerStorageService.getOne(wrapper);
|
||||
if (zyplayerStorage == null) {
|
||||
return null;
|
||||
}
|
||||
return zyplayerStorage.getDocValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MgDubboStorage> like(String key, String value) {
|
||||
QueryWrapper<ZyplayerStorage> wrapper = new QueryWrapper<>();
|
||||
wrapper.like(StringUtils.isNotBlank(key), "doc_key", key);
|
||||
wrapper.like(StringUtils.isNotBlank(value), "doc_value", value);
|
||||
List<ZyplayerStorage> storageList = zyplayerStorageService.list(wrapper);
|
||||
if (storageList == null || storageList.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return storageList.stream().map(val -> new MgDubboStorage(val.getDocKey(), val.getDocValue())).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用数据库来存储,例: storageMapper.updateOrInsert(key, value);
|
||||
*/
|
||||
@Override
|
||||
public void put(String key, String value) {
|
||||
ZyplayerStorage entity = new ZyplayerStorage();
|
||||
entity.setDocValue(value);
|
||||
UpdateWrapper<ZyplayerStorage> updateWrapper = new UpdateWrapper<>();
|
||||
updateWrapper.eq(true, "doc_key", key);
|
||||
boolean update = zyplayerStorageService.update(entity, updateWrapper);
|
||||
if (!update) {
|
||||
entity = new ZyplayerStorage();
|
||||
entity.setDocValue(value);
|
||||
entity.setDocKey(key);
|
||||
zyplayerStorageService.save(entity);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除一个key
|
||||
*/
|
||||
@Override
|
||||
public void remove(String key) {
|
||||
UpdateWrapper<ZyplayerStorage> queryWrapper = new UpdateWrapper<>();
|
||||
queryWrapper.eq("doc_key", key);
|
||||
zyplayerStorageService.remove(queryWrapper);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,7 +3,7 @@ package com.zyplayer.doc.manage.task;
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.zyplayer.doc.core.util.ZyplayerDocVersion;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.zyplayer.doc.manage.web;
|
||||
|
||||
import com.zyplayer.doc.core.annotation.AuthMan;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@@ -42,11 +41,4 @@ public class DocSystemController {
|
||||
modelAndView.setStatus(HttpStatus.OK);
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
@GetMapping("/doc-dubbo")
|
||||
public ModelAndView dubbo() {
|
||||
ModelAndView modelAndView = new ModelAndView("/doc-dubbo.html");
|
||||
modelAndView.setStatus(HttpStatus.OK);
|
||||
return modelAndView;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ 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.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@@ -4,9 +4,6 @@ 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.dozermapper.core.Mapper;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.zyplayer.doc.core.annotation.AuthMan;
|
||||
import com.zyplayer.doc.core.json.DocResponseJson;
|
||||
import com.zyplayer.doc.core.json.ResponseJson;
|
||||
@@ -23,7 +20,8 @@ import com.zyplayer.doc.manage.web.param.UserListParam;
|
||||
import com.zyplayer.doc.manage.web.vo.AuthInfoVo;
|
||||
import com.zyplayer.doc.manage.web.vo.UserAuthVo;
|
||||
import com.zyplayer.doc.manage.web.vo.UserInfoAuthVo;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.util.DigestUtils;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
@@ -50,8 +48,6 @@ public class UserInfoController {
|
||||
AuthInfoService authInfoService;
|
||||
@Resource
|
||||
UserAuthService userAuthService;
|
||||
@Resource
|
||||
Mapper mapper;
|
||||
|
||||
@AuthMan
|
||||
@PostMapping("/selfInfo")
|
||||
@@ -104,13 +100,13 @@ public class UserInfoController {
|
||||
queryWrapper.like(param.getType() == 5, "email", param.getKeyword());
|
||||
}
|
||||
queryWrapper.ne("del_flag", 1);
|
||||
PageHelper.startPage(param.getPageNum(), param.getPageSize(), true);
|
||||
List<UserInfo> userInfoList = userInfoService.list(queryWrapper);
|
||||
if (userInfoList != null && userInfoList.size() > 0) {
|
||||
IPage<UserInfo> page = new Page<>(param.getPageNum(), param.getPageSize(), true);
|
||||
userInfoService.page(page, queryWrapper);
|
||||
List<UserInfo> userInfoList = page.getRecords();
|
||||
if (CollectionUtils.isNotEmpty(userInfoList)) {
|
||||
userInfoList.forEach(val -> val.setPassword(""));
|
||||
}
|
||||
PageInfo<UserInfo> pageInfo = new PageInfo<>(userInfoList);
|
||||
return DocResponseJson.ok(pageInfo);
|
||||
return DocResponseJson.ok(page);
|
||||
}
|
||||
|
||||
@AuthMan(DocAuthConst.USER_MANAGE)
|
||||
@@ -215,7 +211,7 @@ public class UserInfoController {
|
||||
List<AuthInfoVo> authInfoVoList = new LinkedList<>();
|
||||
authList.forEach(val -> {
|
||||
UserAuth userAuth = userAuthMap.get(val.getId());
|
||||
AuthInfoVo infoVo = mapper.map(val, AuthInfoVo.class);
|
||||
AuthInfoVo infoVo = new AuthInfoVo(val);
|
||||
infoVo.setChecked((userAuth == null) ? 0 : 1);
|
||||
authInfoVoList.add(infoVo);
|
||||
});
|
||||
|
||||
@@ -10,7 +10,7 @@ import com.zyplayer.doc.data.config.security.DocUserDetails;
|
||||
import com.zyplayer.doc.data.config.security.DocUserUtil;
|
||||
import com.zyplayer.doc.data.repository.manage.entity.UserMessage;
|
||||
import com.zyplayer.doc.data.service.manage.UserMessageService;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.zyplayer.doc.manage.web.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.zyplayer.doc.data.repository.manage.entity.AuthInfo;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
@@ -52,6 +53,15 @@ public class AuthInfoVo implements Serializable {
|
||||
*/
|
||||
private Date creationTime;
|
||||
|
||||
public AuthInfoVo(AuthInfo authInfo) {
|
||||
this.id = authInfo.getId();
|
||||
this.authName = authInfo.getAuthName();
|
||||
this.authDesc = authInfo.getAuthDesc();
|
||||
this.canEdit = authInfo.getCanEdit();
|
||||
this.createUid = authInfo.getCreateUid();
|
||||
this.creationTime = authInfo.getCreationTime();
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@@ -44,20 +44,6 @@ zyplayer:
|
||||
proxy-request:
|
||||
# 允许代理请求的域名,正则表达式,多个使用 ; 分割,必须设置,防止通过代理接口访问到内部资源,实在觉得没必要可设置为:.+
|
||||
white-domain: .+
|
||||
# ------dubbo相关配置------
|
||||
dubbo:
|
||||
# 存放dubbo文档jar上传后存放的目录
|
||||
doc-lib-path: D:/zyplayerDoc/dubbo
|
||||
# 优先使用zookeeper,未配置时找nacos的配置
|
||||
zookeeper:
|
||||
# url: 127.0.0.1:2181
|
||||
# 服务参数那些信息的服务地址,dubbo7.0新特性
|
||||
# metadata-url: 127.0.0.1:2181
|
||||
nacos:
|
||||
url: http://127.0.0.1:8848/nacos
|
||||
# 服务名称,多个使用 ; 分割,nacos没办法获取所有的服务列表,所以需要指定,好像通过后端接口可以获取,不知道后续版本会不会登录后才可以访问
|
||||
# service: "com.zyplayer.dubbo.service.UserService;\
|
||||
# com.zyplayer.dubbo.service.AnnotateService;"
|
||||
|
||||
spring:
|
||||
application:
|
||||
|
||||
@@ -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-vendors.8924efc6.css rel=preload as=style><link href=css/index.d05463e0.css rel=preload as=style><link href=js/chunk-vendors.cdec70f7.js rel=preload as=script><link href=js/index.12083370.js rel=preload as=script><link href=css/chunk-vendors.8924efc6.css rel=stylesheet><link href=css/index.d05463e0.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.cdec70f7.js></script><script src=js/index.12083370.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-vendors.8924efc6.css rel=preload as=style><link href=css/index.d05463e0.css rel=preload as=style><link href=js/chunk-vendors.cdec70f7.js rel=preload as=script><link href=js/index.088a44d5.js rel=preload as=script><link href=css/chunk-vendors.8924efc6.css rel=stylesheet><link href=css/index.d05463e0.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.cdec70f7.js></script><script src=js/index.088a44d5.js></script></body></html>
|
||||
1
zyplayer-doc-manage/src/main/resources/dist/js/index.088a44d5.js
vendored
Normal file
1
zyplayer-doc-manage/src/main/resources/dist/js/index.088a44d5.js
vendored
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user