yshop3.0-RC2版本
This commit is contained in:
@ -9,7 +9,7 @@ import org.springframework.stereotype.Component;
|
||||
* 初始化站点统计
|
||||
* @author Zheng Jie
|
||||
*/
|
||||
@Component
|
||||
//@Component
|
||||
public class VisitsInitialization implements ApplicationRunner {
|
||||
|
||||
private final VisitsService visitsService;
|
||||
|
@ -2,7 +2,6 @@ package co.yixiang.modules.monitor.service.mapper;
|
||||
|
||||
import co.yixiang.common.mapper.CoreMapper;
|
||||
import co.yixiang.modules.monitor.domain.Visits;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.springframework.stereotype.Repository;
|
||||
@ -10,7 +9,6 @@ import org.springframework.stereotype.Repository;
|
||||
import java.util.List;
|
||||
|
||||
@Repository
|
||||
@Mapper
|
||||
public interface VisitsMapper extends CoreMapper<Visits> {
|
||||
@Select("select * FROM visits where create_time between #{time1} and #{time2}")
|
||||
List<Visits> findAllVisits(@Param("time1") String time1, @Param("time2")String time2);
|
||||
|
@ -7,7 +7,6 @@ package co.yixiang.modules.quartz.service.mapper;
|
||||
|
||||
import co.yixiang.common.mapper.CoreMapper;
|
||||
import co.yixiang.modules.quartz.domain.QuartzJob;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
@ -15,7 +14,6 @@ import org.springframework.stereotype.Repository;
|
||||
* @date 2020-05-13
|
||||
*/
|
||||
@Repository
|
||||
@Mapper
|
||||
public interface QuartzJobMapper extends CoreMapper<QuartzJob> {
|
||||
|
||||
}
|
||||
|
@ -7,7 +7,6 @@ package co.yixiang.modules.quartz.service.mapper;
|
||||
|
||||
import co.yixiang.common.mapper.CoreMapper;
|
||||
import co.yixiang.modules.quartz.domain.QuartzLog;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
@ -15,7 +14,6 @@ import org.springframework.stereotype.Repository;
|
||||
* @date 2020-05-13
|
||||
*/
|
||||
@Repository
|
||||
@Mapper
|
||||
public interface QuartzLogMapper extends CoreMapper<QuartzLog> {
|
||||
|
||||
}
|
||||
|
@ -6,8 +6,8 @@
|
||||
package co.yixiang.modules.security.security;
|
||||
|
||||
import co.yixiang.modules.security.config.SecurityProperties;
|
||||
import co.yixiang.modules.security.security.vo.OnlineUser;
|
||||
import co.yixiang.modules.security.service.OnlineUserService;
|
||||
import co.yixiang.modules.user.vo.OnlineUser;
|
||||
import co.yixiang.utils.SpringContextHolder;
|
||||
import io.jsonwebtoken.ExpiredJwtException;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
@ -1,39 +0,0 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2020
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
|
||||
*/
|
||||
package co.yixiang.modules.security.security.vo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author hupeng
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class OnlineUser {
|
||||
|
||||
private String userName;
|
||||
|
||||
private String nickName;
|
||||
|
||||
private String job;
|
||||
|
||||
private String browser;
|
||||
|
||||
private String ip;
|
||||
|
||||
private String address;
|
||||
|
||||
private String key;
|
||||
|
||||
private Date loginTime;
|
||||
|
||||
|
||||
}
|
@ -5,9 +5,10 @@
|
||||
*/
|
||||
package co.yixiang.modules.security.service;
|
||||
|
||||
import co.yixiang.constant.ShopConstants;
|
||||
import co.yixiang.modules.security.config.SecurityProperties;
|
||||
import co.yixiang.modules.security.security.vo.JwtUser;
|
||||
import co.yixiang.modules.security.security.vo.OnlineUser;
|
||||
import co.yixiang.modules.user.vo.OnlineUser;
|
||||
import co.yixiang.utils.EncryptUtils;
|
||||
import co.yixiang.utils.FileUtil;
|
||||
import co.yixiang.utils.PageUtil;
|
||||
@ -85,7 +86,7 @@ public class OnlineUserService {
|
||||
public List<OnlineUser> getAll(String filter,int type){
|
||||
List<String> keys = null;
|
||||
if(type == 1){
|
||||
keys = redisUtils.scan("m-online-token*");
|
||||
keys = redisUtils.scan(ShopConstants.YSHOP_APP_LOGIN_USER + "*");
|
||||
}else{
|
||||
keys = redisUtils.scan(properties.getOnlineKey() + "*");
|
||||
}
|
||||
@ -125,7 +126,7 @@ public class OnlineUserService {
|
||||
*/
|
||||
public void kickOutT(String key) throws Exception {
|
||||
|
||||
String keyt = "m-online-token" + EncryptUtils.desDecrypt(key);
|
||||
String keyt = ShopConstants.YSHOP_APP_LOGIN_USER + EncryptUtils.desDecrypt(key);
|
||||
redisUtils.del(keyt);
|
||||
|
||||
}
|
||||
|
@ -10,7 +10,6 @@ package co.yixiang.modules.system.service.mapper;
|
||||
|
||||
import co.yixiang.common.mapper.CoreMapper;
|
||||
import co.yixiang.modules.system.domain.Dept;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.springframework.stereotype.Repository;
|
||||
@ -22,7 +21,6 @@ import java.util.Set;
|
||||
* @date 2020-05-14
|
||||
*/
|
||||
@Repository
|
||||
@Mapper
|
||||
public interface DeptMapper extends CoreMapper<Dept> {
|
||||
|
||||
@Select("select m.* from dept m LEFT JOIN roles_depts t on m.id= t.dept_id LEFT JOIN role r on r.id = t.role_id where r.id = ${roleId}")
|
||||
|
@ -10,7 +10,6 @@ package co.yixiang.modules.system.service.mapper;
|
||||
|
||||
import co.yixiang.common.mapper.CoreMapper;
|
||||
import co.yixiang.modules.system.domain.DictDetail;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.springframework.stereotype.Repository;
|
||||
@ -22,7 +21,6 @@ import java.util.List;
|
||||
* @date 2020-05-14
|
||||
*/
|
||||
@Repository
|
||||
@Mapper
|
||||
public interface DictDetailMapper extends CoreMapper<DictDetail> {
|
||||
|
||||
@Select("<script>SELECT d.* from dict_detail d LEFT JOIN dict t on d.dict_id = t.id where 1=1 <if test = \"label !=null\" > and d.label LIKE concat('%', #{label}, '%') </if> <if test = \"dictName != ''||dictName !=null\" > AND t.name = #{dictName} order by t.sort asc</if></script>")
|
||||
|
@ -10,7 +10,6 @@ package co.yixiang.modules.system.service.mapper;
|
||||
|
||||
import co.yixiang.common.mapper.CoreMapper;
|
||||
import co.yixiang.modules.system.domain.Dict;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
@ -18,7 +17,6 @@ import org.springframework.stereotype.Repository;
|
||||
* @date 2020-05-14
|
||||
*/
|
||||
@Repository
|
||||
@Mapper
|
||||
public interface DictMapper extends CoreMapper<Dict> {
|
||||
|
||||
}
|
||||
|
@ -10,7 +10,6 @@ package co.yixiang.modules.system.service.mapper;
|
||||
|
||||
import co.yixiang.common.mapper.CoreMapper;
|
||||
import co.yixiang.modules.system.domain.Job;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
@ -18,7 +17,6 @@ import org.springframework.stereotype.Repository;
|
||||
* @date 2020-05-14
|
||||
*/
|
||||
@Repository
|
||||
@Mapper
|
||||
public interface JobMapper extends CoreMapper<Job> {
|
||||
|
||||
}
|
||||
|
@ -32,11 +32,11 @@ public interface MenuMapper extends CoreMapper<Menu> {
|
||||
* @param pid /
|
||||
* @return /
|
||||
*/
|
||||
@Select("SELECT * from menu m where m.pid = #{pid} ")
|
||||
@Select("SELECT * from menu m where m.pid = #{pid} and m.is_del = 0 ")
|
||||
List<Menu> findByPid(@Param("pid") long pid);
|
||||
|
||||
@Select("select m.* from menu m LEFT JOIN roles_menus t on m.id= t.menu_id LEFT JOIN role r on r.id = t.role_id where r.id = #{roleId}")
|
||||
@Select("select m.* from menu m LEFT JOIN roles_menus t on m.id= t.menu_id LEFT JOIN role r on r.id = t.role_id where r.id = #{roleId} and m.is_del=0")
|
||||
Set<Menu> findMenuByRoleId(@Param("roleId") Long roleId);
|
||||
@Select("<script>select m.* from menu m LEFT OUTER JOIN roles_menus t on m.id= t.menu_id LEFT OUTER JOIN role r on r.id = t.role_id where m.type!=2 and r.id in <foreach collection=\"roleIds\" index=\"index\" item=\"item\" open=\"(\" separator=\",\" close=\")\">#{item}</foreach> order by m.sort asc</script>")
|
||||
@Select("<script>select m.* from menu m LEFT OUTER JOIN roles_menus t on m.id= t.menu_id LEFT OUTER JOIN role r on r.id = t.role_id where m.is_del=0 and m.type!=2 and r.id in <foreach collection=\"roleIds\" index=\"index\" item=\"item\" open=\"(\" separator=\",\" close=\")\">#{item}</foreach> order by m.sort asc</script>")
|
||||
List<Menu> selectListByRoles(@Param("roleIds") List<Long> roleIds);
|
||||
}
|
||||
|
@ -11,7 +11,6 @@ package co.yixiang.modules.system.service.mapper;
|
||||
import co.yixiang.common.mapper.CoreMapper;
|
||||
import co.yixiang.modules.system.domain.Role;
|
||||
import org.apache.ibatis.annotations.Delete;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.springframework.stereotype.Repository;
|
||||
@ -24,7 +23,6 @@ import java.util.Set;
|
||||
* @date 2020-05-14
|
||||
*/
|
||||
@Repository
|
||||
@Mapper
|
||||
public interface RoleMapper extends CoreMapper<Role> {
|
||||
|
||||
/**
|
||||
|
@ -10,7 +10,6 @@ package co.yixiang.modules.system.service.mapper;
|
||||
|
||||
import co.yixiang.common.mapper.CoreMapper;
|
||||
import co.yixiang.modules.system.domain.RolesDepts;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
@ -18,7 +17,6 @@ import org.springframework.stereotype.Repository;
|
||||
* @date 2020-05-16
|
||||
*/
|
||||
@Repository
|
||||
@Mapper
|
||||
public interface RolesDeptsMapper extends CoreMapper<RolesDepts> {
|
||||
|
||||
}
|
||||
|
@ -10,7 +10,6 @@ package co.yixiang.modules.system.service.mapper;
|
||||
|
||||
import co.yixiang.common.mapper.CoreMapper;
|
||||
import co.yixiang.modules.system.domain.RolesMenus;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
@ -18,7 +17,6 @@ import org.springframework.stereotype.Repository;
|
||||
* @date 2020-05-16
|
||||
*/
|
||||
@Repository
|
||||
@Mapper
|
||||
public interface RolesMenusMapper extends CoreMapper<RolesMenus> {
|
||||
|
||||
}
|
||||
|
@ -10,7 +10,6 @@ package co.yixiang.modules.system.service.mapper;
|
||||
|
||||
import co.yixiang.common.mapper.CoreMapper;
|
||||
import co.yixiang.modules.system.domain.User;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.apache.ibatis.annotations.Update;
|
||||
@ -21,7 +20,6 @@ import org.springframework.stereotype.Repository;
|
||||
* @date 2020-05-14
|
||||
*/
|
||||
@Repository
|
||||
@Mapper
|
||||
public interface SysUserMapper extends CoreMapper<User> {
|
||||
|
||||
/**
|
||||
|
@ -10,7 +10,6 @@ package co.yixiang.modules.system.service.mapper;
|
||||
|
||||
import co.yixiang.common.mapper.CoreMapper;
|
||||
import co.yixiang.modules.system.domain.UserAvatar;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
@ -18,7 +17,6 @@ import org.springframework.stereotype.Repository;
|
||||
* @date 2020-05-14
|
||||
*/
|
||||
@Repository
|
||||
@Mapper
|
||||
public interface UserAvatarMapper extends CoreMapper<UserAvatar> {
|
||||
|
||||
}
|
||||
|
@ -10,7 +10,6 @@ package co.yixiang.modules.system.service.mapper;
|
||||
|
||||
import co.yixiang.common.mapper.CoreMapper;
|
||||
import co.yixiang.modules.system.domain.UsersRoles;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
@ -18,7 +17,6 @@ import org.springframework.stereotype.Repository;
|
||||
* @date 2020-05-16
|
||||
*/
|
||||
@Repository
|
||||
@Mapper
|
||||
public interface UsersRolesMapper extends CoreMapper<UsersRoles> {
|
||||
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ spring:
|
||||
exclusions: "*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*"
|
||||
redis:
|
||||
#数据库索引
|
||||
database: 0
|
||||
database: 2
|
||||
host: 127.0.0.1
|
||||
port: 6379
|
||||
password:
|
||||
|
@ -6,9 +6,9 @@ spring:
|
||||
druid:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
|
||||
url: jdbc:log4jdbc:mysql://localhost:3306/yshop?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false
|
||||
username: root
|
||||
password: root
|
||||
url: jdbc:log4jdbc:mysql://localhost:3306/yshop3?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&zeroDateTimeBehavior=convertToNull
|
||||
username: yshop3
|
||||
password:
|
||||
|
||||
# 初始化配置
|
||||
initial-size: 3
|
||||
@ -41,10 +41,10 @@ spring:
|
||||
|
||||
redis:
|
||||
#数据库索引
|
||||
database: 0
|
||||
database: 2
|
||||
host: 127.0.0.1
|
||||
port: 6379
|
||||
password: root
|
||||
password:
|
||||
#连接超时时间
|
||||
timeout: 5000
|
||||
|
||||
@ -79,15 +79,15 @@ generator:
|
||||
|
||||
#是否开启 swagger-ui,生产环境默认不开启
|
||||
swagger:
|
||||
enabled: false
|
||||
enabled: true
|
||||
title: yshop商城管理后台API
|
||||
serverUrl: http://127.0.0.1:8000
|
||||
version: 3.0
|
||||
|
||||
|
||||
file:
|
||||
path: D:\upload\file\
|
||||
avatar: D:\upload\avatar\
|
||||
path: /home/yshop/file/
|
||||
avatar: /home/yshop/avatar/
|
||||
# 文件大小 /M
|
||||
maxSize: 100
|
||||
avatarMaxSize: 5
|
||||
|
@ -1,5 +1,5 @@
|
||||
server:
|
||||
port: 8000
|
||||
port: 8001
|
||||
|
||||
spring:
|
||||
freemarker:
|
||||
|
Reference in New Issue
Block a user