wip: 系统日志临时提交
This commit is contained in:
@@ -3,7 +3,7 @@ package com.youlai.system.config;
|
|||||||
import cn.hutool.captcha.generator.CodeGenerator;
|
import cn.hutool.captcha.generator.CodeGenerator;
|
||||||
import cn.hutool.captcha.generator.MathGenerator;
|
import cn.hutool.captcha.generator.MathGenerator;
|
||||||
import cn.hutool.captcha.generator.RandomGenerator;
|
import cn.hutool.captcha.generator.RandomGenerator;
|
||||||
import com.youlai.system.plugin.captcha.CaptchaProperties;
|
import com.youlai.system.config.property.CaptchaProperties;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import org.springframework.context.annotation.Configuration;
|
|||||||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* mybatis-plus 配置类
|
* mybatis-plus 自动配置类
|
||||||
*
|
*
|
||||||
* @author haoxr
|
* @author haoxr
|
||||||
* @since 2022/7/2
|
* @since 2022/7/2
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import org.springframework.data.redis.serializer.RedisSerializer;
|
|||||||
/**
|
/**
|
||||||
* Redis 缓存配置
|
* Redis 缓存配置
|
||||||
*
|
*
|
||||||
* @author haoxr
|
* @author Ray
|
||||||
* @since 2023/12/4
|
* @since 2023/12/4
|
||||||
*/
|
*/
|
||||||
@EnableCaching
|
@EnableCaching
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import org.springframework.data.redis.serializer.RedisSerializer;
|
|||||||
/**
|
/**
|
||||||
* Redis 配置
|
* Redis 配置
|
||||||
*
|
*
|
||||||
* @author haoxr
|
* @author Ray
|
||||||
* @since 2023/5/15
|
* @since 2023/5/15
|
||||||
*/
|
*/
|
||||||
@Configuration
|
@Configuration
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ import org.springframework.security.web.authentication.UsernamePasswordAuthentic
|
|||||||
/**
|
/**
|
||||||
* Spring Security 权限配置
|
* Spring Security 权限配置
|
||||||
*
|
*
|
||||||
* @author Ray Hao
|
* @author Ray
|
||||||
* @since 2023/2/17
|
* @since 2023/2/17
|
||||||
*/
|
*/
|
||||||
@Configuration
|
@Configuration
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import org.springframework.http.HttpHeaders;
|
|||||||
* Swagger 配置
|
* Swagger 配置
|
||||||
* <p>
|
* <p>
|
||||||
*
|
*
|
||||||
* @author haoxr
|
* @author Ray
|
||||||
* @see <a href="https://doc.xiaominfo.com/docs/quick-start">knife4j 快速开始</a>
|
* @see <a href="https://doc.xiaominfo.com/docs/quick-start">knife4j 快速开始</a>
|
||||||
* @since 2023/2/17
|
* @since 2023/2/17
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -23,6 +23,12 @@ import java.text.SimpleDateFormat;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.TimeZone;
|
import java.util.TimeZone;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* WebMvc 自动装配配置
|
||||||
|
*
|
||||||
|
* @author Ray
|
||||||
|
* @since 2020/10/16
|
||||||
|
*/
|
||||||
@Configuration
|
@Configuration
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class WebMvcConfig implements WebMvcConfigurer {
|
public class WebMvcConfig implements WebMvcConfigurer {
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
package com.youlai.system.plugin.captcha;
|
package com.youlai.system.config.property;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 验证码配置
|
* 验证码 属性配置
|
||||||
*
|
*
|
||||||
* @author haoxr
|
* @author haoxr
|
||||||
* @since 2023/11/24
|
* @since 2023/11/24
|
||||||
@@ -11,6 +11,12 @@ import lombok.RequiredArgsConstructor;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 认证控制层
|
||||||
|
*
|
||||||
|
* @author Ray
|
||||||
|
* @since 2022/10/16
|
||||||
|
*/
|
||||||
@Tag(name = "01.认证中心")
|
@Tag(name = "01.认证中心")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/api/v1/auth")
|
@RequestMapping("/api/v1/auth")
|
||||||
|
|||||||
@@ -11,6 +11,12 @@ import lombok.SneakyThrows;
|
|||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件控制层
|
||||||
|
*
|
||||||
|
* @author Ray
|
||||||
|
* @since 2022/10/16
|
||||||
|
*/
|
||||||
@Tag(name = "07.文件接口")
|
@Tag(name = "07.文件接口")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/api/v1/files")
|
@RequestMapping("/api/v1/files")
|
||||||
@@ -22,7 +28,7 @@ public class FileController {
|
|||||||
@PostMapping
|
@PostMapping
|
||||||
@Operation(summary = "文件上传")
|
@Operation(summary = "文件上传")
|
||||||
public Result<FileInfo> uploadFile(
|
public Result<FileInfo> uploadFile(
|
||||||
@Parameter(description ="表单文件对象") @RequestParam(value = "file") MultipartFile file
|
@Parameter(description = "表单文件对象") @RequestParam(value = "file") MultipartFile file
|
||||||
) {
|
) {
|
||||||
FileInfo fileInfo = ossService.uploadFile(file);
|
FileInfo fileInfo = ossService.uploadFile(file);
|
||||||
return Result.success(fileInfo);
|
return Result.success(fileInfo);
|
||||||
@@ -32,7 +38,7 @@ public class FileController {
|
|||||||
@Operation(summary = "文件删除")
|
@Operation(summary = "文件删除")
|
||||||
@SneakyThrows
|
@SneakyThrows
|
||||||
public Result deleteFile(
|
public Result deleteFile(
|
||||||
@Parameter(description ="文件路径") @RequestParam String filePath
|
@Parameter(description = "文件路径") @RequestParam String filePath
|
||||||
) {
|
) {
|
||||||
boolean result = ossService.deleteFile(filePath);
|
boolean result = ossService.deleteFile(filePath);
|
||||||
return Result.judge(result);
|
return Result.judge(result);
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ public class SysDeptController {
|
|||||||
return Result.success(list);
|
return Result.success(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Operation(summary = "获取部门下拉选项")
|
@Operation(summary = "获取部门下拉列表")
|
||||||
@GetMapping("/options")
|
@GetMapping("/options")
|
||||||
public Result<List<Option>> getDeptOptions() {
|
public Result<List<Option>> getDeptOptions() {
|
||||||
List<Option> list = deptService.listDeptOptions();
|
List<Option> list = deptService.listDeptOptions();
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import org.springframework.web.bind.annotation.*;
|
|||||||
/**
|
/**
|
||||||
* 字典控制层
|
* 字典控制层
|
||||||
*
|
*
|
||||||
* @author Ray Hao
|
* @author Ray
|
||||||
* @since 2.9.0
|
* @since 2.9.0
|
||||||
*/
|
*/
|
||||||
@Tag(name = "06.字典接口")
|
@Tag(name = "06.字典接口")
|
||||||
|
|||||||
@@ -19,9 +19,9 @@ import org.springframework.web.bind.annotation.*;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 菜单控制器
|
* 菜单控制层
|
||||||
*
|
*
|
||||||
* @author haoxr
|
* @author Ray
|
||||||
* @since 2020/11/06
|
* @since 2020/11/06
|
||||||
*/
|
*/
|
||||||
@Tag(name = "04.菜单接口")
|
@Tag(name = "04.菜单接口")
|
||||||
|
|||||||
@@ -20,6 +20,13 @@ import jakarta.validation.Valid;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 角色控制层
|
||||||
|
*
|
||||||
|
* @author Ray
|
||||||
|
* @since 2022/10/16
|
||||||
|
*/
|
||||||
@Tag(name = "03.角色接口")
|
@Tag(name = "03.角色接口")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/api/v1/roles")
|
@RequestMapping("/api/v1/roles")
|
||||||
|
|||||||
@@ -37,9 +37,9 @@ import java.net.URLEncoder;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户控制器
|
* 用户控制层
|
||||||
*
|
*
|
||||||
* @author haoxr
|
* @author Ray
|
||||||
* @since 2022/10/16
|
* @since 2022/10/16
|
||||||
*/
|
*/
|
||||||
@Tag(name = "02.用户接口")
|
@Tag(name = "02.用户接口")
|
||||||
|
|||||||
@@ -13,9 +13,9 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
import java.security.Principal;
|
import java.security.Principal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* WebSocket 测试控制器
|
* WebSocket 测试控制层
|
||||||
*
|
*
|
||||||
* @author haoxr
|
* @author Ray
|
||||||
* @since 2.3.0
|
* @since 2.3.0
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
|
|||||||
21
src/main/java/com/youlai/system/mapper/SysLogMapper.java
Normal file
21
src/main/java/com/youlai/system/mapper/SysLogMapper.java
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
package com.youlai.system.mapper;
|
||||||
|
|
||||||
|
import com.youlai.system.model.entity.SysLog;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 系统日志 数据库访问层
|
||||||
|
*
|
||||||
|
* @author Ray
|
||||||
|
* @since 2.9.0
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface SysLogMapper extends BaseMapper<SysLog> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
51
src/main/java/com/youlai/system/model/entity/SysLog.java
Normal file
51
src/main/java/com/youlai/system/model/entity/SysLog.java
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
package com.youlai.system.model.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 系统日志
|
||||||
|
* @TableName sys_log
|
||||||
|
*/
|
||||||
|
@TableName(value ="sys_log")
|
||||||
|
@Data
|
||||||
|
public class SysLog implements Serializable {
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@TableId(type = IdType.AUTO)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建人ID
|
||||||
|
*/
|
||||||
|
private Long createBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改人ID
|
||||||
|
*/
|
||||||
|
private Long updateBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新时间
|
||||||
|
*/
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 逻辑删除标识(1-已删除 0-未删除)
|
||||||
|
*/
|
||||||
|
private Integer isDeleted;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
}
|
||||||
11
src/main/java/com/youlai/system/service/SysLogService.java
Normal file
11
src/main/java/com/youlai/system/service/SysLogService.java
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
package com.youlai.system.service;
|
||||||
|
|
||||||
|
import com.youlai.system.model.entity.SysLog;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public interface SysLogService extends IService<SysLog> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -12,7 +12,7 @@ import com.youlai.system.common.constant.SecurityConstants;
|
|||||||
import com.youlai.system.common.enums.CaptchaTypeEnum;
|
import com.youlai.system.common.enums.CaptchaTypeEnum;
|
||||||
import com.youlai.system.model.dto.CaptchaResult;
|
import com.youlai.system.model.dto.CaptchaResult;
|
||||||
import com.youlai.system.model.dto.LoginResult;
|
import com.youlai.system.model.dto.LoginResult;
|
||||||
import com.youlai.system.plugin.captcha.CaptchaProperties;
|
import com.youlai.system.config.property.CaptchaProperties;
|
||||||
import com.youlai.system.service.AuthService;
|
import com.youlai.system.service.AuthService;
|
||||||
import com.youlai.system.security.util.JwtUtils;
|
import com.youlai.system.security.util.JwtUtils;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package com.youlai.system.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.youlai.system.model.entity.SysLog;
|
||||||
|
import com.youlai.system.service.SysLogService;
|
||||||
|
import com.youlai.system.mapper.SysLogMapper;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class SysLogServiceImpl extends ServiceImpl<SysLogMapper, SysLog>
|
||||||
|
implements SysLogService{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
20
src/main/resources/mapper/SysLogMapper.xml
Normal file
20
src/main/resources/mapper/SysLogMapper.xml
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.youlai.system.mapper.SysLogMapper">
|
||||||
|
|
||||||
|
<resultMap id="BaseResultMap" type="com.youlai.system.model.entity.SysLog">
|
||||||
|
<id property="id" column="id" jdbcType="BIGINT"/>
|
||||||
|
<result property="createBy" column="create_by" jdbcType="BIGINT"/>
|
||||||
|
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||||
|
<result property="updateBy" column="update_by" jdbcType="BIGINT"/>
|
||||||
|
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||||
|
<result property="isDeleted" column="is_deleted" jdbcType="TINYINT"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="Base_Column_List">
|
||||||
|
id,create_by,create_time,
|
||||||
|
update_by,update_time,is_deleted
|
||||||
|
</sql>
|
||||||
|
</mapper>
|
||||||
Reference in New Issue
Block a user