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.MathGenerator;
|
||||
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.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@@ -12,7 +12,7 @@ import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||
|
||||
/**
|
||||
* mybatis-plus 配置类
|
||||
* mybatis-plus 自动配置类
|
||||
*
|
||||
* @author haoxr
|
||||
* @since 2022/7/2
|
||||
|
||||
@@ -16,7 +16,7 @@ import org.springframework.data.redis.serializer.RedisSerializer;
|
||||
/**
|
||||
* Redis 缓存配置
|
||||
*
|
||||
* @author haoxr
|
||||
* @author Ray
|
||||
* @since 2023/12/4
|
||||
*/
|
||||
@EnableCaching
|
||||
|
||||
@@ -9,7 +9,7 @@ import org.springframework.data.redis.serializer.RedisSerializer;
|
||||
/**
|
||||
* Redis 配置
|
||||
*
|
||||
* @author haoxr
|
||||
* @author Ray
|
||||
* @since 2023/5/15
|
||||
*/
|
||||
@Configuration
|
||||
|
||||
@@ -29,7 +29,7 @@ import org.springframework.security.web.authentication.UsernamePasswordAuthentic
|
||||
/**
|
||||
* Spring Security 权限配置
|
||||
*
|
||||
* @author Ray Hao
|
||||
* @author Ray
|
||||
* @since 2023/2/17
|
||||
*/
|
||||
@Configuration
|
||||
|
||||
@@ -17,7 +17,7 @@ import org.springframework.http.HttpHeaders;
|
||||
* Swagger 配置
|
||||
* <p>
|
||||
*
|
||||
* @author haoxr
|
||||
* @author Ray
|
||||
* @see <a href="https://doc.xiaominfo.com/docs/quick-start">knife4j 快速开始</a>
|
||||
* @since 2023/2/17
|
||||
*/
|
||||
|
||||
@@ -23,6 +23,12 @@ import java.text.SimpleDateFormat;
|
||||
import java.util.List;
|
||||
import java.util.TimeZone;
|
||||
|
||||
/**
|
||||
* WebMvc 自动装配配置
|
||||
*
|
||||
* @author Ray
|
||||
* @since 2020/10/16
|
||||
*/
|
||||
@Configuration
|
||||
@Slf4j
|
||||
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 org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 验证码配置
|
||||
* 验证码 属性配置
|
||||
*
|
||||
* @author haoxr
|
||||
* @since 2023/11/24
|
||||
@@ -11,6 +11,12 @@ import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 认证控制层
|
||||
*
|
||||
* @author Ray
|
||||
* @since 2022/10/16
|
||||
*/
|
||||
@Tag(name = "01.认证中心")
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/auth")
|
||||
|
||||
@@ -5,12 +5,18 @@ import com.youlai.system.model.dto.FileInfo;
|
||||
import com.youlai.system.service.OssService;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.SneakyThrows;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
/**
|
||||
* 文件控制层
|
||||
*
|
||||
* @author Ray
|
||||
* @since 2022/10/16
|
||||
*/
|
||||
@Tag(name = "07.文件接口")
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/files")
|
||||
@@ -22,7 +28,7 @@ public class FileController {
|
||||
@PostMapping
|
||||
@Operation(summary = "文件上传")
|
||||
public Result<FileInfo> uploadFile(
|
||||
@Parameter(description ="表单文件对象") @RequestParam(value = "file") MultipartFile file
|
||||
@Parameter(description = "表单文件对象") @RequestParam(value = "file") MultipartFile file
|
||||
) {
|
||||
FileInfo fileInfo = ossService.uploadFile(file);
|
||||
return Result.success(fileInfo);
|
||||
@@ -32,7 +38,7 @@ public class FileController {
|
||||
@Operation(summary = "文件删除")
|
||||
@SneakyThrows
|
||||
public Result deleteFile(
|
||||
@Parameter(description ="文件路径") @RequestParam String filePath
|
||||
@Parameter(description = "文件路径") @RequestParam String filePath
|
||||
) {
|
||||
boolean result = ossService.deleteFile(filePath);
|
||||
return Result.judge(result);
|
||||
|
||||
@@ -40,7 +40,7 @@ public class SysDeptController {
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
@Operation(summary = "获取部门下拉选项")
|
||||
@Operation(summary = "获取部门下拉列表")
|
||||
@GetMapping("/options")
|
||||
public Result<List<Option>> getDeptOptions() {
|
||||
List<Option> list = deptService.listDeptOptions();
|
||||
|
||||
@@ -18,7 +18,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
/**
|
||||
* 字典控制层
|
||||
*
|
||||
* @author Ray Hao
|
||||
* @author Ray
|
||||
* @since 2.9.0
|
||||
*/
|
||||
@Tag(name = "06.字典接口")
|
||||
|
||||
@@ -19,9 +19,9 @@ import org.springframework.web.bind.annotation.*;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 菜单控制器
|
||||
* 菜单控制层
|
||||
*
|
||||
* @author haoxr
|
||||
* @author Ray
|
||||
* @since 2020/11/06
|
||||
*/
|
||||
@Tag(name = "04.菜单接口")
|
||||
|
||||
@@ -20,6 +20,13 @@ import jakarta.validation.Valid;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 角色控制层
|
||||
*
|
||||
* @author Ray
|
||||
* @since 2022/10/16
|
||||
*/
|
||||
@Tag(name = "03.角色接口")
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/roles")
|
||||
|
||||
@@ -37,9 +37,9 @@ import java.net.URLEncoder;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户控制器
|
||||
* 用户控制层
|
||||
*
|
||||
* @author haoxr
|
||||
* @author Ray
|
||||
* @since 2022/10/16
|
||||
*/
|
||||
@Tag(name = "02.用户接口")
|
||||
|
||||
@@ -13,9 +13,9 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
import java.security.Principal;
|
||||
|
||||
/**
|
||||
* WebSocket 测试控制器
|
||||
* WebSocket 测试控制层
|
||||
*
|
||||
* @author haoxr
|
||||
* @author Ray
|
||||
* @since 2.3.0
|
||||
*/
|
||||
@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.model.dto.CaptchaResult;
|
||||
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.security.util.JwtUtils;
|
||||
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{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user