修改框架
This commit is contained in:
@@ -21,7 +21,7 @@ import com.quoted.framework.security.context.PermissionContextHolder;
|
||||
/**
|
||||
* 数据过滤处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* quoted
|
||||
*/
|
||||
@Aspect
|
||||
@Component
|
||||
|
||||
@@ -18,7 +18,7 @@ import com.quoted.framework.datasource.DynamicDataSourceContextHolder;
|
||||
/**
|
||||
* 多数据源处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* quoted
|
||||
*/
|
||||
@Aspect
|
||||
@Order(1)
|
||||
@@ -27,8 +27,8 @@ public class DataSourceAspect
|
||||
{
|
||||
protected Logger logger = LoggerFactory.getLogger(getClass());
|
||||
|
||||
@Pointcut("@annotation(com.ruoyi.common.annotation.DataSource)"
|
||||
+ "|| @within(com.ruoyi.common.annotation.DataSource)")
|
||||
@Pointcut("@annotation(com.quoted.common.annotation.DataSource)"
|
||||
+ "|| @within(com.quoted.common.annotation.DataSource)")
|
||||
public void dsPointCut()
|
||||
{
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ import com.quoted.system.domain.SysOperLog;
|
||||
/**
|
||||
* 操作日志记录处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* quoted
|
||||
*/
|
||||
@Aspect
|
||||
@Component
|
||||
|
||||
@@ -22,7 +22,7 @@ import com.quoted.common.utils.ip.IpUtils;
|
||||
/**
|
||||
* 限流处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* quoted
|
||||
*/
|
||||
@Aspect
|
||||
@Component
|
||||
|
||||
@@ -10,13 +10,13 @@ import org.springframework.context.annotation.EnableAspectJAutoProxy;
|
||||
/**
|
||||
* 程序注解配置
|
||||
*
|
||||
* @author ruoyi
|
||||
* quoted
|
||||
*/
|
||||
@Configuration
|
||||
// 表示通过aop框架暴露该代理对象,AopContext能够访问
|
||||
@EnableAspectJAutoProxy(exposeProxy = true)
|
||||
// 指定要扫描的Mapper类的包的路径
|
||||
@MapperScan("com.ruoyi.**.mapper")
|
||||
@MapperScan("com.quoted.**.mapper")
|
||||
public class ApplicationConfig
|
||||
{
|
||||
/**
|
||||
|
||||
@@ -10,7 +10,7 @@ import static com.google.code.kaptcha.Constants.*;
|
||||
/**
|
||||
* 验证码配置
|
||||
*
|
||||
* @author ruoyi
|
||||
* quoted
|
||||
*/
|
||||
@Configuration
|
||||
public class CaptchaConfig
|
||||
@@ -63,7 +63,7 @@ public class CaptchaConfig
|
||||
// KAPTCHA_SESSION_KEY
|
||||
properties.setProperty(KAPTCHA_SESSION_CONFIG_KEY, "kaptchaCodeMath");
|
||||
// 验证码文本生成器
|
||||
properties.setProperty(KAPTCHA_TEXTPRODUCER_IMPL, "com.ruoyi.framework.config.KaptchaTextCreator");
|
||||
properties.setProperty(KAPTCHA_TEXTPRODUCER_IMPL, "com.quoted.framework.config.KaptchaTextCreator");
|
||||
// 验证码文本字符间距 默认为2
|
||||
properties.setProperty(KAPTCHA_TEXTPRODUCER_CHAR_SPACE, "3");
|
||||
// 验证码文本字符长度 默认为5
|
||||
|
||||
@@ -27,7 +27,7 @@ import com.quoted.framework.datasource.DynamicDataSource;
|
||||
/**
|
||||
* druid 配置多数据源
|
||||
*
|
||||
* @author ruoyi
|
||||
* quoted
|
||||
*/
|
||||
@Configuration
|
||||
public class DruidConfig
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ import com.quoted.common.constant.Constants;
|
||||
/**
|
||||
* Redis使用FastJson序列化
|
||||
*
|
||||
* @author ruoyi
|
||||
* quoted
|
||||
*/
|
||||
public class FastJson2JsonRedisSerializer<T> implements RedisSerializer<T>
|
||||
{
|
||||
|
||||
@@ -17,7 +17,7 @@ import com.quoted.common.utils.StringUtils;
|
||||
/**
|
||||
* Filter配置
|
||||
*
|
||||
* @author ruoyi
|
||||
* quoted
|
||||
*/
|
||||
@Configuration
|
||||
public class FilterConfig
|
||||
|
||||
@@ -12,7 +12,7 @@ import com.quoted.common.constant.Constants;
|
||||
/**
|
||||
* 资源文件配置加载
|
||||
*
|
||||
* @author ruoyi
|
||||
* quoted
|
||||
*/
|
||||
@Configuration
|
||||
public class I18nConfig implements WebMvcConfigurer
|
||||
|
||||
@@ -6,7 +6,7 @@ import com.google.code.kaptcha.text.impl.DefaultTextCreator;
|
||||
/**
|
||||
* 验证码文本生成器
|
||||
*
|
||||
* @author ruoyi
|
||||
* quoted
|
||||
*/
|
||||
public class KaptchaTextCreator extends DefaultTextCreator
|
||||
{
|
||||
|
||||
@@ -27,7 +27,7 @@ import com.quoted.common.utils.StringUtils;
|
||||
/**
|
||||
* Mybatis支持*匹配扫描包
|
||||
*
|
||||
* @author ruoyi
|
||||
* quoted
|
||||
*/
|
||||
@Configuration
|
||||
public class MyBatisConfig
|
||||
@@ -124,6 +124,7 @@ public class MyBatisConfig
|
||||
|
||||
final SqlSessionFactoryBean sessionFactory = new SqlSessionFactoryBean();
|
||||
sessionFactory.setDataSource(dataSource);
|
||||
sessionFactory.setVfs(SpringBootVFS.class);
|
||||
sessionFactory.setTypeAliasesPackage(typeAliasesPackage);
|
||||
sessionFactory.setMapperLocations(resolveMapperLocations(StringUtils.split(mapperLocations, ",")));
|
||||
sessionFactory.setConfigLocation(new DefaultResourceLoader().getResource(configLocation));
|
||||
|
||||
@@ -12,7 +12,7 @@ import org.springframework.data.redis.serializer.StringRedisSerializer;
|
||||
/**
|
||||
* redis配置
|
||||
*
|
||||
* @author ruoyi
|
||||
* quoted
|
||||
*/
|
||||
@Configuration
|
||||
@EnableCaching
|
||||
|
||||
@@ -11,14 +11,14 @@ import org.springframework.web.filter.CorsFilter;
|
||||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
import com.quoted.common.config.RuoYiConfig;
|
||||
import com.quoted.common.config.QuotedConfig;
|
||||
import com.quoted.common.constant.Constants;
|
||||
import com.quoted.framework.interceptor.RepeatSubmitInterceptor;
|
||||
|
||||
/**
|
||||
* 通用配置
|
||||
*
|
||||
* @author ruoyi
|
||||
* quoted
|
||||
*/
|
||||
@Configuration
|
||||
public class ResourcesConfig implements WebMvcConfigurer
|
||||
@@ -31,7 +31,7 @@ public class ResourcesConfig implements WebMvcConfigurer
|
||||
{
|
||||
/** 本地文件上传路径 */
|
||||
registry.addResourceHandler(Constants.RESOURCE_PREFIX + "/**")
|
||||
.addResourceLocations("file:" + RuoYiConfig.getProfile() + "/");
|
||||
.addResourceLocations("file:" + QuotedConfig.getProfile() + "/");
|
||||
|
||||
/** swagger配置 */
|
||||
registry.addResourceHandler("/swagger-ui/**")
|
||||
|
||||
@@ -24,7 +24,7 @@ import com.quoted.framework.security.handle.LogoutSuccessHandlerImpl;
|
||||
/**
|
||||
* spring security配置
|
||||
*
|
||||
* @author ruoyi
|
||||
* quoted
|
||||
*/
|
||||
@EnableMethodSecurity(prePostEnabled = true, securedEnabled = true)
|
||||
@Configuration
|
||||
|
||||
@@ -7,7 +7,7 @@ import com.quoted.common.utils.ServletUtils;
|
||||
/**
|
||||
* 服务相关配置
|
||||
*
|
||||
* @author ruoyi
|
||||
* quoted
|
||||
*/
|
||||
@Component
|
||||
public class ServerConfig
|
||||
|
||||
@@ -12,7 +12,7 @@ import java.util.concurrent.ThreadPoolExecutor;
|
||||
/**
|
||||
* 线程池配置
|
||||
*
|
||||
* @author ruoyi
|
||||
* quoted
|
||||
**/
|
||||
@Configuration
|
||||
public class ThreadPoolConfig
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ import com.alibaba.druid.pool.DruidDataSource;
|
||||
/**
|
||||
* druid 配置属性
|
||||
*
|
||||
* @author ruoyi
|
||||
* quoted
|
||||
*/
|
||||
@Configuration
|
||||
public class DruidProperties
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ import com.quoted.common.annotation.Anonymous;
|
||||
/**
|
||||
* 设置Anonymous注解允许匿名访问的url
|
||||
*
|
||||
* @author ruoyi
|
||||
* quoted
|
||||
*/
|
||||
@Configuration
|
||||
public class PermitAllUrlProperties implements InitializingBean, ApplicationContextAware
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;
|
||||
/**
|
||||
* 动态数据源
|
||||
*
|
||||
* @author ruoyi
|
||||
* quoted
|
||||
*/
|
||||
public class DynamicDataSource extends AbstractRoutingDataSource
|
||||
{
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ import org.slf4j.LoggerFactory;
|
||||
/**
|
||||
* 数据源切换处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* quoted
|
||||
*/
|
||||
public class DynamicDataSourceContextHolder
|
||||
{
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ import com.quoted.common.utils.ServletUtils;
|
||||
/**
|
||||
* 防止重复提交拦截器
|
||||
*
|
||||
* @author ruoyi
|
||||
* quoted
|
||||
*/
|
||||
@Component
|
||||
public abstract class RepeatSubmitInterceptor implements HandlerInterceptor
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ import com.quoted.framework.interceptor.RepeatSubmitInterceptor;
|
||||
* 判断请求url和数据是否和上一次相同,
|
||||
* 如果和上次相同,则是重复提交表单。 有效时间为10秒内。
|
||||
*
|
||||
* @author ruoyi
|
||||
* quoted
|
||||
*/
|
||||
@Component
|
||||
public class SameUrlDataInterceptor extends RepeatSubmitInterceptor
|
||||
|
||||
@@ -9,7 +9,7 @@ import com.quoted.common.utils.spring.SpringUtils;
|
||||
/**
|
||||
* 异步任务管理器
|
||||
*
|
||||
* @author ruoyi
|
||||
* quoted
|
||||
*/
|
||||
public class AsyncManager
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@ import javax.annotation.PreDestroy;
|
||||
/**
|
||||
* 确保应用退出时能关闭后台线程
|
||||
*
|
||||
* @author ruoyi
|
||||
* quoted
|
||||
*/
|
||||
@Component
|
||||
public class ShutdownManager
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ import com.quoted.system.service.ISysOperLogService;
|
||||
/**
|
||||
* 异步工厂(产生任务用)
|
||||
*
|
||||
* @author ruoyi
|
||||
* quoted
|
||||
*/
|
||||
public class AsyncFactory
|
||||
{
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ import org.springframework.security.core.Authentication;
|
||||
/**
|
||||
* 身份验证信息
|
||||
*
|
||||
* @author ruoyi
|
||||
* quoted
|
||||
*/
|
||||
public class AuthenticationContextHolder
|
||||
{
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ import com.quoted.common.core.text.Convert;
|
||||
/**
|
||||
* 权限信息
|
||||
*
|
||||
* @author ruoyi
|
||||
* quoted
|
||||
*/
|
||||
public class PermissionContextHolder
|
||||
{
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ import com.quoted.framework.web.service.TokenService;
|
||||
/**
|
||||
* token过滤器 验证token有效性
|
||||
*
|
||||
* @author ruoyi
|
||||
* quoted
|
||||
*/
|
||||
@Component
|
||||
public class JwtAuthenticationTokenFilter extends OncePerRequestFilter
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@ import com.quoted.common.utils.StringUtils;
|
||||
/**
|
||||
* 认证失败处理类 返回未授权
|
||||
*
|
||||
* @author ruoyi
|
||||
* quoted
|
||||
*/
|
||||
@Component
|
||||
public class AuthenticationEntryPointImpl implements AuthenticationEntryPoint, Serializable
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ import com.quoted.framework.web.service.TokenService;
|
||||
/**
|
||||
* 自定义退出处理类 返回成功
|
||||
*
|
||||
* @author ruoyi
|
||||
* quoted
|
||||
*/
|
||||
@Configuration
|
||||
public class LogoutSuccessHandlerImpl implements LogoutSuccessHandler
|
||||
|
||||
@@ -24,7 +24,7 @@ import oshi.util.Util;
|
||||
/**
|
||||
* 服务器相关信息
|
||||
*
|
||||
* @author ruoyi
|
||||
* quoted
|
||||
*/
|
||||
public class Server
|
||||
{
|
||||
|
||||
@@ -5,7 +5,7 @@ import com.quoted.common.utils.Arith;
|
||||
/**
|
||||
* CPU相关信息
|
||||
*
|
||||
* @author ruoyi
|
||||
* quoted
|
||||
*/
|
||||
public class Cpu
|
||||
{
|
||||
|
||||
@@ -7,7 +7,7 @@ import com.quoted.common.utils.DateUtils;
|
||||
/**
|
||||
* JVM相关信息
|
||||
*
|
||||
* @author ruoyi
|
||||
* quoted
|
||||
*/
|
||||
public class Jvm
|
||||
{
|
||||
|
||||
@@ -5,7 +5,7 @@ import com.quoted.common.utils.Arith;
|
||||
/**
|
||||
* 內存相关信息
|
||||
*
|
||||
* @author ruoyi
|
||||
* quoted
|
||||
*/
|
||||
public class Mem
|
||||
{
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.quoted.framework.web.domain.server;
|
||||
/**
|
||||
* 系统相关信息
|
||||
*
|
||||
* @author ruoyi
|
||||
* quoted
|
||||
*/
|
||||
public class Sys
|
||||
{
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.quoted.framework.web.domain.server;
|
||||
/**
|
||||
* 系统文件相关信息
|
||||
*
|
||||
* @author ruoyi
|
||||
* quoted
|
||||
*/
|
||||
public class SysFile
|
||||
{
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ import com.quoted.common.utils.html.EscapeUtil;
|
||||
/**
|
||||
* 全局异常处理器
|
||||
*
|
||||
* @author ruoyi
|
||||
* quoted
|
||||
*/
|
||||
@RestControllerAdvice
|
||||
public class GlobalExceptionHandler
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ import com.quoted.framework.security.context.PermissionContextHolder;
|
||||
/**
|
||||
* RuoYi首创 自定义权限实现,ss取自SpringSecurity首字母
|
||||
*
|
||||
* @author ruoyi
|
||||
* quoted
|
||||
*/
|
||||
@Service("ss")
|
||||
public class PermissionService
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ import com.quoted.system.service.ISysUserService;
|
||||
/**
|
||||
* 登录校验方法
|
||||
*
|
||||
* @author ruoyi
|
||||
* quoted
|
||||
*/
|
||||
@Component
|
||||
public class SysLoginService
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@ import com.quoted.framework.security.context.AuthenticationContextHolder;
|
||||
/**
|
||||
* 登录密码方法
|
||||
*
|
||||
* @author ruoyi
|
||||
* quoted
|
||||
*/
|
||||
@Component
|
||||
public class SysPasswordService
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ import com.quoted.system.service.ISysRoleService;
|
||||
/**
|
||||
* 用户权限处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* quoted
|
||||
*/
|
||||
@Component
|
||||
public class SysPermissionService
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ import com.quoted.system.service.ISysUserService;
|
||||
/**
|
||||
* 注册校验方法
|
||||
*
|
||||
* @author ruoyi
|
||||
* quoted
|
||||
*/
|
||||
@Component
|
||||
public class SysRegisterService
|
||||
|
||||
@@ -27,7 +27,7 @@ import javax.servlet.http.HttpServletRequest;
|
||||
/**
|
||||
* token验证处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* quoted
|
||||
*/
|
||||
@Component
|
||||
public class TokenService
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ import com.quoted.system.service.ISysUserService;
|
||||
/**
|
||||
* 用户验证处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* quoted
|
||||
*/
|
||||
@Service
|
||||
public class UserDetailsServiceImpl implements UserDetailsService
|
||||
|
||||
Reference in New Issue
Block a user