mirror of https://gitee.com/y_project/RuoYi.git
Pre Merge pull request !538 from dark_wu/master
commit
6fbbba82ea
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration>
|
||||
<!-- 日志存放路径 -->
|
||||
<property name="log.path" value="/home/ruoyi/logs" />
|
||||
<property name="log.path" value="./logs" />
|
||||
<!-- 日志输出格式 -->
|
||||
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@ import org.springframework.context.ApplicationContext;
|
|||
import org.springframework.context.ApplicationContextAware;
|
||||
import org.springframework.stereotype.Component;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import org.springframework.lang.NonNull;
|
||||
|
||||
/**
|
||||
* spring工具类 方便在非spring管理环境中获取bean
|
||||
|
@ -24,13 +25,13 @@ public final class SpringUtils implements BeanFactoryPostProcessor, ApplicationC
|
|||
private static ApplicationContext applicationContext;
|
||||
|
||||
@Override
|
||||
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException
|
||||
public void postProcessBeanFactory(@NonNull ConfigurableListableBeanFactory beanFactory) throws BeansException
|
||||
{
|
||||
SpringUtils.beanFactory = beanFactory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException
|
||||
public void setApplicationContext(@NonNull ApplicationContext applicationContext) throws BeansException
|
||||
{
|
||||
SpringUtils.applicationContext = applicationContext;
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
|||
import org.springframework.web.servlet.i18n.LocaleChangeInterceptor;
|
||||
import org.springframework.web.servlet.i18n.SessionLocaleResolver;
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
import org.springframework.lang.NonNull;
|
||||
|
||||
/**
|
||||
* 资源文件配置加载
|
||||
|
@ -36,7 +37,7 @@ public class I18nConfig implements WebMvcConfigurer
|
|||
}
|
||||
|
||||
@Override
|
||||
public void addInterceptors(InterceptorRegistry registry)
|
||||
public void addInterceptors(@NonNull InterceptorRegistry registry)
|
||||
{
|
||||
registry.addInterceptor(localeChangeInterceptor());
|
||||
}
|
||||
|
|
|
@ -116,9 +116,9 @@ public class MyBatisConfig
|
|||
@Bean
|
||||
public SqlSessionFactory sqlSessionFactory(DataSource dataSource) throws Exception
|
||||
{
|
||||
String typeAliasesPackage = env.getProperty("mybatis.typeAliasesPackage");
|
||||
String mapperLocations = env.getProperty("mybatis.mapperLocations");
|
||||
String configLocation = env.getProperty("mybatis.configLocation");
|
||||
String typeAliasesPackage = env.getProperty("mybatis.typeAliasesPackage", "");
|
||||
String mapperLocations = env.getProperty("mybatis.mapperLocations", "");
|
||||
String configLocation = env.getProperty("mybatis.configLocation", "");
|
||||
typeAliasesPackage = setTypeAliasesPackage(typeAliasesPackage);
|
||||
VFS.addImplClass(SpringBootVFS.class);
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
|||
import com.ruoyi.common.config.RuoYiConfig;
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
import com.ruoyi.framework.interceptor.RepeatSubmitInterceptor;
|
||||
import org.springframework.lang.NonNull;
|
||||
|
||||
/**
|
||||
* 通用配置
|
||||
|
@ -32,13 +33,13 @@ public class ResourcesConfig implements WebMvcConfigurer
|
|||
* 默认首页的设置,当输入域名是可以自动跳转到默认指定的网页
|
||||
*/
|
||||
@Override
|
||||
public void addViewControllers(ViewControllerRegistry registry)
|
||||
public void addViewControllers(@NonNull ViewControllerRegistry registry)
|
||||
{
|
||||
registry.addViewController("/").setViewName("forward:" + indexUrl);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addResourceHandlers(ResourceHandlerRegistry registry)
|
||||
public void addResourceHandlers(@NonNull ResourceHandlerRegistry registry)
|
||||
{
|
||||
/** 本地文件上传路径 */
|
||||
registry.addResourceHandler(Constants.RESOURCE_PREFIX + "/**").addResourceLocations("file:" + RuoYiConfig.getProfile() + "/");
|
||||
|
@ -51,7 +52,7 @@ public class ResourcesConfig implements WebMvcConfigurer
|
|||
* 自定义拦截规则
|
||||
*/
|
||||
@Override
|
||||
public void addInterceptors(InterceptorRegistry registry)
|
||||
public void addInterceptors(@NonNull InterceptorRegistry registry)
|
||||
{
|
||||
registry.addInterceptor(repeatSubmitInterceptor).addPathPatterns("/**");
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@ import org.springframework.web.bind.annotation.PostMapping;
|
|||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import com.ruoyi.common.annotation.Anonymous;
|
||||
import org.springframework.lang.NonNull;
|
||||
|
||||
/**
|
||||
* 设置Anonymous注解允许匿名访问的url
|
||||
|
@ -40,7 +41,8 @@ public class PermitAllUrlProperties implements InitializingBean, ApplicationCont
|
|||
Class<?> beanClass;
|
||||
if (bean instanceof Advised)
|
||||
{
|
||||
beanClass = ((Advised) bean).getTargetSource().getTarget().getClass();
|
||||
Object target = ((Advised) bean).getTargetSource().getTarget();
|
||||
beanClass = target != null ? target.getClass() : bean.getClass();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -134,7 +136,7 @@ public class PermitAllUrlProperties implements InitializingBean, ApplicationCont
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setApplicationContext(ApplicationContext context) throws BeansException
|
||||
public void setApplicationContext(@NonNull ApplicationContext context) throws BeansException
|
||||
{
|
||||
this.applicationContext = context;
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@ import com.ruoyi.common.json.JSON;
|
|||
import com.ruoyi.common.annotation.RepeatSubmit;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.utils.ServletUtils;
|
||||
import org.springframework.lang.NonNull;
|
||||
|
||||
/**
|
||||
* 防止重复提交拦截器
|
||||
|
@ -20,7 +21,7 @@ import com.ruoyi.common.utils.ServletUtils;
|
|||
public abstract class RepeatSubmitInterceptor implements HandlerInterceptor
|
||||
{
|
||||
@Override
|
||||
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception
|
||||
public boolean preHandle(@NonNull HttpServletRequest request, @NonNull HttpServletResponse response, @NonNull Object handler) throws Exception
|
||||
{
|
||||
if (handler instanceof HandlerMethod)
|
||||
{
|
||||
|
|
|
@ -124,7 +124,9 @@ public class GlobalExceptionHandler
|
|||
value = EscapeUtil.clean(value);
|
||||
}
|
||||
log.error("请求参数类型不匹配'{}',发生系统异常.", requestURI, e);
|
||||
return AjaxResult.error(String.format("请求参数类型不匹配,参数[%s]要求类型为:'%s',但输入值为:'%s'", e.getName(), e.getRequiredType().getName(), value));
|
||||
Class<?> requiredType = e.getRequiredType();
|
||||
String typeName = requiredType != null ? requiredType.getName() : "unknown";
|
||||
return AjaxResult.error(String.format("请求参数类型不匹配,参数[%s]要求类型为:'%s',但输入值为:'%s'", e.getName(), typeName, value));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package com.ruoyi.quartz.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import javax.validation.constraints.*;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
|
@ -17,7 +16,7 @@ import com.ruoyi.quartz.util.CronUtils;
|
|||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class SysJob extends BaseEntity implements Serializable
|
||||
public class SysJob extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
|
Loading…
Reference in New Issue