1. 修改 SysNotification 实体,新增 senderId, senderName, targetType 字段 2. 新增 SendNotificationRequest 请求DTO 3. 扩展通知类型至6种(新增用户通知、课程通知) 4. 实现角色层级权限控制,支持多级管理员通知下级 5. 支持老师群发课程通知给学生 6. 新增批量发送接口和权限配置
42 lines
1.3 KiB
Java
42 lines
1.3 KiB
Java
package art.kexue.sxwz.config;
|
|
|
|
import art.kexue.sxwz.interceptor.LogInterceptor;
|
|
import art.kexue.sxwz.mapper.SysLogMapper;
|
|
import org.springframework.context.annotation.Configuration;
|
|
import org.springframework.scheduling.annotation.EnableAsync;
|
|
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
/**
|
|
* 日志配置类
|
|
* 注册日志拦截器,启用异步支持
|
|
*
|
|
* @author 王志维
|
|
* @since 2026-04-14
|
|
*/
|
|
@Configuration
|
|
@EnableAsync // 启用异步支持
|
|
public class LogConfiguration implements WebMvcConfigurer {
|
|
|
|
@Resource
|
|
private SysLogMapper sysLogMapper;
|
|
|
|
/**
|
|
* 注册拦截器
|
|
*/
|
|
@Override
|
|
public void addInterceptors(InterceptorRegistry registry) {
|
|
LogInterceptor logInterceptor = new LogInterceptor();
|
|
logInterceptor.setSysLogMapper(sysLogMapper);
|
|
registry.addInterceptor(logInterceptor)
|
|
.addPathPatterns("/api/**") // 拦截所有 API 请求
|
|
.excludePathPatterns(
|
|
"/api/login/validateToken", // 排除 token 验证接口
|
|
"/api/captcha/**" // 排除验证码接口
|
|
);
|
|
}
|
|
}
|
|
|