Commit 8c4fd97e authored by 郑杰's avatar 郑杰
Browse files

v1.5 beta版发布,详细查看发行版说明

parent b066bb99
package me.zhengjie.system.service.impl;
package me.zhengjie.modules.system.service.impl;
import cn.hutool.core.util.StrUtil;
import me.zhengjie.common.exception.BadRequestException;
import me.zhengjie.common.exception.EntityExistException;
import me.zhengjie.common.utils.ValidationUtil;
import me.zhengjie.system.domain.Menu;
import me.zhengjie.system.domain.Role;
import me.zhengjie.system.domain.vo.MenuMetaVo;
import me.zhengjie.system.domain.vo.MenuVo;
import me.zhengjie.system.repository.MenuRepository;
import me.zhengjie.system.service.MenuService;
import me.zhengjie.system.service.dto.MenuDTO;
import me.zhengjie.system.service.mapper.MenuMapper;
import me.zhengjie.modules.system.domain.Menu;
import me.zhengjie.modules.system.domain.Role;
import me.zhengjie.modules.system.domain.vo.MenuMetaVo;
import me.zhengjie.modules.system.domain.vo.MenuVo;
import me.zhengjie.exception.BadRequestException;
import me.zhengjie.exception.EntityExistException;
import me.zhengjie.modules.system.repository.MenuRepository;
import me.zhengjie.modules.system.service.MenuService;
import me.zhengjie.modules.system.service.dto.MenuDTO;
import me.zhengjie.modules.system.service.mapper.MenuMapper;
import me.zhengjie.utils.ListSortUtil;
import me.zhengjie.utils.ValidationUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
......@@ -40,9 +41,10 @@ public class MenuServiceImpl implements MenuService {
public List<MenuDTO> findByRoles(Set<Role> roles) {
Set<Menu> menus = new LinkedHashSet<>();
for (Role role : roles) {
Set<Role> roleSet = new HashSet<>();
roleSet.add(role);
menus.addAll(menuRepository.findByRolesOrderBySort(roleSet));
ListSortUtil<Menu> sortList = new ListSortUtil<Menu>();
List<Menu> menus1 = role.getMenus().stream().collect(Collectors.toList());
sortList.sort(menus1, "sort", "asc");
menus.addAll(menus1);
}
return menus.stream().map(menuMapper::toDto).collect(Collectors.toList());
}
......@@ -160,7 +162,7 @@ public class MenuServiceImpl implements MenuService {
// 如果不是外链
if(!menuDTO.getIFrame()){
if(menuDTO.getPid().equals(0L)){
//一级目录需要加斜杠,不然访问不了
//一级目录需要加斜杠,不然访问 会跳转404页面
menuVo.setPath("/" + menuDTO.getPath());
menuVo.setComponent(StrUtil.isEmpty(menuDTO.getComponent())?"Layout":menuDTO.getComponent());
}else if(!StrUtil.isEmpty(menuDTO.getComponent())){
......
package me.zhengjie.system.service.impl;
import me.zhengjie.common.exception.BadRequestException;
import me.zhengjie.common.exception.EntityExistException;
import me.zhengjie.common.utils.ValidationUtil;
import me.zhengjie.system.domain.Permission;
import me.zhengjie.system.repository.PermissionRepository;
import me.zhengjie.system.service.PermissionService;
import me.zhengjie.system.service.dto.PermissionDTO;
import me.zhengjie.system.service.mapper.PermissionMapper;
package me.zhengjie.modules.system.service.impl;
import me.zhengjie.modules.system.domain.Permission;
import me.zhengjie.exception.BadRequestException;
import me.zhengjie.exception.EntityExistException;
import me.zhengjie.modules.system.repository.PermissionRepository;
import me.zhengjie.modules.system.service.PermissionService;
import me.zhengjie.modules.system.service.dto.PermissionDTO;
import me.zhengjie.modules.system.service.mapper.PermissionMapper;
import me.zhengjie.utils.ValidationUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
......
package me.zhengjie.system.service.impl;
import me.zhengjie.common.exception.BadRequestException;
import me.zhengjie.common.exception.EntityExistException;
import me.zhengjie.common.utils.ValidationUtil;
import me.zhengjie.system.domain.Role;
import me.zhengjie.system.repository.RoleRepository;
import me.zhengjie.system.service.RoleService;
import me.zhengjie.system.service.dto.RoleDTO;
import me.zhengjie.system.service.mapper.RoleMapper;
package me.zhengjie.modules.system.service.impl;
import me.zhengjie.modules.system.domain.Role;
import me.zhengjie.exception.BadRequestException;
import me.zhengjie.exception.EntityExistException;
import me.zhengjie.modules.system.repository.RoleRepository;
import me.zhengjie.modules.system.service.RoleService;
import me.zhengjie.modules.system.service.dto.RoleDTO;
import me.zhengjie.modules.system.service.mapper.RoleMapper;
import me.zhengjie.utils.ValidationUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
/**
......
package me.zhengjie.system.service.impl;
import me.zhengjie.common.exception.BadRequestException;
import me.zhengjie.common.exception.EntityExistException;
import me.zhengjie.common.exception.EntityNotFoundException;
import me.zhengjie.common.utils.ValidationUtil;
import me.zhengjie.core.security.JwtUser;
import me.zhengjie.core.utils.EncryptUtils;
import me.zhengjie.core.utils.JwtTokenUtil;
import me.zhengjie.system.domain.User;
import me.zhengjie.system.repository.UserRepository;
import me.zhengjie.system.service.UserService;
import me.zhengjie.system.service.dto.UserDTO;
import me.zhengjie.system.service.mapper.UserMapper;
package me.zhengjie.modules.system.service.impl;
import me.zhengjie.modules.system.domain.User;
import me.zhengjie.exception.BadRequestException;
import me.zhengjie.exception.EntityExistException;
import me.zhengjie.exception.EntityNotFoundException;
import me.zhengjie.modules.system.repository.UserRepository;
import me.zhengjie.modules.security.security.JwtUser;
import me.zhengjie.modules.security.utils.JwtTokenUtil;
import me.zhengjie.modules.system.service.UserService;
import me.zhengjie.modules.system.service.dto.UserDTO;
import me.zhengjie.modules.system.service.mapper.UserMapper;
import me.zhengjie.utils.ValidationUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.Optional;
/**
......@@ -135,7 +136,7 @@ public class UserServiceImpl implements UserService {
@Override
@Transactional(rollbackFor = Exception.class)
public void updatePass(JwtUser jwtUser, String pass) {
userRepository.updatePass(jwtUser.getId(),pass);
userRepository.updatePass(jwtUser.getId(),pass,new Date());
}
@Override
......
package me.zhengjie.system.service.mapper;
package me.zhengjie.modules.system.service.mapper;
import me.zhengjie.common.mapper.EntityMapper;
import me.zhengjie.system.domain.Menu;
import me.zhengjie.system.service.dto.MenuDTO;
import me.zhengjie.modules.system.domain.Menu;
import me.zhengjie.mapper.EntityMapper;
import me.zhengjie.modules.system.service.dto.MenuDTO;
import org.mapstruct.Mapper;
import org.mapstruct.ReportingPolicy;
......
package me.zhengjie.system.service.mapper;
package me.zhengjie.modules.system.service.mapper;
import me.zhengjie.common.mapper.EntityMapper;
import me.zhengjie.system.domain.Permission;
import me.zhengjie.system.domain.Role;
import me.zhengjie.system.service.dto.PermissionDTO;
import me.zhengjie.system.service.dto.RoleDTO;
import me.zhengjie.modules.system.domain.Permission;
import me.zhengjie.mapper.EntityMapper;
import me.zhengjie.modules.system.service.dto.PermissionDTO;
import org.mapstruct.Mapper;
import org.mapstruct.ReportingPolicy;
......
package me.zhengjie.system.service.mapper;
package me.zhengjie.modules.system.service.mapper;
import me.zhengjie.common.mapper.EntityMapper;
import me.zhengjie.system.domain.Role;
import me.zhengjie.system.service.dto.RoleDTO;
import me.zhengjie.modules.system.domain.Role;
import me.zhengjie.mapper.EntityMapper;
import me.zhengjie.modules.system.service.dto.RoleDTO;
import org.mapstruct.Mapper;
import org.mapstruct.ReportingPolicy;
......
package me.zhengjie.system.service.mapper;
package me.zhengjie.modules.system.service.mapper;
import me.zhengjie.common.mapper.EntityMapper;
import me.zhengjie.system.domain.User;
import me.zhengjie.system.service.dto.UserDTO;
import me.zhengjie.modules.system.domain.User;
import me.zhengjie.mapper.EntityMapper;
import me.zhengjie.modules.system.service.dto.UserDTO;
import org.mapstruct.Mapper;
import org.mapstruct.ReportingPolicy;
......
package me.zhengjie.system.service.query;
package me.zhengjie.modules.system.service.query;
import me.zhengjie.system.domain.Menu;
import me.zhengjie.system.repository.MenuRepository;
import me.zhengjie.system.service.mapper.MenuMapper;
import me.zhengjie.modules.system.domain.Menu;
import me.zhengjie.modules.system.repository.MenuRepository;
import me.zhengjie.modules.system.service.mapper.MenuMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;
......
package me.zhengjie.system.service.query;
package me.zhengjie.modules.system.service.query;
import me.zhengjie.system.domain.Permission;
import me.zhengjie.system.repository.PermissionRepository;
import me.zhengjie.system.service.mapper.PermissionMapper;
import me.zhengjie.modules.system.domain.Permission;
import me.zhengjie.modules.system.repository.PermissionRepository;
import me.zhengjie.modules.system.service.mapper.PermissionMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;
......
package me.zhengjie.system.service.query;
package me.zhengjie.modules.system.service.query;
import me.zhengjie.common.utils.PageUtil;
import me.zhengjie.system.domain.Role;
import me.zhengjie.system.repository.RoleRepository;
import me.zhengjie.system.service.dto.RoleDTO;
import me.zhengjie.system.service.mapper.RoleMapper;
import me.zhengjie.modules.system.domain.Role;
import me.zhengjie.modules.system.repository.RoleRepository;
import me.zhengjie.modules.system.service.dto.RoleDTO;
import me.zhengjie.modules.system.service.mapper.RoleMapper;
import me.zhengjie.utils.PageUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;
......
package me.zhengjie.system.service.query;
package me.zhengjie.modules.system.service.query;
import me.zhengjie.common.utils.PageUtil;
import me.zhengjie.system.domain.User;
import me.zhengjie.system.repository.UserRepository;
import me.zhengjie.system.service.dto.UserDTO;
import me.zhengjie.system.service.mapper.UserMapper;
import me.zhengjie.modules.system.domain.User;
import me.zhengjie.modules.system.repository.UserRepository;
import me.zhengjie.modules.system.service.dto.UserDTO;
import me.zhengjie.modules.system.service.mapper.UserMapper;
import me.zhengjie.utils.PageUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;
......@@ -15,7 +15,10 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils;
import javax.persistence.criteria.*;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Predicate;
import javax.persistence.criteria.Root;
import java.util.ArrayList;
import java.util.List;
......
_ _ _
| | | | (_)
___| |______ __ _ __| |_ __ ___ _ _ __
/ _ | |______/ _` |/ _` | '_ ` _ \| | '_ \
| __| | | (_| | (_| | | | | | | | | | |
\___|_| \__,_|\__,_|_| |_| |_|_|_| |_|
:: Spring Boot :: (v2.1.0.RELEASE)
\ No newline at end of file
server:
port: 8000
#配置数据源
spring:
datasource:
......@@ -44,36 +41,9 @@ spring:
#配置 Jpa
jpa:
properties:
hibernate:
dialect: org.hibernate.dialect.MySQL5InnoDBDialect
hibernate:
# 生产环境设置成 none,避免程序运行时自动更新数据库结构
ddl-auto: update
naming:
physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
open-in-view: true
jackson:
time-zone: GMT+8
redis:
#数据库索引
database: 0
host: 127.0.0.1
port: 6379
password:
jedis:
pool:
#最大连接数
max-active: 100
#最大阻塞等待时间(负数表示没限制)
max-wait: 2000
#最大空闲
max-idle: 500
#最小空闲
min-idle: 8
#连接超时时间
timeout: 5000
#jwt
jwt:
......@@ -81,18 +51,12 @@ jwt:
secret: mySecret
# token 过期时间 2个小时
expiration: 7200000
# expiration: 60000
auth:
# 授权路径
path: /login
# 获取用户信息
account: /info
#七牛云
qiniu:
# 文件大小 /M
max-size: 5
#验证码有效时间/分钟
code:
expiration: 5
\ No newline at end of file
#是否允许生成代码,生产环境设置为false
generator:
enabled: true
\ No newline at end of file
#配置数据源
spring:
datasource:
druid:
type: com.alibaba.druid.pool.DruidDataSource
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
url: jdbc:log4jdbc:mysql://localhost:3306/eladmin?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false
username: root
password: 123456
# 初始化连接大小
initial-size: 5
# 最小空闲连接数
min-idle: 5
max-active: 20
max-wait: 30000
# 可关闭的空闲连接间隔时间
time-between-eviction-runs-millis: 60000
# 配置连接在池中的最小生存时间
min-evictable-idle-time-millis: 300000
validation-query: select '1' from dual
test-while-idle: true
test-on-borrow: false
test-on-return: false
# 打开PSCache,并且指定每个连接上PSCache的大小
pool-prepared-statements: true
max-open-prepared-statements: 20
max-pool-prepared-statement-per-connection-size: 20
# 配置监控统计拦截的filters
filters: stat
stat-view-servlet:
url-pattern: /druid/*
reset-enable: false
login-username: admin
login-password: 123456
web-stat-filter:
url-pattern: /*
exclusions: "*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*"
#配置 Jpa
jpa:
hibernate:
# 生产环境设置成 none,避免程序运行时自动更新数据库结构
ddl-auto: none
#jwt
jwt:
header: Authorization
secret: mySecret
# token 过期时间 2个小时
expiration: 7200000
auth:
# 授权路径
path: /login
# 获取用户信息
account: /info
#是否允许生成代码,生产环境设置为false
generator:
enabled: false
\ No newline at end of file
server:
port: 8000
spring:
profiles:
active: dev
jackson:
time-zone: GMT+8
data:
redis:
repositories:
enabled: false
#配置 Jpa
jpa:
properties:
hibernate:
dialect: org.hibernate.dialect.MySQL5InnoDBDialect
naming:
physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
open-in-view: true
redis:
#数据库索引
database: 0
host: 127.0.0.1
port: 6379
password:
jedis:
pool:
#最大连接数
max-active: 100
#最大阻塞等待时间(负数表示没限制)
max-wait: 2000
#最大空闲
max-idle: 500
#最小空闲
min-idle: 8
#连接超时时间
timeout: 5000
#七牛云
qiniu:
# 文件大小 /M
max-size: 5
#验证码有效时间/分钟
code:
expiration: 5
\ No newline at end of file
#Êý¾Ý¿âÀàÐÍת»»³ÉjavaÀàÐÍ
tinyint=Integer
smallint=Integer
mediumint=Integer
int=Integer
integer=Integer
bigint=Long
float=Float
double=Double
decimal=BigDecimal
bit=Boolean
char=String
varchar=String
tinytext=String
text=String
mediumtext=String
longtext=String
date=Timestamp
datetime=Timestamp
timestamp=Timestamp
\ No newline at end of file
......@@ -10,7 +10,7 @@
</encoder>
<!--添加我们自定义的filter-->
<filter class="me.zhengjie.monitor.config.LogFilter"></filter>
<filter class="me.zhengjie.modules.monitor.config.LogFilter"></filter>
</appender>
<!--普通日志输出到控制台-->
......
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<style>
@page {
margin: 0;
}
</style>
</head>
<body style="margin: 0px;
padding: 0px;
font: 100% SimSun, Microsoft YaHei, Times New Roman, Verdana, Arial, Helvetica, sans-serif;
color: #000;">
<div style="height: auto;
width: 820px;
min-width: 820px;
margin: 0 auto;
margin-top: 20px;
border: 1px solid #eee;">
<div style="padding: 10px;padding-bottom: 0px;">
<p style="margin-bottom: 10px;padding-bottom: 0px;">尊敬的用户,您好:</p>
<p style="text-indent: 2em; margin-bottom: 10px;">您正在申请邮箱验证,您的验证码为:</p>
<p style="text-align: center;
font-family: Times New Roman;
font-size: 22px;
color: #C60024;
padding: 20px 0px;
margin-bottom: 10px;
font-weight: bold;
background: #ebebeb;">${code}</p>
<div style="list-style: none;
margin-top: 22px;
maigin-bottom: 10px;
font-size: 14px;
color: #555;">
<p style="line-height: 12px;">扣扣群:891137268</p>
<p style="line-height: 12px;">Github:<a hover="color: #DA251D;" style="color: #999;" href="https://github.com/elunez/eladmin" target="_blank">https://github.com/elunez/eladmin</a></p>
</div>
<div class="foot-hr hr" style="margin: 0 auto;
z-index: 111;
width: 800px;
margin-top: 30px;
border-top: 1px solid #DA251D;">
</div>
<div style="text-align: center;
font-size: 12px;
padding: 20px 0px;
font-family: Microsoft YaHei;">
Copyright &copy;${.now?string("yyyy")} EL-ADMIN 后台管理系统 All Rights Reserved.
</div>
</div>
</div>
</body>
</html>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment