mod
This commit is contained in:
@@ -15,7 +15,9 @@ import java.net.UnknownHostException;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 启动类
|
||||
* @Description 描述:
|
||||
* @Author A贾宇婷034244310
|
||||
* @Date 20260615
|
||||
*/
|
||||
@Log4j2
|
||||
@SpringBootApplication
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
package com.bc.exam.ability;
|
||||
|
||||
|
||||
/**
|
||||
* 通用常量
|
||||
* @author chenhaodong
|
||||
*/
|
||||
public class Constant {
|
||||
|
||||
|
||||
/**
|
||||
* 文件上传路径
|
||||
*/
|
||||
public static final String FILE_PREFIX = "/upload/file/";
|
||||
}
|
||||
@@ -22,9 +22,11 @@ import org.springframework.stereotype.Component;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 用户登录鉴权和获取用户授权
|
||||
* @author chenhaodong
|
||||
* @Description 描述:用户登录鉴权和获取用户授权
|
||||
* @Author A贾宇婷034244310
|
||||
* @Date 20260615
|
||||
*/
|
||||
@Component
|
||||
@Slf4j
|
||||
|
||||
@@ -12,9 +12,11 @@ import javax.servlet.ServletResponse;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
|
||||
/**
|
||||
* 鉴权登录拦截器
|
||||
* @author chenhaodong
|
||||
* @Description 描述:鉴权登录拦截器
|
||||
* @Author A贾宇婷034244310
|
||||
* @Date 20260615
|
||||
*/
|
||||
@Slf4j
|
||||
public class JwtFilter extends BasicHttpAuthenticationFilter {
|
||||
|
||||
@@ -4,7 +4,9 @@ import lombok.Data;
|
||||
import org.apache.shiro.authc.AuthenticationToken;
|
||||
|
||||
/**
|
||||
* @author chenhaodong
|
||||
* @Description 描述:
|
||||
* @Author A贾宇婷034244310
|
||||
* @Date 20260615
|
||||
*/
|
||||
@Data
|
||||
public class JwtToken implements AuthenticationToken {
|
||||
|
||||
@@ -11,8 +11,9 @@ import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* JWT工具类
|
||||
* @author chenhaodong
|
||||
* @Description 描述:JWT工具类
|
||||
* @Author A贾宇婷034244310
|
||||
* @Date 20260615
|
||||
*/
|
||||
public class JwtUtils {
|
||||
|
||||
|
||||
@@ -23,16 +23,18 @@ import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 数据字典AOP类,处理数据字典值
|
||||
*
|
||||
* @author chenhaodong
|
||||
* @Description 描述:数据字典AOP类,处理数据字典值
|
||||
* @Author A贾宇婷034244310
|
||||
* @Date 20260615
|
||||
*/
|
||||
@Aspect
|
||||
//@Component
|
||||
@Slf4j
|
||||
public class DictAspect {
|
||||
|
||||
|
||||
@Autowired
|
||||
private SysDictService sysDictService;
|
||||
|
||||
|
||||
@@ -24,10 +24,13 @@ import java.io.StringReader;
|
||||
import java.sql.Connection;
|
||||
import java.util.Properties;
|
||||
|
||||
|
||||
/**
|
||||
* 查询拦截器,用于拦截处理通用的信息、如用户ID、多租户信息等;
|
||||
* @Description 描述:查询拦截器,用于拦截处理通用的信息、如用户ID、多租户信息等;
|
||||
* 特别注意:此处继承了PaginationInterceptor分页,分页必须在拦截数据后执行,否则容易出现分页不准确,分页计数大于实际数量等问题
|
||||
* @author chenhaodong
|
||||
*
|
||||
* @Author A贾宇婷034244310
|
||||
* @Date 20260615
|
||||
*/
|
||||
@Log4j2
|
||||
@Intercepts({@Signature(type = StatementHandler.class, method = "prepare", args = {Connection.class, Integer.class}),})
|
||||
|
||||
@@ -17,8 +17,9 @@ import java.util.Objects;
|
||||
import java.util.Properties;
|
||||
|
||||
/**
|
||||
* 自动给创建时间个更新时间加值
|
||||
* @author chenhaodong
|
||||
* @Description 描述:自动给创建时间和更新时间加值
|
||||
* @Author A贾宇婷034244310
|
||||
* @Date 20260615
|
||||
*/
|
||||
@Intercepts(value = {@Signature(type = Executor.class, method = "update", args = {MappedStatement.class, Object.class})})
|
||||
public class UpdateInterceptor extends AbstractSqlParserHandler implements Interceptor {
|
||||
|
||||
@@ -10,10 +10,11 @@ import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
|
||||
/**
|
||||
* 注入工具类
|
||||
* @author chenhaodong
|
||||
* @date 2019-07-17 09:32
|
||||
* @Description 描述:注入工具类 写出统一错误信息
|
||||
* @Author A贾宇婷034244310
|
||||
* @Date 20260615
|
||||
*/
|
||||
@Log4j2
|
||||
@Component
|
||||
|
||||
@@ -9,10 +9,11 @@ import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
|
||||
import org.springframework.web.filter.CorsFilter;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 网关全局设置,允许跨域
|
||||
* @author chenhaodong
|
||||
* @date 2019-08-13 17:28
|
||||
* @Description 描述:网关全局设置,允许跨域
|
||||
* @Author A贾宇婷034244310
|
||||
* @Date 20260615
|
||||
*/
|
||||
|
||||
@Configuration
|
||||
|
||||
@@ -6,10 +6,11 @@ import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
|
||||
/**
|
||||
* Mybatis过滤器配置
|
||||
* 注意:必须按顺序进行配置,否则容易出现业务异常
|
||||
* @author chenhaodong
|
||||
* @Description 描述:Mybatis过滤器配置 注意:必须按顺序进行配置,否则容易出现业务异常
|
||||
* @Author A贾宇婷034244310
|
||||
* @Date 20260615
|
||||
*/
|
||||
@Configuration
|
||||
@MapperScan("com.bc.exam.modules.**.mapper")
|
||||
|
||||
@@ -15,9 +15,11 @@ import org.springframework.scheduling.config.ScheduledTaskRegistrar;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
|
||||
|
||||
/**
|
||||
* 任务调度配置
|
||||
* @author chenhaodong
|
||||
* @Description 描述:任务调度配置
|
||||
* @Author A贾宇婷034244310
|
||||
* @Date 20260615
|
||||
*/
|
||||
@Log4j2
|
||||
@Configuration
|
||||
|
||||
@@ -22,8 +22,9 @@ import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* Shiro配置类
|
||||
* @author chenhaodong
|
||||
* @Description 描述:Shiro配置类
|
||||
* @Author A贾宇婷034244310
|
||||
* @Date 20260615
|
||||
*/
|
||||
@Slf4j
|
||||
@Configuration
|
||||
|
||||
@@ -19,9 +19,9 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
||||
import java.util.Collections;
|
||||
|
||||
/**
|
||||
* Swagger配置
|
||||
* @author chenhaodong
|
||||
* @date 2020/8/19 20:53
|
||||
* @Description 描述:Swagger配置
|
||||
* @Author A贾宇婷034244310
|
||||
* @Date 20260615
|
||||
*/
|
||||
@Configuration
|
||||
@EnableSwagger2
|
||||
|
||||
@@ -16,9 +16,11 @@ import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* @author chenhaodong
|
||||
* @since 2023-01-03 13:56
|
||||
* @Description 描述:
|
||||
* @Author A贾宇婷034244310
|
||||
* @Date 20260615
|
||||
*/
|
||||
@Aspect
|
||||
@Configuration
|
||||
|
||||
@@ -5,9 +5,11 @@ import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
|
||||
/**
|
||||
* 数据字典注解
|
||||
* @author chenhaodong
|
||||
* @Description 描述:数据字典注解
|
||||
* @Author A贾宇婷034244310
|
||||
* @Date 20260615
|
||||
*/
|
||||
@Target(ElementType.FIELD)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
|
||||
@@ -5,9 +5,11 @@ import com.bc.exam.core.api.ApiError;
|
||||
import com.bc.exam.core.api.ApiRest;
|
||||
import com.bc.exam.core.exception.ServiceException;
|
||||
|
||||
|
||||
/**
|
||||
* 基础控制器
|
||||
* @author chenhaodong
|
||||
* @Description 描述:基础控制器 control复用这里公共的内容
|
||||
* @Author A贾宇婷034244310
|
||||
* @Date 20260615
|
||||
*/
|
||||
public class BaseController {
|
||||
|
||||
|
||||
@@ -4,10 +4,12 @@ import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 请求和响应的基础类,用于处理序列化
|
||||
* @author chenhaodong
|
||||
* @date 2019/3/16 15:56
|
||||
* @Description 描述:请求和响应的基础类,用于处理序列化
|
||||
* @Author A贾宇婷034244310
|
||||
* @Date 20260615
|
||||
*/
|
||||
@Data
|
||||
public class BaseDTO implements Serializable {
|
||||
|
||||
@@ -5,13 +5,11 @@ import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 主键通用请求类,用于根据ID查询
|
||||
* </p>
|
||||
*
|
||||
* @author chenhaodong
|
||||
* @since 2019-04-20 12:15
|
||||
* @Description 描述:主键通用请求类,用于根据ID查询
|
||||
* @Author A贾宇婷034244310
|
||||
* @Date 20260615
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value="主键通用请求类", description="主键通用请求类")
|
||||
|
||||
@@ -6,13 +6,12 @@ import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 主键通用响应类,用于添加后返回内容
|
||||
* </p>
|
||||
*
|
||||
* @author chenhaodong
|
||||
* @since 2019-04-20 12:15
|
||||
* @Description 描述:主键通用响应类,用于添加后返回内容
|
||||
* @Author A贾宇婷034244310
|
||||
* @Date 20260615
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value="主键通用响应类", description="主键通用响应类")
|
||||
|
||||
Reference in New Issue
Block a user