init
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>data-system-service-parent</artifactId>
|
||||
<groupId>com.platform</groupId>
|
||||
<version>0.4.x</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<version>0.4.x</version>
|
||||
<artifactId>data-system-service-api</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.github.xiaoymin</groupId>
|
||||
<artifactId>knife4j-micro-spring-boot-starter</artifactId>
|
||||
<version>${knife4j.version}</version>
|
||||
</dependency>
|
||||
<!--feign 依赖-->
|
||||
<dependency>
|
||||
<groupId>io.github.openfeign</groupId>
|
||||
<artifactId>feign-okhttp</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.platform</groupId>
|
||||
<artifactId>common-core</artifactId>
|
||||
<version>0.4.x</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.springframework.security</groupId>
|
||||
<artifactId>spring-security-web</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,42 @@
|
||||
package cn.datax.service.system.api.dto;
|
||||
|
||||
import cn.datax.common.validate.ValidationGroups;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
/**
|
||||
* <p>
|
||||
* 系统参数配置信息表 实体DTO
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @date 2022-05-19
|
||||
*/
|
||||
@ApiModel(value = "系统参数配置信息表Model")
|
||||
@Data
|
||||
public class ConfigDto implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
@ApiModelProperty(value = "主键ID")
|
||||
@NotBlank(message = "主键ID不能为空", groups = {ValidationGroups.Update.class})
|
||||
private String id;
|
||||
@ApiModelProperty(value = "参数名称")
|
||||
@NotBlank(message = "参数名称不能为空", groups = {ValidationGroups.Insert.class, ValidationGroups.Update.class})
|
||||
private String configName;
|
||||
@ApiModelProperty(value = "参数键名")
|
||||
@NotBlank(message = "参数键名不能为空", groups = {ValidationGroups.Insert.class, ValidationGroups.Update.class})
|
||||
private String configKey;
|
||||
@ApiModelProperty(value = "参数键值")
|
||||
@NotBlank(message = "参数键值不能为空", groups = {ValidationGroups.Insert.class, ValidationGroups.Update.class})
|
||||
private String configValue;
|
||||
@ApiModelProperty(value = "状态")
|
||||
@NotNull(message = "状态不能为空", groups = {ValidationGroups.Insert.class, ValidationGroups.Update.class})
|
||||
private String status;
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package cn.datax.service.system.api.dto;
|
||||
|
||||
import cn.datax.common.validate.ValidationGroups;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
|
||||
@ApiModel(value = "部门Model")
|
||||
@Data
|
||||
public class DeptDto implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
@ApiModelProperty(value = "主键ID")
|
||||
@NotBlank(message = "主键ID不能为空", groups = {ValidationGroups.Update.class})
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "父部门ID")
|
||||
@NotBlank(message = "父部门ID不能为空", groups = {ValidationGroups.Insert.class, ValidationGroups.Update.class})
|
||||
private String parentId;
|
||||
|
||||
@ApiModelProperty(value = "部门名称")
|
||||
@NotBlank(message = "部门名称不能为空", groups = {ValidationGroups.Insert.class, ValidationGroups.Update.class})
|
||||
private String deptName;
|
||||
|
||||
@ApiModelProperty(value = "部门编码")
|
||||
@NotBlank(message = "部门编码不能为空", groups = {ValidationGroups.Insert.class, ValidationGroups.Update.class})
|
||||
private String deptNo;
|
||||
|
||||
@ApiModelProperty(value = "状态")
|
||||
@NotNull(message = "状态不能为空", groups = {ValidationGroups.Insert.class, ValidationGroups.Update.class})
|
||||
private String status;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package cn.datax.service.system.api.dto;
|
||||
|
||||
import cn.datax.common.validate.ValidationGroups;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
/**
|
||||
* <p>
|
||||
* 字典编码信息表 实体DTO
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @date 2022-04-17
|
||||
*/
|
||||
@ApiModel(value = "字典编码信息表Model")
|
||||
@Data
|
||||
public class DictDto implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
@ApiModelProperty(value = "主键ID")
|
||||
@NotBlank(message = "主键ID不能为空", groups = {ValidationGroups.Update.class})
|
||||
private String id;
|
||||
@ApiModelProperty(value = "字典名称")
|
||||
@NotBlank(message = "字典名称不能为空", groups = {ValidationGroups.Insert.class, ValidationGroups.Update.class})
|
||||
private String dictName;
|
||||
@ApiModelProperty(value = "字典编码")
|
||||
@NotBlank(message = "字典编码不能为空", groups = {ValidationGroups.Insert.class, ValidationGroups.Update.class})
|
||||
private String dictCode;
|
||||
@ApiModelProperty(value = "状态")
|
||||
@NotNull(message = "状态不能为空", groups = {ValidationGroups.Insert.class, ValidationGroups.Update.class})
|
||||
private String status;
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package cn.datax.service.system.api.dto;
|
||||
|
||||
import cn.datax.common.validate.ValidationGroups;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
/**
|
||||
* <p>
|
||||
* 字典项信息表 实体DTO
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @date 2022-04-17
|
||||
*/
|
||||
@ApiModel(value = "字典项信息表Model")
|
||||
@Data
|
||||
public class DictItemDto implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
@ApiModelProperty(value = "主键ID")
|
||||
@NotBlank(message = "主键ID不能为空", groups = {ValidationGroups.Update.class})
|
||||
private String id;
|
||||
@ApiModelProperty(value = "字典ID")
|
||||
@NotBlank(message = "字典ID不能为空", groups = {ValidationGroups.Insert.class, ValidationGroups.Update.class})
|
||||
private String dictId;
|
||||
@ApiModelProperty(value = "字典项文本")
|
||||
@NotBlank(message = "字典项文本不能为空", groups = {ValidationGroups.Insert.class, ValidationGroups.Update.class})
|
||||
private String itemText;
|
||||
@ApiModelProperty(value = "字典项值")
|
||||
@NotBlank(message = "字典项值不能为空", groups = {ValidationGroups.Insert.class, ValidationGroups.Update.class})
|
||||
private String itemValue;
|
||||
@ApiModelProperty(value = "排序")
|
||||
@NotNull(message = "排序不能为空", groups = {ValidationGroups.Insert.class, ValidationGroups.Update.class})
|
||||
private Integer itemSort;
|
||||
@ApiModelProperty(value = "状态")
|
||||
@NotNull(message = "状态不能为空", groups = {ValidationGroups.Insert.class, ValidationGroups.Update.class})
|
||||
private String status;
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package cn.datax.service.system.api.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@ApiModel(value = "日志Model")
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class LogDto implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
@ApiModelProperty(value = "主键ID")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "所属模块")
|
||||
private String module;
|
||||
|
||||
@ApiModelProperty(value = "日志标题")
|
||||
private String title;
|
||||
|
||||
@ApiModelProperty(value = "用户ID")
|
||||
private String userId;
|
||||
|
||||
@ApiModelProperty(value = "用户名称")
|
||||
private String userName;
|
||||
|
||||
@ApiModelProperty(value = "请求IP")
|
||||
private String remoteAddr;
|
||||
|
||||
@ApiModelProperty(value = "请求URI")
|
||||
private String requestUri;
|
||||
|
||||
@ApiModelProperty(value = "方法类名")
|
||||
private String className;
|
||||
|
||||
@ApiModelProperty(value = "方法名称")
|
||||
private String methodName;
|
||||
|
||||
@ApiModelProperty(value = "请求参数")
|
||||
private String params;
|
||||
|
||||
@ApiModelProperty(value = "请求耗时")
|
||||
private String time;
|
||||
|
||||
@ApiModelProperty(value = "浏览器名称")
|
||||
private String browser;
|
||||
|
||||
@ApiModelProperty(value = "操作系统")
|
||||
private String os;
|
||||
|
||||
@ApiModelProperty(value = "错误类型")
|
||||
private String exCode;
|
||||
|
||||
@ApiModelProperty(value = "错误信息")
|
||||
private String exMsg;
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package cn.datax.service.system.api.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 登录日志信息表 实体DTO
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @date 2022-05-29
|
||||
*/
|
||||
@ApiModel(value = "登录日志信息表Model")
|
||||
@Data
|
||||
public class LoginLogDto implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
@ApiModelProperty(value = "主键ID")
|
||||
private String id;
|
||||
@ApiModelProperty(value = "操作系统")
|
||||
private String opOs;
|
||||
@ApiModelProperty(value = "浏览器类型")
|
||||
private String opBrowser;
|
||||
@ApiModelProperty(value = "登录IP地址")
|
||||
private String opIp;
|
||||
@ApiModelProperty(value = "登录时间")
|
||||
private LocalDateTime opDate;
|
||||
@ApiModelProperty(value = "登录用户ID")
|
||||
private String userId;
|
||||
@ApiModelProperty(value = "登录用户名称")
|
||||
private String userName;
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package cn.datax.service.system.api.dto;
|
||||
|
||||
import cn.datax.common.validate.ValidationGroups;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
|
||||
@ApiModel(value = "资源Model")
|
||||
@Data
|
||||
public class MenuDto implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
@ApiModelProperty(value = "主键ID")
|
||||
@NotBlank(message = "主键ID不能为空", groups = {ValidationGroups.Update.class})
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "父资源ID")
|
||||
@NotBlank(message = "父资源ID不能为空", groups = {ValidationGroups.Insert.class, ValidationGroups.Update.class})
|
||||
private String parentId;
|
||||
|
||||
@ApiModelProperty(value = "资源名称")
|
||||
@NotBlank(message = "资源名称不能为空", groups = {ValidationGroups.Insert.class, ValidationGroups.Update.class})
|
||||
private String menuName;
|
||||
|
||||
@ApiModelProperty(value = "对应路由地址path")
|
||||
private String menuPath;
|
||||
|
||||
@ApiModelProperty(value = "对应路由组件component")
|
||||
private String menuComponent;
|
||||
|
||||
@ApiModelProperty(value = "对应路由默认跳转地址redirect")
|
||||
private String menuRedirect;
|
||||
|
||||
@ApiModelProperty(value = "权限标识")
|
||||
private String menuPerms;
|
||||
|
||||
@ApiModelProperty(value = "资源图标")
|
||||
private String menuIcon;
|
||||
|
||||
@ApiModelProperty(value = "资源类型")
|
||||
@NotNull(message = "类型不能为空", groups = {ValidationGroups.Insert.class, ValidationGroups.Update.class})
|
||||
private String menuType;
|
||||
|
||||
@ApiModelProperty(value = "资源编码")
|
||||
private String menuCode;
|
||||
|
||||
@ApiModelProperty(value = "隐藏")
|
||||
@NotNull(message = "隐藏不能为空", groups = {ValidationGroups.Insert.class, ValidationGroups.Update.class})
|
||||
private String menuHidden;
|
||||
|
||||
@ApiModelProperty(value = "排序")
|
||||
@NotNull(message = "排序不能为空", groups = {ValidationGroups.Insert.class, ValidationGroups.Update.class})
|
||||
private Integer menuSort;
|
||||
|
||||
@ApiModelProperty(value = "状态")
|
||||
@NotNull(message = "状态不能为空", groups = {ValidationGroups.Insert.class, ValidationGroups.Update.class})
|
||||
private String status;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package cn.datax.service.system.api.dto;
|
||||
|
||||
import cn.datax.common.validate.ValidationGroups;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
|
||||
@ApiModel(value = "岗位Model")
|
||||
@Data
|
||||
public class PostDto implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
@ApiModelProperty(value = "主键ID")
|
||||
@NotBlank(message = "主键ID不能为空", groups = {ValidationGroups.Update.class})
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "岗位名称")
|
||||
@NotBlank(message = "岗位名称不能为空", groups = {ValidationGroups.Insert.class, ValidationGroups.Update.class})
|
||||
private String postName;
|
||||
|
||||
@ApiModelProperty(value = "状态")
|
||||
@NotNull(message = "状态不能为空", groups = {ValidationGroups.Insert.class, ValidationGroups.Update.class})
|
||||
private String status;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package cn.datax.service.system.api.dto;
|
||||
|
||||
import cn.datax.common.validate.ValidationGroups;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@ApiModel(value = "角色Model")
|
||||
@Data
|
||||
public class RoleDto implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
@ApiModelProperty(value = "主键ID")
|
||||
@NotBlank(message = "主键ID不能为空", groups = {ValidationGroups.Update.class})
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "角色名称")
|
||||
@NotBlank(message = "角色名称不能为空", groups = {ValidationGroups.Insert.class, ValidationGroups.Update.class})
|
||||
private String roleName;
|
||||
|
||||
@ApiModelProperty(value = "角色编码")
|
||||
@NotBlank(message = "角色编码不能为空", groups = {ValidationGroups.Insert.class, ValidationGroups.Update.class})
|
||||
private String roleCode;
|
||||
|
||||
@ApiModelProperty(value = "数据范围")
|
||||
@NotNull(message = "数据范围不能为空", groups = {ValidationGroups.Insert.class, ValidationGroups.Update.class})
|
||||
private String dataScope;
|
||||
|
||||
@ApiModelProperty(value = "资源")
|
||||
@NotEmpty(message = "资源不能为空", groups = {ValidationGroups.Insert.class, ValidationGroups.Update.class})
|
||||
private List<String> menuList;
|
||||
|
||||
@ApiModelProperty(value = "数据范围为2时自定义数据权限")
|
||||
private List<String> deptList;
|
||||
|
||||
@ApiModelProperty(value = "状态")
|
||||
@NotNull(message = "状态不能为空", groups = {ValidationGroups.Insert.class, ValidationGroups.Update.class})
|
||||
private String status;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package cn.datax.service.system.api.dto;
|
||||
|
||||
import cn.datax.common.validate.ValidationGroups;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
@ApiModel(value = "用户Model")
|
||||
@Data
|
||||
public class UserDto implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
@ApiModelProperty(value = "主键ID")
|
||||
@NotBlank(message = "主键ID不能为空", groups = {ValidationGroups.Update.class})
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "用户名称")
|
||||
@NotBlank(message = "用户名称不能为空", groups = {ValidationGroups.Insert.class, ValidationGroups.Update.class})
|
||||
@Length(min=3, max = 12, message="用户名称长度必须位于{min}-{max}之间")
|
||||
private String username;
|
||||
|
||||
@ApiModelProperty(value = "用户昵称")
|
||||
@NotBlank(message = "用户昵称不能为空", groups = {ValidationGroups.Insert.class, ValidationGroups.Update.class})
|
||||
private String nickname;
|
||||
|
||||
@ApiModelProperty(value = "用户密码")
|
||||
@NotBlank(message = "用户密码不能为空", groups = {ValidationGroups.Insert.class, ValidationGroups.Update.class})
|
||||
private String password;
|
||||
|
||||
@ApiModelProperty(value = "电子邮箱")
|
||||
@NotBlank(message = "电子邮箱不能为空", groups = {ValidationGroups.Insert.class, ValidationGroups.Update.class})
|
||||
@Email(message = "请输入正确的邮箱")
|
||||
private String email;
|
||||
|
||||
@ApiModelProperty(value = "手机号码")
|
||||
@NotBlank(message = "手机号码不能为空", groups = {ValidationGroups.Insert.class, ValidationGroups.Update.class})
|
||||
private String phone;
|
||||
|
||||
@ApiModelProperty(value = "出生日期", example = "2019-09-09")
|
||||
@NotNull(message = "出生日期不能为空", groups = {ValidationGroups.Insert.class, ValidationGroups.Update.class})
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private LocalDate birthday;
|
||||
|
||||
@ApiModelProperty(value = "部门")
|
||||
@NotBlank(message = "部门不能为空", groups = {ValidationGroups.Insert.class, ValidationGroups.Update.class})
|
||||
private String deptId;
|
||||
|
||||
@ApiModelProperty(value = "角色")
|
||||
@NotEmpty(message = "角色不能为空", groups = {ValidationGroups.Insert.class, ValidationGroups.Update.class})
|
||||
@Size(min = 1, max = 5, message="角色长度必须位于{min}-{max}之间")
|
||||
private List<String> roleList;
|
||||
|
||||
@ApiModelProperty(value = "岗位")
|
||||
@NotEmpty(message = "岗位不能为空", groups = {ValidationGroups.Insert.class, ValidationGroups.Update.class})
|
||||
@Size(min = 1, max = 1, message="岗位长度必须位于{min}-{max}之间")
|
||||
private List<String> postList;
|
||||
|
||||
@ApiModelProperty(value = "状态")
|
||||
@NotNull(message = "状态不能为空", groups = {ValidationGroups.Insert.class, ValidationGroups.Update.class})
|
||||
private String status;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package cn.datax.service.system.api.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.io.Serializable;
|
||||
|
||||
@ApiModel(value = "用户密码Model")
|
||||
@Data
|
||||
public class UserPasswordDto implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
@ApiModelProperty(value = "主键ID")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "密码")
|
||||
@NotBlank(message = "密码不能为空")
|
||||
private String password;
|
||||
|
||||
@ApiModelProperty(value = "旧密码")
|
||||
@NotBlank(message = "旧密码不能为空")
|
||||
private String oldPassword;
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package cn.datax.service.system.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import cn.datax.common.base.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 系统参数配置信息表
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @date 2022-05-19
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
@TableName("sys_config")
|
||||
public class ConfigEntity extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 参数名称
|
||||
*/
|
||||
private String configName;
|
||||
|
||||
/**
|
||||
* 参数键名
|
||||
*/
|
||||
private String configKey;
|
||||
|
||||
/**
|
||||
* 参数键值
|
||||
*/
|
||||
private String configValue;
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package cn.datax.service.system.api.entity;
|
||||
|
||||
import cn.datax.common.base.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @date 2022-09-11
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
@TableName("sys_dept")
|
||||
public class DeptEntity extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 父部门ID
|
||||
*/
|
||||
private String parentId;
|
||||
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
private String deptName;
|
||||
|
||||
/**
|
||||
* 一级:10
|
||||
* 二级:10 001、10 002
|
||||
* 三级:10 001 001、10 001 002、10 002 001
|
||||
* 部门编码(数据权限优化查询速度 like '10001%')
|
||||
*/
|
||||
private String deptNo;
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package cn.datax.service.system.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 部门关系表
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @date 2022-11-22
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@TableName("sys_dept_relation")
|
||||
public class DeptRelationEntity implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.ASSIGN_ID)
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 祖先节点
|
||||
*/
|
||||
private String ancestor;
|
||||
|
||||
/**
|
||||
* 后代节点
|
||||
*/
|
||||
private String descendant;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package cn.datax.service.system.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import cn.datax.common.base.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 字典编码信息表
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @date 2022-04-17
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
@TableName("sys_dict")
|
||||
public class DictEntity extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 字典名称
|
||||
*/
|
||||
private String dictName;
|
||||
|
||||
/**
|
||||
* 字典编码
|
||||
*/
|
||||
private String dictCode;
|
||||
|
||||
@TableField(exist = false)
|
||||
private List<DictItemEntity> items;
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package cn.datax.service.system.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import cn.datax.common.base.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 字典项信息表
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @date 2022-04-17
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
@TableName("sys_market_dict_item")
|
||||
public class DictItemEntity extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 字典id
|
||||
*/
|
||||
private String dictId;
|
||||
|
||||
/**
|
||||
* 字典项文本
|
||||
*/
|
||||
private String itemText;
|
||||
|
||||
/**
|
||||
* 字典项值
|
||||
*/
|
||||
private String itemValue;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer itemSort;
|
||||
}
|
||||
@@ -0,0 +1,108 @@
|
||||
package cn.datax.service.system.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @date 2022-09-11
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@TableName("sys_log")
|
||||
public class LogEntity implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.ASSIGN_ID)
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 所属模块
|
||||
*/
|
||||
private String module;
|
||||
|
||||
/**
|
||||
* 日志标题
|
||||
*/
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* 用户名称
|
||||
*/
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 请求IP
|
||||
*/
|
||||
private String remoteAddr;
|
||||
|
||||
/**
|
||||
* 请求URI
|
||||
*/
|
||||
private String requestUri;
|
||||
|
||||
/**
|
||||
* 方法类名
|
||||
*/
|
||||
private String className;
|
||||
|
||||
/**
|
||||
* 方法名称
|
||||
*/
|
||||
private String methodName;
|
||||
|
||||
/**
|
||||
* 请求参数
|
||||
*/
|
||||
private String params;
|
||||
|
||||
/**
|
||||
* 请求耗时
|
||||
*/
|
||||
private String time;
|
||||
|
||||
/**
|
||||
* 浏览器名称
|
||||
*/
|
||||
private String browser;
|
||||
|
||||
/**
|
||||
* 操作系统
|
||||
*/
|
||||
private String os;
|
||||
|
||||
/**
|
||||
* 错误类型
|
||||
*/
|
||||
private String exCode;
|
||||
|
||||
/**
|
||||
* 错误信息
|
||||
*/
|
||||
private String exMsg;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@TableField(value = "create_time", fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package cn.datax.service.system.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 登录日志信息表
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @date 2022-05-29
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@TableName("sys_login_log")
|
||||
public class LoginLogEntity implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.ASSIGN_ID)
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 操作系统
|
||||
*/
|
||||
private String opOs;
|
||||
|
||||
/**
|
||||
* 浏览器类型
|
||||
*/
|
||||
private String opBrowser;
|
||||
|
||||
/**
|
||||
* 登录IP地址
|
||||
*/
|
||||
private String opIp;
|
||||
|
||||
/**
|
||||
* 登录时间
|
||||
*/
|
||||
private LocalDateTime opDate;
|
||||
|
||||
/**
|
||||
* 登录用户ID
|
||||
*/
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* 登录用户名称
|
||||
*/
|
||||
private String userName;
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
package cn.datax.service.system.api.entity;
|
||||
|
||||
import cn.datax.common.base.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @date 2022-09-11
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
@TableName("sys_menu")
|
||||
public class MenuEntity extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 父资源ID
|
||||
*/
|
||||
private String parentId;
|
||||
|
||||
/**
|
||||
* 资源名称
|
||||
*/
|
||||
private String menuName;
|
||||
|
||||
/**
|
||||
* 对应路由地址path
|
||||
*/
|
||||
private String menuPath;
|
||||
|
||||
/**
|
||||
* 对应路由组件component
|
||||
*/
|
||||
private String menuComponent;
|
||||
|
||||
/**
|
||||
* 对应路由默认跳转地址redirect
|
||||
*/
|
||||
private String menuRedirect;
|
||||
|
||||
/**
|
||||
* 权限标识
|
||||
*/
|
||||
private String menuPerms;
|
||||
|
||||
/**
|
||||
* 资源图标
|
||||
*/
|
||||
private String menuIcon;
|
||||
|
||||
/**
|
||||
* 资源类型(0模块,1菜单,2按钮)
|
||||
*/
|
||||
private String menuType;
|
||||
|
||||
/**
|
||||
* 资源编码
|
||||
*/
|
||||
private String menuCode;
|
||||
|
||||
/**
|
||||
* 资源隐藏(0否,1是)
|
||||
*/
|
||||
private String menuHidden;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer menuSort;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package cn.datax.service.system.api.entity;
|
||||
|
||||
import cn.datax.common.base.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @date 2022-09-11
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
@TableName("sys_post")
|
||||
public class PostEntity extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 岗位名称
|
||||
*/
|
||||
private String postName;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package cn.datax.service.system.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 角色和部门关联表
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @date 2022-11-22
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@TableName("sys_role_dept")
|
||||
public class RoleDeptEntity implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.ASSIGN_ID)
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 角色ID
|
||||
*/
|
||||
private String roleId;
|
||||
|
||||
/**
|
||||
* 部门ID
|
||||
*/
|
||||
private String deptId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package cn.datax.service.system.api.entity;
|
||||
|
||||
import cn.datax.common.base.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @date 2022-09-11
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
@TableName(value = "sys_role", autoResultMap = true)
|
||||
public class RoleEntity extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 角色名称
|
||||
*/
|
||||
private String roleName;
|
||||
|
||||
/**
|
||||
* 角色编码
|
||||
*/
|
||||
private String roleCode;
|
||||
|
||||
/**
|
||||
* 数据范围(1:全部数据权限 2:自定义数据权限 3:本部门数据权限 4:本部门及以下数据权限 5:仅本人数据权限)
|
||||
*/
|
||||
private String dataScope;
|
||||
|
||||
@TableField(exist = false)
|
||||
private List<MenuEntity> menus;
|
||||
|
||||
@TableField(exist = false)
|
||||
private List<DeptEntity> depts;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package cn.datax.service.system.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @date 2022-09-11
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@TableName("sys_role_menu")
|
||||
public class RoleMenuEntity implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.ASSIGN_ID)
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 角色ID
|
||||
*/
|
||||
private String roleId;
|
||||
|
||||
/**
|
||||
* 菜单ID
|
||||
*/
|
||||
private String menuId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package cn.datax.service.system.api.entity;
|
||||
|
||||
import cn.datax.common.base.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @date 2022-09-11
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
@TableName(value = "sys_user", autoResultMap = true)
|
||||
public class UserEntity extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 用户名称
|
||||
*/
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* 用户昵称
|
||||
*/
|
||||
private String nickname;
|
||||
|
||||
/**
|
||||
* 用户密码
|
||||
*/
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 电子邮箱
|
||||
*/
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 手机号码
|
||||
*/
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 出生日期
|
||||
*/
|
||||
private LocalDate birthday;
|
||||
|
||||
/**
|
||||
* 部门
|
||||
*/
|
||||
private String deptId;
|
||||
|
||||
@TableField(exist = false)
|
||||
private DeptEntity dept;
|
||||
|
||||
@TableField(exist = false)
|
||||
private List<RoleEntity> roles;
|
||||
|
||||
@TableField(exist = false)
|
||||
private List<PostEntity> posts;
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package cn.datax.service.system.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @date 2022-09-11
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@TableName("sys_user_post")
|
||||
public class UserPostEntity implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.ASSIGN_ID)
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* 岗位ID
|
||||
*/
|
||||
private String postId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package cn.datax.service.system.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @date 2022-09-11
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@TableName("sys_user_role")
|
||||
public class UserRoleEntity implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.ASSIGN_ID)
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* 角色ID
|
||||
*/
|
||||
private String roleId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package cn.datax.service.system.api.feign;
|
||||
|
||||
import cn.datax.service.system.api.dto.LogDto;
|
||||
import cn.datax.service.system.api.feign.factory.LogServiceFeignFallbackFactory;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
@FeignClient(contextId = "logServiceFeign", value = "datax-service-system", fallbackFactory = LogServiceFeignFallbackFactory.class)
|
||||
public interface LogServiceFeign {
|
||||
|
||||
@PostMapping("/inner/logs")
|
||||
void saveLog(@RequestBody LogDto logDto);
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package cn.datax.service.system.api.feign;
|
||||
|
||||
import cn.datax.service.system.api.feign.factory.UserServiceFeignFallbackFactory;
|
||||
import cn.datax.service.system.api.vo.UserInfo;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
|
||||
@FeignClient(contextId = "userServiceFeign", value = "datax-service-system", fallbackFactory = UserServiceFeignFallbackFactory.class)
|
||||
public interface UserServiceFeign {
|
||||
|
||||
@GetMapping("/login/username/{username}")
|
||||
UserInfo loginByUsername(@PathVariable("username") String username);
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package cn.datax.service.system.api.feign.factory;
|
||||
|
||||
import cn.datax.service.system.api.feign.LogServiceFeign;
|
||||
import cn.datax.service.system.api.feign.fallback.LogServiceFeignFallbackImpl;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class LogServiceFeignFallbackFactory implements FallbackFactory<LogServiceFeign> {
|
||||
|
||||
@Override
|
||||
public LogServiceFeign create(Throwable throwable) {
|
||||
LogServiceFeignFallbackImpl logServiceFeignFallback = new LogServiceFeignFallbackImpl();
|
||||
logServiceFeignFallback.setCause(throwable);
|
||||
return logServiceFeignFallback;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package cn.datax.service.system.api.feign.factory;
|
||||
|
||||
import cn.datax.service.system.api.feign.UserServiceFeign;
|
||||
import cn.datax.service.system.api.feign.fallback.UserServiceFeignFallbackImpl;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class UserServiceFeignFallbackFactory implements FallbackFactory<UserServiceFeign> {
|
||||
|
||||
@Override
|
||||
public UserServiceFeign create(Throwable throwable) {
|
||||
UserServiceFeignFallbackImpl userServiceFeignFallback = new UserServiceFeignFallbackImpl();
|
||||
userServiceFeignFallback.setCause(throwable);
|
||||
return userServiceFeignFallback;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package cn.datax.service.system.api.feign.fallback;
|
||||
|
||||
import cn.datax.service.system.api.dto.LogDto;
|
||||
import cn.datax.service.system.api.feign.LogServiceFeign;
|
||||
import lombok.Setter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
public class LogServiceFeignFallbackImpl implements LogServiceFeign {
|
||||
|
||||
@Setter
|
||||
private Throwable cause;
|
||||
|
||||
@Override
|
||||
public void saveLog(LogDto logDto) {
|
||||
log.error("feign 调用出错", cause);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package cn.datax.service.system.api.feign.fallback;
|
||||
|
||||
import cn.datax.service.system.api.feign.UserServiceFeign;
|
||||
import cn.datax.service.system.api.vo.UserInfo;
|
||||
import lombok.Setter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
public class UserServiceFeignFallbackImpl implements UserServiceFeign {
|
||||
|
||||
@Setter
|
||||
private Throwable cause;
|
||||
|
||||
@Override
|
||||
public UserInfo loginByUsername(String username) {
|
||||
log.error("feign 调用{}出错", username, cause);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package cn.datax.service.system.api.query;
|
||||
|
||||
import cn.datax.common.base.BaseQueryParams;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 系统参数配置信息表 查询实体
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @date 2022-05-19
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class ConfigQuery extends BaseQueryParams {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package cn.datax.service.system.api.query;
|
||||
|
||||
import cn.datax.common.base.BaseQueryParams;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 字典项信息表 查询实体
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @date 2022-04-17
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class DictItemQuery extends BaseQueryParams {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 字典id
|
||||
*/
|
||||
private String dictId;
|
||||
private String itemText;
|
||||
private String itemValue;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package cn.datax.service.system.api.query;
|
||||
|
||||
import cn.datax.common.base.BaseQueryParams;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 字典编码信息表 查询实体
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @date 2022-04-17
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class DictQuery extends BaseQueryParams {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
private String dictName;
|
||||
private String dictCode;
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package cn.datax.service.system.api.query;
|
||||
|
||||
import cn.datax.common.base.BaseQueryParams;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class LogQuery extends BaseQueryParams {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 日志标题
|
||||
*/
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 所属模块
|
||||
*/
|
||||
private String module;
|
||||
|
||||
/**
|
||||
* 用户名称
|
||||
*/
|
||||
private String userName;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package cn.datax.service.system.api.query;
|
||||
|
||||
import cn.datax.common.base.BaseQueryParams;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 登录日志信息表 查询实体
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @date 2022-05-29
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class LoginLogQuery extends BaseQueryParams {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 登录用户名称
|
||||
*/
|
||||
private String userName;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package cn.datax.service.system.api.query;
|
||||
|
||||
import cn.datax.common.base.BaseQueryParams;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class PostQuery extends BaseQueryParams {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 岗位名称
|
||||
*/
|
||||
private String postName;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package cn.datax.service.system.api.query;
|
||||
|
||||
import cn.datax.common.base.BaseQueryParams;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class RoleQuery extends BaseQueryParams {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 角色名称
|
||||
*/
|
||||
private String roleName;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package cn.datax.service.system.api.query;
|
||||
|
||||
import cn.datax.common.base.BaseQueryParams;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class UserQuery extends BaseQueryParams {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 用户名称
|
||||
*/
|
||||
private String username;
|
||||
/**
|
||||
* 用户昵称
|
||||
*/
|
||||
private String nickname;
|
||||
/**
|
||||
* 部门ID
|
||||
*/
|
||||
private String deptId;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package cn.datax.service.system.api.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 系统参数配置信息表 实体VO
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @date 2022-05-19
|
||||
*/
|
||||
@Data
|
||||
public class ConfigVo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
private String id;
|
||||
private String status;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private LocalDateTime createTime;
|
||||
private String remark;
|
||||
private String configName;
|
||||
private String configKey;
|
||||
private String configValue;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package cn.datax.service.system.api.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class DeptVo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
private String id;
|
||||
private String status;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private LocalDateTime createTime;
|
||||
private String remark;
|
||||
private String parentId;
|
||||
private String deptName;
|
||||
private String deptNo;
|
||||
private List<DictItemVo> items;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package cn.datax.service.system.api.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 字典项信息表 实体VO
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @date 2022-04-17
|
||||
*/
|
||||
@Data
|
||||
public class DictItemVo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
private String id;
|
||||
private String status;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private LocalDateTime createTime;
|
||||
private String remark;
|
||||
private String dictId;
|
||||
private String itemText;
|
||||
private String itemValue;
|
||||
private Integer itemSort;
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package cn.datax.service.system.api.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 字典编码信息表 实体VO
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @date 2022-04-17
|
||||
*/
|
||||
@Data
|
||||
public class DictVo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
private String id;
|
||||
private String status;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private LocalDateTime createTime;
|
||||
private String remark;
|
||||
private String dictName;
|
||||
private String dictCode;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package cn.datax.service.system.api.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
public class LogVo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
private String id;
|
||||
private String module;
|
||||
private String title;
|
||||
private String userId;
|
||||
private String userName;
|
||||
private String remoteAddr;
|
||||
private String requestUri;
|
||||
private String className;
|
||||
private String methodName;
|
||||
private String params;
|
||||
private String time;
|
||||
private String browser;
|
||||
private String os;
|
||||
private String exCode;
|
||||
private String exMsg;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private LocalDateTime createTime;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package cn.datax.service.system.api.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 登录日志信息表 实体VO
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @date 2022-05-29
|
||||
*/
|
||||
@Data
|
||||
public class LoginLogVo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
private String id;
|
||||
private String opOs;
|
||||
private String opBrowser;
|
||||
private String opIp;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private LocalDateTime opDate;
|
||||
private String userId;
|
||||
private String userName;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package cn.datax.service.system.api.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
public class MenuVo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
private String id;
|
||||
private String status;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private LocalDateTime createTime;
|
||||
private String remark;
|
||||
private String parentId;
|
||||
private String menuName;
|
||||
private String menuPath;
|
||||
private String menuComponent;
|
||||
private String menuRedirect;
|
||||
private String menuPerms;
|
||||
private String menuIcon;
|
||||
private String menuType;
|
||||
private String menuCode;
|
||||
private String menuHidden;
|
||||
private Integer menuSort;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package cn.datax.service.system.api.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
public class PostVo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
private String id;
|
||||
private String status;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private LocalDateTime createTime;
|
||||
private String remark;
|
||||
private String postName;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package cn.datax.service.system.api.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class RoleVo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
private String id;
|
||||
private String status;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private LocalDateTime createTime;
|
||||
private String remark;
|
||||
private String roleName;
|
||||
private String roleCode;
|
||||
private String dataScope;
|
||||
private List<MenuVo> menus;
|
||||
private List<DeptVo> depts;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package cn.datax.service.system.api.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class UserInfo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 用户基本信息
|
||||
*/
|
||||
private UserVo userVo;
|
||||
/**
|
||||
* 权限标识集合
|
||||
*/
|
||||
private String[] perms;
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package cn.datax.service.system.api.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class UserVo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
private String id;
|
||||
private String status;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private LocalDateTime createTime;
|
||||
private String remark;
|
||||
private String username;
|
||||
private String nickname;
|
||||
private String password;
|
||||
private String email;
|
||||
private String phone;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
private LocalDate birthday;
|
||||
private String deptId;
|
||||
private DeptVo dept;
|
||||
private List<PostVo> posts;
|
||||
private List<RoleVo> roles;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package cn.datax.service.system.api.vo.route;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class MetaVo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 路由标题
|
||||
*/
|
||||
private String title;
|
||||
/**
|
||||
* 路由图标
|
||||
*/
|
||||
private String icon;
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package cn.datax.service.system.api.vo.route;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class RouteVo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 请求url
|
||||
*/
|
||||
private String path;
|
||||
/**
|
||||
* 对应组件
|
||||
*/
|
||||
private String component;
|
||||
/**
|
||||
* 父级菜单重定向地址
|
||||
*/
|
||||
private String redirect;
|
||||
/**
|
||||
* 路由名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 路由附带内容
|
||||
*/
|
||||
private MetaVo meta;
|
||||
/**
|
||||
* 隐藏
|
||||
*/
|
||||
private Boolean hidden;
|
||||
/**
|
||||
* 子路由
|
||||
*/
|
||||
private List<RouteVo> children;
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
|
||||
cn.datax.service.system.api.feign.factory.LogServiceFeignFallbackFactory,\
|
||||
cn.datax.service.system.api.feign.factory.UserServiceFeignFallbackFactory,\
|
||||
cn.datax.service.system.api.feign.fallback.LogServiceFeignFallbackImpl,\
|
||||
cn.datax.service.system.api.feign.fallback.UserServiceFeignFallbackImpl
|
||||
@@ -0,0 +1,88 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>data-system-service-parent</artifactId>
|
||||
<groupId>com.platform</groupId>
|
||||
<version>0.4.x</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<version>0.4.x</version>
|
||||
<artifactId>data-system-service</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<!--web 模块-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>spring-boot-starter-tomcat</artifactId>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-undertow</artifactId>
|
||||
</dependency>
|
||||
<!--配置中心客户端 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-config</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mapstruct</groupId>
|
||||
<artifactId>mapstruct</artifactId>
|
||||
<version>${mapstruct.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mapstruct</groupId>
|
||||
<artifactId>mapstruct-processor</artifactId>
|
||||
<version>${mapstruct.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>eu.bitwalker</groupId>
|
||||
<artifactId>UserAgentUtils</artifactId>
|
||||
<version>${bitwalker.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.platform</groupId>
|
||||
<artifactId>common-mybatis</artifactId>
|
||||
<version>0.4.x</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.platform</groupId>
|
||||
<artifactId>common-redis</artifactId>
|
||||
<version>0.4.x</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.platform</groupId>
|
||||
<artifactId>common-security</artifactId>
|
||||
<version>0.4.x</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.platform</groupId>
|
||||
<artifactId>common-log</artifactId>
|
||||
<version>0.4.x</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.platform</groupId>
|
||||
<artifactId>data-system-service-api</artifactId>
|
||||
<version>0.4.x</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@@ -0,0 +1,15 @@
|
||||
package cn.datax.service.system;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.cloud.client.SpringCloudApplication;
|
||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
|
||||
@EnableFeignClients(basePackages = {"cn.datax.service.system.api.feign"})
|
||||
@SpringCloudApplication
|
||||
public class DataxSystemApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(DataxSystemApplication.class);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package cn.datax.service.system.async;
|
||||
|
||||
import cn.datax.service.system.api.dto.LogDto;
|
||||
import cn.datax.service.system.service.LogService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 异步处理 分布式获取请求头有问题
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class AsyncTask {
|
||||
|
||||
@Autowired
|
||||
private LogService logService;
|
||||
|
||||
@Async("taskExecutor")
|
||||
public void doTask(LogDto logDto) {
|
||||
logService.saveLog(logDto);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package cn.datax.service.system.config;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.scheduling.annotation.EnableAsync;
|
||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
|
||||
@EnableAsync
|
||||
@Configuration
|
||||
public class AsyncConfig {
|
||||
|
||||
@Bean("taskExecutor")
|
||||
public Executor taskExecutor() {
|
||||
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
|
||||
executor.setCorePoolSize(5);
|
||||
executor.setMaxPoolSize(20);
|
||||
executor.setQueueCapacity(100);
|
||||
executor.setKeepAliveSeconds(30);
|
||||
executor.setThreadNamePrefix("datax-async-service-");
|
||||
executor.setWaitForTasksToCompleteOnShutdown(true);
|
||||
executor.setAwaitTerminationSeconds(60);
|
||||
executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
|
||||
executor.initialize();
|
||||
return executor;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package cn.datax.service.system.config;
|
||||
|
||||
import cn.datax.common.core.DataConstant;
|
||||
import cn.datax.common.core.RedisConstant;
|
||||
import cn.datax.common.redis.service.RedisService;
|
||||
import cn.datax.service.system.api.entity.ConfigEntity;
|
||||
import cn.datax.service.system.api.entity.DictEntity;
|
||||
import cn.datax.service.system.dao.ConfigDao;
|
||||
import cn.datax.service.system.dao.DictDao;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.ApplicationArguments;
|
||||
import org.springframework.boot.ApplicationRunner;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.springframework.core.env.Environment;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class StartedUpRunner implements ApplicationRunner {
|
||||
|
||||
private final ConfigurableApplicationContext context;
|
||||
private final Environment environment;
|
||||
|
||||
@Autowired
|
||||
private RedisService redisService;
|
||||
@Autowired
|
||||
private DictDao dictDao;
|
||||
@Autowired
|
||||
private ConfigDao configDao;
|
||||
|
||||
@Override
|
||||
public void run(ApplicationArguments args) {
|
||||
if (context.isActive()) {
|
||||
String banner = "-----------------------------------------\n" +
|
||||
"服务启动成功,时间:" + DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss").format(LocalDateTime.now()) + "\n" +
|
||||
"服务名称:" + environment.getProperty("spring.application.name") + "\n" +
|
||||
"端口号:" + environment.getProperty("server.port") + "\n" +
|
||||
"-----------------------------------------";
|
||||
System.out.println(banner);
|
||||
|
||||
// 项目启动时,初始化缓存
|
||||
String dictKey = RedisConstant.SYSTEM_DICT_KEY;
|
||||
Boolean hasDictKey = redisService.hasKey(dictKey);
|
||||
if (!hasDictKey) {
|
||||
List<DictEntity> dictEntityList = dictDao.queryDictList(DataConstant.EnableState.ENABLE.getKey());
|
||||
redisService.set(dictKey, dictEntityList);
|
||||
}
|
||||
String configKey = RedisConstant.SYSTEM_CONFIG_KEY;
|
||||
Boolean hasConfigKey = redisService.hasKey(configKey);
|
||||
if (!hasConfigKey) {
|
||||
List<ConfigEntity> configEntityList = configDao.queryConfigList(DataConstant.EnableState.ENABLE.getKey());
|
||||
Map<String, Object> map = configEntityList.stream().collect(Collectors.toMap(ConfigEntity::getConfigKey, ConfigEntity::getConfigValue));
|
||||
redisService.hmset(configKey, map);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
package cn.datax.service.system.config;
|
||||
|
||||
import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Import;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import springfox.bean.validators.configuration.BeanValidatorPluginsConfiguration;
|
||||
import springfox.documentation.builders.*;
|
||||
import springfox.documentation.schema.ModelRef;
|
||||
import springfox.documentation.service.*;
|
||||
import springfox.documentation.spi.DocumentationType;
|
||||
import springfox.documentation.spring.web.plugins.Docket;
|
||||
import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Configuration
|
||||
@ConditionalOnProperty(prefix = "swagger", name = "enable", havingValue = "true")
|
||||
@EnableConfigurationProperties(SwaggerProperties.class)
|
||||
@EnableSwagger2
|
||||
@EnableKnife4j
|
||||
@Import(BeanValidatorPluginsConfiguration.class)
|
||||
public class SwaggerConfig {
|
||||
|
||||
@Autowired
|
||||
private SwaggerProperties swaggerProperties;
|
||||
|
||||
/**
|
||||
* 创建API应用
|
||||
* apiInfo() 增加API相关信息
|
||||
* 通过select()函数返回一个ApiSelectorBuilder实例,用来控制哪些接口暴露给Swagger来展现,
|
||||
* 本例采用指定扫描的包路径来定义指定要建立API的目录。
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Bean
|
||||
public Docket createRestApi(){
|
||||
//版本类型是swagger2
|
||||
return new Docket(DocumentationType.SWAGGER_2)
|
||||
//通过调用自定义方法apiInfo,获得文档的主要信息
|
||||
.apiInfo(apiInfo())
|
||||
//设置全局参数
|
||||
.globalOperationParameters(globalParamBuilder())
|
||||
//设置全局响应参数
|
||||
.globalResponseMessage(RequestMethod.GET,responseBuilder())
|
||||
.globalResponseMessage(RequestMethod.POST,responseBuilder())
|
||||
.globalResponseMessage(RequestMethod.PUT,responseBuilder())
|
||||
.globalResponseMessage(RequestMethod.DELETE,responseBuilder())
|
||||
.select()
|
||||
//扫描该包下面的API注解
|
||||
.apis(RequestHandlerSelectors.basePackage(swaggerProperties.getBasePackage()))
|
||||
.paths(PathSelectors.any())
|
||||
.build()
|
||||
//设置安全认证
|
||||
.securitySchemes(security());
|
||||
}
|
||||
/**
|
||||
* 创建该API的基本信息(这些基本信息会展现在文档页面中)
|
||||
* 访问地址:http://项目实际地址/swagger-ui.html
|
||||
* @return
|
||||
*/
|
||||
private ApiInfo apiInfo() {
|
||||
return new ApiInfoBuilder()
|
||||
.title(swaggerProperties.getTitle())
|
||||
.description(swaggerProperties.getDescription())
|
||||
.termsOfServiceUrl(swaggerProperties.getTermsOfServiceUrl())
|
||||
.version(swaggerProperties.getVersion())
|
||||
.contact(new Contact(swaggerProperties.getContact().getName(), swaggerProperties.getContact().getUrl(), swaggerProperties.getContact().getEmail()))
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 安全认证参数
|
||||
* @return
|
||||
*/
|
||||
private List<ApiKey> security() {
|
||||
List<ApiKey> apiKeys = new ArrayList<>();
|
||||
apiKeys.add(new ApiKey("Authorization", "Authorization", "header"));
|
||||
return apiKeys;
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建全局参数列表
|
||||
* @return
|
||||
*/
|
||||
private List<Parameter> globalParamBuilder(){
|
||||
List<Parameter> pars = new ArrayList<>();
|
||||
pars.add(parameterBuilder("Authorization","令牌","string","header",false).build());
|
||||
return pars;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建参数
|
||||
* @return
|
||||
*/
|
||||
private ParameterBuilder parameterBuilder(String name, String desc, String type, String parameterType, boolean required) {
|
||||
ParameterBuilder tokenPar = new ParameterBuilder();
|
||||
tokenPar.name(name).description(desc).modelRef(new ModelRef(type)).parameterType(parameterType).required(required).build();
|
||||
return tokenPar;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建全局响应值
|
||||
* @return
|
||||
*/
|
||||
private List<ResponseMessage> responseBuilder() {
|
||||
List<ResponseMessage> responseMessageList = new ArrayList<>();
|
||||
responseMessageList.add(new ResponseMessageBuilder().code(200).message("响应成功").build());
|
||||
responseMessageList.add(new ResponseMessageBuilder().code(500).message("服务器内部错误").build());
|
||||
return responseMessageList;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
package cn.datax.service.system.config;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
|
||||
@ConfigurationProperties(ignoreUnknownFields = false, prefix = "swagger")
|
||||
public class SwaggerProperties {
|
||||
|
||||
private Boolean enable;
|
||||
private String title;
|
||||
private String description;
|
||||
private String version;
|
||||
private String termsOfServiceUrl;
|
||||
private String basePackage;
|
||||
private Contact contact;
|
||||
|
||||
public Boolean getEnable() {
|
||||
return enable;
|
||||
}
|
||||
|
||||
public void setEnable(Boolean enable) {
|
||||
this.enable = enable;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setVersion(String version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public String getTermsOfServiceUrl() {
|
||||
return termsOfServiceUrl;
|
||||
}
|
||||
|
||||
public void setTermsOfServiceUrl(String termsOfServiceUrl) {
|
||||
this.termsOfServiceUrl = termsOfServiceUrl;
|
||||
}
|
||||
|
||||
public String getBasePackage() {
|
||||
return basePackage;
|
||||
}
|
||||
|
||||
public void setBasePackage(String basePackage) {
|
||||
this.basePackage = basePackage;
|
||||
}
|
||||
|
||||
public Contact getContact() {
|
||||
return contact;
|
||||
}
|
||||
|
||||
public void setContact(Contact contact) {
|
||||
this.contact = contact;
|
||||
}
|
||||
|
||||
public static class Contact {
|
||||
private String name;
|
||||
private String url;
|
||||
private String email;
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
public void setUrl(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
|
||||
public void setEmail(String email) {
|
||||
this.email = email;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package cn.datax.service.system.config;
|
||||
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
|
||||
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
|
||||
|
||||
@Configuration
|
||||
@EnableWebSecurity(debug = false)
|
||||
public class WebSecurityConfiguration extends WebSecurityConfigurerAdapter {
|
||||
|
||||
@Override
|
||||
protected void configure(HttpSecurity http) throws Exception {
|
||||
http.csrf().disable().authorizeRequests().anyRequest().permitAll().and().logout().permitAll();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,151 @@
|
||||
package cn.datax.service.system.controller;
|
||||
|
||||
import cn.datax.common.core.JsonPage;
|
||||
import cn.datax.common.core.R;
|
||||
import cn.datax.common.validate.ValidationGroups;
|
||||
import cn.datax.service.system.api.dto.ConfigDto;
|
||||
import cn.datax.service.system.api.entity.ConfigEntity;
|
||||
import cn.datax.service.system.api.vo.ConfigVo;
|
||||
import cn.datax.service.system.api.query.ConfigQuery;
|
||||
import cn.datax.service.system.mapstruct.ConfigMapper;
|
||||
import cn.datax.service.system.service.ConfigService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import cn.datax.common.base.BaseController;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 系统参数配置信息表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @date 2022-05-19
|
||||
*/
|
||||
@Api(tags = {"系统参数配置信息表"})
|
||||
@RestController
|
||||
@RequestMapping("/configs")
|
||||
public class ConfigController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private ConfigService configService;
|
||||
|
||||
@Autowired
|
||||
private ConfigMapper configMapper;
|
||||
|
||||
/**
|
||||
* 通过ID查询信息
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "获取详细信息", notes = "根据url的id来获取详细信息")
|
||||
@ApiImplicitParam(name = "id", value = "ID", required = true, dataType = "String", paramType = "path")
|
||||
@GetMapping("/{id}")
|
||||
public R getConfigById(@PathVariable String id) {
|
||||
ConfigEntity configEntity = configService.getConfigById(id);
|
||||
return R.ok().setData(configMapper.toVO(configEntity));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询信息
|
||||
*
|
||||
* @param configQuery
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询", notes = "")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "configQuery", value = "查询实体configQuery", required = true, dataTypeClass = ConfigQuery.class)
|
||||
})
|
||||
@GetMapping("/page")
|
||||
public R getConfigPage(ConfigQuery configQuery) {
|
||||
QueryWrapper<ConfigEntity> queryWrapper = new QueryWrapper<>();
|
||||
IPage<ConfigEntity> page = configService.page(new Page<>(configQuery.getPageNum(), configQuery.getPageSize()), queryWrapper);
|
||||
List<ConfigVo> collect = page.getRecords().stream().map(configMapper::toVO).collect(Collectors.toList());
|
||||
JsonPage<ConfigVo> jsonPage = new JsonPage<>(page.getCurrent(), page.getSize(), page.getTotal(), collect);
|
||||
return R.ok().setData(jsonPage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
* @param config
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "添加信息", notes = "根据config对象添加信息")
|
||||
@ApiImplicitParam(name = "config", value = "详细实体config", required = true, dataType = "ConfigDto")
|
||||
@PostMapping()
|
||||
public R saveConfig(@RequestBody @Validated({ValidationGroups.Insert.class}) ConfigDto config) {
|
||||
ConfigEntity configEntity = configService.saveConfig(config);
|
||||
return R.ok().setData(configMapper.toVO(configEntity));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
* @param config
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "修改信息", notes = "根据url的id来指定修改对象,并根据传过来的信息来修改详细信息")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "ID", required = true, dataType = "String", paramType = "path"),
|
||||
@ApiImplicitParam(name = "config", value = "详细实体config", required = true, dataType = "ConfigDto")
|
||||
})
|
||||
@PutMapping("/{id}")
|
||||
public R updateConfig(@PathVariable String id, @RequestBody @Validated({ValidationGroups.Update.class}) ConfigDto config) {
|
||||
ConfigEntity configEntity = configService.updateConfig(config);
|
||||
return R.ok().setData(configMapper.toVO(configEntity));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "删除", notes = "根据url的id来指定删除对象")
|
||||
@ApiImplicitParam(name = "id", value = "ID", required = true, dataType = "String", paramType = "path")
|
||||
@DeleteMapping("/{id}")
|
||||
public R deleteConfigById(@PathVariable String id) {
|
||||
configService.deleteConfigById(id);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "批量删除", notes = "根据url的ids来批量删除对象")
|
||||
@ApiImplicitParam(name = "ids", value = "ID集合", required = true, dataType = "List", paramType = "path")
|
||||
@DeleteMapping("/batch/{ids}")
|
||||
public R deleteConfigBatch(@PathVariable List<String> ids) {
|
||||
configService.deleteConfigBatch(ids);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取参数
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/key/{key}")
|
||||
public R getConfig(@PathVariable String key) {
|
||||
String val = configService.getConfig(key);
|
||||
return R.ok().setData(val);
|
||||
}
|
||||
|
||||
/**
|
||||
* 刷新参数缓存
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/refresh")
|
||||
public R refreshConfig() {
|
||||
configService.refreshConfig();
|
||||
return R.ok();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
package cn.datax.service.system.controller;
|
||||
|
||||
import cn.datax.common.core.R;
|
||||
import cn.datax.common.validate.ValidationGroups;
|
||||
import cn.datax.service.system.api.dto.DeptDto;
|
||||
import cn.datax.service.system.api.entity.DeptEntity;
|
||||
import cn.datax.service.system.api.vo.DeptVo;
|
||||
import cn.datax.service.system.mapstruct.DeptMapper;
|
||||
import cn.datax.service.system.service.DeptService;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import cn.datax.common.base.BaseController;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @date 2022-09-04
|
||||
*/
|
||||
@Api(value="系统管理接口", tags = {"系统管理"})
|
||||
@RestController
|
||||
@RequestMapping("/depts")
|
||||
public class DeptController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private DeptService deptService;
|
||||
|
||||
@Autowired
|
||||
private DeptMapper deptMapper;
|
||||
|
||||
@ApiOperation(value = "获取部门详细信息", notes = "根据url的id来获取部门详细信息")
|
||||
@ApiImplicitParam(name = "id", value = "部门ID", required = true, dataType = "String", paramType = "path")
|
||||
@GetMapping("/{id}")
|
||||
public R getDeptById(@PathVariable String id) {
|
||||
DeptEntity deptEntity = deptService.getById(id);
|
||||
return R.ok().setData(deptMapper.toVO(deptEntity));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取部门列表", notes = "")
|
||||
@GetMapping("/list")
|
||||
public R getDeptList() {
|
||||
List<DeptEntity> list = deptService.list(Wrappers.emptyWrapper());
|
||||
List<DeptVo> collect = list.stream().map(deptMapper::toVO).collect(Collectors.toList());
|
||||
return R.ok().setData(collect);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "创建部门", notes = "根据dept对象创建部门")
|
||||
@ApiImplicitParam(name = "dept", value = "部门详细实体dept", required = true, dataType = "DeptDto")
|
||||
@PostMapping()
|
||||
public R saveDept(@RequestBody @Validated({ValidationGroups.Insert.class}) DeptDto dept) {
|
||||
DeptEntity deptEntity = deptService.saveDept(dept);
|
||||
return R.ok().setData(deptMapper.toVO(deptEntity));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "更新部门详细信息", notes = "根据url的id来指定更新对象,并根据传过来的dept信息来更新部门详细信息")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "部门ID", required = true, dataType = "String", paramType = "path"),
|
||||
@ApiImplicitParam(name = "dept", value = "部门详细实体dept", required = true, dataType = "DeptDto")
|
||||
})
|
||||
@PutMapping("/{id}")
|
||||
public R updateDept(@PathVariable String id, @RequestBody @Validated({ValidationGroups.Update.class}) DeptDto dept) {
|
||||
DeptEntity deptEntity = deptService.updateDept(dept);
|
||||
return R.ok().setData(deptMapper.toVO(deptEntity));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除部门", notes = "根据url的id来指定删除对象")
|
||||
@ApiImplicitParam(name = "id", value = "部门ID", required = true, dataType = "String", paramType = "path")
|
||||
@DeleteMapping("/{id}")
|
||||
public R deleteDept(@PathVariable String id) {
|
||||
deptService.deleteDeptById(id);
|
||||
return R.ok();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,161 @@
|
||||
package cn.datax.service.system.controller;
|
||||
|
||||
import cn.datax.common.core.JsonPage;
|
||||
import cn.datax.common.core.R;
|
||||
import cn.datax.common.validate.ValidationGroups;
|
||||
import cn.datax.service.system.api.dto.DictDto;
|
||||
import cn.datax.service.system.api.entity.DictEntity;
|
||||
import cn.datax.service.system.api.entity.DictItemEntity;
|
||||
import cn.datax.service.system.api.vo.DictItemVo;
|
||||
import cn.datax.service.system.api.vo.DictVo;
|
||||
import cn.datax.service.system.api.query.DictQuery;
|
||||
import cn.datax.service.system.mapstruct.DictItemMapper;
|
||||
import cn.datax.service.system.mapstruct.DictMapper;
|
||||
import cn.datax.service.system.service.DictService;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import cn.datax.common.base.BaseController;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 字典编码信息表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @date 2022-04-17
|
||||
*/
|
||||
@Api(tags = {"字典编码信息表"})
|
||||
@RestController
|
||||
@RequestMapping("/dicts")
|
||||
public class DictController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private DictService dictService;
|
||||
|
||||
@Autowired
|
||||
private DictMapper dictMapper;
|
||||
|
||||
@Autowired
|
||||
private DictItemMapper dictItemMapper;
|
||||
|
||||
/**
|
||||
* 通过ID查询信息
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "获取详细信息", notes = "根据url的id来获取详细信息")
|
||||
@ApiImplicitParam(name = "id", value = "ID", required = true, dataType = "String", paramType = "path")
|
||||
@GetMapping("/{id}")
|
||||
public R getDictById(@PathVariable String id) {
|
||||
DictEntity dictEntity = dictService.getById(id);
|
||||
return R.ok().setData(dictMapper.toVO(dictEntity));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询信息
|
||||
*
|
||||
* @param dictQuery
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询", notes = "")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "dictQuery", value = "查询实体dictQuery", required = true, dataTypeClass = DictQuery.class)
|
||||
})
|
||||
@GetMapping("/page")
|
||||
public R getDictPage(DictQuery dictQuery) {
|
||||
QueryWrapper<DictEntity> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.like(StrUtil.isNotBlank(dictQuery.getDictName()), "dict_name", dictQuery.getDictName());
|
||||
queryWrapper.like(StrUtil.isNotBlank(dictQuery.getDictCode()), "dict_code", dictQuery.getDictCode());
|
||||
IPage<DictEntity> page = dictService.page(new Page<>(dictQuery.getPageNum(), dictQuery.getPageSize()), queryWrapper);
|
||||
List<DictVo> collect = page.getRecords().stream().map(dictMapper::toVO).collect(Collectors.toList());
|
||||
JsonPage<DictVo> jsonPage = new JsonPage<>(page.getCurrent(), page.getSize(), page.getTotal(), collect);
|
||||
return R.ok().setData(jsonPage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
* @param dict
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "添加信息", notes = "根据dict对象添加信息")
|
||||
@ApiImplicitParam(name = "dict", value = "详细实体dict", required = true, dataType = "DictDto")
|
||||
@PostMapping()
|
||||
public R saveDict(@RequestBody @Validated({ValidationGroups.Insert.class}) DictDto dict) {
|
||||
DictEntity dictEntity = dictService.saveDict(dict);
|
||||
return R.ok().setData(dictMapper.toVO(dictEntity));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
* @param dict
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "修改信息", notes = "根据url的id来指定修改对象,并根据传过来的信息来修改详细信息")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "ID", required = true, dataType = "String", paramType = "path"),
|
||||
@ApiImplicitParam(name = "dict", value = "详细实体dict", required = true, dataType = "DictDto")
|
||||
})
|
||||
@PutMapping("/{id}")
|
||||
public R updateDict(@PathVariable String id, @RequestBody @Validated({ValidationGroups.Update.class}) DictDto dict) {
|
||||
DictEntity dictEntity = dictService.updateDict(dict);
|
||||
return R.ok().setData(dictMapper.toVO(dictEntity));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "删除", notes = "根据url的id来指定删除对象")
|
||||
@ApiImplicitParam(name = "id", value = "ID", required = true, dataType = "String", paramType = "path")
|
||||
@DeleteMapping("/{id}")
|
||||
public R deleteDictById(@PathVariable String id) {
|
||||
dictService.deleteDictById(id);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "批量删除", notes = "根据url的ids来批量删除对象")
|
||||
@ApiImplicitParam(name = "ids", value = "ID集合", required = true, dataType = "List", paramType = "path")
|
||||
@DeleteMapping("/batch/{ids}")
|
||||
public R deleteDictBatch(@PathVariable List<String> ids) {
|
||||
dictService.deleteDictBatch(ids);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取字典项
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/code/{code}")
|
||||
public R getDictItems(@PathVariable String code) {
|
||||
List<DictItemEntity> list = dictService.getDictItems(code);
|
||||
List<DictItemVo> collect = list.stream().map(dictItemMapper::toVO).collect(Collectors.toList());
|
||||
return R.ok().setData(collect);
|
||||
}
|
||||
|
||||
/**
|
||||
* 刷新字典缓存
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/refresh")
|
||||
public R refreshDict() {
|
||||
dictService.refreshDict();
|
||||
return R.ok();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,133 @@
|
||||
package cn.datax.service.system.controller;
|
||||
|
||||
import cn.datax.common.core.JsonPage;
|
||||
import cn.datax.common.core.R;
|
||||
import cn.datax.common.validate.ValidationGroups;
|
||||
import cn.datax.service.system.api.dto.DictItemDto;
|
||||
import cn.datax.service.system.api.entity.DictItemEntity;
|
||||
import cn.datax.service.system.api.vo.DictItemVo;
|
||||
import cn.datax.service.system.api.query.DictItemQuery;
|
||||
import cn.datax.service.system.mapstruct.DictItemMapper;
|
||||
import cn.datax.service.system.service.DictItemService;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import cn.datax.common.base.BaseController;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 字典项信息表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @date 2022-04-17
|
||||
*/
|
||||
@Api(tags = {"字典项信息表"})
|
||||
@RestController
|
||||
@RequestMapping("/dict/items")
|
||||
public class DictItemController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private DictItemService dictItemService;
|
||||
|
||||
@Autowired
|
||||
private DictItemMapper dictItemMapper;
|
||||
|
||||
/**
|
||||
* 通过ID查询信息
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "获取详细信息", notes = "根据url的id来获取详细信息")
|
||||
@ApiImplicitParam(name = "id", value = "ID", required = true, dataType = "String", paramType = "path")
|
||||
@GetMapping("/{id}")
|
||||
public R getDictItemById(@PathVariable String id) {
|
||||
DictItemEntity dictItemEntity = dictItemService.getById(id);
|
||||
return R.ok().setData(dictItemMapper.toVO(dictItemEntity));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询信息
|
||||
*
|
||||
* @param dictItemQuery
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询", notes = "")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "dictItemQuery", value = "查询实体dictItemQuery", required = true, dataTypeClass = DictItemQuery.class)
|
||||
})
|
||||
@GetMapping("/page")
|
||||
public R getDictItemPage(DictItemQuery dictItemQuery) {
|
||||
QueryWrapper<DictItemEntity> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.like(StrUtil.isNotBlank(dictItemQuery.getItemText()), "item_text", dictItemQuery.getItemText());
|
||||
queryWrapper.like(StrUtil.isNotBlank(dictItemQuery.getItemValue()), "item_value", dictItemQuery.getItemValue());
|
||||
queryWrapper.eq(StrUtil.isNotBlank(dictItemQuery.getDictId()), "dict_id", dictItemQuery.getDictId());
|
||||
IPage<DictItemEntity> page = dictItemService.page(new Page<>(dictItemQuery.getPageNum(), dictItemQuery.getPageSize()), queryWrapper);
|
||||
List<DictItemVo> collect = page.getRecords().stream().map(dictItemMapper::toVO).collect(Collectors.toList());
|
||||
JsonPage<DictItemVo> jsonPage = new JsonPage<>(page.getCurrent(), page.getSize(), page.getTotal(), collect);
|
||||
return R.ok().setData(jsonPage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
* @param dictItem
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "添加信息", notes = "根据dictItem对象添加信息")
|
||||
@ApiImplicitParam(name = "dictItem", value = "详细实体dictItem", required = true, dataType = "DictItemDto")
|
||||
@PostMapping()
|
||||
public R saveDictItem(@RequestBody @Validated({ValidationGroups.Insert.class}) DictItemDto dictItem) {
|
||||
DictItemEntity dictItemEntity = dictItemService.saveDictItem(dictItem);
|
||||
return R.ok().setData(dictItemMapper.toVO(dictItemEntity));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
* @param dictItem
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "修改信息", notes = "根据url的id来指定修改对象,并根据传过来的信息来修改详细信息")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "ID", required = true, dataType = "String", paramType = "path"),
|
||||
@ApiImplicitParam(name = "dictItem", value = "详细实体dictItem", required = true, dataType = "DictItemDto")
|
||||
})
|
||||
@PutMapping("/{id}")
|
||||
public R updateDictItem(@PathVariable String id, @RequestBody @Validated({ValidationGroups.Update.class}) DictItemDto dictItem) {
|
||||
DictItemEntity dictItemEntity = dictItemService.updateDictItem(dictItem);
|
||||
return R.ok().setData(dictItemMapper.toVO(dictItemEntity));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "删除", notes = "根据url的id来指定删除对象")
|
||||
@ApiImplicitParam(name = "id", value = "ID", required = true, dataType = "String", paramType = "path")
|
||||
@DeleteMapping("/{id}")
|
||||
public R deleteDictItemById(@PathVariable String id) {
|
||||
dictItemService.deleteDictItemById(id);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "批量删除", notes = "根据url的ids来批量删除对象")
|
||||
@ApiImplicitParam(name = "ids", value = "ID集合", required = true, dataType = "List", paramType = "path")
|
||||
@DeleteMapping("/batch/{ids}")
|
||||
public R deleteDictItemBatch(@PathVariable List<String> ids) {
|
||||
dictItemService.deleteDictItemBatch(ids);
|
||||
return R.ok();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package cn.datax.service.system.controller;
|
||||
|
||||
import cn.datax.common.base.BaseController;
|
||||
import cn.datax.common.security.annotation.DataInner;
|
||||
import cn.datax.service.system.api.dto.LogDto;
|
||||
import cn.datax.service.system.async.AsyncTask;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/inner")
|
||||
public class InnerController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private AsyncTask asyncTask;
|
||||
|
||||
@DataInner
|
||||
@PostMapping("/logs")
|
||||
public void saveLog(@RequestBody LogDto log) {
|
||||
asyncTask.doTask(log);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
package cn.datax.service.system.controller;
|
||||
|
||||
import cn.datax.common.base.BaseController;
|
||||
import cn.datax.common.core.JsonPage;
|
||||
import cn.datax.common.core.R;
|
||||
import cn.datax.service.system.api.entity.LogEntity;
|
||||
import cn.datax.service.system.api.query.LogQuery;
|
||||
import cn.datax.service.system.api.vo.LogVo;
|
||||
import cn.datax.service.system.mapstruct.LogMapper;
|
||||
import cn.datax.service.system.service.LogService;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @date 2022-09-04
|
||||
*/
|
||||
@Api(value="系统管理接口", tags = {"系统管理"})
|
||||
@RestController
|
||||
@RequestMapping("/logs")
|
||||
public class LogController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private LogService logService;
|
||||
|
||||
@Autowired
|
||||
private LogMapper logMapper;
|
||||
|
||||
/**
|
||||
* 通过ID查询信息
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "获取详细信息", notes = "根据url的id来获取详细信息")
|
||||
@ApiImplicitParam(name = "id", value = "ID", required = true, dataType = "String", paramType = "path")
|
||||
@GetMapping("/{id}")
|
||||
public R getLogById(@PathVariable String id) {
|
||||
LogEntity logEntity = logService.getLogById(id);
|
||||
return R.ok().setData(logMapper.toVO(logEntity));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "日志分页查询", notes = "")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "logQuery", value = "查询实体logQuery", required = true, dataTypeClass = LogQuery.class)
|
||||
})
|
||||
@GetMapping("/page")
|
||||
public R getLogPage(LogQuery logQuery) {
|
||||
QueryWrapper<LogEntity> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.like(StrUtil.isNotBlank(logQuery.getTitle()), "title", logQuery.getTitle());
|
||||
queryWrapper.like(StrUtil.isNotBlank(logQuery.getModule()), "module", logQuery.getModule());
|
||||
queryWrapper.like(StrUtil.isNotBlank(logQuery.getUserName()), "user_name", logQuery.getUserName());
|
||||
IPage<LogEntity> page = logService.page(new Page<>(logQuery.getPageNum(), logQuery.getPageSize()), queryWrapper);
|
||||
List<LogVo> collect = page.getRecords().stream().map(logMapper::toVO).collect(Collectors.toList());
|
||||
JsonPage<LogVo> jsonPage = new JsonPage<>(page.getCurrent(), page.getSize(), page.getTotal(), collect);
|
||||
return R.ok().setData(jsonPage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "删除", notes = "根据url的id来指定删除对象")
|
||||
@ApiImplicitParam(name = "id", value = "ID", required = true, dataType = "String", paramType = "path")
|
||||
@DeleteMapping("/{id}")
|
||||
public R deleteLogById(@PathVariable String id) {
|
||||
logService.deleteLogById(id);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "批量删除角色", notes = "根据url的ids来批量删除对象")
|
||||
@ApiImplicitParam(name = "ids", value = "ID集合", required = true, dataType = "List", paramType = "path")
|
||||
@DeleteMapping("/batch/{ids}")
|
||||
public R deleteLogBatch(@PathVariable List<String> ids) {
|
||||
logService.deleteLogBatch(ids);
|
||||
return R.ok();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
package cn.datax.service.system.controller;
|
||||
|
||||
import cn.datax.common.core.JsonPage;
|
||||
import cn.datax.common.core.R;
|
||||
import cn.datax.service.system.api.entity.LoginLogEntity;
|
||||
import cn.datax.service.system.api.vo.LoginLogVo;
|
||||
import cn.datax.service.system.api.query.LoginLogQuery;
|
||||
import cn.datax.service.system.mapstruct.LoginLogMapper;
|
||||
import cn.datax.service.system.service.LoginLogService;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import cn.datax.common.base.BaseController;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 登录日志信息表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @date 2022-05-29
|
||||
*/
|
||||
@Api(tags = {"登录日志信息表"})
|
||||
@RestController
|
||||
@RequestMapping("/login/logs")
|
||||
public class LoginLogController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private LoginLogService loginLogService;
|
||||
|
||||
@Autowired
|
||||
private LoginLogMapper loginLogMapper;
|
||||
|
||||
/**
|
||||
* 通过ID查询信息
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "获取详细信息", notes = "根据url的id来获取详细信息")
|
||||
@ApiImplicitParam(name = "id", value = "ID", required = true, dataType = "String", paramType = "path")
|
||||
@GetMapping("/{id}")
|
||||
public R getLoginLogById(@PathVariable String id) {
|
||||
LoginLogEntity loginLogEntity = loginLogService.getLoginLogById(id);
|
||||
return R.ok().setData(loginLogMapper.toVO(loginLogEntity));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询信息
|
||||
*
|
||||
* @param loginLogQuery
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询", notes = "")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "loginLogQuery", value = "查询实体loginLogQuery", required = true, dataTypeClass = LoginLogQuery.class)
|
||||
})
|
||||
@GetMapping("/page")
|
||||
public R getLoginLogPage(LoginLogQuery loginLogQuery) {
|
||||
QueryWrapper<LoginLogEntity> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.like(StrUtil.isNotBlank(loginLogQuery.getUserName()), "user_name", loginLogQuery.getUserName());
|
||||
IPage<LoginLogEntity> page = loginLogService.page(new Page<>(loginLogQuery.getPageNum(), loginLogQuery.getPageSize()), queryWrapper);
|
||||
List<LoginLogVo> collect = page.getRecords().stream().map(loginLogMapper::toVO).collect(Collectors.toList());
|
||||
JsonPage<LoginLogVo> jsonPage = new JsonPage<>(page.getCurrent(), page.getSize(), page.getTotal(), collect);
|
||||
return R.ok().setData(jsonPage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加登录日志
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "添加信息", notes = "根据request对象添加信息")
|
||||
@PostMapping()
|
||||
public R loginLog(HttpServletRequest request) {
|
||||
loginLogService.saveLoginLog(request);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "删除", notes = "根据url的id来指定删除对象")
|
||||
@ApiImplicitParam(name = "id", value = "ID", required = true, dataType = "String", paramType = "path")
|
||||
@DeleteMapping("/{id}")
|
||||
public R deleteLoginLogById(@PathVariable String id) {
|
||||
loginLogService.deleteLoginLogById(id);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "批量删除角色", notes = "根据url的ids来批量删除对象")
|
||||
@ApiImplicitParam(name = "ids", value = "ID集合", required = true, dataType = "List", paramType = "path")
|
||||
@DeleteMapping("/batch/{ids}")
|
||||
public R deleteLoginLogBatch(@PathVariable List<String> ids) {
|
||||
loginLogService.deleteLoginLogBatch(ids);
|
||||
return R.ok();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
package cn.datax.service.system.controller;
|
||||
|
||||
import cn.datax.common.core.DataConstant;
|
||||
import cn.datax.common.core.R;
|
||||
import cn.datax.common.validate.ValidationGroups;
|
||||
import cn.datax.service.system.api.dto.MenuDto;
|
||||
import cn.datax.service.system.api.entity.MenuEntity;
|
||||
import cn.datax.service.system.api.entity.RoleEntity;
|
||||
import cn.datax.service.system.api.vo.MenuVo;
|
||||
import cn.datax.service.system.mapstruct.MenuMapper;
|
||||
import cn.datax.service.system.service.MenuService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import cn.datax.common.base.BaseController;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @date 2022-09-11
|
||||
*/
|
||||
@Api(value="系统管理接口", tags = {"系统管理"})
|
||||
@RestController
|
||||
@RequestMapping("/menus")
|
||||
public class MenuController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private MenuService menuService;
|
||||
|
||||
@Autowired
|
||||
private MenuMapper menuMapper;
|
||||
|
||||
@ApiOperation(value = "获取资源详细信息", notes = "根据url的id来获取资源详细信息")
|
||||
@ApiImplicitParam(name = "id", value = "资源ID", required = true, dataType = "String", paramType = "path")
|
||||
@GetMapping("/{id}")
|
||||
public R getMenuById(@PathVariable String id) {
|
||||
MenuEntity menuEntity = menuService.getById(id);
|
||||
return R.ok().setData(menuMapper.toVO(menuEntity));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取资源列表", notes = "")
|
||||
@GetMapping("/list")
|
||||
public R getMenuList() {
|
||||
List<MenuEntity> list = menuService.list(Wrappers.emptyWrapper());
|
||||
List<MenuVo> collect = list.stream().map(menuMapper::toVO).collect(Collectors.toList());
|
||||
return R.ok().setData(collect);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "创建资源", notes = "根据menu对象创建资源")
|
||||
@ApiImplicitParam(name = "menu", value = "资源详细实体menu", required = true, dataType = "MenuDto")
|
||||
@PostMapping()
|
||||
public R saveMenu(@RequestBody @Validated({ValidationGroups.Insert.class}) MenuDto menu) {
|
||||
MenuEntity menuEntity = menuService.saveMenu(menu);
|
||||
return R.ok().setData(menuMapper.toVO(menuEntity));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "更新资源详细信息", notes = "根据url的id来指定更新对象,并根据传过来的menu信息来更新资源详细信息")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "资源ID", required = true, dataType = "String", paramType = "path"),
|
||||
@ApiImplicitParam(name = "menu", value = "资源详细实体menu", required = true, dataType = "MenuDto")
|
||||
})
|
||||
@PutMapping("/{id}")
|
||||
public R updateMenu(@PathVariable String id, @RequestBody @Validated({ValidationGroups.Update.class}) MenuDto menu) {
|
||||
MenuEntity menuEntity = menuService.updateMenu(menu);
|
||||
return R.ok().setData(menuMapper.toVO(menuEntity));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除资源", notes = "根据url的id来指定删除对象")
|
||||
@ApiImplicitParam(name = "id", value = "资源ID", required = true, dataType = "String", paramType = "path")
|
||||
@DeleteMapping("/{id}")
|
||||
public R deleteMenu(@PathVariable String id) {
|
||||
menuService.deleteMenuById(id);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取工作流资源列表", notes = "")
|
||||
@GetMapping("/list/flow")
|
||||
public R getMenuListForFlow() {
|
||||
QueryWrapper<MenuEntity> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("status", DataConstant.EnableState.ENABLE.getKey());
|
||||
queryWrapper.eq("menu_type", DataConstant.MenuType.MENU.getKey());
|
||||
queryWrapper.eq("menu_hidden", DataConstant.EnableState.DISABLE.getKey());
|
||||
queryWrapper.isNotNull("menu_code");
|
||||
List<MenuEntity> list = menuService.list(queryWrapper);
|
||||
List<MenuVo> collect = list.stream().map(menuMapper::toVO).collect(Collectors.toList());
|
||||
return R.ok().setData(collect);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,116 @@
|
||||
package cn.datax.service.system.controller;
|
||||
|
||||
import cn.datax.common.core.DataConstant;
|
||||
import cn.datax.common.core.JsonPage;
|
||||
import cn.datax.common.core.R;
|
||||
import cn.datax.common.validate.ValidationGroups;
|
||||
import cn.datax.service.system.api.dto.PostDto;
|
||||
import cn.datax.service.system.api.entity.PostEntity;
|
||||
import cn.datax.service.system.api.query.PostQuery;
|
||||
import cn.datax.service.system.api.vo.PostVo;
|
||||
import cn.datax.service.system.mapstruct.PostMapper;
|
||||
import cn.datax.service.system.service.PostService;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import cn.datax.common.base.BaseController;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @date 2022-09-11
|
||||
*/
|
||||
@Api(value="系统管理接口", tags = {"系统管理"})
|
||||
@RestController
|
||||
@RequestMapping("/posts")
|
||||
public class PostController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private PostService postService;
|
||||
|
||||
@Autowired
|
||||
private PostMapper postMapper;
|
||||
|
||||
@ApiOperation(value = "获取岗位详细信息", notes = "根据url的id来获取岗位详细信息")
|
||||
@ApiImplicitParam(name = "id", value = "岗位ID", required = true, dataType = "String", paramType = "path")
|
||||
@GetMapping("/{id}")
|
||||
public R getPostById(@PathVariable String id) {
|
||||
PostEntity postEntity = postService.getById(id);
|
||||
return R.ok().setData(postMapper.toVO(postEntity));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取岗位列表", notes = "")
|
||||
@GetMapping("/list")
|
||||
public R getPostList() {
|
||||
QueryWrapper<PostEntity> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("status", DataConstant.EnableState.ENABLE.getKey());
|
||||
List<PostEntity> list = postService.list(queryWrapper);
|
||||
List<PostVo> collect = list.stream().map(postMapper::toVO).collect(Collectors.toList());
|
||||
return R.ok().setData(collect);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "岗位分页查询", notes = "")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "postQuery", value = "查询实体postQuery", required = true, dataTypeClass = PostQuery.class)
|
||||
})
|
||||
@GetMapping("/page")
|
||||
public R getPostPage(PostQuery postQuery) {
|
||||
QueryWrapper<PostEntity> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.like(StrUtil.isNotBlank(postQuery.getPostName()), "post_name", postQuery.getPostName());
|
||||
IPage<PostEntity> page = postService.page(new Page<>(postQuery.getPageNum(), postQuery.getPageSize()), queryWrapper);
|
||||
List<PostVo> collect = page.getRecords().stream().map(postMapper::toVO).collect(Collectors.toList());
|
||||
JsonPage<PostVo> jsonPage = new JsonPage<>(page.getCurrent(), page.getSize(), page.getTotal(), collect);
|
||||
return R.ok().setData(jsonPage);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "创建岗位", notes = "根据post对象创建岗位")
|
||||
@ApiImplicitParam(name = "post", value = "岗位详细实体post", required = true, dataType = "PostDto")
|
||||
@PostMapping()
|
||||
public R savePost(@RequestBody @Validated({ValidationGroups.Insert.class}) PostDto post) {
|
||||
PostEntity postEntity = postService.savePost(post);
|
||||
return R.ok().setData(postMapper.toVO(postEntity));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "更新岗位详细信息", notes = "根据url的id来指定更新对象,并根据传过来的post信息来更新岗位详细信息")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "岗位ID", required = true, dataType = "String", paramType = "path"),
|
||||
@ApiImplicitParam(name = "post", value = "岗位详细实体post", required = true, dataType = "PostDto")
|
||||
})
|
||||
@PutMapping("/{id}")
|
||||
public R updatePost(@PathVariable String id, @RequestBody @Validated({ValidationGroups.Update.class}) PostDto post) {
|
||||
PostEntity postEntity = postService.updatePost(post);
|
||||
return R.ok().setData(postMapper.toVO(postEntity));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除岗位", notes = "根据url的id来指定删除对象")
|
||||
@ApiImplicitParam(name = "id", value = "岗位ID", required = true, dataType = "String", paramType = "path")
|
||||
@DeleteMapping("/{id}")
|
||||
public R deletePost(@PathVariable String id) {
|
||||
postService.deletePostById(id);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "批量删除岗位", notes = "根据url的ids来批量删除对象")
|
||||
@ApiImplicitParam(name = "ids", value = "岗位ID集合", required = true, dataType = "List", paramType = "path")
|
||||
@DeleteMapping("/batch/{ids}")
|
||||
public R deletePostBatch(@PathVariable List<String> ids) {
|
||||
postService.deletePostBatch(ids);
|
||||
return R.ok();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,117 @@
|
||||
package cn.datax.service.system.controller;
|
||||
|
||||
import cn.datax.common.core.DataConstant;
|
||||
import cn.datax.common.core.JsonPage;
|
||||
import cn.datax.common.core.R;
|
||||
import cn.datax.common.validate.ValidationGroups;
|
||||
import cn.datax.service.system.api.dto.RoleDto;
|
||||
import cn.datax.service.system.api.entity.RoleEntity;
|
||||
import cn.datax.service.system.api.query.RoleQuery;
|
||||
import cn.datax.service.system.api.vo.RoleVo;
|
||||
import cn.datax.service.system.mapstruct.RoleMapper;
|
||||
import cn.datax.service.system.service.RoleService;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import cn.datax.common.base.BaseController;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @date 2022-09-04
|
||||
*/
|
||||
@Api(value="系统管理接口", tags = {"系统管理"})
|
||||
@RestController
|
||||
@RequestMapping("/roles")
|
||||
public class RoleController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private RoleService roleService;
|
||||
|
||||
@Autowired
|
||||
private RoleMapper roleMapper;
|
||||
|
||||
@ApiOperation(value = "获取角色详细信息", notes = "根据url的id来获取角色详细信息")
|
||||
@ApiImplicitParam(name = "id", value = "角色ID", required = true, dataType = "String", paramType = "path")
|
||||
@GetMapping("/{id}")
|
||||
public R getRoleById(@PathVariable String id) {
|
||||
RoleEntity roleEntity = roleService.getById(id);
|
||||
return R.ok().setData(roleMapper.toVO(roleEntity));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取角色列表", notes = "")
|
||||
@GetMapping("/list")
|
||||
public R getPostList() {
|
||||
QueryWrapper<RoleEntity> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("status", DataConstant.EnableState.ENABLE.getKey());
|
||||
List<RoleEntity> list = roleService.list(queryWrapper);
|
||||
List<RoleVo> collect = list.stream().map(roleMapper::toVO).collect(Collectors.toList());
|
||||
return R.ok().setData(collect);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "角色分页查询", notes = "")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "roleQuery", value = "查询实体roleQuery", required = true, dataTypeClass = RoleQuery.class)
|
||||
})
|
||||
@GetMapping("/page")
|
||||
public R getRolePage(RoleQuery roleQuery) {
|
||||
QueryWrapper<RoleEntity> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.like(StrUtil.isNotBlank(roleQuery.getRoleName()), "role_name", roleQuery.getRoleName());
|
||||
IPage<RoleEntity> page = roleService.page(new Page<>(roleQuery.getPageNum(), roleQuery.getPageSize()), queryWrapper);
|
||||
List<RoleVo> collect = page.getRecords().stream().map(roleMapper::toVO).collect(Collectors.toList());
|
||||
JsonPage<RoleVo> jsonPage = new JsonPage<>(page.getCurrent(), page.getSize(), page.getTotal(), collect);
|
||||
return R.ok().setData(jsonPage);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "创建角色", notes = "根据role对象创建角色")
|
||||
@ApiImplicitParam(name = "role", value = "角色详细实体role", required = true, dataType = "RoleDto")
|
||||
@PostMapping()
|
||||
public R saveRole(@RequestBody @Validated({ValidationGroups.Insert.class}) RoleDto role) {
|
||||
RoleEntity roleEntity = roleService.saveRole(role);
|
||||
return R.ok().setData(roleMapper.toVO(roleEntity));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "更新角色详细信息", notes = "根据url的id来指定更新对象,并根据传过来的role信息来更新角色详细信息")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "角色ID", required = true, dataType = "String", paramType = "path"),
|
||||
@ApiImplicitParam(name = "role", value = "角色详细实体role", required = true, dataType = "RoleDto")
|
||||
})
|
||||
@PutMapping("/{id}")
|
||||
public R updateRole(@PathVariable String id, @RequestBody @Validated({ValidationGroups.Update.class}) RoleDto role) {
|
||||
RoleEntity roleEntity = roleService.updateRole(role);
|
||||
return R.ok().setData(roleMapper.toVO(roleEntity));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除角色", notes = "根据url的id来指定删除对象")
|
||||
@ApiImplicitParam(name = "id", value = "角色ID", required = true, dataType = "String", paramType = "path")
|
||||
@DeleteMapping("/{id}")
|
||||
public R deleteRole(@PathVariable String id) {
|
||||
roleService.deleteRoleById(id);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "批量删除角色", notes = "根据url的ids来批量删除对象")
|
||||
@ApiImplicitParam(name = "ids", value = "角色ID集合", required = true, dataType = "List", paramType = "path")
|
||||
@DeleteMapping("/batch/{ids}")
|
||||
public R deletePostBatch(@PathVariable List<String> ids) {
|
||||
roleService.deleteRoleBatch(ids);
|
||||
return R.ok();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package cn.datax.service.system.dao;
|
||||
|
||||
import cn.datax.common.base.BaseDao;
|
||||
import cn.datax.service.system.api.entity.ConfigEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 系统参数配置信息表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @date 2022-05-19
|
||||
*/
|
||||
@Mapper
|
||||
public interface ConfigDao extends BaseDao<ConfigEntity> {
|
||||
|
||||
/**
|
||||
* 查询有效参数集合
|
||||
*
|
||||
* @return
|
||||
* @param status
|
||||
*/
|
||||
List<ConfigEntity> queryConfigList(@Param("status") String status);
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package cn.datax.service.system.dao;
|
||||
|
||||
import cn.datax.common.base.BaseDao;
|
||||
import cn.datax.service.system.api.entity.DeptEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @date 2022-09-04
|
||||
*/
|
||||
@Mapper
|
||||
public interface DeptDao extends BaseDao<DeptEntity> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package cn.datax.service.system.dao;
|
||||
|
||||
import cn.datax.service.system.api.entity.DeptRelationEntity;
|
||||
import cn.datax.common.base.BaseDao;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 部门关系表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @date 2022-11-22
|
||||
*/
|
||||
@Mapper
|
||||
public interface DeptRelationDao extends BaseDao<DeptRelationEntity> {
|
||||
|
||||
void insertBatch(List<DeptRelationEntity> list);
|
||||
|
||||
void deleteByAncestor(String id);
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package cn.datax.service.system.dao;
|
||||
|
||||
import cn.datax.common.base.BaseDao;
|
||||
import cn.datax.service.system.api.entity.DictEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 字典编码信息表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @date 2022-04-17
|
||||
*/
|
||||
@Mapper
|
||||
public interface DictDao extends BaseDao<DictEntity> {
|
||||
|
||||
/**
|
||||
* 查询有效字典集合
|
||||
*
|
||||
* @return
|
||||
* @param status
|
||||
*/
|
||||
List<DictEntity> queryDictList(@Param("status") String status);
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package cn.datax.service.system.dao;
|
||||
|
||||
import cn.datax.common.base.BaseDao;
|
||||
import cn.datax.service.system.api.entity.DictItemEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 字典项信息表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @date 2022-04-17
|
||||
*/
|
||||
@Mapper
|
||||
public interface DictItemDao extends BaseDao<DictItemEntity> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package cn.datax.service.system.dao;
|
||||
|
||||
import cn.datax.common.base.BaseDao;
|
||||
import cn.datax.service.system.api.entity.LogEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @date 2022-11-19
|
||||
*/
|
||||
@Mapper
|
||||
public interface LogDao extends BaseDao<LogEntity> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package cn.datax.service.system.dao;
|
||||
|
||||
import cn.datax.common.base.BaseDao;
|
||||
import cn.datax.service.system.api.entity.LoginLogEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 登录日志信息表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @date 2022-05-29
|
||||
*/
|
||||
@Mapper
|
||||
public interface LoginLogDao extends BaseDao<LoginLogEntity> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package cn.datax.service.system.dao;
|
||||
|
||||
import cn.datax.service.system.api.entity.MenuEntity;
|
||||
import cn.datax.common.base.BaseDao;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @date 2022-09-11
|
||||
*/
|
||||
@Mapper
|
||||
public interface MenuDao extends BaseDao<MenuEntity> {
|
||||
|
||||
List<MenuEntity> selectMenuByRoleIds(@Param("roleIds") List<String> roleIds);
|
||||
|
||||
List<MenuEntity> selectMenuByUserId(@Param("userId") String userId);
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package cn.datax.service.system.dao;
|
||||
|
||||
import cn.datax.service.system.api.entity.PostEntity;
|
||||
import cn.datax.common.base.BaseDao;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @date 2022-09-11
|
||||
*/
|
||||
@Mapper
|
||||
public interface PostDao extends BaseDao<PostEntity> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package cn.datax.service.system.dao;
|
||||
|
||||
import cn.datax.common.base.BaseDao;
|
||||
import cn.datax.service.system.api.entity.RoleEntity;
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @date 2022-09-04
|
||||
*/
|
||||
@Mapper
|
||||
public interface RoleDao extends BaseDao<RoleEntity> {
|
||||
|
||||
@Override
|
||||
RoleEntity selectById(Serializable id);
|
||||
|
||||
@Override
|
||||
<E extends IPage<RoleEntity>> E selectPage(E page, @Param(Constants.WRAPPER) Wrapper<RoleEntity> queryWrapper);
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package cn.datax.service.system.dao;
|
||||
|
||||
import cn.datax.service.system.api.entity.RoleDeptEntity;
|
||||
import cn.datax.common.base.BaseDao;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 角色和部门关联表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @date 2022-11-22
|
||||
*/
|
||||
@Mapper
|
||||
public interface RoleDeptDao extends BaseDao<RoleDeptEntity> {
|
||||
|
||||
void insertBatch(List<RoleDeptEntity> list);
|
||||
|
||||
void deleteByRoleId(String id);
|
||||
|
||||
void deleteByRoleIds(List<String> ids);
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package cn.datax.service.system.dao;
|
||||
|
||||
import cn.datax.service.system.api.entity.RoleMenuEntity;
|
||||
import cn.datax.common.base.BaseDao;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @date 2022-09-11
|
||||
*/
|
||||
@Mapper
|
||||
public interface RoleMenuDao extends BaseDao<RoleMenuEntity> {
|
||||
|
||||
void insertBatch(List<RoleMenuEntity> list);
|
||||
|
||||
void deleteByRoleId(String id);
|
||||
|
||||
void deleteByRoleIds(List<String> ids);
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package cn.datax.service.system.dao;
|
||||
|
||||
import cn.datax.service.system.api.entity.UserPostEntity;
|
||||
import cn.datax.common.base.BaseDao;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @date 2022-09-11
|
||||
*/
|
||||
@Mapper
|
||||
public interface UserPostDao extends BaseDao<UserPostEntity> {
|
||||
|
||||
void insertBatch(List<UserPostEntity> list);
|
||||
|
||||
void deleteByUserId(String id);
|
||||
|
||||
void deleteByUserIds(List<String> ids);
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package cn.datax.service.system.dao;
|
||||
|
||||
import cn.datax.common.base.BaseDao;
|
||||
import cn.datax.service.system.api.entity.UserRoleEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @date 2022-09-04
|
||||
*/
|
||||
@Mapper
|
||||
public interface UserRoleDao extends BaseDao<UserRoleEntity> {
|
||||
|
||||
void insertBatch(List<UserRoleEntity> list);
|
||||
|
||||
void deleteByUserId(String id);
|
||||
|
||||
void deleteByUserIds(List<String> ids);
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package cn.datax.service.system.mapstruct;
|
||||
|
||||
import cn.datax.common.mapstruct.EntityMapper;
|
||||
import cn.datax.service.system.api.dto.ConfigDto;
|
||||
import cn.datax.service.system.api.entity.ConfigEntity;
|
||||
import cn.datax.service.system.api.vo.ConfigVo;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 系统参数配置信息表 Mapper 实体映射
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @date 2022-05-19
|
||||
*/
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface ConfigMapper extends EntityMapper<ConfigDto, ConfigEntity, ConfigVo> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package cn.datax.service.system.mapstruct;
|
||||
|
||||
import cn.datax.common.mapstruct.EntityMapper;
|
||||
import cn.datax.service.system.api.dto.DeptDto;
|
||||
import cn.datax.service.system.api.entity.DeptEntity;
|
||||
import cn.datax.service.system.api.vo.DeptVo;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface DeptMapper extends EntityMapper<DeptDto, DeptEntity, DeptVo> {
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package cn.datax.service.system.mapstruct;
|
||||
|
||||
import cn.datax.common.mapstruct.EntityMapper;
|
||||
import cn.datax.service.system.api.dto.DictItemDto;
|
||||
import cn.datax.service.system.api.entity.DictItemEntity;
|
||||
import cn.datax.service.system.api.vo.DictItemVo;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 字典项信息表 Mapper 实体映射
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @date 2022-04-17
|
||||
*/
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface DictItemMapper extends EntityMapper<DictItemDto, DictItemEntity, DictItemVo> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package cn.datax.service.system.mapstruct;
|
||||
|
||||
import cn.datax.common.mapstruct.EntityMapper;
|
||||
import cn.datax.service.system.api.dto.DictDto;
|
||||
import cn.datax.service.system.api.entity.DictEntity;
|
||||
import cn.datax.service.system.api.vo.DictVo;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 字典编码信息表 Mapper 实体映射
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @date 2022-04-17
|
||||
*/
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface DictMapper extends EntityMapper<DictDto, DictEntity, DictVo> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package cn.datax.service.system.mapstruct;
|
||||
|
||||
import cn.datax.common.mapstruct.EntityMapper;
|
||||
import cn.datax.service.system.api.dto.LogDto;
|
||||
import cn.datax.service.system.api.entity.LogEntity;
|
||||
import cn.datax.service.system.api.vo.LogVo;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface LogMapper extends EntityMapper<LogDto, LogEntity, LogVo> {
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package cn.datax.service.system.mapstruct;
|
||||
|
||||
import cn.datax.common.mapstruct.EntityMapper;
|
||||
import cn.datax.service.system.api.dto.LoginLogDto;
|
||||
import cn.datax.service.system.api.entity.LoginLogEntity;
|
||||
import cn.datax.service.system.api.vo.LoginLogVo;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 登录日志信息表 Mapper 实体映射
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @date 2022-05-29
|
||||
*/
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface LoginLogMapper extends EntityMapper<LoginLogDto, LoginLogEntity, LoginLogVo> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package cn.datax.service.system.mapstruct;
|
||||
|
||||
import cn.datax.common.mapstruct.EntityMapper;
|
||||
import cn.datax.service.system.api.dto.MenuDto;
|
||||
import cn.datax.service.system.api.entity.MenuEntity;
|
||||
import cn.datax.service.system.api.vo.MenuVo;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface MenuMapper extends EntityMapper<MenuDto, MenuEntity, MenuVo> {
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package cn.datax.service.system.mapstruct;
|
||||
|
||||
import cn.datax.common.mapstruct.EntityMapper;
|
||||
import cn.datax.service.system.api.dto.PostDto;
|
||||
import cn.datax.service.system.api.entity.PostEntity;
|
||||
import cn.datax.service.system.api.vo.PostVo;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface PostMapper extends EntityMapper<PostDto, PostEntity, PostVo> {
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package cn.datax.service.system.mapstruct;
|
||||
|
||||
import cn.datax.common.mapstruct.EntityMapper;
|
||||
import cn.datax.service.system.api.dto.RoleDto;
|
||||
import cn.datax.service.system.api.entity.RoleEntity;
|
||||
import cn.datax.service.system.api.vo.RoleVo;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface RoleMapper extends EntityMapper<RoleDto, RoleEntity, RoleVo> {
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package cn.datax.service.system.service;
|
||||
|
||||
import cn.datax.service.system.api.dto.ConfigDto;
|
||||
import cn.datax.service.system.api.entity.ConfigEntity;
|
||||
import cn.datax.common.base.BaseService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 系统参数配置信息表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @date 2022-05-19
|
||||
*/
|
||||
public interface ConfigService extends BaseService<ConfigEntity> {
|
||||
|
||||
ConfigEntity saveConfig(ConfigDto sysConfig);
|
||||
|
||||
ConfigEntity updateConfig(ConfigDto sysConfig);
|
||||
|
||||
ConfigEntity getConfigById(String id);
|
||||
|
||||
void deleteConfigById(String id);
|
||||
|
||||
void deleteConfigBatch(List<String> ids);
|
||||
|
||||
String getConfig(String key);
|
||||
|
||||
void refreshConfig();
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package cn.datax.service.system.service;
|
||||
|
||||
import cn.datax.common.base.BaseService;
|
||||
import cn.datax.service.system.api.dto.DeptDto;
|
||||
import cn.datax.service.system.api.entity.DeptEntity;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @date 2022-09-04
|
||||
*/
|
||||
public interface DeptService extends BaseService<DeptEntity> {
|
||||
|
||||
DeptEntity saveDept(DeptDto dept);
|
||||
|
||||
DeptEntity updateDept(DeptDto dept);
|
||||
|
||||
void deleteDeptById(String id);
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package cn.datax.service.system.service;
|
||||
|
||||
import cn.datax.service.system.api.entity.DictItemEntity;
|
||||
import cn.datax.service.system.api.dto.DictItemDto;
|
||||
import cn.datax.common.base.BaseService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 字典项信息表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @date 2022-04-17
|
||||
*/
|
||||
public interface DictItemService extends BaseService<DictItemEntity> {
|
||||
|
||||
DictItemEntity saveDictItem(DictItemDto dictItem);
|
||||
|
||||
DictItemEntity updateDictItem(DictItemDto dictItem);
|
||||
|
||||
void deleteDictItemById(String id);
|
||||
|
||||
void deleteDictItemBatch(List<String> ids);
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package cn.datax.service.system.service;
|
||||
|
||||
import cn.datax.service.system.api.entity.DictEntity;
|
||||
import cn.datax.service.system.api.dto.DictDto;
|
||||
import cn.datax.common.base.BaseService;
|
||||
import cn.datax.service.system.api.entity.DictItemEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 字典编码信息表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @date 2022-04-17
|
||||
*/
|
||||
public interface DictService extends BaseService<DictEntity> {
|
||||
|
||||
DictEntity saveDict(DictDto dict);
|
||||
|
||||
DictEntity updateDict(DictDto dict);
|
||||
|
||||
void deleteDictById(String id);
|
||||
|
||||
void deleteDictBatch(List<String> ids);
|
||||
|
||||
List<DictItemEntity> getDictItems(String code);
|
||||
|
||||
void refreshDict();
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user