Compare commits
3 Commits
97c11dd43e
...
6fcf473df8
Author | SHA1 | Date |
---|---|---|
|
6fcf473df8 | |
|
364a038d14 | |
|
f2f9eb980a |
|
@ -14,13 +14,13 @@ public class AdminCodeGenerator {
|
|||
// 作者名称
|
||||
public static final String author = "Bunny";
|
||||
// 公共路径
|
||||
public static final String outputDir = "D:\\MyFolder\\auth-admin\\auth-server-java\\service";
|
||||
// public static final String outputDir = "D:\\Project\\web\\PC\\auth\\auth-server-java\\service";
|
||||
// public static final String outputDir = "D:\\MyFolder\\auth-admin\\auth-server-java\\service";
|
||||
public static final String outputDir = "D:\\Project\\web\\PC\\auth\\auth-server-java\\service";
|
||||
// 实体类名称
|
||||
public static final String entity = "Bunny";
|
||||
|
||||
public static void main(String[] args) {
|
||||
Generation("quartz_execute_log");
|
||||
Generation("log_user_login");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -51,7 +51,7 @@ public class AdminCodeGenerator {
|
|||
.strategyConfig(builder -> {
|
||||
// 设置要生成的表名
|
||||
builder.addInclude(tableName)
|
||||
.addTablePrefix("sys_", "v_")
|
||||
.addTablePrefix("sys_", "v_", "log_")
|
||||
.entityBuilder()
|
||||
.enableLombok()
|
||||
.enableChainModel()
|
||||
|
|
|
@ -3,11 +3,11 @@ package cn.bunny.common.generator.generator;
|
|||
import cn.bunny.common.generator.entity.BaseField;
|
||||
import cn.bunny.common.generator.entity.BaseResultMap;
|
||||
import cn.bunny.common.generator.utils.GeneratorCodeUtils;
|
||||
import cn.bunny.dao.dto.quartz.executeLog.QuartzExecuteLogAddDto;
|
||||
import cn.bunny.dao.dto.quartz.executeLog.QuartzExecuteLogDto;
|
||||
import cn.bunny.dao.dto.quartz.executeLog.QuartzExecuteLogUpdateDto;
|
||||
import cn.bunny.dao.entity.quartz.QuartzExecuteLog;
|
||||
import cn.bunny.dao.vo.quartz.QuartzExecuteLogVo;
|
||||
import cn.bunny.dao.dto.log.UserLoginLogAddDto;
|
||||
import cn.bunny.dao.dto.log.UserLoginLogDto;
|
||||
import cn.bunny.dao.dto.log.UserLoginLogUpdateDto;
|
||||
import cn.bunny.dao.entity.log.UserLoginLog;
|
||||
import cn.bunny.dao.vo.log.UserLoginLogVo;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.google.common.base.CaseFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
@ -36,26 +36,26 @@ import java.util.stream.Stream;
|
|||
@Service
|
||||
public class WebGeneratorCode {
|
||||
// 公共路径
|
||||
public static String commonPath = "D:\\MyFolder\\auth-admin\\auth-web\\src";
|
||||
public static String commonPath = "D:\\Project\\web\\PC\\auth\\auth-web\\src";
|
||||
// 生成API请求路径
|
||||
public static String apiPath = commonPath + "\\api\\v1\\";
|
||||
// 生成vue路径
|
||||
public static String vuePath = commonPath + "\\views\\scheduler\\";
|
||||
public static String vuePath = commonPath + "\\views\\monitor\\";
|
||||
// 生成仓库路径
|
||||
public static String storePath = commonPath + "\\store\\scheduler\\";
|
||||
public static String storePath = commonPath + "\\store\\monitor\\";
|
||||
// 后端controller
|
||||
public static String controllerPath = "D:\\MyFolder\\auth-admin\\auth-server-java\\service\\src\\main\\java\\cn\\bunny\\services\\controller\\";
|
||||
public static String servicePath = "D:\\MyFolder\\auth-admin\\auth-server-java\\service\\src\\main\\java\\cn\\bunny\\services\\service\\";
|
||||
public static String serviceImplPath = "D:\\MyFolder\\auth-admin\\auth-server-java\\service\\src\\main\\java\\cn\\bunny\\services\\service\\impl\\";
|
||||
public static String mapperPath = "D:\\MyFolder\\auth-admin\\auth-server-java\\service\\src\\main\\java\\cn\\bunny\\services\\mapper\\";
|
||||
public static String resourceMapperPath = "D:\\MyFolder\\auth-admin\\auth-server-java\\service\\src\\main\\resources\\mapper\\";
|
||||
public static String controllerPath = "D:\\Project\\web\\PC\\auth\\auth-server-java\\service\\src\\main\\java\\cn\\bunny\\services\\controller\\";
|
||||
public static String servicePath = "D:\\Project\\web\\PC\\auth\\auth-server-java\\service\\src\\main\\java\\cn\\bunny\\services\\service\\";
|
||||
public static String serviceImplPath = "D:\\Project\\web\\PC\\auth\\auth-server-java\\service\\src\\main\\java\\cn\\bunny\\services\\service\\impl\\";
|
||||
public static String mapperPath = "D:\\Project\\web\\PC\\auth\\auth-server-java\\service\\src\\main\\java\\cn\\bunny\\services\\mapper\\";
|
||||
public static String resourceMapperPath = "D:\\Project\\web\\PC\\auth\\auth-server-java\\service\\src\\main\\resources\\mapper\\";
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
Class<?> originalClass = QuartzExecuteLog.class;
|
||||
Class<?> dtoClass = QuartzExecuteLogDto.class;
|
||||
Class<?> addDtoClass = QuartzExecuteLogAddDto.class;
|
||||
Class<?> updateDtoClass = QuartzExecuteLogUpdateDto.class;
|
||||
Class<?> voClass = QuartzExecuteLogVo.class;
|
||||
Class<?> originalClass = UserLoginLog.class;
|
||||
Class<?> dtoClass = UserLoginLogDto.class;
|
||||
Class<?> addDtoClass = UserLoginLogAddDto.class;
|
||||
Class<?> updateDtoClass = UserLoginLogUpdateDto.class;
|
||||
Class<?> voClass = UserLoginLogVo.class;
|
||||
|
||||
// 设置velocity资源加载器
|
||||
Properties prop = new Properties();
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package cn.bunny.services.service.impl;
|
||||
|
||||
import cn.bunny.dao.entity.system.${originalName};
|
||||
import cn.bunny.dao.pojo.result.PageResult;
|
||||
import cn.bunny.services.mapper.${originalName}Mapper;
|
||||
import cn.bunny.services.service.${originalName}Service;
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
<el-form ref="formRef" :model="form" :rules="rules" label-width="auto">
|
||||
#foreach($item in $baseFieldList)
|
||||
|
||||
// $item.annotation
|
||||
<!-- $item.annotation -->
|
||||
<el-form-item :label="$t('${lowercaseName}_${item.name}')" prop="$item.name">
|
||||
<el-input v-model="form.$item.name" autocomplete="off" type="text" :placeholder="$t('input') + $t('${lowercaseName}_${item.name}')" />
|
||||
</el-form-item>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package cn.bunny.dao.dto.quartz.executeLog;
|
||||
package cn.bunny.dao.dto.log;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
|
@ -13,7 +13,7 @@ import java.time.LocalDateTime;
|
|||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Schema(name = "QuartzExecuteLogDto对象", title = "调度任务执行日志分页查询", description = "调度任务执行日志分页查询")
|
||||
public class QuartzExecuteLogDto {
|
||||
public class ScheduleExecuteLogDto {
|
||||
|
||||
@Schema(name = "jobName", title = "任务名称")
|
||||
private String jobName;
|
|
@ -0,0 +1,34 @@
|
|||
package cn.bunny.dao.dto.log;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Schema(name = "UserLoginLogDto对象", title = "用户登录日志分页查询", description = "用户登录日志分页查询")
|
||||
public class UserLoginLogAddDto {
|
||||
|
||||
@Schema(name = "userId", title = "用户Id")
|
||||
private Long userId;
|
||||
|
||||
@Schema(name = "username", title = "用户名")
|
||||
private String username;
|
||||
|
||||
@Schema(name = "token", title = "登录token")
|
||||
private String token;
|
||||
|
||||
@Schema(name = "ip", title = "登录Ip")
|
||||
private String ip;
|
||||
|
||||
@Schema(name = "ipAddress", title = "登录Ip地点")
|
||||
private String ipAddress;
|
||||
|
||||
@Schema(name = "userAgent", title = "登录时代理")
|
||||
private String userAgent;
|
||||
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
package cn.bunny.dao.dto.log;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Schema(name = "UserLoginLogDto对象", title = "用户登录日志分页查询", description = "用户登录日志分页查询")
|
||||
public class UserLoginLogDto {
|
||||
|
||||
@Schema(name = "userId", title = "用户Id")
|
||||
private Long userId;
|
||||
|
||||
@Schema(name = "username", title = "用户名")
|
||||
private String username;
|
||||
|
||||
@Schema(name = "token", title = "登录token")
|
||||
private String token;
|
||||
|
||||
@Schema(name = "ip", title = "登录Ip")
|
||||
private String ip;
|
||||
|
||||
@Schema(name = "ipAddress", title = "登录Ip地点")
|
||||
private String ipAddress;
|
||||
|
||||
@Schema(name = "userAgent", title = "登录时代理")
|
||||
private String userAgent;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package cn.bunny.dao.dto.log;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Schema(name = "UserLoginLogDto对象", title = "用户登录日志分页查询", description = "用户登录日志分页查询")
|
||||
public class UserLoginLogUpdateDto {
|
||||
|
||||
@Schema(name = "userId", title = "用户Id")
|
||||
private Long userId;
|
||||
|
||||
@Schema(name = "username", title = "用户名")
|
||||
private String username;
|
||||
|
||||
@Schema(name = "token", title = "登录token")
|
||||
private String token;
|
||||
|
||||
@Schema(name = "ip", title = "登录Ip")
|
||||
private String ip;
|
||||
|
||||
@Schema(name = "ipAddress", title = "登录Ip地点")
|
||||
private String ipAddress;
|
||||
|
||||
@Schema(name = "userAgent", title = "登录时代理")
|
||||
private String userAgent;
|
||||
|
||||
}
|
|
@ -1,55 +0,0 @@
|
|||
package cn.bunny.dao.dto.quartz.executeLog;
|
||||
|
||||
import cn.bunny.dao.entity.quartz.QuartzExecuteLogJson;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Schema(name = "QuartzExecuteLogAddDto对象", title = "添加调度任务执行日志", description = "添加调度任务执行日志")
|
||||
public class QuartzExecuteLogAddDto {
|
||||
|
||||
@Schema(name = "jobName", title = "任务名称")
|
||||
@NotBlank(message = "任务分组不能为空")
|
||||
@NotNull(message = "任务分组不能为空")
|
||||
private String jobName;
|
||||
|
||||
@Schema(name = "jobGroup", title = "任务分组")
|
||||
@NotBlank(message = "任务分组不能为空")
|
||||
@NotNull(message = "任务分组不能为空")
|
||||
private String jobGroup;
|
||||
|
||||
@Schema(name = "jobClassName", title = "执行任务类名")
|
||||
@NotBlank(message = "任务分组不能为空")
|
||||
@NotNull(message = "任务分组不能为空")
|
||||
private String jobClassName;
|
||||
|
||||
@Schema(name = "cronExpression", title = "执行任务core表达式")
|
||||
@NotBlank(message = "任务分组不能为空")
|
||||
@NotNull(message = "任务分组不能为空")
|
||||
private String cronExpression;
|
||||
|
||||
@Schema(name = "triggerName", title = "触发器名称")
|
||||
@NotBlank(message = "任务分组不能为空")
|
||||
@NotNull(message = "任务分组不能为空")
|
||||
private String triggerName;
|
||||
|
||||
@Schema(name = "executeResult", title = "执行结果")
|
||||
private QuartzExecuteLogJson executeResult;
|
||||
|
||||
@Schema(name = "duration", title = "执行时间")
|
||||
private Integer duration;
|
||||
|
||||
@Schema(name = "endTime", title = "结束时间")
|
||||
private LocalDateTime endTime;
|
||||
|
||||
}
|
|
@ -1,59 +0,0 @@
|
|||
package cn.bunny.dao.dto.quartz.executeLog;
|
||||
|
||||
import cn.bunny.dao.entity.quartz.QuartzExecuteLogJson;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Schema(name = "QuartzExecuteLogUpdateDto对象", title = "更新调度任务执行日志", description = "更新调度任务执行日志")
|
||||
public class QuartzExecuteLogUpdateDto {
|
||||
|
||||
@Schema(name = "id", title = "主键")
|
||||
@NotNull(message = "id不能为空")
|
||||
private Long id;
|
||||
|
||||
@Schema(name = "jobName", title = "任务名称")
|
||||
@NotBlank(message = "任务分组不能为空")
|
||||
@NotNull(message = "任务分组不能为空")
|
||||
private String jobName;
|
||||
|
||||
@Schema(name = "jobGroup", title = "任务分组")
|
||||
@NotBlank(message = "任务分组不能为空")
|
||||
@NotNull(message = "任务分组不能为空")
|
||||
private String jobGroup;
|
||||
|
||||
@Schema(name = "jobClassName", title = "执行任务类名")
|
||||
@NotBlank(message = "任务分组不能为空")
|
||||
@NotNull(message = "任务分组不能为空")
|
||||
private String jobClassName;
|
||||
|
||||
@Schema(name = "cronExpression", title = "执行任务core表达式")
|
||||
@NotBlank(message = "任务分组不能为空")
|
||||
@NotNull(message = "任务分组不能为空")
|
||||
private String cronExpression;
|
||||
|
||||
@Schema(name = "triggerName", title = "触发器名称")
|
||||
@NotBlank(message = "任务分组不能为空")
|
||||
@NotNull(message = "任务分组不能为空")
|
||||
private String triggerName;
|
||||
|
||||
@Schema(name = "executeResult", title = "执行结果")
|
||||
private QuartzExecuteLogJson executeResult;
|
||||
|
||||
@Schema(name = "duration", title = "执行时间")
|
||||
private Integer duration;
|
||||
|
||||
@Schema(name = "endTime", title = "结束时间")
|
||||
private LocalDateTime endTime;
|
||||
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package cn.bunny.dao.dto.quartz.scheduleGroup;
|
||||
package cn.bunny.dao.dto.quartz.group;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
|
@ -1,4 +1,4 @@
|
|||
package cn.bunny.dao.dto.quartz.scheduleGroup;
|
||||
package cn.bunny.dao.dto.quartz.group;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
|
@ -1,4 +1,4 @@
|
|||
package cn.bunny.dao.dto.quartz.scheduleGroup;
|
||||
package cn.bunny.dao.dto.quartz.group;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
|
@ -1,4 +1,4 @@
|
|||
package cn.bunny.dao.dto.system.email;
|
||||
package cn.bunny.dao.dto.system.email.template;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
|
@ -1,4 +1,4 @@
|
|||
package cn.bunny.dao.dto.system.email;
|
||||
package cn.bunny.dao.dto.system.email.template;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
|
@ -1,4 +1,4 @@
|
|||
package cn.bunny.dao.dto.system.email;
|
||||
package cn.bunny.dao.dto.system.email.template;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
|
@ -1,4 +1,4 @@
|
|||
package cn.bunny.dao.dto.system.email;
|
||||
package cn.bunny.dao.dto.system.email.user;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
|
@ -1,4 +1,4 @@
|
|||
package cn.bunny.dao.dto.system.email;
|
||||
package cn.bunny.dao.dto.system.email.user;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
|
@ -1,4 +1,4 @@
|
|||
package cn.bunny.dao.dto.system.email;
|
||||
package cn.bunny.dao.dto.system.email.user;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
|
@ -1,4 +1,4 @@
|
|||
package cn.bunny.dao.dto.system.email;
|
||||
package cn.bunny.dao.dto.system.email.user;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
|
@ -1,4 +1,4 @@
|
|||
package cn.bunny.dao.dto.system.rolePower;
|
||||
package cn.bunny.dao.dto.system.rolePower.power;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
|
@ -1,4 +1,4 @@
|
|||
package cn.bunny.dao.dto.system.rolePower;
|
||||
package cn.bunny.dao.dto.system.rolePower.power;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
|
@ -1,4 +1,4 @@
|
|||
package cn.bunny.dao.dto.system.rolePower;
|
||||
package cn.bunny.dao.dto.system.rolePower.power;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
|
@ -1,4 +1,4 @@
|
|||
package cn.bunny.dao.dto.system.rolePower;
|
||||
package cn.bunny.dao.dto.system.rolePower.power;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
|
@ -1,4 +1,4 @@
|
|||
package cn.bunny.dao.dto.system.rolePower;
|
||||
package cn.bunny.dao.dto.system.rolePower.role;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
|
@ -1,4 +1,4 @@
|
|||
package cn.bunny.dao.dto.system.rolePower;
|
||||
package cn.bunny.dao.dto.system.rolePower.role;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
|
@ -1,4 +1,4 @@
|
|||
package cn.bunny.dao.dto.system.rolePower;
|
||||
package cn.bunny.dao.dto.system.rolePower.role;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
|
@ -1,4 +1,4 @@
|
|||
package cn.bunny.dao.entity.quartz;
|
||||
package cn.bunny.dao.entity.log;
|
||||
|
||||
import cn.bunny.dao.entity.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
@ -22,7 +22,7 @@ import java.time.LocalDateTime;
|
|||
@Accessors(chain = true)
|
||||
@TableName("log_quartz_execute")
|
||||
@Schema(name = "QuartzExecuteLog对象", title = "调度任务执行日志", description = "调度任务执行日志")
|
||||
public class QuartzExecuteLog extends BaseEntity {
|
||||
public class ScheduleExecuteLog extends BaseEntity {
|
||||
|
||||
@Schema(name = "jobName", title = "任务名称")
|
||||
private String jobName;
|
|
@ -1,4 +1,4 @@
|
|||
package cn.bunny.dao.entity.quartz;
|
||||
package cn.bunny.dao.entity.log;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
|
@ -11,7 +11,7 @@ import lombok.NoArgsConstructor;
|
|||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Schema(name = "QuartzExecuteLog对象", title = "执行任务的日志", description = "执行任务的日志")
|
||||
public class QuartzExecuteLogJson {
|
||||
public class ScheduleExecuteLogJson {
|
||||
|
||||
@Schema(name = "result", title = "执行结果")
|
||||
private String result;
|
|
@ -0,0 +1,43 @@
|
|||
package cn.bunny.dao.entity.log;
|
||||
|
||||
import cn.bunny.dao.entity.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户登录日志
|
||||
* </p>
|
||||
*
|
||||
* @author Bunny
|
||||
* @since 2024-10-18
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Accessors(chain = true)
|
||||
@TableName("log_user_login")
|
||||
@Schema(name = "UserLogin对象", title = "用户登录日志", description = "用户登录日志")
|
||||
public class UserLoginLog extends BaseEntity {
|
||||
|
||||
@Schema(name = "userId", title = "用户Id")
|
||||
private Long userId;
|
||||
|
||||
@Schema(name = "username", title = "用户名")
|
||||
private String username;
|
||||
|
||||
@Schema(name = "token", title = "登录token")
|
||||
private String token;
|
||||
|
||||
@Schema(name = "ip", title = "登录Ip")
|
||||
private String ip;
|
||||
|
||||
@Schema(name = "ipAddress", title = "登录Ip地点")
|
||||
private String ipAddress;
|
||||
|
||||
@Schema(name = "userAgent", title = "登录时代理")
|
||||
private String userAgent;
|
||||
|
||||
}
|
|
@ -34,4 +34,5 @@ public class EmailSend {
|
|||
|
||||
@Schema(name = "file", title = "发送的文件")
|
||||
private MultipartFile[] files;
|
||||
|
||||
}
|
|
@ -27,4 +27,5 @@ public class EmailSendInit {
|
|||
|
||||
@Schema(name = "password", title = "密码")
|
||||
private String password;
|
||||
|
||||
}
|
|
@ -1,11 +1,11 @@
|
|||
package cn.bunny.dao.pojo.common;
|
||||
package cn.bunny.dao.pojo.enums;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@Schema(description = "Email Template Types")
|
||||
public enum EmailTemplateTypes {
|
||||
public enum EmailTemplateEnums {
|
||||
VERIFICATION_CODE("verification_code", "邮箱验证码发送"),
|
||||
NOTIFICATION("notification", "通知型邮件"),
|
||||
WARNING("warning", "警告型邮件"),
|
||||
|
@ -14,7 +14,7 @@ public enum EmailTemplateTypes {
|
|||
private final String type;
|
||||
private final String summary;
|
||||
|
||||
EmailTemplateTypes(String type, String summary) {
|
||||
EmailTemplateEnums(String type, String summary) {
|
||||
this.type = type;
|
||||
this.summary = summary;
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
package cn.bunny.dao.pojo.enums;
|
||||
|
||||
/**
|
||||
* 数据库操作类型
|
||||
*/
|
||||
public enum OperationType {
|
||||
UPDATE, INSERT
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package cn.bunny.dao.vo;
|
||||
package cn.bunny.dao.vo.common;
|
||||
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
@ -17,6 +17,7 @@ import java.time.LocalDateTime;
|
|||
@Data
|
||||
@Schema(name = "BaseVo", title = "基础返回对象内容", description = "基础返回对象内容")
|
||||
public class BaseVo implements Serializable {
|
||||
|
||||
@Schema(name = "id", title = "主键")
|
||||
@JsonProperty("id")
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING)
|
||||
|
@ -44,4 +45,5 @@ public class BaseVo implements Serializable {
|
|||
@JsonFormat(shape = JsonFormat.Shape.STRING)
|
||||
@JSONField(serializeUsing = ToStringSerializer.class)
|
||||
private Long updateUser;
|
||||
|
||||
}
|
|
@ -1,38 +0,0 @@
|
|||
package cn.bunny.dao.vo.common;
|
||||
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@ApiModel(value = "KvData对象", description = "基础键值对数据")
|
||||
public class KvData {
|
||||
@ApiModelProperty(value = "id", name = "主键")
|
||||
@JsonProperty("id")
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING)
|
||||
@JSONField(serializeUsing = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("值内容")
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING)
|
||||
@JSONField(serializeUsing = ToStringSerializer.class)
|
||||
private Object value;
|
||||
|
||||
@ApiModelProperty("值内容")
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING)
|
||||
@JSONField(serializeUsing = ToStringSerializer.class)
|
||||
private Object key;
|
||||
|
||||
@ApiModelProperty("显示内容")
|
||||
private String label;
|
||||
}
|
|
@ -2,24 +2,41 @@ package cn.bunny.dao.vo.common;
|
|||
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@ApiModel(value = "TreeSelectList对象", description = "树形结构数据")
|
||||
public class TreeSelectVo extends KvData {
|
||||
@Schema(name = "TreeSelectList对象", title = "树形结构数据", description = "树形结构数据")
|
||||
public class TreeSelectVo {
|
||||
|
||||
@ApiModelProperty("父级id")
|
||||
@Schema(name = "id", title = "主键")
|
||||
@JsonProperty("id")
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING)
|
||||
@JSONField(serializeUsing = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
@Schema(name = "value", title = "值内容")
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING)
|
||||
@JSONField(serializeUsing = ToStringSerializer.class)
|
||||
private Object value;
|
||||
|
||||
@Schema(name = "key", title = "key内容")
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING)
|
||||
@JSONField(serializeUsing = ToStringSerializer.class)
|
||||
private Object key;
|
||||
|
||||
@Schema(name = "label", title = "显示内容")
|
||||
private String label;
|
||||
|
||||
@Schema(name = "parentId", title = "父级id")
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING)
|
||||
@JSONField(serializeUsing = ToStringSerializer.class)
|
||||
private Long parentId;
|
||||
|
||||
@ApiModelProperty("子级内容")
|
||||
@Schema(name = "children", title = "子级内容")
|
||||
private List<TreeSelectVo> children;
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
package cn.bunny.dao.vo.i18n;
|
||||
|
||||
import cn.bunny.dao.vo.BaseVo;
|
||||
import cn.bunny.dao.vo.common.BaseVo;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.bunny.dao.vo.i18n;
|
||||
|
||||
import cn.bunny.dao.vo.BaseVo;
|
||||
import cn.bunny.dao.vo.common.BaseVo;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package cn.bunny.dao.vo.quartz;
|
||||
package cn.bunny.dao.vo.log;
|
||||
|
||||
import cn.bunny.dao.entity.quartz.QuartzExecuteLogJson;
|
||||
import cn.bunny.dao.vo.BaseVo;
|
||||
import cn.bunny.dao.entity.log.ScheduleExecuteLogJson;
|
||||
import cn.bunny.dao.vo.common.BaseVo;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
|
@ -31,7 +31,7 @@ public class QuartzExecuteLogVo extends BaseVo {
|
|||
private String triggerName;
|
||||
|
||||
@Schema(name = "executeResult", title = "执行结果")
|
||||
private QuartzExecuteLogJson executeResult;
|
||||
private ScheduleExecuteLogJson executeResult;
|
||||
|
||||
@Schema(name = "duration", title = "执行时间")
|
||||
private Integer duration;
|
|
@ -0,0 +1,33 @@
|
|||
package cn.bunny.dao.vo.log;
|
||||
|
||||
import cn.bunny.dao.vo.common.BaseVo;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Schema(name = "UserLoginLogVo对象", title = "用户登录日志", description = "用户登录日志")
|
||||
public class UserLoginLogVo extends BaseVo {
|
||||
|
||||
@Schema(name = "userId", title = "用户Id")
|
||||
private Long userId;
|
||||
|
||||
@Schema(name = "username", title = "用户名")
|
||||
private String username;
|
||||
|
||||
@Schema(name = "token", title = "登录token")
|
||||
private String token;
|
||||
|
||||
@Schema(name = "ip", title = "登录Ip")
|
||||
private String ip;
|
||||
|
||||
@Schema(name = "ipAddress", title = "登录Ip地点")
|
||||
private String ipAddress;
|
||||
|
||||
@Schema(name = "userAgent", title = "登录时代理")
|
||||
private String userAgent;
|
||||
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
package cn.bunny.dao.vo.system;
|
||||
|
||||
import cn.bunny.dao.vo.BaseVo;
|
||||
import cn.bunny.dao.vo.common.BaseVo;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.bunny.dao.vo.system;
|
||||
|
||||
import cn.bunny.dao.vo.BaseVo;
|
||||
import cn.bunny.dao.vo.common.BaseVo;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.bunny.dao.vo.system.email;
|
||||
|
||||
import cn.bunny.dao.vo.BaseVo;
|
||||
import cn.bunny.dao.vo.common.BaseVo;
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.bunny.dao.vo.system.email;
|
||||
|
||||
import cn.bunny.dao.vo.BaseVo;
|
||||
import cn.bunny.dao.vo.common.BaseVo;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.bunny.dao.vo.system.files;
|
||||
|
||||
import cn.bunny.dao.vo.BaseVo;
|
||||
import cn.bunny.dao.vo.common.BaseVo;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.bunny.dao.vo.system.files;
|
||||
|
||||
import cn.bunny.dao.vo.BaseVo;
|
||||
import cn.bunny.dao.vo.common.BaseVo;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.bunny.dao.vo.system.rolePower;
|
||||
|
||||
import cn.bunny.dao.vo.BaseVo;
|
||||
import cn.bunny.dao.vo.common.BaseVo;
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.bunny.dao.vo.system.rolePower;
|
||||
|
||||
import cn.bunny.dao.vo.BaseVo;
|
||||
import cn.bunny.dao.vo.common.BaseVo;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.bunny.dao.vo.system.router;
|
||||
|
||||
import cn.bunny.dao.vo.BaseVo;
|
||||
import cn.bunny.dao.vo.common.BaseVo;
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.bunny.dao.vo.system.user;
|
||||
|
||||
import cn.bunny.dao.vo.BaseVo;
|
||||
import cn.bunny.dao.vo.common.BaseVo;
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.bunny.dao.vo.system.user;
|
||||
|
||||
import cn.bunny.dao.vo.BaseVo;
|
||||
import cn.bunny.dao.vo.common.BaseVo;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.bunny.dao.vo.system.user;
|
||||
|
||||
import cn.bunny.dao.vo.BaseVo;
|
||||
import cn.bunny.dao.vo.common.BaseVo;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package cn.bunny.services.controller;
|
||||
|
||||
import cn.bunny.dao.dto.system.email.EmailTemplateAddDto;
|
||||
import cn.bunny.dao.dto.system.email.EmailTemplateDto;
|
||||
import cn.bunny.dao.dto.system.email.EmailTemplateUpdateDto;
|
||||
import cn.bunny.dao.dto.system.email.template.EmailTemplateAddDto;
|
||||
import cn.bunny.dao.dto.system.email.template.EmailTemplateDto;
|
||||
import cn.bunny.dao.dto.system.email.template.EmailTemplateUpdateDto;
|
||||
import cn.bunny.dao.entity.system.EmailTemplate;
|
||||
import cn.bunny.dao.pojo.result.PageResult;
|
||||
import cn.bunny.dao.pojo.result.Result;
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package cn.bunny.services.controller;
|
||||
|
||||
import cn.bunny.dao.dto.system.email.EmailUserUpdateStatusDto;
|
||||
import cn.bunny.dao.dto.system.email.EmailUsersAddDto;
|
||||
import cn.bunny.dao.dto.system.email.EmailUsersDto;
|
||||
import cn.bunny.dao.dto.system.email.EmailUsersUpdateDto;
|
||||
import cn.bunny.dao.dto.system.email.user.EmailUserUpdateStatusDto;
|
||||
import cn.bunny.dao.dto.system.email.user.EmailUsersAddDto;
|
||||
import cn.bunny.dao.dto.system.email.user.EmailUsersDto;
|
||||
import cn.bunny.dao.dto.system.email.user.EmailUsersUpdateDto;
|
||||
import cn.bunny.dao.entity.system.EmailUsers;
|
||||
import cn.bunny.dao.pojo.result.PageResult;
|
||||
import cn.bunny.dao.pojo.result.Result;
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package cn.bunny.services.controller;
|
||||
|
||||
import cn.bunny.dao.dto.system.rolePower.PowerAddDto;
|
||||
import cn.bunny.dao.dto.system.rolePower.PowerDto;
|
||||
import cn.bunny.dao.dto.system.rolePower.PowerUpdateBatchByParentIdDto;
|
||||
import cn.bunny.dao.dto.system.rolePower.PowerUpdateDto;
|
||||
import cn.bunny.dao.dto.system.rolePower.power.PowerAddDto;
|
||||
import cn.bunny.dao.dto.system.rolePower.power.PowerDto;
|
||||
import cn.bunny.dao.dto.system.rolePower.power.PowerUpdateBatchByParentIdDto;
|
||||
import cn.bunny.dao.dto.system.rolePower.power.PowerUpdateDto;
|
||||
import cn.bunny.dao.entity.system.Power;
|
||||
import cn.bunny.dao.pojo.result.PageResult;
|
||||
import cn.bunny.dao.pojo.result.Result;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package cn.bunny.services.controller;
|
||||
|
||||
import cn.bunny.dao.dto.system.rolePower.RoleAddDto;
|
||||
import cn.bunny.dao.dto.system.rolePower.RoleDto;
|
||||
import cn.bunny.dao.dto.system.rolePower.RoleUpdateDto;
|
||||
import cn.bunny.dao.dto.system.rolePower.role.RoleAddDto;
|
||||
import cn.bunny.dao.dto.system.rolePower.role.RoleDto;
|
||||
import cn.bunny.dao.dto.system.rolePower.role.RoleUpdateDto;
|
||||
import cn.bunny.dao.entity.system.Role;
|
||||
import cn.bunny.dao.pojo.result.PageResult;
|
||||
import cn.bunny.dao.pojo.result.Result;
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
package cn.bunny.services.controller;
|
||||
|
||||
import cn.bunny.dao.dto.quartz.executeLog.QuartzExecuteLogDto;
|
||||
import cn.bunny.dao.entity.quartz.QuartzExecuteLog;
|
||||
import cn.bunny.dao.dto.log.ScheduleExecuteLogDto;
|
||||
import cn.bunny.dao.entity.log.ScheduleExecuteLog;
|
||||
import cn.bunny.dao.pojo.result.PageResult;
|
||||
import cn.bunny.dao.pojo.result.Result;
|
||||
import cn.bunny.dao.pojo.result.ResultCodeEnum;
|
||||
import cn.bunny.dao.vo.quartz.QuartzExecuteLogVo;
|
||||
import cn.bunny.services.service.QuartzExecuteLogService;
|
||||
import cn.bunny.dao.vo.log.QuartzExecuteLogVo;
|
||||
import cn.bunny.services.service.ScheduleExecuteLogService;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
|
@ -28,10 +28,10 @@ import java.util.List;
|
|||
@Tag(name = "调度任务执行日志", description = "调度任务执行日志相关接口")
|
||||
@RestController
|
||||
@RequestMapping("admin/quartzExecuteLog")
|
||||
public class QuartzExecuteLogController {
|
||||
public class ScheduleExecuteLogController {
|
||||
|
||||
@Autowired
|
||||
private QuartzExecuteLogService quartzExecuteLogService;
|
||||
private ScheduleExecuteLogService scheduleExecuteLogService;
|
||||
|
||||
@Operation(summary = "分页查询调度任务执行日志", description = "分页查询调度任务执行日志")
|
||||
@GetMapping("getQuartzExecuteLogList/{page}/{limit}")
|
||||
|
@ -40,16 +40,16 @@ public class QuartzExecuteLogController {
|
|||
@PathVariable("page") Integer page,
|
||||
@Parameter(name = "limit", description = "每页记录数", required = true)
|
||||
@PathVariable("limit") Integer limit,
|
||||
QuartzExecuteLogDto dto) {
|
||||
Page<QuartzExecuteLog> pageParams = new Page<>(page, limit);
|
||||
PageResult<QuartzExecuteLogVo> pageResult = quartzExecuteLogService.getQuartzExecuteLogList(pageParams, dto);
|
||||
ScheduleExecuteLogDto dto) {
|
||||
Page<ScheduleExecuteLog> pageParams = new Page<>(page, limit);
|
||||
PageResult<QuartzExecuteLogVo> pageResult = scheduleExecuteLogService.getQuartzExecuteLogList(pageParams, dto);
|
||||
return Mono.just(Result.success(pageResult));
|
||||
}
|
||||
|
||||
@Operation(summary = "删除调度任务执行日志", description = "删除调度任务执行日志")
|
||||
@DeleteMapping("deleteQuartzExecuteLog")
|
||||
public Mono<Result<String>> deleteQuartzExecuteLog(@RequestBody List<Long> ids) {
|
||||
quartzExecuteLogService.deleteQuartzExecuteLog(ids);
|
||||
scheduleExecuteLogService.deleteQuartzExecuteLog(ids);
|
||||
return Mono.just(Result.success(ResultCodeEnum.DELETE_SUCCESS));
|
||||
}
|
||||
}
|
|
@ -1,8 +1,8 @@
|
|||
package cn.bunny.services.controller;
|
||||
|
||||
import cn.bunny.dao.dto.quartz.scheduleGroup.SchedulersGroupAddDto;
|
||||
import cn.bunny.dao.dto.quartz.scheduleGroup.SchedulersGroupDto;
|
||||
import cn.bunny.dao.dto.quartz.scheduleGroup.SchedulersGroupUpdateDto;
|
||||
import cn.bunny.dao.dto.quartz.group.SchedulersGroupAddDto;
|
||||
import cn.bunny.dao.dto.quartz.group.SchedulersGroupDto;
|
||||
import cn.bunny.dao.dto.quartz.group.SchedulersGroupUpdateDto;
|
||||
import cn.bunny.dao.entity.quartz.SchedulersGroup;
|
||||
import cn.bunny.dao.pojo.result.PageResult;
|
||||
import cn.bunny.dao.pojo.result.Result;
|
||||
|
|
|
@ -0,0 +1,72 @@
|
|||
package cn.bunny.services.controller;
|
||||
|
||||
import cn.bunny.dao.dto.log.UserLoginLogAddDto;
|
||||
import cn.bunny.dao.dto.log.UserLoginLogDto;
|
||||
import cn.bunny.dao.dto.log.UserLoginLogUpdateDto;
|
||||
import cn.bunny.dao.entity.log.UserLoginLog;
|
||||
import cn.bunny.dao.pojo.result.PageResult;
|
||||
import cn.bunny.dao.pojo.result.Result;
|
||||
import cn.bunny.dao.pojo.result.ResultCodeEnum;
|
||||
import cn.bunny.dao.vo.log.UserLoginLogVo;
|
||||
import cn.bunny.services.service.UserLoginLogService;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户登录日志表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author Bunny
|
||||
* @since 2024-10-18 22:36:07
|
||||
*/
|
||||
@Tag(name = "用户登录日志", description = "用户登录日志相关接口")
|
||||
@RestController
|
||||
@RequestMapping("admin/userLoginLog")
|
||||
public class UserLoginLogController {
|
||||
|
||||
@Autowired
|
||||
private UserLoginLogService userLoginLogService;
|
||||
|
||||
@Operation(summary = "分页查询用户登录日志", description = "分页查询用户登录日志")
|
||||
@GetMapping("getUserLoginLogList/{page}/{limit}")
|
||||
public Mono<Result<PageResult<UserLoginLogVo>>> getUserLoginLogList(
|
||||
@Parameter(name = "page", description = "当前页", required = true)
|
||||
@PathVariable("page") Integer page,
|
||||
@Parameter(name = "limit", description = "每页记录数", required = true)
|
||||
@PathVariable("limit") Integer limit,
|
||||
UserLoginLogDto dto) {
|
||||
Page<UserLoginLog> pageParams = new Page<>(page, limit);
|
||||
PageResult<UserLoginLogVo> pageResult = userLoginLogService.getUserLoginLogList(pageParams, dto);
|
||||
return Mono.just(Result.success(pageResult));
|
||||
}
|
||||
|
||||
@Operation(summary = "添加用户登录日志", description = "添加用户登录日志")
|
||||
@PostMapping("addUserLoginLog")
|
||||
public Mono<Result<String>> addUserLoginLog(@Valid @RequestBody UserLoginLogAddDto dto) {
|
||||
userLoginLogService.addUserLoginLog(dto);
|
||||
return Mono.just(Result.success(ResultCodeEnum.ADD_SUCCESS));
|
||||
}
|
||||
|
||||
@Operation(summary = "更新用户登录日志", description = "更新用户登录日志")
|
||||
@PutMapping("updateUserLoginLog")
|
||||
public Mono<Result<String>> updateUserLoginLog(@Valid @RequestBody UserLoginLogUpdateDto dto) {
|
||||
userLoginLogService.updateUserLoginLog(dto);
|
||||
return Mono.just(Result.success(ResultCodeEnum.UPDATE_SUCCESS));
|
||||
}
|
||||
|
||||
@Operation(summary = "删除用户登录日志", description = "删除用户登录日志")
|
||||
@DeleteMapping("deleteUserLoginLog")
|
||||
public Mono<Result<String>> deleteUserLoginLog(@RequestBody List<Long> ids) {
|
||||
userLoginLogService.deleteUserLoginLog(ids);
|
||||
return Mono.just(Result.success(ResultCodeEnum.DELETE_SUCCESS));
|
||||
}
|
||||
}
|
|
@ -6,7 +6,7 @@ import cn.bunny.dao.entity.system.EmailTemplate;
|
|||
import cn.bunny.dao.entity.system.EmailUsers;
|
||||
import cn.bunny.dao.pojo.common.EmailSend;
|
||||
import cn.bunny.dao.pojo.common.EmailSendInit;
|
||||
import cn.bunny.dao.pojo.common.EmailTemplateTypes;
|
||||
import cn.bunny.dao.pojo.enums.EmailTemplateEnums;
|
||||
import cn.bunny.dao.pojo.result.ResultCodeEnum;
|
||||
import cn.bunny.services.mapper.EmailTemplateMapper;
|
||||
import cn.bunny.services.mapper.EmailUsersMapper;
|
||||
|
@ -37,7 +37,7 @@ public class EmailFactory {
|
|||
// 查询验证码邮件模板
|
||||
LambdaQueryWrapper<EmailTemplate> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(EmailTemplate::getIsDefault, true);
|
||||
lambdaQueryWrapper.eq(EmailTemplate::getType, EmailTemplateTypes.VERIFICATION_CODE.getType());
|
||||
lambdaQueryWrapper.eq(EmailTemplate::getType, EmailTemplateEnums.VERIFICATION_CODE.getType());
|
||||
EmailTemplate emailTemplate = emailTemplateMapper.selectOne(lambdaQueryWrapper);
|
||||
|
||||
// 判断邮件模板是否为空
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.bunny.services.mapper;
|
||||
|
||||
import cn.bunny.dao.dto.system.email.EmailTemplateDto;
|
||||
import cn.bunny.dao.dto.system.email.template.EmailTemplateDto;
|
||||
import cn.bunny.dao.entity.system.EmailTemplate;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.bunny.services.mapper;
|
||||
|
||||
import cn.bunny.dao.dto.system.email.EmailUsersDto;
|
||||
import cn.bunny.dao.dto.system.email.user.EmailUsersDto;
|
||||
import cn.bunny.dao.entity.system.EmailUsers;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.bunny.services.mapper;
|
||||
|
||||
import cn.bunny.dao.dto.system.rolePower.PowerDto;
|
||||
import cn.bunny.dao.dto.system.rolePower.power.PowerDto;
|
||||
import cn.bunny.dao.entity.system.Power;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.bunny.services.mapper;
|
||||
|
||||
import cn.bunny.dao.dto.system.rolePower.RoleDto;
|
||||
import cn.bunny.dao.dto.system.rolePower.role.RoleDto;
|
||||
import cn.bunny.dao.entity.system.Role;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package cn.bunny.services.mapper;
|
||||
|
||||
import cn.bunny.dao.dto.quartz.executeLog.QuartzExecuteLogDto;
|
||||
import cn.bunny.dao.entity.quartz.QuartzExecuteLog;
|
||||
import cn.bunny.dao.dto.log.ScheduleExecuteLogDto;
|
||||
import cn.bunny.dao.entity.log.ScheduleExecuteLog;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
|
@ -19,7 +19,7 @@ import java.util.List;
|
|||
* @since 2024-10-18 12:56:39
|
||||
*/
|
||||
@Mapper
|
||||
public interface QuartzExecuteLogMapper extends BaseMapper<QuartzExecuteLog> {
|
||||
public interface ScheduleExecuteLogMapper extends BaseMapper<ScheduleExecuteLog> {
|
||||
|
||||
/**
|
||||
* * 分页查询调度任务执行日志内容
|
||||
|
@ -28,7 +28,7 @@ public interface QuartzExecuteLogMapper extends BaseMapper<QuartzExecuteLog> {
|
|||
* @param dto 调度任务执行日志查询表单
|
||||
* @return 调度任务执行日志分页结果
|
||||
*/
|
||||
IPage<QuartzExecuteLog> selectListByPage(@Param("page") Page<QuartzExecuteLog> pageParams, @Param("dto") QuartzExecuteLogDto dto);
|
||||
IPage<ScheduleExecuteLog> selectListByPage(@Param("page") Page<ScheduleExecuteLog> pageParams, @Param("dto") ScheduleExecuteLogDto dto);
|
||||
|
||||
/**
|
||||
* 物理删除调度任务执行日志
|
|
@ -1,6 +1,6 @@
|
|||
package cn.bunny.services.mapper;
|
||||
|
||||
import cn.bunny.dao.dto.quartz.scheduleGroup.SchedulersGroupDto;
|
||||
import cn.bunny.dao.dto.quartz.group.SchedulersGroupDto;
|
||||
import cn.bunny.dao.entity.quartz.SchedulersGroup;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
|
|
|
@ -0,0 +1,39 @@
|
|||
package cn.bunny.services.mapper;
|
||||
|
||||
import cn.bunny.dao.dto.log.UserLoginLogDto;
|
||||
import cn.bunny.dao.entity.log.UserLoginLog;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户登录日志 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author Bunny
|
||||
* @since 2024-10-18 22:36:07
|
||||
*/
|
||||
@Mapper
|
||||
public interface UserLoginLogMapper extends BaseMapper<UserLoginLog> {
|
||||
|
||||
/**
|
||||
* * 分页查询用户登录日志内容
|
||||
*
|
||||
* @param pageParams 用户登录日志分页参数
|
||||
* @param dto 用户登录日志查询表单
|
||||
* @return 用户登录日志分页结果
|
||||
*/
|
||||
IPage<UserLoginLog> selectListByPage(@Param("page") Page<UserLoginLog> pageParams, @Param("dto") UserLoginLogDto dto);
|
||||
|
||||
/**
|
||||
* 物理删除用户登录日志
|
||||
*
|
||||
* @param ids 删除 id 列表
|
||||
*/
|
||||
void deleteBatchIdsWithPhysics(List<Long> ids);
|
||||
}
|
|
@ -1,8 +1,8 @@
|
|||
package cn.bunny.services.service;
|
||||
|
||||
import cn.bunny.dao.dto.system.email.EmailTemplateAddDto;
|
||||
import cn.bunny.dao.dto.system.email.EmailTemplateDto;
|
||||
import cn.bunny.dao.dto.system.email.EmailTemplateUpdateDto;
|
||||
import cn.bunny.dao.dto.system.email.template.EmailTemplateAddDto;
|
||||
import cn.bunny.dao.dto.system.email.template.EmailTemplateDto;
|
||||
import cn.bunny.dao.dto.system.email.template.EmailTemplateUpdateDto;
|
||||
import cn.bunny.dao.entity.system.EmailTemplate;
|
||||
import cn.bunny.dao.pojo.result.PageResult;
|
||||
import cn.bunny.dao.vo.system.email.EmailTemplateVo;
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package cn.bunny.services.service;
|
||||
|
||||
import cn.bunny.dao.dto.system.email.EmailUserUpdateStatusDto;
|
||||
import cn.bunny.dao.dto.system.email.EmailUsersAddDto;
|
||||
import cn.bunny.dao.dto.system.email.EmailUsersDto;
|
||||
import cn.bunny.dao.dto.system.email.EmailUsersUpdateDto;
|
||||
import cn.bunny.dao.dto.system.email.user.EmailUserUpdateStatusDto;
|
||||
import cn.bunny.dao.dto.system.email.user.EmailUsersAddDto;
|
||||
import cn.bunny.dao.dto.system.email.user.EmailUsersDto;
|
||||
import cn.bunny.dao.dto.system.email.user.EmailUsersUpdateDto;
|
||||
import cn.bunny.dao.entity.system.EmailUsers;
|
||||
import cn.bunny.dao.pojo.result.PageResult;
|
||||
import cn.bunny.dao.vo.system.email.EmailUsersVo;
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package cn.bunny.services.service;
|
||||
|
||||
import cn.bunny.dao.dto.system.rolePower.PowerAddDto;
|
||||
import cn.bunny.dao.dto.system.rolePower.PowerDto;
|
||||
import cn.bunny.dao.dto.system.rolePower.PowerUpdateBatchByParentIdDto;
|
||||
import cn.bunny.dao.dto.system.rolePower.PowerUpdateDto;
|
||||
import cn.bunny.dao.dto.system.rolePower.power.PowerAddDto;
|
||||
import cn.bunny.dao.dto.system.rolePower.power.PowerDto;
|
||||
import cn.bunny.dao.dto.system.rolePower.power.PowerUpdateBatchByParentIdDto;
|
||||
import cn.bunny.dao.dto.system.rolePower.power.PowerUpdateDto;
|
||||
import cn.bunny.dao.entity.system.Power;
|
||||
import cn.bunny.dao.pojo.result.PageResult;
|
||||
import cn.bunny.dao.vo.system.rolePower.PowerVo;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package cn.bunny.services.service;
|
||||
|
||||
import cn.bunny.dao.dto.system.rolePower.RoleAddDto;
|
||||
import cn.bunny.dao.dto.system.rolePower.RoleDto;
|
||||
import cn.bunny.dao.dto.system.rolePower.RoleUpdateDto;
|
||||
import cn.bunny.dao.dto.system.rolePower.role.RoleAddDto;
|
||||
import cn.bunny.dao.dto.system.rolePower.role.RoleDto;
|
||||
import cn.bunny.dao.dto.system.rolePower.role.RoleUpdateDto;
|
||||
import cn.bunny.dao.entity.system.Role;
|
||||
import cn.bunny.dao.pojo.result.PageResult;
|
||||
import cn.bunny.dao.vo.system.rolePower.RoleVo;
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package cn.bunny.services.service;
|
||||
|
||||
import cn.bunny.dao.dto.quartz.executeLog.QuartzExecuteLogDto;
|
||||
import cn.bunny.dao.entity.quartz.QuartzExecuteLog;
|
||||
import cn.bunny.dao.dto.log.ScheduleExecuteLogDto;
|
||||
import cn.bunny.dao.entity.log.ScheduleExecuteLog;
|
||||
import cn.bunny.dao.pojo.result.PageResult;
|
||||
import cn.bunny.dao.vo.quartz.QuartzExecuteLogVo;
|
||||
import cn.bunny.dao.vo.log.QuartzExecuteLogVo;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
|
@ -17,14 +17,14 @@ import java.util.List;
|
|||
* @author Bunny
|
||||
* @since 2024-10-18 12:56:39
|
||||
*/
|
||||
public interface QuartzExecuteLogService extends IService<QuartzExecuteLog> {
|
||||
public interface ScheduleExecuteLogService extends IService<ScheduleExecuteLog> {
|
||||
|
||||
/**
|
||||
* * 获取调度任务执行日志列表
|
||||
*
|
||||
* @return 调度任务执行日志返回列表
|
||||
*/
|
||||
PageResult<QuartzExecuteLogVo> getQuartzExecuteLogList(Page<QuartzExecuteLog> pageParams, QuartzExecuteLogDto dto);
|
||||
PageResult<QuartzExecuteLogVo> getQuartzExecuteLogList(Page<ScheduleExecuteLog> pageParams, ScheduleExecuteLogDto dto);
|
||||
|
||||
/**
|
||||
* * 删除|批量删除调度任务执行日志类型
|
|
@ -1,8 +1,8 @@
|
|||
package cn.bunny.services.service;
|
||||
|
||||
import cn.bunny.dao.dto.quartz.scheduleGroup.SchedulersGroupAddDto;
|
||||
import cn.bunny.dao.dto.quartz.scheduleGroup.SchedulersGroupDto;
|
||||
import cn.bunny.dao.dto.quartz.scheduleGroup.SchedulersGroupUpdateDto;
|
||||
import cn.bunny.dao.dto.quartz.group.SchedulersGroupAddDto;
|
||||
import cn.bunny.dao.dto.quartz.group.SchedulersGroupDto;
|
||||
import cn.bunny.dao.dto.quartz.group.SchedulersGroupUpdateDto;
|
||||
import cn.bunny.dao.entity.quartz.SchedulersGroup;
|
||||
import cn.bunny.dao.pojo.result.PageResult;
|
||||
import cn.bunny.dao.vo.quartz.SchedulersGroupVo;
|
||||
|
|
|
@ -0,0 +1,52 @@
|
|||
package cn.bunny.services.service;
|
||||
|
||||
import cn.bunny.dao.dto.log.UserLoginLogAddDto;
|
||||
import cn.bunny.dao.dto.log.UserLoginLogDto;
|
||||
import cn.bunny.dao.dto.log.UserLoginLogUpdateDto;
|
||||
import cn.bunny.dao.entity.log.UserLoginLog;
|
||||
import cn.bunny.dao.pojo.result.PageResult;
|
||||
import cn.bunny.dao.vo.log.UserLoginLogVo;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户登录日志 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author Bunny
|
||||
* @since 2024-10-18 22:36:07
|
||||
*/
|
||||
public interface UserLoginLogService extends IService<UserLoginLog> {
|
||||
|
||||
/**
|
||||
* * 获取用户登录日志列表
|
||||
*
|
||||
* @return 用户登录日志返回列表
|
||||
*/
|
||||
PageResult<UserLoginLogVo> getUserLoginLogList(Page<UserLoginLog> pageParams, UserLoginLogDto dto);
|
||||
|
||||
/**
|
||||
* * 添加用户登录日志
|
||||
*
|
||||
* @param dto 添加表单
|
||||
*/
|
||||
void addUserLoginLog(@Valid UserLoginLogAddDto dto);
|
||||
|
||||
/**
|
||||
* * 更新用户登录日志
|
||||
*
|
||||
* @param dto 更新表单
|
||||
*/
|
||||
void updateUserLoginLog(@Valid UserLoginLogUpdateDto dto);
|
||||
|
||||
/**
|
||||
* * 删除|批量删除用户登录日志类型
|
||||
*
|
||||
* @param ids 删除id列表
|
||||
*/
|
||||
void deleteUserLoginLog(List<Long> ids);
|
||||
}
|
|
@ -1,11 +1,11 @@
|
|||
package cn.bunny.services.service.impl;
|
||||
|
||||
import cn.bunny.common.service.exception.BunnyException;
|
||||
import cn.bunny.dao.dto.system.email.EmailTemplateAddDto;
|
||||
import cn.bunny.dao.dto.system.email.EmailTemplateDto;
|
||||
import cn.bunny.dao.dto.system.email.EmailTemplateUpdateDto;
|
||||
import cn.bunny.dao.dto.system.email.template.EmailTemplateAddDto;
|
||||
import cn.bunny.dao.dto.system.email.template.EmailTemplateDto;
|
||||
import cn.bunny.dao.dto.system.email.template.EmailTemplateUpdateDto;
|
||||
import cn.bunny.dao.entity.system.EmailTemplate;
|
||||
import cn.bunny.dao.pojo.common.EmailTemplateTypes;
|
||||
import cn.bunny.dao.pojo.enums.EmailTemplateEnums;
|
||||
import cn.bunny.dao.pojo.result.PageResult;
|
||||
import cn.bunny.dao.pojo.result.ResultCodeEnum;
|
||||
import cn.bunny.dao.vo.system.email.EmailTemplateVo;
|
||||
|
@ -115,10 +115,10 @@ public class EmailTemplateServiceImpl extends ServiceImpl<EmailTemplateMapper, E
|
|||
*/
|
||||
@Override
|
||||
public List<Map<String, String>> getEmailTypes() {
|
||||
return Arrays.stream(EmailTemplateTypes.values()).map(emailTemplateTypes -> {
|
||||
return Arrays.stream(EmailTemplateEnums.values()).map(emailTemplateEnums -> {
|
||||
Map<String, String> map = new HashMap<>();
|
||||
map.put("key", emailTemplateTypes.getSummary());
|
||||
map.put("value", emailTemplateTypes.getType());
|
||||
map.put("key", emailTemplateEnums.getSummary());
|
||||
map.put("value", emailTemplateEnums.getType());
|
||||
return map;
|
||||
}).toList();
|
||||
}
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
package cn.bunny.services.service.impl;
|
||||
|
||||
import cn.bunny.common.service.exception.BunnyException;
|
||||
import cn.bunny.dao.dto.system.email.EmailUserUpdateStatusDto;
|
||||
import cn.bunny.dao.dto.system.email.EmailUsersAddDto;
|
||||
import cn.bunny.dao.dto.system.email.EmailUsersDto;
|
||||
import cn.bunny.dao.dto.system.email.EmailUsersUpdateDto;
|
||||
import cn.bunny.dao.dto.system.email.user.EmailUserUpdateStatusDto;
|
||||
import cn.bunny.dao.dto.system.email.user.EmailUsersAddDto;
|
||||
import cn.bunny.dao.dto.system.email.user.EmailUsersDto;
|
||||
import cn.bunny.dao.dto.system.email.user.EmailUsersUpdateDto;
|
||||
import cn.bunny.dao.entity.system.EmailUsers;
|
||||
import cn.bunny.dao.pojo.result.PageResult;
|
||||
import cn.bunny.dao.pojo.result.ResultCodeEnum;
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
package cn.bunny.services.service.impl;
|
||||
|
||||
import cn.bunny.common.service.exception.BunnyException;
|
||||
import cn.bunny.dao.dto.system.rolePower.PowerAddDto;
|
||||
import cn.bunny.dao.dto.system.rolePower.PowerDto;
|
||||
import cn.bunny.dao.dto.system.rolePower.PowerUpdateBatchByParentIdDto;
|
||||
import cn.bunny.dao.dto.system.rolePower.PowerUpdateDto;
|
||||
import cn.bunny.dao.dto.system.rolePower.power.PowerAddDto;
|
||||
import cn.bunny.dao.dto.system.rolePower.power.PowerDto;
|
||||
import cn.bunny.dao.dto.system.rolePower.power.PowerUpdateBatchByParentIdDto;
|
||||
import cn.bunny.dao.dto.system.rolePower.power.PowerUpdateDto;
|
||||
import cn.bunny.dao.entity.system.Power;
|
||||
import cn.bunny.dao.pojo.result.PageResult;
|
||||
import cn.bunny.dao.pojo.result.ResultCodeEnum;
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package cn.bunny.services.service.impl;
|
||||
|
||||
import cn.bunny.common.service.exception.BunnyException;
|
||||
import cn.bunny.dao.dto.system.rolePower.RoleAddDto;
|
||||
import cn.bunny.dao.dto.system.rolePower.RoleDto;
|
||||
import cn.bunny.dao.dto.system.rolePower.RoleUpdateDto;
|
||||
import cn.bunny.dao.dto.system.rolePower.role.RoleAddDto;
|
||||
import cn.bunny.dao.dto.system.rolePower.role.RoleDto;
|
||||
import cn.bunny.dao.dto.system.rolePower.role.RoleUpdateDto;
|
||||
import cn.bunny.dao.entity.system.Role;
|
||||
import cn.bunny.dao.pojo.result.PageResult;
|
||||
import cn.bunny.dao.pojo.result.ResultCodeEnum;
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package cn.bunny.services.service.impl;
|
||||
|
||||
import cn.bunny.dao.dto.quartz.executeLog.QuartzExecuteLogDto;
|
||||
import cn.bunny.dao.entity.quartz.QuartzExecuteLog;
|
||||
import cn.bunny.dao.dto.log.ScheduleExecuteLogDto;
|
||||
import cn.bunny.dao.entity.log.ScheduleExecuteLog;
|
||||
import cn.bunny.dao.pojo.result.PageResult;
|
||||
import cn.bunny.dao.vo.quartz.QuartzExecuteLogVo;
|
||||
import cn.bunny.services.mapper.QuartzExecuteLogMapper;
|
||||
import cn.bunny.services.service.QuartzExecuteLogService;
|
||||
import cn.bunny.dao.vo.log.QuartzExecuteLogVo;
|
||||
import cn.bunny.services.mapper.ScheduleExecuteLogMapper;
|
||||
import cn.bunny.services.service.ScheduleExecuteLogService;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
@ -23,7 +23,7 @@ import java.util.List;
|
|||
* @since 2024-10-18 12:56:39
|
||||
*/
|
||||
@Service
|
||||
public class QuartzExecuteLogServiceImpl extends ServiceImpl<QuartzExecuteLogMapper, QuartzExecuteLog> implements QuartzExecuteLogService {
|
||||
public class ScheduleExecuteLogServiceImpl extends ServiceImpl<ScheduleExecuteLogMapper, ScheduleExecuteLog> implements ScheduleExecuteLogService {
|
||||
|
||||
/**
|
||||
* * 调度任务执行日志 服务实现类
|
||||
|
@ -33,9 +33,9 @@ public class QuartzExecuteLogServiceImpl extends ServiceImpl<QuartzExecuteLogMap
|
|||
* @return 查询分页调度任务执行日志返回对象
|
||||
*/
|
||||
@Override
|
||||
public PageResult<QuartzExecuteLogVo> getQuartzExecuteLogList(Page<QuartzExecuteLog> pageParams, QuartzExecuteLogDto dto) {
|
||||
public PageResult<QuartzExecuteLogVo> getQuartzExecuteLogList(Page<ScheduleExecuteLog> pageParams, ScheduleExecuteLogDto dto) {
|
||||
// 分页查询菜单图标
|
||||
IPage<QuartzExecuteLog> page = baseMapper.selectListByPage(pageParams, dto);
|
||||
IPage<ScheduleExecuteLog> page = baseMapper.selectListByPage(pageParams, dto);
|
||||
|
||||
List<QuartzExecuteLogVo> voList = page.getRecords().stream().map(quartzExecuteLog -> {
|
||||
QuartzExecuteLogVo quartzExecuteLogVo = new QuartzExecuteLogVo();
|
|
@ -1,8 +1,8 @@
|
|||
package cn.bunny.services.service.impl;
|
||||
|
||||
import cn.bunny.dao.dto.quartz.scheduleGroup.SchedulersGroupAddDto;
|
||||
import cn.bunny.dao.dto.quartz.scheduleGroup.SchedulersGroupDto;
|
||||
import cn.bunny.dao.dto.quartz.scheduleGroup.SchedulersGroupUpdateDto;
|
||||
import cn.bunny.dao.dto.quartz.group.SchedulersGroupAddDto;
|
||||
import cn.bunny.dao.dto.quartz.group.SchedulersGroupDto;
|
||||
import cn.bunny.dao.dto.quartz.group.SchedulersGroupUpdateDto;
|
||||
import cn.bunny.dao.entity.quartz.SchedulersGroup;
|
||||
import cn.bunny.dao.pojo.result.PageResult;
|
||||
import cn.bunny.dao.vo.quartz.SchedulersGroupVo;
|
||||
|
|
|
@ -0,0 +1,92 @@
|
|||
package cn.bunny.services.service.impl;
|
||||
|
||||
import cn.bunny.dao.dto.log.UserLoginLogAddDto;
|
||||
import cn.bunny.dao.dto.log.UserLoginLogDto;
|
||||
import cn.bunny.dao.dto.log.UserLoginLogUpdateDto;
|
||||
import cn.bunny.dao.entity.log.UserLoginLog;
|
||||
import cn.bunny.dao.pojo.result.PageResult;
|
||||
import cn.bunny.dao.vo.log.UserLoginLogVo;
|
||||
import cn.bunny.services.mapper.UserLoginLogMapper;
|
||||
import cn.bunny.services.service.UserLoginLogService;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户登录日志 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author Bunny
|
||||
* @since 2024-10-18 22:36:07
|
||||
*/
|
||||
@Service
|
||||
public class UserLoginLogServiceImpl extends ServiceImpl<UserLoginLogMapper, UserLoginLog> implements UserLoginLogService {
|
||||
|
||||
/**
|
||||
* * 用户登录日志 服务实现类
|
||||
*
|
||||
* @param pageParams 用户登录日志分页查询page对象
|
||||
* @param dto 用户登录日志分页查询对象
|
||||
* @return 查询分页用户登录日志返回对象
|
||||
*/
|
||||
@Override
|
||||
public PageResult<UserLoginLogVo> getUserLoginLogList(Page<UserLoginLog> pageParams, UserLoginLogDto dto) {
|
||||
// 分页查询菜单图标
|
||||
IPage<UserLoginLog> page = baseMapper.selectListByPage(pageParams, dto);
|
||||
|
||||
List<UserLoginLogVo> voList = page.getRecords().stream().map(userLoginLog -> {
|
||||
UserLoginLogVo userLoginLogVo = new UserLoginLogVo();
|
||||
BeanUtils.copyProperties(userLoginLog, userLoginLogVo);
|
||||
return userLoginLogVo;
|
||||
}).toList();
|
||||
|
||||
return PageResult.<UserLoginLogVo>builder()
|
||||
.list(voList)
|
||||
.pageNo(page.getCurrent())
|
||||
.pageSize(page.getSize())
|
||||
.total(page.getTotal())
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加用户登录日志
|
||||
*
|
||||
* @param dto 用户登录日志添加
|
||||
*/
|
||||
@Override
|
||||
public void addUserLoginLog(@Valid UserLoginLogAddDto dto) {
|
||||
// 保存数据
|
||||
UserLoginLog userLoginLog = new UserLoginLog();
|
||||
BeanUtils.copyProperties(dto, userLoginLog);
|
||||
save(userLoginLog);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新用户登录日志
|
||||
*
|
||||
* @param dto 用户登录日志更新
|
||||
*/
|
||||
@Override
|
||||
public void updateUserLoginLog(@Valid UserLoginLogUpdateDto dto) {
|
||||
// 更新内容
|
||||
UserLoginLog userLoginLog = new UserLoginLog();
|
||||
BeanUtils.copyProperties(dto, userLoginLog);
|
||||
updateById(userLoginLog);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除|批量删除用户登录日志
|
||||
*
|
||||
* @param ids 删除id列表
|
||||
*/
|
||||
@Override
|
||||
public void deleteUserLoginLog(List<Long> ids) {
|
||||
baseMapper.deleteBatchIdsWithPhysics(ids);
|
||||
}
|
||||
}
|
|
@ -1,9 +1,9 @@
|
|||
<?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="cn.bunny.services.mapper.QuartzExecuteLogMapper">
|
||||
<mapper namespace="cn.bunny.services.mapper.ScheduleExecuteLogMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="cn.bunny.dao.entity.quartz.QuartzExecuteLog">
|
||||
<resultMap id="BaseResultMap" type="cn.bunny.dao.entity.log.ScheduleExecuteLog">
|
||||
<id column="id" property="id"/>
|
||||
<id column="create_time" property="createTime"/>
|
||||
<id column="update_time" property="updateTime"/>
|
||||
|
@ -26,7 +26,7 @@
|
|||
</sql>
|
||||
|
||||
<!-- 分页查询调度任务执行日志内容 -->
|
||||
<select id="selectListByPage" resultType="cn.bunny.dao.entity.quartz.QuartzExecuteLog">
|
||||
<select id="selectListByPage" resultType="cn.bunny.dao.entity.log.ScheduleExecuteLog">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from log_quartz_execute
|
|
@ -0,0 +1,64 @@
|
|||
<?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="cn.bunny.services.mapper.UserLoginLogMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="cn.bunny.dao.entity.log.UserLoginLog">
|
||||
<id column="id" property="id"/>
|
||||
<id column="create_time" property="createTime"/>
|
||||
<id column="update_time" property="updateTime"/>
|
||||
<id column="create_user" property="createUser"/>
|
||||
<id column="update_user" property="updateUser"/>
|
||||
<id column="is_deleted" property="isDeleted"/>
|
||||
<id column="user_id" property="userId"/>
|
||||
<id column="username" property="username"/>
|
||||
<id column="token" property="token"/>
|
||||
<id column="ip" property="ip"/>
|
||||
<id column="ip_address" property="ipAddress"/>
|
||||
<id column="user_agent" property="userAgent"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
id, create_time, update_time, create_user, update_user, is_deleted, user_id, username, token, ip, ip_address, user_agent
|
||||
</sql>
|
||||
|
||||
<!-- 分页查询用户登录日志内容 -->
|
||||
<select id="selectListByPage" resultType="cn.bunny.dao.entity.log.UserLoginLog">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from log_user_login
|
||||
<where>
|
||||
<if test="dto.userId != null and dto.userId != ''">
|
||||
and user_id like CONCAT('%',#{dto.userId},'%')
|
||||
</if>
|
||||
<if test="dto.username != null and dto.username != ''">
|
||||
and username like CONCAT('%',#{dto.username},'%')
|
||||
</if>
|
||||
<if test="dto.token != null and dto.token != ''">
|
||||
and token like CONCAT('%',#{dto.token},'%')
|
||||
</if>
|
||||
<if test="dto.ip != null and dto.ip != ''">
|
||||
and ip like CONCAT('%',#{dto.ip},'%')
|
||||
</if>
|
||||
<if test="dto.ipAddress != null and dto.ipAddress != ''">
|
||||
and ip_address like CONCAT('%',#{dto.ipAddress},'%')
|
||||
</if>
|
||||
<if test="dto.userAgent != null and dto.userAgent != ''">
|
||||
and user_agent like CONCAT('%',#{dto.userAgent},'%')
|
||||
</if>
|
||||
</where>
|
||||
order by update_time desc
|
||||
</select>
|
||||
|
||||
<!-- 物理删除用户登录日志 -->
|
||||
<delete id="deleteBatchIdsWithPhysics">
|
||||
delete
|
||||
from log_user_login
|
||||
where id in
|
||||
<foreach collection="ids" item="id" open="(" close=")" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue