feat: initial iShare project code
This commit is contained in:
49
as-upms/as-upms-api/pom.xml
Normal file
49
as-upms/as-upms-api/pom.xml
Normal file
@@ -0,0 +1,49 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>as-upms</artifactId>
|
||||
<version>5.2.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>as-upms-api</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<description>pigx 通用用户权限管理系统公共api模块</description>
|
||||
|
||||
|
||||
<dependencies>
|
||||
<!-- 连表查询注解 -->
|
||||
<dependency>
|
||||
<groupId>com.github.yulichang</groupId>
|
||||
<artifactId>mybatis-plus-join-annotation</artifactId>
|
||||
</dependency>
|
||||
<!--core 工具类-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-core</artifactId>
|
||||
</dependency>
|
||||
<!--mybatis plus extension,包含了mybatis plus core-->
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-extension</artifactId>
|
||||
</dependency>
|
||||
<!--feign 工具类-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-feign</artifactId>
|
||||
</dependency>
|
||||
<!-- excel 导入导出 -->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-excel</artifactId>
|
||||
</dependency>
|
||||
<!--字段审计注解-->
|
||||
<dependency>
|
||||
<groupId>org.javers</groupId>
|
||||
<artifactId>javers-core</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.pig4cloud.pigx.admin.api.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 文件传输DTO
|
||||
*
|
||||
* @author lengleng
|
||||
* @date 2023/7/26
|
||||
*/
|
||||
@Data
|
||||
public class SysFileGroupDTO {
|
||||
|
||||
/**
|
||||
* 文件组
|
||||
*/
|
||||
private Long groupId;
|
||||
|
||||
/**
|
||||
* 文件id
|
||||
*/
|
||||
private Long[] ids;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
package com.pig4cloud.pigx.admin.api.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2020/10/9
|
||||
* <p>
|
||||
* 日志查询传输对象
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "日志查询对象")
|
||||
public class SysLogDTO {
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 日志类型
|
||||
*/
|
||||
@NotBlank(message = "日志类型不能为空")
|
||||
private String logType;
|
||||
|
||||
/**
|
||||
* 日志标题
|
||||
*/
|
||||
@NotBlank(message = "日志标题不能为空")
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 操作IP地址
|
||||
*/
|
||||
private String remoteAddr;
|
||||
|
||||
/**
|
||||
* 用户代理
|
||||
*/
|
||||
private String userAgent;
|
||||
|
||||
/**
|
||||
* 请求URI
|
||||
*/
|
||||
private String requestUri;
|
||||
|
||||
/**
|
||||
* 操作方式
|
||||
*/
|
||||
private String method;
|
||||
|
||||
/**
|
||||
* 操作提交的数据
|
||||
*/
|
||||
private String params;
|
||||
|
||||
/**
|
||||
* 参数重写成object
|
||||
*/
|
||||
private Object body;
|
||||
|
||||
/**
|
||||
* 执行时间
|
||||
*/
|
||||
private Long time;
|
||||
|
||||
/**
|
||||
* 异常信息
|
||||
*/
|
||||
private String exception;
|
||||
|
||||
/**
|
||||
* 服务ID
|
||||
*/
|
||||
private String serviceId;
|
||||
|
||||
/**
|
||||
* 创建时间区间 [开始时间,结束时间]
|
||||
*/
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
/**
|
||||
* 租户编号
|
||||
*/
|
||||
private Long tenantId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.pig4cloud.pigx.admin.api.dto;
|
||||
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysOauthClientDetails;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2020/11/18
|
||||
* <p>
|
||||
* 终端管理传输对象
|
||||
*/
|
||||
@Data
|
||||
public class SysOauthClientDetailsDTO extends SysOauthClientDetails {
|
||||
|
||||
/**
|
||||
* 验证码开关
|
||||
*/
|
||||
private String captchaFlag;
|
||||
|
||||
/**
|
||||
* 前端密码传输是否加密
|
||||
*/
|
||||
private String encFlag;
|
||||
|
||||
/**
|
||||
* 客户端允许同时在线数量
|
||||
*/
|
||||
private String onlineQuantity;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.api.dto;
|
||||
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysUser;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2017/11/5
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "系统用户传输对象")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class UserDTO extends SysUser {
|
||||
|
||||
/**
|
||||
* 角色ID
|
||||
*/
|
||||
@Schema(description = "角色id集合")
|
||||
private List<Long> role;
|
||||
|
||||
/**
|
||||
* 部门id
|
||||
*/
|
||||
@Schema(description = "部门id")
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 岗位ID
|
||||
*/
|
||||
private List<Long> post;
|
||||
|
||||
/**
|
||||
* 新密码
|
||||
*/
|
||||
@Schema(description = "新密码")
|
||||
private String newpassword1;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.api.dto;
|
||||
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysUser;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2017/11/11
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "用户信息")
|
||||
public class UserInfo implements Serializable {
|
||||
|
||||
/**
|
||||
* 用户基本信息
|
||||
*/
|
||||
@Schema(description = "用户基本信息")
|
||||
private SysUser sysUser;
|
||||
|
||||
/**
|
||||
* 权限标识集合
|
||||
*/
|
||||
@Schema(description = "权限标识集合")
|
||||
private String[] permissions;
|
||||
|
||||
/**
|
||||
* 角色集合
|
||||
*/
|
||||
@Schema(description = "角色标识集合")
|
||||
private Long[] roles;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 审计记录表
|
||||
*
|
||||
* @author PIG
|
||||
* @date 2023-02-28 20:12:23
|
||||
*/
|
||||
@Data
|
||||
@TableName("sys_audit_log")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "审计记录表")
|
||||
public class SysAuditLog extends Model<SysAuditLog> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "主键")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 审计名称
|
||||
*/
|
||||
@Schema(description = "审计名称")
|
||||
private String auditName;
|
||||
|
||||
/**
|
||||
* 字段名称
|
||||
*/
|
||||
@Schema(description = "字段名称")
|
||||
private String auditField;
|
||||
|
||||
/**
|
||||
* 变更前值
|
||||
*/
|
||||
@Schema(description = "变更前值")
|
||||
private String beforeVal;
|
||||
|
||||
/**
|
||||
* 变更后值
|
||||
*/
|
||||
@Schema(description = "变更后值")
|
||||
private String afterVal;
|
||||
|
||||
/**
|
||||
* 操作人
|
||||
*/
|
||||
@Schema(description = "操作人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 操作时间
|
||||
*/
|
||||
@Schema(description = "操作时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 删除标记
|
||||
*/
|
||||
@Schema(description = "删除标记")
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
@Schema(description = "租户ID")
|
||||
private Long tenantId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 部门管理
|
||||
* </p>
|
||||
*
|
||||
* @author lengleng
|
||||
* @since 2018-01-22
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "部门")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class SysDept extends Model<SysDept> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "dept_id", type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "部门id")
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
@NotBlank(message = "部门名称不能为空")
|
||||
@Schema(description = "部门名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
@NotNull(message = "排序值不能为空")
|
||||
@Schema(description = "排序值")
|
||||
private Integer sortOrder;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
@Schema(description = "修改人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description = "创建时间")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@Schema(description = "修改时间")
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 父级部门id
|
||||
*/
|
||||
@Schema(description = "父级部门id")
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 是否删除 1:已删除 0:正常
|
||||
*/
|
||||
@TableLogic
|
||||
@Schema(description = "删除标记,1:已删除,0:正常")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String delFlag;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 部门关系表
|
||||
* </p>
|
||||
*
|
||||
* @author lengleng
|
||||
* @since 2018-01-22
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "部门关系")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class SysDeptRelation extends Model<SysDeptRelation> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 祖先节点
|
||||
*/
|
||||
@Schema(description = "祖先节点")
|
||||
private Long ancestor;
|
||||
|
||||
/**
|
||||
* 后代节点
|
||||
*/
|
||||
@Schema(description = "后代节点")
|
||||
private Long descendant;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
package com.pig4cloud.pigx.admin.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 字典表
|
||||
*
|
||||
* @author lengleng
|
||||
* @date 2019/03/19
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "字典类型")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class SysDict extends Model<SysDict> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "字典编号")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
@Schema(description = "字典类型")
|
||||
private String dictType;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
@Schema(description = "字典描述")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description = "创建时间")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@Schema(description = "更新时间")
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 是否是系统内置
|
||||
*/
|
||||
@Schema(description = "是否系统内置")
|
||||
private String systemFlag;
|
||||
|
||||
/**
|
||||
* 备注信息
|
||||
*/
|
||||
@Schema(description = "备注信息")
|
||||
private String remarks;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
@Schema(description = "修改人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 删除标记
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "删除标记,1:已删除,0:正常")
|
||||
private String delFlag;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
package com.pig4cloud.pigx.admin.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 字典项
|
||||
*
|
||||
* @author lengleng
|
||||
* @date 2019/03/19
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "字典项")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class SysDictItem extends Model<SysDictItem> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "字典项id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 所属字典类id
|
||||
*/
|
||||
@Schema(description = "所属字典类id")
|
||||
private Long dictId;
|
||||
|
||||
/**
|
||||
* 数据值
|
||||
*/
|
||||
@Schema(description = "数据值")
|
||||
@JsonProperty(value = "value")
|
||||
private String itemValue;
|
||||
|
||||
/**
|
||||
* 标签名
|
||||
*/
|
||||
@Schema(description = "标签名")
|
||||
private String label;
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
@Schema(description = "类型")
|
||||
private String dictType;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
@Schema(description = "描述")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 排序(升序)
|
||||
*/
|
||||
@Schema(description = "排序值,默认升序")
|
||||
private Integer sortOrder;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
@Schema(description = "修改人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 备注信息
|
||||
*/
|
||||
@Schema(description = "备注信息")
|
||||
private String remarks;
|
||||
|
||||
/**
|
||||
* 删除标记
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "删除标记,1:已删除,0:正常")
|
||||
private String delFlag;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 文件管理
|
||||
*
|
||||
* @author Luckly
|
||||
* @date 2019-06-18 17:18:42
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "文件")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class SysFile extends Model<SysFile> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "文件编号")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 文件名
|
||||
*/
|
||||
@Schema(description = "文件名")
|
||||
private String fileName;
|
||||
|
||||
/**
|
||||
* 原文件名
|
||||
*/
|
||||
@Schema(description = "原始文件名")
|
||||
private String original;
|
||||
|
||||
/**
|
||||
* 容器名称
|
||||
*/
|
||||
@Schema(description = "存储桶名称")
|
||||
private String bucketName;
|
||||
|
||||
/**
|
||||
* 文件类型
|
||||
*/
|
||||
@Schema(description = "文件类型")
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 文件组
|
||||
*/
|
||||
@Schema(description = "文件组")
|
||||
private Long groupId;
|
||||
|
||||
/**
|
||||
* 文件大小
|
||||
*/
|
||||
@Schema(description = "文件大小")
|
||||
private Long fileSize;
|
||||
|
||||
/**
|
||||
* 上传人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建者")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 上传时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "更新者")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 删除标识:1-删除,0-正常
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "删除标记,1:已删除,0:正常")
|
||||
private String delFlag;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
package com.pig4cloud.pigx.admin.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 文件类型
|
||||
*
|
||||
* @author lengleng
|
||||
* @date 2023/7/25
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "文件")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class SysFileGroup extends Model<SysFile> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "主键ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "父级ID")
|
||||
private Long pid;
|
||||
|
||||
@Schema(description = "分类类型: [10=图片,20=视频]")
|
||||
private Long type;
|
||||
|
||||
@Schema(description = "分类名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 上传人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建者")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 上传时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "更新者")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 删除标识:1-删除,0-正常
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "删除标记,1:已删除,0:正常")
|
||||
private String delFlag;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 系统表-国际化
|
||||
*
|
||||
* @author PIG
|
||||
* @date 2023-02-14 09:07:01
|
||||
*/
|
||||
@Data
|
||||
@TableName("sys_i18n")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "系统表-国际化")
|
||||
public class SysI18nEntity extends Model<SysI18nEntity> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* key
|
||||
*/
|
||||
@Schema(description = "name")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 中文
|
||||
*/
|
||||
@Schema(description = "中文")
|
||||
private String zhCn;
|
||||
|
||||
/**
|
||||
* 英文
|
||||
*/
|
||||
@Schema(description = "英文")
|
||||
private String en;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "修改人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 删除标记
|
||||
*/
|
||||
@TableLogic
|
||||
@Schema(description = "删除标记")
|
||||
private String delFlag;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,158 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.api.entity;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnore;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 日志表
|
||||
* </p>
|
||||
*
|
||||
* @author lengleng
|
||||
* @since 2017-11-20
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "日志")
|
||||
public class SysLog implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ExcelProperty("日志编号")
|
||||
@Schema(description = "日志编号")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 日志类型
|
||||
*/
|
||||
@NotBlank(message = "日志类型不能为空")
|
||||
@ExcelProperty("日志类型(0-正常 9-错误)")
|
||||
@Schema(description = "日志类型")
|
||||
private String logType;
|
||||
|
||||
/**
|
||||
* 日志标题
|
||||
*/
|
||||
@NotBlank(message = "日志标题不能为空")
|
||||
@ExcelProperty("日志标题")
|
||||
@Schema(description = "日志标题")
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
@ExcelProperty("创建人")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ExcelProperty("创建时间")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@ExcelIgnore
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 操作IP地址
|
||||
*/
|
||||
@ExcelProperty("操作ip地址")
|
||||
@Schema(description = "操作ip地址")
|
||||
private String remoteAddr;
|
||||
|
||||
/**
|
||||
* 用户代理
|
||||
*/
|
||||
@Schema(description = "用户代理")
|
||||
private String userAgent;
|
||||
|
||||
/**
|
||||
* 请求URI
|
||||
*/
|
||||
@ExcelProperty("浏览器")
|
||||
@Schema(description = "请求uri")
|
||||
private String requestUri;
|
||||
|
||||
/**
|
||||
* 操作方式
|
||||
*/
|
||||
@ExcelProperty("操作方式")
|
||||
@Schema(description = "操作方式")
|
||||
private String method;
|
||||
|
||||
/**
|
||||
* 操作提交的数据
|
||||
*/
|
||||
@ExcelProperty("提交数据")
|
||||
@Schema(description = "提交数据")
|
||||
private String params;
|
||||
|
||||
/**
|
||||
* 执行时间
|
||||
*/
|
||||
@ExcelProperty("执行时间")
|
||||
@Schema(description = "方法执行时间")
|
||||
private Long time;
|
||||
|
||||
/**
|
||||
* 异常信息
|
||||
*/
|
||||
@ExcelProperty("异常信息")
|
||||
@Schema(description = "异常信息")
|
||||
private String exception;
|
||||
|
||||
/**
|
||||
* 服务ID
|
||||
*/
|
||||
@ExcelProperty("应用标识")
|
||||
@Schema(description = "应用标识")
|
||||
private String serviceId;
|
||||
|
||||
/**
|
||||
* 删除标记
|
||||
*/
|
||||
@TableLogic
|
||||
@ExcelIgnore
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "删除标记,1:已删除,0:正常")
|
||||
private String delFlag;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,150 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 菜单权限表
|
||||
* </p>
|
||||
*
|
||||
* @author lengleng
|
||||
* @since 2017-11-08
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "菜单")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class SysMenu extends Model<SysMenu> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 菜单ID
|
||||
*/
|
||||
@TableId(value = "menu_id", type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "菜单id")
|
||||
private Long menuId;
|
||||
|
||||
/**
|
||||
* 菜单名称
|
||||
*/
|
||||
@NotBlank(message = "菜单名称不能为空")
|
||||
@Schema(description = "菜单名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 菜单权限标识
|
||||
*/
|
||||
@Schema(description = "菜单权限标识")
|
||||
private String permission;
|
||||
|
||||
/**
|
||||
* 父菜单ID
|
||||
*/
|
||||
@NotNull(message = "菜单父ID不能为空")
|
||||
@Schema(description = "菜单父id")
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 图标
|
||||
*/
|
||||
@Schema(description = "菜单图标")
|
||||
private String icon;
|
||||
|
||||
/**
|
||||
* 前端路由标识路径,默认和 comment 保持一致 过期
|
||||
*/
|
||||
@Schema(description = "前端路由标识路径")
|
||||
private String path;
|
||||
|
||||
/**
|
||||
* 菜单显示隐藏控制
|
||||
*/
|
||||
@Schema(description = "菜单是否显示")
|
||||
private String visible;
|
||||
|
||||
/**
|
||||
* 排序值
|
||||
*/
|
||||
@Schema(description = "排序值")
|
||||
private Integer sortOrder;
|
||||
|
||||
/**
|
||||
* 菜单类型 (0菜单 1按钮)
|
||||
*/
|
||||
@NotNull(message = "菜单类型不能为空")
|
||||
@Schema(description = "菜单类型,0:菜单 1:按钮")
|
||||
private String menuType;
|
||||
|
||||
/**
|
||||
* 路由缓冲
|
||||
*/
|
||||
@Schema(description = "路由缓冲")
|
||||
private String keepAlive;
|
||||
|
||||
@Schema(description = "菜单是否内嵌")
|
||||
private String embedded;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
@Schema(description = "修改人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 0--正常 1--删除
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "删除标记,1:已删除,0:正常")
|
||||
private String delFlag;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,155 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 客户端信息
|
||||
* </p>
|
||||
*
|
||||
* @author lengleng
|
||||
* @since 2018-05-15
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "客户端信息")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class SysOauthClientDetails extends Model<SysOauthClientDetails> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 客户端ID
|
||||
*/
|
||||
@NotBlank(message = "client_id 不能为空")
|
||||
@Schema(description = "客户端id")
|
||||
private String clientId;
|
||||
|
||||
/**
|
||||
* 客户端密钥
|
||||
*/
|
||||
@NotBlank(message = "client_secret 不能为空")
|
||||
@Schema(description = "客户端密钥")
|
||||
private String clientSecret;
|
||||
|
||||
/**
|
||||
* 资源ID
|
||||
*/
|
||||
@Schema(description = "资源id列表")
|
||||
private String resourceIds;
|
||||
|
||||
/**
|
||||
* 作用域
|
||||
*/
|
||||
@NotBlank(message = "scope 不能为空")
|
||||
@Schema(description = "作用域")
|
||||
private String scope;
|
||||
|
||||
/**
|
||||
* 授权方式[A,B,C]
|
||||
*/
|
||||
@Schema(description = "授权方式")
|
||||
private String[] authorizedGrantTypes;
|
||||
|
||||
/**
|
||||
* 回调地址
|
||||
*/
|
||||
@Schema(description = "回调地址")
|
||||
private String webServerRedirectUri;
|
||||
|
||||
/**
|
||||
* 权限
|
||||
*/
|
||||
@Schema(description = "权限列表")
|
||||
private String authorities;
|
||||
|
||||
/**
|
||||
* 请求令牌有效时间
|
||||
*/
|
||||
@Schema(description = "请求令牌有效时间")
|
||||
private Integer accessTokenValidity;
|
||||
|
||||
/**
|
||||
* 刷新令牌有效时间
|
||||
*/
|
||||
@Schema(description = "刷新令牌有效时间")
|
||||
private Integer refreshTokenValidity;
|
||||
|
||||
/**
|
||||
* 扩展信息
|
||||
*/
|
||||
@Schema(description = "扩展信息")
|
||||
private String additionalInformation;
|
||||
|
||||
/**
|
||||
* 是否自动放行
|
||||
*/
|
||||
@Schema(description = "是否自动放行")
|
||||
private String autoapprove;
|
||||
|
||||
/**
|
||||
* 删除标记
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "删除标记,1:已删除,0:正常")
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
@Schema(description = "修改人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 岗位信息表
|
||||
*
|
||||
* @author fxz
|
||||
* @date 2022-03-26 12:50:43
|
||||
*/
|
||||
@Data
|
||||
@TableName("sys_post")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "岗位信息表")
|
||||
public class SysPost extends Model<SysPost> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 岗位ID
|
||||
*/
|
||||
@TableId(value = "post_id", type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "岗位ID")
|
||||
private Long postId;
|
||||
|
||||
/**
|
||||
* 岗位编码
|
||||
*/
|
||||
@NotBlank(message = "岗位编码不能为空")
|
||||
@Schema(description = "岗位编码")
|
||||
private String postCode;
|
||||
|
||||
/**
|
||||
* 岗位名称
|
||||
*/
|
||||
@NotBlank(message = "岗位名称不能为空")
|
||||
@Schema(description = "岗位名称")
|
||||
private String postName;
|
||||
|
||||
/**
|
||||
* 岗位排序
|
||||
*/
|
||||
@NotNull(message = "排序值不能为空")
|
||||
@Schema(description = "岗位排序")
|
||||
private Integer postSort;
|
||||
|
||||
/**
|
||||
* 岗位描述
|
||||
*/
|
||||
@Schema(description = "岗位描述")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
@Schema(description = "修改人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 是否删除 -1:已删除 0:正常
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "是否删除 -1:已删除 0:正常")
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description = "创建时间")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@Schema(description = "更新时间")
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 公共参数配置
|
||||
*
|
||||
* @author Lucky
|
||||
* @date 2019-04-29
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "公共参数")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class SysPublicParam extends Model<SysPublicParam> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "公共参数编号")
|
||||
private Long publicId;
|
||||
|
||||
/**
|
||||
* 公共参数名称
|
||||
*/
|
||||
@Schema(description = "公共参数名称", required = true, example = "公共参数名称")
|
||||
private String publicName;
|
||||
|
||||
/**
|
||||
* 公共参数地址值,英文大写+下划线
|
||||
*/
|
||||
@Schema(description = "键[英文大写+下划线]", required = true, example = "PIGX_PUBLIC_KEY")
|
||||
private String publicKey;
|
||||
|
||||
/**
|
||||
* 值
|
||||
*/
|
||||
@Schema(description = "值", required = true, example = "999")
|
||||
private String publicValue;
|
||||
|
||||
/**
|
||||
* 状态(1有效;2无效;)
|
||||
*/
|
||||
@Schema(description = "标识[1有效;2无效]", example = "1")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 公共参数编码
|
||||
*/
|
||||
@Schema(description = "编码", example = "^(PIG|PIGX)$")
|
||||
private String validateCode;
|
||||
|
||||
/**
|
||||
* 是否是系统内置
|
||||
*/
|
||||
@Schema(description = "是否是系统内置")
|
||||
private String systemFlag;
|
||||
|
||||
/**
|
||||
* 配置类型:0-默认;1-检索;2-原文;3-报表;4-安全;5-文档;6-消息;9-其他
|
||||
*/
|
||||
@Schema(description = "类型[1-检索;2-原文...]", example = "1")
|
||||
private String publicType;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
@Schema(description = "修改人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 删除标记
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "删除标记,1:已删除,0:正常")
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 角色表
|
||||
* </p>
|
||||
*
|
||||
* @author lengleng
|
||||
* @since 2017-10-29
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "角色")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class SysRole extends Model<SysRole> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "role_id", type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "角色编号")
|
||||
private Long roleId;
|
||||
|
||||
@NotBlank(message = "角色名称不能为空")
|
||||
@Schema(description = "角色名称")
|
||||
private String roleName;
|
||||
|
||||
@NotBlank(message = "角色标识不能为空")
|
||||
@Schema(description = "角色标识")
|
||||
private String roleCode;
|
||||
|
||||
@Schema(description = "角色描述")
|
||||
private String roleDesc;
|
||||
|
||||
@NotNull(message = "数据权限类型不能为空")
|
||||
@Schema(description = "数据权限类型")
|
||||
private Integer dsType;
|
||||
|
||||
/**
|
||||
* 数据权限作用范围
|
||||
*/
|
||||
@Schema(description = "数据权限作用范围")
|
||||
private String dsScope;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
@Schema(description = "修改人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description = "创建时间")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@Schema(description = "修改时间")
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 删除标识(0-正常,1-删除)
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "删除标记,1:已删除,0:正常")
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 租户ID fix pigX 功能bug -> 默认角色为空报错 (字段未添加)
|
||||
*/
|
||||
@Schema(description = "用户所属租户id")
|
||||
private Long tenantId;
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 角色菜单表
|
||||
* </p>
|
||||
*
|
||||
* @author lengleng
|
||||
* @since 2017-10-29
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "角色菜单")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class SysRoleMenu extends Model<SysRoleMenu> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 角色ID
|
||||
*/
|
||||
@Schema(description = "角色id")
|
||||
private Long roleId;
|
||||
|
||||
/**
|
||||
* 菜单ID
|
||||
*/
|
||||
@Schema(description = "菜单id")
|
||||
private Long menuId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 路由
|
||||
*
|
||||
* @author lengleng
|
||||
* @date 2018-11-06 10:17:18
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "网关路由信息")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class SysRouteConf extends Model<SysRouteConf> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@JsonIgnore
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "主键")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 路由ID
|
||||
*/
|
||||
@Schema(description = "路由id")
|
||||
private String routeId;
|
||||
|
||||
/**
|
||||
* 路由名称
|
||||
*/
|
||||
@Schema(description = "路由名称")
|
||||
private String routeName;
|
||||
|
||||
/**
|
||||
* 断言
|
||||
*/
|
||||
@Schema(description = "断言")
|
||||
private String predicates;
|
||||
|
||||
/**
|
||||
* 过滤器
|
||||
*/
|
||||
@Schema(description = "过滤器")
|
||||
private String filters;
|
||||
|
||||
/**
|
||||
* uri
|
||||
*/
|
||||
@Schema(description = "请求uri")
|
||||
private String uri;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
@Schema(description = "排序值")
|
||||
private Integer sortOrder;
|
||||
|
||||
@Schema(description = "元数据")
|
||||
private String metadata;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@Schema(description = "修改时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 删除标识(0-正常,1-删除)
|
||||
*/
|
||||
@TableLogic
|
||||
@Schema(description = "删除标记,1:已删除,0:正常")
|
||||
private String delFlag;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,123 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
|
||||
/**
|
||||
* 日程
|
||||
*
|
||||
* @author aeizzz
|
||||
* @date 2023-03-06 14:26:23
|
||||
*/
|
||||
@Data
|
||||
@TableName("sys_schedule")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "日程")
|
||||
public class SysScheduleEntity extends Model<SysScheduleEntity> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
@Schema(description = "标题")
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 日程类型
|
||||
*/
|
||||
@Schema(description = "日程类型")
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@Schema(description = "状态")
|
||||
private String state;
|
||||
|
||||
/**
|
||||
* 内容
|
||||
*/
|
||||
@Schema(description = "内容")
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 时间
|
||||
*/
|
||||
@Schema(description = "时间")
|
||||
private LocalTime time;
|
||||
|
||||
/**
|
||||
* 日期
|
||||
*/
|
||||
@Schema(description = "日期")
|
||||
private LocalDate date;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@Schema(description = "创建人")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description = "创建时间")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@Schema(description = "修改人")
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@Schema(description = "更新时间")
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 删除标记
|
||||
*/
|
||||
@TableLogic
|
||||
@Schema(description = "删除标记")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String delFlag;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,128 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import com.pig4cloud.pigx.common.core.sensitive.Sensitive;
|
||||
import com.pig4cloud.pigx.common.core.util.ValidGroup;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 系统社交登录账号表
|
||||
*
|
||||
* @author lengleng
|
||||
* @date 2018-08-16 21:30:41
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "第三方账号信息")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class SysSocialDetails extends Model<SysSocialDetails> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主鍵
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "主键")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
@NotBlank(message = "类型不能为空")
|
||||
@Schema(description = "账号类型")
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
@Schema(description = "描述")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* appid
|
||||
*/
|
||||
@Sensitive(prefixNoMaskLen = 4, suffixNoMaskLen = 4)
|
||||
@NotBlank(message = "账号不能为空")
|
||||
@Schema(description = "appId")
|
||||
private String appId;
|
||||
|
||||
/**
|
||||
* app_secret
|
||||
*/
|
||||
@Sensitive(prefixNoMaskLen = 9, suffixNoMaskLen = 9)
|
||||
@NotBlank(message = "密钥不能为空", groups = { ValidGroup.Insert.class })
|
||||
@Schema(description = "app secret")
|
||||
private String appSecret;
|
||||
|
||||
/**
|
||||
* 回调地址
|
||||
*/
|
||||
@Schema(description = "回调地址")
|
||||
private String redirectUrl;
|
||||
|
||||
/**
|
||||
* 拓展字段
|
||||
*/
|
||||
@Schema(description = "拓展字段")
|
||||
private String ext;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
@Schema(description = "修改人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description = "创建时间")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@Schema(description = "更新时间")
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 删除标记
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "删除标记,1:已删除,0:正常")
|
||||
private String delFlag;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,167 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.api.entity;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 租户
|
||||
*
|
||||
* @author lengleng
|
||||
* @date 2019-05-15 15:55:41
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "租户信息")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class SysTenant extends Model<SysTenant> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 租户id
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "租户id")
|
||||
@ExcelProperty("租户id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 租户名称
|
||||
*/
|
||||
@Schema(description = "租户名称")
|
||||
@ExcelProperty("租户名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 租户编号
|
||||
*/
|
||||
@Schema(description = "租户编号")
|
||||
@ExcelProperty("租户编号")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 租户域名
|
||||
*/
|
||||
@Schema(description = "租户域名")
|
||||
@ExcelProperty("租户域名")
|
||||
private String tenantDomain;
|
||||
|
||||
/**
|
||||
* 网站名称
|
||||
*/
|
||||
@Schema(description = "网站名称")
|
||||
@ExcelProperty("网站名称")
|
||||
private String websiteName;
|
||||
|
||||
/**
|
||||
* logo
|
||||
*/
|
||||
@Schema(description = "logo")
|
||||
@ExcelProperty("logo")
|
||||
private String logo;
|
||||
|
||||
/**
|
||||
* footer
|
||||
*/
|
||||
@Schema(description = "footer")
|
||||
@ExcelProperty("footer")
|
||||
private String footer;
|
||||
|
||||
/**
|
||||
* 移动端二维码
|
||||
*/
|
||||
@Schema(description = "移动端二维码")
|
||||
@ExcelProperty("移动端二维码")
|
||||
private String miniQr;
|
||||
|
||||
/**
|
||||
* 登录页图片
|
||||
*/
|
||||
@Schema(description = "登录页图片")
|
||||
@ExcelProperty("登录页图片")
|
||||
private String background;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
@Schema(description = "开始时间")
|
||||
@ExcelProperty("开始时间")
|
||||
private LocalDateTime startTime;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
@Schema(description = "结束时间")
|
||||
@ExcelProperty("结束时间")
|
||||
private LocalDateTime endTime;
|
||||
|
||||
/**
|
||||
* 0正常 9-冻结
|
||||
*/
|
||||
@Schema(description = "租户冻结标记,9:冻结,0:正常")
|
||||
@ExcelProperty("租户冻结")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "租户菜单ID")
|
||||
@ExcelProperty("租户菜单ID")
|
||||
private String menuId;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
@Schema(description = "修改人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 删除标记
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "删除标记,1:已删除,0:正常")
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,190 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.javers.core.metamodel.annotation.DiffInclude;
|
||||
import org.javers.core.metamodel.annotation.PropertyName;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户表
|
||||
* </p>
|
||||
*
|
||||
* @author lengleng
|
||||
* @since 2017-10-29
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "用户")
|
||||
public class SysUser implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(value = "user_id", type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "主键id")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
@Schema(description = "用户名")
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
@Schema(description = "密码")
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 随机盐
|
||||
*/
|
||||
@JsonIgnore
|
||||
@Schema(description = "随机盐")
|
||||
private String salt;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
@Schema(description = "修改人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
@Schema(description = "修改时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 0-正常,1-删除
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "删除标记,1:已删除,0:正常")
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 锁定标记
|
||||
*/
|
||||
@Schema(description = "锁定标记")
|
||||
private String lockFlag;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@DiffInclude
|
||||
@PropertyName("手机号")
|
||||
@Schema(description = "手机号")
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 头像
|
||||
*/
|
||||
@Schema(description = "头像地址")
|
||||
private String avatar;
|
||||
|
||||
/**
|
||||
* 部门ID
|
||||
*/
|
||||
@Schema(description = "用户所属部门id")
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
@Schema(description = "用户所属租户id")
|
||||
private Long tenantId;
|
||||
|
||||
/**
|
||||
* 微信openid
|
||||
*/
|
||||
@Schema(description = "微信openid")
|
||||
private String wxOpenid;
|
||||
|
||||
/**
|
||||
* 微信小程序openId
|
||||
*/
|
||||
@Schema(description = "微信小程序openid")
|
||||
private String miniOpenid;
|
||||
|
||||
/**
|
||||
* QQ openid
|
||||
*/
|
||||
@Schema(description = "QQ openid")
|
||||
private String qqOpenid;
|
||||
|
||||
/**
|
||||
* 码云唯一标识
|
||||
*/
|
||||
@Schema(description = "码云唯一标识")
|
||||
private String giteeLogin;
|
||||
|
||||
/**
|
||||
* 开源中国唯一标识
|
||||
*/
|
||||
@Schema(description = "开源中国唯一标识")
|
||||
private String oscId;
|
||||
|
||||
/**
|
||||
* 昵称
|
||||
*/
|
||||
@Schema(description = "昵称")
|
||||
private String nickname;
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
@Schema(description = "姓名")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
@DiffInclude
|
||||
@PropertyName("邮箱")
|
||||
@Schema(description = "邮箱")
|
||||
private String email;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* Copyright (c) 2020 pig4cloud Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户岗位表
|
||||
* </p>
|
||||
*
|
||||
* @author fxz
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class SysUserPost extends Model<SysUserPost> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
@Schema(description = "用户id")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 岗位ID
|
||||
*/
|
||||
@Schema(description = "岗位id")
|
||||
private Long postId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户角色表
|
||||
* </p>
|
||||
*
|
||||
* @author lengleng
|
||||
* @since 2017-10-29
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "用户角色")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class SysUserRole extends Model<SysUserRole> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
@Schema(description = "用户id")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 角色ID
|
||||
*/
|
||||
@Schema(description = "角色id")
|
||||
private Long roleId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.api.feign;
|
||||
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysAuditLog;
|
||||
import com.pig4cloud.pigx.common.core.constant.SecurityConstants;
|
||||
import com.pig4cloud.pigx.common.core.constant.ServiceNameConstants;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestHeader;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2023-02-27
|
||||
*/
|
||||
@FeignClient(contextId = "remoteAuditLogService", value = ServiceNameConstants.UPMS_SERVICE)
|
||||
public interface RemoteAuditLogService {
|
||||
|
||||
/**
|
||||
* 保存日志
|
||||
* @param auditLogList 日志实体 列表
|
||||
* @param from 是否内部调用
|
||||
* @return succes、false
|
||||
*/
|
||||
@PostMapping("/audit")
|
||||
R<Boolean> saveLog(@RequestBody List<SysAuditLog> auditLogList, @RequestHeader(SecurityConstants.FROM) String from);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.api.feign;
|
||||
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysOauthClientDetails;
|
||||
import com.pig4cloud.pigx.common.core.constant.SecurityConstants;
|
||||
import com.pig4cloud.pigx.common.core.constant.ServiceNameConstants;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestHeader;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2020/12/05
|
||||
*/
|
||||
@FeignClient(contextId = "remoteClientDetailsService", value = ServiceNameConstants.UPMS_SERVICE)
|
||||
public interface RemoteClientDetailsService {
|
||||
|
||||
/**
|
||||
* 通过clientId 查询客户端信息
|
||||
* @param clientId 用户名
|
||||
* @param from 调用标志
|
||||
* @return R
|
||||
*/
|
||||
@GetMapping("/client/getClientDetailsById/{clientId}")
|
||||
R<SysOauthClientDetails> getClientDetailsById(@PathVariable("clientId") String clientId,
|
||||
@RequestHeader(SecurityConstants.FROM) String from);
|
||||
|
||||
/**
|
||||
* 查询全部客户端
|
||||
* @param from 调用标识
|
||||
* @return R
|
||||
*/
|
||||
@GetMapping("/client/list")
|
||||
R<List<SysOauthClientDetails>> listClientDetails(@RequestHeader(SecurityConstants.FROM) String from);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.api.feign;
|
||||
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysDept;
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysRole;
|
||||
import com.pig4cloud.pigx.common.core.constant.ServiceNameConstants;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2019-09-07
|
||||
* <p>
|
||||
* 远程数据权限调用接口
|
||||
*/
|
||||
@FeignClient(contextId = "remoteDataScopeService", value = ServiceNameConstants.UPMS_SERVICE)
|
||||
public interface RemoteDataScopeService {
|
||||
|
||||
/**
|
||||
* 通过角色ID 查询角色列表
|
||||
* @param roleIdList 角色ID
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/role/getRoleList")
|
||||
R<List<SysRole>> getRoleList(@RequestBody List<String> roleIdList);
|
||||
|
||||
/**
|
||||
* 获取子级部门
|
||||
* @param deptId 部门ID
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/dept/getDescendantList/{deptId}")
|
||||
R<List<SysDept>> getDescendantList(@PathVariable("deptId") Long deptId);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.api.feign;
|
||||
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysDept;
|
||||
import com.pig4cloud.pigx.common.core.constant.ServiceNameConstants;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2018/6/22
|
||||
*/
|
||||
@FeignClient(contextId = "remoteDeptService", value = ServiceNameConstants.UPMS_SERVICE)
|
||||
public interface RemoteDeptService {
|
||||
|
||||
/**
|
||||
* 获取所有部门接口
|
||||
* @return R 返回结果对象,包含所有部门信息列表
|
||||
*/
|
||||
@GetMapping("/dept/list")
|
||||
R<List<SysDept>> getAllDept();
|
||||
|
||||
/**
|
||||
* 通过部门ID获取负责人列表
|
||||
* @param deptId 部门ID
|
||||
* @return 负责人ID列表
|
||||
*/
|
||||
@GetMapping("/dept/leader/{deptId}")
|
||||
R<List<Long>> getAllDeptLeader(@PathVariable("deptId") Long deptId);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.pig4cloud.pigx.admin.api.feign;
|
||||
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysDictItem;
|
||||
import com.pig4cloud.pigx.common.core.constant.ServiceNameConstants;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2020/5/12
|
||||
* <p>
|
||||
* 查询参数相关
|
||||
*/
|
||||
@FeignClient(contextId = "remoteDictService", value = ServiceNameConstants.UPMS_SERVICE)
|
||||
public interface RemoteDictService {
|
||||
|
||||
/**
|
||||
* 通过字典类型查找字典
|
||||
* @param type 字典类型
|
||||
* @return 同类型字典
|
||||
*/
|
||||
@GetMapping("/dict/type/{type}")
|
||||
R<List<SysDictItem>> getDictByType(@PathVariable("type") String type);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.api.feign;
|
||||
|
||||
import com.pig4cloud.pigx.admin.api.dto.SysLogDTO;
|
||||
import com.pig4cloud.pigx.common.core.constant.SecurityConstants;
|
||||
import com.pig4cloud.pigx.common.core.constant.ServiceNameConstants;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestHeader;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2018/6/28
|
||||
*/
|
||||
@FeignClient(contextId = "remoteLogService", value = ServiceNameConstants.UPMS_SERVICE)
|
||||
public interface RemoteLogService {
|
||||
|
||||
/**
|
||||
* 保存日志
|
||||
* @param sysLog 日志实体
|
||||
* @param from 是否内部调用
|
||||
* @return succes、false
|
||||
*/
|
||||
@PostMapping("/log/save")
|
||||
R<Boolean> saveLog(@RequestBody SysLogDTO sysLog, @RequestHeader(SecurityConstants.FROM) String from);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.pig4cloud.pigx.admin.api.feign;
|
||||
|
||||
import com.pig4cloud.pigx.common.core.constant.SecurityConstants;
|
||||
import com.pig4cloud.pigx.common.core.constant.ServiceNameConstants;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestHeader;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2020/5/12
|
||||
* <p>
|
||||
* 查询参数相关
|
||||
*/
|
||||
@FeignClient(contextId = "remoteParamService", value = ServiceNameConstants.UPMS_SERVICE)
|
||||
public interface RemoteParamService {
|
||||
|
||||
/**
|
||||
* 通过key 查询参数配置
|
||||
* @param key key
|
||||
* @param from 声明成内部调用,避免MQ 等无法调用
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/param/publicValue/{key}")
|
||||
R<String> getByKey(@PathVariable("key") String key, @RequestHeader(SecurityConstants.FROM) String from);
|
||||
|
||||
/**
|
||||
* 通过keys 查询参数配置
|
||||
* @param keys keys
|
||||
* @param from 声明成内部调用,避免MQ 等无法调用
|
||||
* @return map
|
||||
*/
|
||||
@GetMapping("/param/publicValues")
|
||||
R<Map<String, Object>> getByKeys(@RequestParam("keys") String[] keys,
|
||||
@RequestHeader(SecurityConstants.FROM) String from);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.api.feign;
|
||||
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysRole;
|
||||
import com.pig4cloud.pigx.common.core.constant.ServiceNameConstants;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2018/6/22
|
||||
*/
|
||||
@FeignClient(contextId = "remoteRoleService", value = ServiceNameConstants.UPMS_SERVICE)
|
||||
public interface RemoteRoleService {
|
||||
|
||||
/**
|
||||
* 获取所有部门接口
|
||||
* @return R 返回结果对象,包含所有部门信息列表
|
||||
*/
|
||||
@GetMapping("/role/list")
|
||||
R<List<SysRole>> getAllRole();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.api.feign;
|
||||
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysTenant;
|
||||
import com.pig4cloud.pigx.common.core.constant.SecurityConstants;
|
||||
import com.pig4cloud.pigx.common.core.constant.ServiceNameConstants;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestHeader;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2019/6/19
|
||||
* <p>
|
||||
* 租户接口
|
||||
*/
|
||||
@FeignClient(contextId = "remoteTenantService", value = ServiceNameConstants.UPMS_SERVICE)
|
||||
public interface RemoteTenantService {
|
||||
|
||||
/**
|
||||
* 查询全部有效租户
|
||||
* @param from 内部标志
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/tenant/list")
|
||||
R<List<SysTenant>> list(@RequestHeader(SecurityConstants.FROM) String from);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.api.feign;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.pig4cloud.pigx.common.core.constant.CommonConstants;
|
||||
import com.pig4cloud.pigx.common.core.constant.SecurityConstants;
|
||||
import com.pig4cloud.pigx.common.core.constant.ServiceNameConstants;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2018/9/4
|
||||
*/
|
||||
@FeignClient(contextId = "remoteTokenService", value = ServiceNameConstants.AUTH_SERVICE)
|
||||
public interface RemoteTokenService {
|
||||
|
||||
/**
|
||||
* 分页查询token 信息
|
||||
* @param from 内部调用标志
|
||||
* @param params 分页参数
|
||||
* @param from 内部调用标志
|
||||
* @return page
|
||||
*/
|
||||
@PostMapping("/token/page")
|
||||
R<Page> getTokenPage(@RequestBody Map<String, Object> params, @RequestHeader(SecurityConstants.FROM) String from);
|
||||
|
||||
/**
|
||||
* 删除token
|
||||
* @param from 内部调用标志
|
||||
* @param token token
|
||||
* @param from 内部调用标志
|
||||
* @return
|
||||
*/
|
||||
@DeleteMapping("/token/{token}")
|
||||
R<Boolean> removeTokenById(@PathVariable("token") String token, @RequestHeader(SecurityConstants.FROM) String from);
|
||||
|
||||
/**
|
||||
* 校验令牌获取用户信息
|
||||
* @param token
|
||||
* @param from
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/token/query-token")
|
||||
R<Map<String, Object>> queryToken(@RequestParam("token") String token,
|
||||
@RequestParam(CommonConstants.TENANT_ID) String tenantId,
|
||||
@RequestHeader(SecurityConstants.FROM) String from);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.api.feign;
|
||||
|
||||
import com.pig4cloud.pigx.admin.api.dto.UserInfo;
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysUser;
|
||||
import com.pig4cloud.pigx.common.core.constant.SecurityConstants;
|
||||
import com.pig4cloud.pigx.common.core.constant.ServiceNameConstants;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2018/6/22
|
||||
*/
|
||||
@FeignClient(contextId = "remoteUserService", value = ServiceNameConstants.UPMS_SERVICE)
|
||||
public interface RemoteUserService {
|
||||
|
||||
/**
|
||||
* 通过用户名查询用户、角色信息
|
||||
* @param username 用户名
|
||||
* @param from 调用标志
|
||||
* @return R
|
||||
*/
|
||||
@GetMapping("/user/info/{username}")
|
||||
R<UserInfo> info(@PathVariable("username") String username, @RequestHeader(SecurityConstants.FROM) String from);
|
||||
|
||||
/**
|
||||
* 根据用户ID获取用户
|
||||
* @param userId ID
|
||||
* @return SysUser
|
||||
*/
|
||||
@GetMapping("/user/details/{userId}")
|
||||
R<SysUser> getUserById(@PathVariable("userId") Long userId);
|
||||
|
||||
/**
|
||||
* 通过社交账号或手机号查询用户、角色信息
|
||||
* @param inStr appid@code
|
||||
* @param from 调用标志
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/social/info/{inStr}")
|
||||
R<UserInfo> social(@PathVariable("inStr") String inStr, @RequestHeader(SecurityConstants.FROM) String from);
|
||||
|
||||
/**
|
||||
* 查询上级部门的用户信息
|
||||
* @param username 用户名
|
||||
* @return R
|
||||
*/
|
||||
@GetMapping("/user/ancestor/{username}")
|
||||
R<List<SysUser>> ancestorUsers(@PathVariable("username") String username);
|
||||
|
||||
/**
|
||||
* 锁定用户
|
||||
* @param username 用户名
|
||||
* @param from 调用标识
|
||||
* @return
|
||||
*/
|
||||
@PutMapping("/user/lock/{username}")
|
||||
R<Boolean> lockUser(@PathVariable("username") String username, @RequestHeader(SecurityConstants.FROM) String from);
|
||||
|
||||
/**
|
||||
* 根据角色ID查询用户列表
|
||||
* @param roleIdList 角色ID列表
|
||||
* @return 用户ID列表
|
||||
*/
|
||||
@GetMapping("/user/getUserIdListByRoleIdList")
|
||||
R<List<Long>> getUserIdListByRoleIdList(@RequestParam("roleIdList") List<Long> roleIdList);
|
||||
|
||||
/**
|
||||
* 根据部门ID列表获取用户ID列表接口
|
||||
* @param deptIdList 部门ID列表
|
||||
* @return 用户ID列表
|
||||
*/
|
||||
@GetMapping("/user/getUserIdListByDeptIdList")
|
||||
R<List<SysUser>> getUserIdListByDeptIdList(@RequestParam("deptIdList") List<Long> deptIdList);
|
||||
|
||||
/**
|
||||
* 通过用户名查询用户列表
|
||||
* @param userName 用户名
|
||||
* @return 用户列表
|
||||
*/
|
||||
@GetMapping("/user/getUserListByUserName")
|
||||
R<List<SysUser>> getUserListByUserName(@RequestParam("username") String userName);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.pig4cloud.pigx.admin.api.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnore;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.pig4cloud.pigx.common.excel.annotation.ExcelLine;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 企业微信用户导入
|
||||
*/
|
||||
@Data
|
||||
public class CpUserExcelVo implements Serializable {
|
||||
|
||||
/**
|
||||
* 导入时候回显行号
|
||||
*/
|
||||
@ExcelLine
|
||||
@ExcelIgnore
|
||||
private Long lineNum;
|
||||
|
||||
@NotBlank(message = "帐号不能为空")
|
||||
@ExcelProperty("帐号")
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@NotBlank(message = "手机号不能为空")
|
||||
@ExcelProperty("手机")
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
@NotBlank(message = "姓名不能为空")
|
||||
@ExcelProperty("姓名")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 别名
|
||||
*/
|
||||
@ExcelProperty("别名")
|
||||
private String nickname;
|
||||
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
@NotBlank(message = "部门不能为空")
|
||||
@ExcelProperty("部门")
|
||||
private String deptName;
|
||||
|
||||
@ExcelProperty("企业邮箱")
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 锁定标记
|
||||
*/
|
||||
@ExcelProperty("激活状态,0:已激活,9:未激活")
|
||||
private String lockFlag;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.pig4cloud.pigx.admin.api.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnore;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.pig4cloud.pigx.common.excel.annotation.ExcelLine;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 部门导入导出
|
||||
*/
|
||||
@Data
|
||||
public class DeptExcelVo implements Serializable {
|
||||
|
||||
/**
|
||||
* 导入时候回显行号
|
||||
*/
|
||||
@ExcelLine
|
||||
@ExcelIgnore
|
||||
private Long lineNum;
|
||||
|
||||
/**
|
||||
* 上级部门
|
||||
*/
|
||||
@NotBlank(message = "上级部门不能为空")
|
||||
@ExcelProperty("上级部门")
|
||||
private String parentName;
|
||||
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
@NotBlank(message = "部门名称不能为空")
|
||||
@ExcelProperty("部门名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
@ExcelProperty(value = "排序值")
|
||||
private Integer sortOrder;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.pig4cloud.pigx.admin.api.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnore;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.pig4cloud.pigx.common.excel.annotation.ExcelLine;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class DingUserExcelVo implements Serializable {
|
||||
|
||||
/**
|
||||
* 导入时候回显行号
|
||||
*/
|
||||
@ExcelLine
|
||||
@ExcelIgnore
|
||||
private Long lineNum;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@NotBlank(message = "手机号不能为空")
|
||||
@ExcelProperty("手机号")
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
@NotBlank(message = "姓名不能为空")
|
||||
@ExcelProperty("姓名")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
@NotBlank(message = "部门不能为空")
|
||||
@ExcelProperty("部门")
|
||||
private String deptName;
|
||||
|
||||
@ExcelProperty("邮箱")
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 锁定标记
|
||||
*/
|
||||
@ExcelProperty("激活状态,0:是,9:否")
|
||||
private String lockFlag;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
package com.pig4cloud.pigx.admin.api.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnore;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
||||
import com.pig4cloud.pigx.common.excel.annotation.ExcelLine;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 岗位excel 对应的实体
|
||||
*
|
||||
* @author fxz
|
||||
* @date 2022/3/21
|
||||
*/
|
||||
@Data
|
||||
@ColumnWidth(30)
|
||||
public class PostExcelVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 导入时候回显行号
|
||||
*/
|
||||
@ExcelLine
|
||||
@ExcelIgnore
|
||||
private Long lineNum;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@ExcelProperty("岗位编号")
|
||||
private Long postId;
|
||||
|
||||
/**
|
||||
* 岗位名称
|
||||
*/
|
||||
@NotBlank(message = "岗位名称不能为空")
|
||||
@ExcelProperty("岗位名称")
|
||||
private String postName;
|
||||
|
||||
/**
|
||||
* 岗位标识
|
||||
*/
|
||||
@NotBlank(message = "岗位标识不能为空")
|
||||
@ExcelProperty("岗位标识")
|
||||
private String postCode;
|
||||
|
||||
/**
|
||||
* 岗位排序
|
||||
*/
|
||||
@NotNull(message = "岗位排序不能为空")
|
||||
@ExcelProperty("岗位排序")
|
||||
private Integer postSort;
|
||||
|
||||
/**
|
||||
* 岗位描述
|
||||
*/
|
||||
@NotBlank(message = "岗位描述不能为空")
|
||||
@ExcelProperty(value = "岗位描述")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ExcelProperty(value = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.api.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2018/8/27 前端日志vo
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "前端日志展示对象")
|
||||
public class PreLogVO {
|
||||
|
||||
/**
|
||||
* 请求url
|
||||
*/
|
||||
@Schema(description = "请求url")
|
||||
private String url;
|
||||
|
||||
/**
|
||||
* 请求耗时
|
||||
*/
|
||||
@Schema(description = "请求耗时")
|
||||
private String time;
|
||||
|
||||
/**
|
||||
* 请求用户
|
||||
*/
|
||||
@Schema(description = "请求用户")
|
||||
private String user;
|
||||
|
||||
/**
|
||||
* 请求结果
|
||||
*/
|
||||
@Schema(description = "请求结果0:成功9:失败")
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 请求传递参数
|
||||
*/
|
||||
@Schema(description = "请求传递参数")
|
||||
private String message;
|
||||
|
||||
/**
|
||||
* 异常信息
|
||||
*/
|
||||
@Schema(description = "异常信息")
|
||||
private String stack;
|
||||
|
||||
/**
|
||||
* 日志标题
|
||||
*/
|
||||
@Schema(description = "日志标题")
|
||||
private String info;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.pig4cloud.pigx.admin.api.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnore;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
||||
import com.pig4cloud.pigx.common.excel.annotation.ExcelLine;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 角色excel 对应的实体
|
||||
*
|
||||
* @author fxz
|
||||
* @date 2022/3/21
|
||||
*/
|
||||
@Data
|
||||
@ColumnWidth(30)
|
||||
public class RoleExcelVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 导入时候回显行号
|
||||
*/
|
||||
@ExcelLine
|
||||
@ExcelIgnore
|
||||
private Long lineNum;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@ExcelProperty("角色编号")
|
||||
private Long roleId;
|
||||
|
||||
/**
|
||||
* 角色名称
|
||||
*/
|
||||
@NotBlank(message = "角色名称不能为空")
|
||||
@ExcelProperty("角色名称")
|
||||
private String roleName;
|
||||
|
||||
/**
|
||||
* 角色标识
|
||||
*/
|
||||
@NotBlank(message = "角色标识不能为空")
|
||||
@ExcelProperty("角色标识")
|
||||
private String roleCode;
|
||||
|
||||
/**
|
||||
* 角色描述
|
||||
*/
|
||||
@NotBlank(message = "角色描述不能为空")
|
||||
@ExcelProperty("角色描述")
|
||||
private String roleDesc;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ExcelProperty(value = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.api.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2020/2/10
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "前端角色展示对象")
|
||||
public class RoleVO {
|
||||
|
||||
/**
|
||||
* 角色id
|
||||
*/
|
||||
private Long roleId;
|
||||
|
||||
/**
|
||||
* 菜单列表
|
||||
*/
|
||||
private String menuIds;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.pig4cloud.pigx.admin.api.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 前端展示令牌管理
|
||||
*
|
||||
* @author lengleng
|
||||
* @date 2022/6/2
|
||||
*/
|
||||
@Data
|
||||
public class TokenVo {
|
||||
|
||||
private String id;
|
||||
|
||||
private Long userId;
|
||||
|
||||
private String clientId;
|
||||
|
||||
private String username;
|
||||
|
||||
private String accessToken;
|
||||
|
||||
private String issuedAt;
|
||||
|
||||
private String expiresAt;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
package com.pig4cloud.pigx.admin.api.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnore;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
||||
import com.pig4cloud.pigx.common.excel.annotation.ExcelLine;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 用户excel 对应的实体
|
||||
*
|
||||
* @author lengleng
|
||||
* @date 2021/8/4
|
||||
*/
|
||||
@Data
|
||||
@ColumnWidth(30)
|
||||
public class UserExcelVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 导入时候回显行号
|
||||
*/
|
||||
@ExcelLine
|
||||
@ExcelIgnore
|
||||
private Long lineNum;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@ExcelProperty("用户编号")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
@NotBlank(message = "用户名不能为空")
|
||||
@ExcelProperty("用户名")
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@NotBlank(message = "手机号不能为空")
|
||||
@ExcelProperty("手机号")
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@NotBlank(message = "昵称不能为空")
|
||||
@ExcelProperty("昵称")
|
||||
private String nickname;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@NotBlank(message = "姓名不能为空")
|
||||
@ExcelProperty("姓名")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@NotBlank(message = "邮箱不能为空")
|
||||
@ExcelProperty("邮箱")
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
@NotBlank(message = "部门名称不能为空")
|
||||
@ExcelProperty("部门名称")
|
||||
private String deptName;
|
||||
|
||||
/**
|
||||
* 角色列表
|
||||
*/
|
||||
@NotBlank(message = "角色不能为空")
|
||||
@ExcelProperty("角色")
|
||||
private String roleNameList;
|
||||
|
||||
/**
|
||||
* 角色列表
|
||||
*/
|
||||
@NotBlank(message = "岗位不能为空")
|
||||
@ExcelProperty("岗位名称")
|
||||
private String postNameList;
|
||||
|
||||
/**
|
||||
* 锁定标记
|
||||
*/
|
||||
@ExcelProperty("锁定标记,0:正常,9:已锁定")
|
||||
private String lockFlag;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ExcelProperty(value = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,175 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.api.vo;
|
||||
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysPost;
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysRole;
|
||||
import com.pig4cloud.pigx.common.core.sensitive.Sensitive;
|
||||
import com.pig4cloud.pigx.common.core.sensitive.SensitiveTypeEnum;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2017/10/29
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "前端用户展示对象")
|
||||
public class UserVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@Schema(description = "主键")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
@Schema(description = "用户名")
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
@Schema(description = "密码")
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 随机盐
|
||||
*/
|
||||
@Schema(description = "随机盐")
|
||||
private String salt;
|
||||
|
||||
/**
|
||||
* 微信openid
|
||||
*/
|
||||
@Schema(description = "微信open id")
|
||||
private String wxOpenid;
|
||||
|
||||
/**
|
||||
* QQ openid
|
||||
*/
|
||||
@Schema(description = "qq open id")
|
||||
private String qqOpenid;
|
||||
|
||||
/**
|
||||
* gitee openid
|
||||
*/
|
||||
@Schema(description = "gitee open id")
|
||||
private String giteeOpenId;
|
||||
|
||||
/**
|
||||
* 开源中国 openid
|
||||
*/
|
||||
@Schema(description = "开源中国 open id")
|
||||
private String oscOpenId;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@Schema(description = "修改时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 0-正常,1-删除
|
||||
*/
|
||||
@Schema(description = "删除标记,1:已删除,0:正常")
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 锁定标记
|
||||
*/
|
||||
@Schema(description = "锁定标记,0:正常,9:已锁定")
|
||||
private String lockFlag;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@Sensitive(type = SensitiveTypeEnum.MOBILE_PHONE)
|
||||
@Schema(description = "手机号")
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 头像
|
||||
*/
|
||||
@Schema(description = "头像")
|
||||
private String avatar;
|
||||
|
||||
/**
|
||||
* 部门ID
|
||||
*/
|
||||
@Schema(description = "所属部门")
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
@Schema(description = "所属租户")
|
||||
private Long tenantId;
|
||||
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
@Schema(description = "所属部门名称")
|
||||
private String deptName;
|
||||
|
||||
/**
|
||||
* 角色列表
|
||||
*/
|
||||
@Schema(description = "拥有的角色列表")
|
||||
private List<SysRole> roleList;
|
||||
|
||||
/**
|
||||
* 岗位列表
|
||||
*/
|
||||
private List<SysPost> postList;
|
||||
|
||||
/**
|
||||
* 昵称
|
||||
*/
|
||||
@Schema(description = "昵称")
|
||||
private String nickname;
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
@Schema(description = "姓名")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
@Schema(description = "邮箱")
|
||||
private String email;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
com.pig4cloud.pigx.admin.api.feign.RemoteDataScopeService
|
||||
com.pig4cloud.pigx.admin.api.feign.RemoteClientDetailsService
|
||||
com.pig4cloud.pigx.admin.api.feign.RemoteLogService
|
||||
com.pig4cloud.pigx.admin.api.feign.RemoteParamService
|
||||
com.pig4cloud.pigx.admin.api.feign.RemoteTenantService
|
||||
com.pig4cloud.pigx.admin.api.feign.RemoteTokenService
|
||||
com.pig4cloud.pigx.admin.api.feign.RemoteUserService
|
||||
com.pig4cloud.pigx.admin.api.feign.RemoteRoleService
|
||||
com.pig4cloud.pigx.admin.api.feign.RemoteDeptService
|
||||
com.pig4cloud.pigx.admin.api.feign.RemoteDictService
|
||||
com.pig4cloud.pigx.admin.api.feign.RemoteAuditLogService
|
||||
18
as-upms/as-upms-biz/Dockerfile
Normal file
18
as-upms/as-upms-biz/Dockerfile
Normal file
@@ -0,0 +1,18 @@
|
||||
FROM pig4cloud/java:8-jre
|
||||
|
||||
MAINTAINER wangiegie@gmail.com
|
||||
|
||||
ENV TZ=Asia/Shanghai
|
||||
ENV JAVA_OPTS="-Xms512m -Xmx1024m -Djava.security.egd=file:/dev/./urandom"
|
||||
|
||||
RUN ln -sf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||
|
||||
RUN mkdir -p /pigx-upms
|
||||
|
||||
WORKDIR /as-upms
|
||||
|
||||
EXPOSE 4000
|
||||
|
||||
ADD ./target/as-upms-biz.jar ./
|
||||
|
||||
CMD sleep 60;java $JAVA_OPTS -jar as-upms-biz.jar
|
||||
186
as-upms/as-upms-biz/pom.xml
Normal file
186
as-upms/as-upms-biz/pom.xml
Normal file
@@ -0,0 +1,186 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>as-upms</artifactId>
|
||||
<version>5.2.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>as-upms-biz</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<description>pigx 通用用户权限管理系统业务处理模块</description>
|
||||
|
||||
<dependencies>
|
||||
<!-- mysql -->
|
||||
<dependency>
|
||||
<groupId>com.mysql</groupId>
|
||||
<artifactId>mysql-connector-j</artifactId>
|
||||
</dependency>
|
||||
<!-- ojdbc8 -->
|
||||
<dependency>
|
||||
<groupId>com.oracle.database.jdbc</groupId>
|
||||
<artifactId>ojdbc8</artifactId>
|
||||
</dependency>
|
||||
<!--PG-->
|
||||
<dependency>
|
||||
<groupId>org.postgresql</groupId>
|
||||
<artifactId>postgresql</artifactId>
|
||||
</dependency>
|
||||
<!--mssql-->
|
||||
<dependency>
|
||||
<groupId>com.microsoft.sqlserver</groupId>
|
||||
<artifactId>mssql-jdbc</artifactId>
|
||||
</dependency>
|
||||
<!--DM8-->
|
||||
<dependency>
|
||||
<groupId>com.dameng</groupId>
|
||||
<artifactId>DmJdbcDriver18</artifactId>
|
||||
</dependency>
|
||||
<!--upms api、model 模块-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>as-upms-api</artifactId>
|
||||
</dependency>
|
||||
<!--日志处理-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-log</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-data</artifactId>
|
||||
</dependency>
|
||||
<!--swagger-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-swagger</artifactId>
|
||||
</dependency>
|
||||
<!--文件系统-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-oss</artifactId>
|
||||
</dependency>
|
||||
<!--注册中心客户端-->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
<!--配置中心客户端-->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
<!--spring security 、oauth、jwt依赖-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-security</artifactId>
|
||||
</dependency>
|
||||
<!--XSS 安全过滤-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-xss</artifactId>
|
||||
</dependency>
|
||||
<!-- 字段审计 -->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-audit</artifactId>
|
||||
</dependency>
|
||||
<!--支持动态路由配置 -->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-gateway</artifactId>
|
||||
</dependency>
|
||||
<!--sentinel 依赖-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-sentinel</artifactId>
|
||||
</dependency>
|
||||
<!--路由控制-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-gray</artifactId>
|
||||
</dependency>
|
||||
<!--mybatis-->
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||
</dependency>
|
||||
<!-- druid 连接池 -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>druid-spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
<!-- cas sdk -->
|
||||
<dependency>
|
||||
<groupId>org.jasig.cas.client</groupId>
|
||||
<artifactId>cas-client-core</artifactId>
|
||||
<version>${cas.sdk.version}</version>
|
||||
</dependency>
|
||||
<!--旧版api,新版api未包含全部的服务端API的产品能力-->
|
||||
<dependency>
|
||||
<groupId>com.aliyun</groupId>
|
||||
<artifactId>alibaba-dingtalk-service-sdk</artifactId>
|
||||
<version>${dingtalk.old.version}</version>
|
||||
</dependency>
|
||||
<!--企业微信-->
|
||||
<dependency>
|
||||
<groupId>com.github.binarywang</groupId>
|
||||
<artifactId>weixin-java-cp</artifactId>
|
||||
</dependency>
|
||||
<!--web 模块-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<!--undertow容器-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-undertow</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<configuration>
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>io.fabric8</groupId>
|
||||
<artifactId>docker-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<skip>false</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<filtering>true</filtering>
|
||||
<excludes>
|
||||
<exclude>**/*.xlsx</exclude>
|
||||
<exclude>**/*.xls</exclude>
|
||||
</excludes>
|
||||
</resource>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<filtering>false</filtering>
|
||||
<includes>
|
||||
<include>**/*.xlsx</include>
|
||||
<include>**/*.xls</include>
|
||||
</includes>
|
||||
</resource>
|
||||
</resources>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin;
|
||||
|
||||
import com.pig4cloud.pigx.common.feign.annotation.EnablePigxFeignClients;
|
||||
import com.pig4cloud.pigx.common.security.annotation.EnablePigxResourceServer;
|
||||
import com.pig4cloud.pigx.common.swagger.annotation.EnableOpenApi;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2018年06月21日
|
||||
* <p>
|
||||
* 用户统一管理系统
|
||||
*/
|
||||
@EnableOpenApi("admin")
|
||||
@EnablePigxFeignClients
|
||||
@EnablePigxResourceServer
|
||||
@EnableDiscoveryClient
|
||||
@SpringBootApplication
|
||||
public class AsAdminApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(AsAdminApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
package com.pig4cloud.pigx.admin.config;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.pig4cloud.pigx.admin.service.SysOauthClientDetailsService;
|
||||
import com.pig4cloud.pigx.admin.service.SysTenantService;
|
||||
import com.pig4cloud.pigx.common.core.constant.CacheConstants;
|
||||
import com.pig4cloud.pigx.common.data.tenant.TenantBroker;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.boot.web.context.WebServerInitializedEvent;
|
||||
import org.springframework.context.ApplicationEvent;
|
||||
import org.springframework.context.event.EventListener;
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.data.redis.listener.ChannelTopic;
|
||||
import org.springframework.data.redis.listener.RedisMessageListenerContainer;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.event.TransactionalEventListener;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2020/11/18
|
||||
* <p>
|
||||
* oauth 客户端认证参数初始化
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@SuppressWarnings("all")
|
||||
public class ClientDetailsInitRunner implements InitializingBean {
|
||||
|
||||
private final SysOauthClientDetailsService clientDetailsService;
|
||||
|
||||
private final RedisMessageListenerContainer listenerContainer;
|
||||
|
||||
private final SysTenantService tenantService;
|
||||
|
||||
private final RedisTemplate redisTemplate;
|
||||
|
||||
/**
|
||||
* WebServerInitializedEvent 使用 TransactionalEventListener 时启动时无法获取到事件
|
||||
*/
|
||||
@Async
|
||||
@Order
|
||||
@EventListener({ WebServerInitializedEvent.class })
|
||||
public void webServerInit() {
|
||||
this.initClientDetails();
|
||||
}
|
||||
|
||||
@Async
|
||||
@Order
|
||||
@TransactionalEventListener({ ClientDetailsInitEvent.class })
|
||||
public void initClientDetails() {
|
||||
log.debug("初始化客户端信息开始 ");
|
||||
|
||||
// 1. 查询全部租户循环遍历
|
||||
tenantService.list().forEach(tenant -> {
|
||||
TenantBroker.runAs(tenant.getId(), tenantId -> {
|
||||
// 2. 查询当前租户的所有客户端信息 (排除客户端扩展信息为空)
|
||||
clientDetailsService.list().stream().filter(client -> {
|
||||
return StrUtil.isNotBlank(client.getAdditionalInformation());
|
||||
}).forEach(client -> {
|
||||
// 3. 拼接key 1:client_config_flag:clinetId
|
||||
String key = String.format("%s:%s:%s", tenantId, CacheConstants.CLIENT_FLAG, client.getClientId());
|
||||
// 4. hashkey clientId 保存客户端信息
|
||||
redisTemplate.opsForValue().set(key, client.getAdditionalInformation());
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
log.debug("初始化客户端信息结束 ");
|
||||
}
|
||||
|
||||
/**
|
||||
* 客户端刷新事件
|
||||
*/
|
||||
public static class ClientDetailsInitEvent extends ApplicationEvent {
|
||||
|
||||
public ClientDetailsInitEvent(Object source) {
|
||||
super(source);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* redis 监听配置,监听 upms_redis_client_reload_topic,重新加载Redis
|
||||
*/
|
||||
@Override
|
||||
public void afterPropertiesSet() throws Exception {
|
||||
listenerContainer.addMessageListener((message, bytes) -> {
|
||||
log.warn("接收到重新Redis 重新加载客户端配置事件");
|
||||
initClientDetails();
|
||||
}, new ChannelTopic(CacheConstants.CLIENT_REDIS_RELOAD_TOPIC));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.config;
|
||||
|
||||
import cn.hutool.json.JSONArray;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.pig4cloud.pigx.admin.service.SysRouteConfService;
|
||||
import com.pig4cloud.pigx.common.core.constant.CacheConstants;
|
||||
import com.pig4cloud.pigx.common.gateway.support.DynamicRouteInitEvent;
|
||||
import com.pig4cloud.pigx.common.gateway.vo.RouteDefinitionVo;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.boot.web.context.WebServerInitializedEvent;
|
||||
import org.springframework.cloud.gateway.filter.FilterDefinition;
|
||||
import org.springframework.cloud.gateway.handler.predicate.PredicateDefinition;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.event.EventListener;
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.data.redis.listener.ChannelTopic;
|
||||
import org.springframework.data.redis.listener.RedisMessageListenerContainer;
|
||||
import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.transaction.event.TransactionalEventListener;
|
||||
|
||||
import java.net.URI;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2018/10/31
|
||||
* <p>
|
||||
* 容器启动后保存配置文件里面的路由信息到Redis
|
||||
*/
|
||||
@Slf4j
|
||||
@Configuration
|
||||
@RequiredArgsConstructor
|
||||
public class DynamicRouteInitRunner implements InitializingBean {
|
||||
|
||||
private final RedisTemplate redisTemplate;
|
||||
|
||||
private final SysRouteConfService routeConfService;
|
||||
|
||||
private final RedisMessageListenerContainer listenerContainer;
|
||||
|
||||
/**
|
||||
* WebServerInitializedEvent 使用 TransactionalEventListener 时启动时无法获取到事件
|
||||
*/
|
||||
@Async
|
||||
@Order
|
||||
@EventListener({ WebServerInitializedEvent.class })
|
||||
public void WebServerInit() {
|
||||
this.initRoute();
|
||||
}
|
||||
|
||||
@Async
|
||||
@Order
|
||||
@TransactionalEventListener({ DynamicRouteInitEvent.class })
|
||||
public void initRoute() {
|
||||
redisTemplate.delete(CacheConstants.ROUTE_KEY);
|
||||
log.info("开始初始化网关路由");
|
||||
|
||||
routeConfService.list().forEach(route -> {
|
||||
RouteDefinitionVo vo = new RouteDefinitionVo();
|
||||
vo.setRouteName(route.getRouteName());
|
||||
vo.setId(route.getRouteId());
|
||||
vo.setUri(URI.create(route.getUri()));
|
||||
vo.setOrder(route.getSortOrder());
|
||||
|
||||
JSONArray filterObj = JSONUtil.parseArray(route.getFilters());
|
||||
vo.setFilters(filterObj.toList(FilterDefinition.class));
|
||||
JSONArray predicateObj = JSONUtil.parseArray(route.getPredicates());
|
||||
vo.setPredicates(predicateObj.toList(PredicateDefinition.class));
|
||||
vo.setMetadata(JSONUtil.toBean(route.getMetadata(), Map.class));
|
||||
log.info("加载路由ID:{},{}", route.getRouteId(), vo);
|
||||
redisTemplate.setHashValueSerializer(new Jackson2JsonRedisSerializer<>(RouteDefinitionVo.class));
|
||||
redisTemplate.opsForHash().put(CacheConstants.ROUTE_KEY, route.getRouteId(), vo);
|
||||
});
|
||||
|
||||
// 通知网关重置路由
|
||||
redisTemplate.convertAndSend(CacheConstants.ROUTE_JVM_RELOAD_TOPIC, "路由信息,网关缓存更新");
|
||||
log.debug("初始化网关路由结束 ");
|
||||
}
|
||||
|
||||
/**
|
||||
* redis 监听配置,监听 upms_redis_route_reload_topic,重新加载Redis
|
||||
*/
|
||||
@Override
|
||||
public void afterPropertiesSet() {
|
||||
listenerContainer.addMessageListener((message, bytes) -> {
|
||||
log.warn("接收到重新Redis 重新加载路由事件");
|
||||
initRoute();
|
||||
}, new ChannelTopic(CacheConstants.ROUTE_REDIS_RELOAD_TOPIC));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package com.pig4cloud.pigx.admin.controller;
|
||||
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysDept;
|
||||
import com.pig4cloud.pigx.admin.service.ConnectService;
|
||||
import com.pig4cloud.pigx.admin.service.SysDeptService;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 钉钉、微信 互联
|
||||
*
|
||||
* @author lengleng
|
||||
* @date 2022/4/22
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/connect")
|
||||
@Tag(description = "connect", name = "开放互联")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class ConnectController {
|
||||
|
||||
private final ConnectService connectService;
|
||||
|
||||
private final SysDeptService deptService;
|
||||
|
||||
/**
|
||||
* 同步钉钉用户
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/sync/ding/user")
|
||||
@PreAuthorize("@pms.hasPermission('sys_connect_sync')")
|
||||
public R syncUser() {
|
||||
for (SysDept sysDept : deptService.list()) {
|
||||
connectService.syncDingUser(sysDept.getDeptId());
|
||||
}
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 同步钉钉部门
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/sync/ding/dept")
|
||||
@PreAuthorize("@pms.hasPermission('sys_connect_sync')")
|
||||
public R syncDept() {
|
||||
return R.ok(connectService.syncDingDept());
|
||||
}
|
||||
|
||||
/**
|
||||
* 同步企微用户
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/sync/cp/user")
|
||||
@PreAuthorize("@pms.hasPermission('sys_connect_sync')")
|
||||
public R syncCpUser() {
|
||||
return connectService.syncCpUser();
|
||||
}
|
||||
|
||||
/**
|
||||
* 同步企微部门
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/sync/cp/dept")
|
||||
@PreAuthorize("@pms.hasPermission('sys_connect_sync')")
|
||||
public R syncCpDept() {
|
||||
return connectService.syncCpDept();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.controller;
|
||||
|
||||
import com.pig4cloud.pigx.admin.service.MobileService;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.security.annotation.Inner;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2018/11/14
|
||||
* <p>
|
||||
* 手机验证码
|
||||
*/
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/mobile")
|
||||
@Tag(description = "mobile", name = "手机管理模块")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class MobileController {
|
||||
|
||||
private final MobileService mobileService;
|
||||
|
||||
@Inner(value = false)
|
||||
@GetMapping("/{mobile}")
|
||||
public R sendSmsCode(@PathVariable String mobile) {
|
||||
return mobileService.sendSmsCode(mobile);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.pig4cloud.pigx.admin.controller;
|
||||
|
||||
import com.pig4cloud.pigx.admin.api.dto.UserDTO;
|
||||
import com.pig4cloud.pigx.admin.service.SysUserService;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.log.annotation.SysLog;
|
||||
import com.pig4cloud.pigx.common.security.annotation.Inner;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2022/3/30
|
||||
* <p>
|
||||
* 客户端注册功能 register.user = false
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/register")
|
||||
@RequiredArgsConstructor
|
||||
@ConditionalOnProperty(name = "register.user", matchIfMissing = true)
|
||||
public class RegisterController {
|
||||
|
||||
private final SysUserService userService;
|
||||
|
||||
/**
|
||||
* 注册用户
|
||||
* @param userDto 用户信息
|
||||
* @return success/false
|
||||
*/
|
||||
@Inner(value = false)
|
||||
@SysLog("注册用户")
|
||||
@PostMapping("/user")
|
||||
public R<Boolean> registerUser(@RequestBody UserDTO userDto) {
|
||||
return userService.registerUser(userDto);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.controller;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysAuditLog;
|
||||
import com.pig4cloud.pigx.admin.service.SysAuditLogService;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.excel.annotation.ResponseExcel;
|
||||
import com.pig4cloud.pigx.common.log.annotation.SysLog;
|
||||
import com.pig4cloud.pigx.common.security.annotation.Inner;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springdoc.api.annotations.ParameterObject;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 审计记录表
|
||||
*
|
||||
* @author PIG
|
||||
* @date 2023-02-28 20:12:23
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/audit")
|
||||
@Tag(description = "audit", name = "审计记录表管理")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class SysAuditLogController {
|
||||
|
||||
private final SysAuditLogService sysAuditLogService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
* @param sysAuditLog 审计记录表
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "分页查询", description = "分页查询")
|
||||
@GetMapping("/page")
|
||||
public R getsysAuditLogPage(@ParameterObject Page page, @ParameterObject SysAuditLog sysAuditLog) {
|
||||
return R.ok(sysAuditLogService.getAuditsByScope(page, sysAuditLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询审计记录表
|
||||
* @param id id
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "通过id查询", description = "通过id查询")
|
||||
@GetMapping("/{id}")
|
||||
public R getById(@PathVariable("id") Long id) {
|
||||
return R.ok(sysAuditLogService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增审计记录表 (异步插入)
|
||||
* @param auditLogList 审计记录
|
||||
* @return R
|
||||
*/
|
||||
@Inner
|
||||
@PostMapping
|
||||
@Operation(summary = "新增审计记录表", description = "新增审计记录表")
|
||||
public R save(@RequestBody List<SysAuditLog> auditLogList) {
|
||||
return R.ok(sysAuditLogService.saveBatch(auditLogList));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除审计记录表
|
||||
* @param ids id列表
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "通过id删除审计记录表", description = "通过id删除审计记录表")
|
||||
@SysLog("通过id删除审计记录表")
|
||||
@DeleteMapping("/delete")
|
||||
@PreAuthorize("@pms.hasPermission('sys_audit_del')")
|
||||
public R removeById(@RequestBody Long[] ids) {
|
||||
return R.ok(sysAuditLogService.removeBatchByIds(CollUtil.toList(ids)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel 表格
|
||||
* @param sysAuditLog 查询条件
|
||||
* @return excel 文件流
|
||||
*/
|
||||
@ResponseExcel
|
||||
@GetMapping("/export")
|
||||
@PreAuthorize("@pms.hasPermission('sys_audit_export')")
|
||||
public List<SysAuditLog> export(SysAuditLog sysAuditLog, Long[] ids) {
|
||||
return sysAuditLogService
|
||||
.list(Wrappers.lambdaQuery(sysAuditLog).in(ArrayUtil.isNotEmpty(ids), SysAuditLog::getId, ids));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,181 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.controller;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.pig4cloud.pigx.admin.api.dto.SysOauthClientDetailsDTO;
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysOauthClientDetails;
|
||||
import com.pig4cloud.pigx.admin.config.ClientDetailsInitRunner;
|
||||
import com.pig4cloud.pigx.admin.service.SysOauthClientDetailsService;
|
||||
import com.pig4cloud.pigx.common.core.constant.CommonConstants;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.core.util.SpringContextHolder;
|
||||
import com.pig4cloud.pigx.common.excel.annotation.ResponseExcel;
|
||||
import com.pig4cloud.pigx.common.log.annotation.SysLog;
|
||||
import com.pig4cloud.pigx.common.security.annotation.Inner;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springdoc.api.annotations.ParameterObject;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author lengleng
|
||||
* @since 2018-05-15
|
||||
*/
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/client")
|
||||
@Tag(description = "client", name = "客户端管理模块")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class SysClientController {
|
||||
|
||||
private final SysOauthClientDetailsService clientDetailsService;
|
||||
|
||||
/**
|
||||
* 通过ID查询
|
||||
* @param clientId clientId
|
||||
* @return SysOauthClientDetails
|
||||
*/
|
||||
@GetMapping("/{clientId}")
|
||||
public R getByClientId(@PathVariable String clientId) {
|
||||
SysOauthClientDetails details = clientDetailsService
|
||||
.getOne(Wrappers.<SysOauthClientDetails>lambdaQuery().eq(SysOauthClientDetails::getClientId, clientId));
|
||||
String information = details.getAdditionalInformation();
|
||||
String captchaFlag = JSONUtil.parseObj(information).getStr(CommonConstants.CAPTCHA_FLAG);
|
||||
String encFlag = JSONUtil.parseObj(information).getStr(CommonConstants.ENC_FLAG);
|
||||
String onlineQuantity = JSONUtil.parseObj(information).getStr(CommonConstants.ONLINE_QUANTITY);
|
||||
SysOauthClientDetailsDTO dto = new SysOauthClientDetailsDTO();
|
||||
BeanUtils.copyProperties(details, dto);
|
||||
dto.setCaptchaFlag(captchaFlag);
|
||||
dto.setEncFlag(encFlag);
|
||||
dto.setOnlineQuantity(onlineQuantity);
|
||||
return R.ok(dto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 简单分页查询
|
||||
* @param page 分页对象
|
||||
* @param sysOauthClientDetails 系统终端
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
public R getOauthClientDetailsPage(@ParameterObject Page page,
|
||||
@ParameterObject SysOauthClientDetails sysOauthClientDetails) {
|
||||
LambdaQueryWrapper<SysOauthClientDetails> wrapper = Wrappers.<SysOauthClientDetails>lambdaQuery()
|
||||
.like(StrUtil.isNotBlank(sysOauthClientDetails.getClientId()), SysOauthClientDetails::getClientId,
|
||||
sysOauthClientDetails.getClientId())
|
||||
.like(StrUtil.isNotBlank(sysOauthClientDetails.getClientSecret()),
|
||||
SysOauthClientDetails::getClientSecret, sysOauthClientDetails.getClientSecret());
|
||||
return R.ok(clientDetailsService.page(page, wrapper));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
* @param clientDetailsDTO 实体
|
||||
* @return success/false
|
||||
*/
|
||||
@SysLog("添加终端")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('sys_client_add')")
|
||||
public R add(@Valid @RequestBody SysOauthClientDetailsDTO clientDetailsDTO) {
|
||||
return R.ok(clientDetailsService.saveClient(clientDetailsDTO));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param ids ID 列表
|
||||
* @return success/false
|
||||
*/
|
||||
@SysLog("删除终端")
|
||||
@DeleteMapping
|
||||
@PreAuthorize("@pms.hasPermission('sys_client_del')")
|
||||
public R removeById(@RequestBody Long[] ids) {
|
||||
clientDetailsService.removeBatchByIds(CollUtil.toList(ids));
|
||||
SpringContextHolder.publishEvent(new ClientDetailsInitRunner.ClientDetailsInitEvent(ids));
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param clientDetailsDTO 实体
|
||||
* @return success/false
|
||||
*/
|
||||
@SysLog("编辑终端")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('sys_client_edit')")
|
||||
public R update(@Valid @RequestBody SysOauthClientDetailsDTO clientDetailsDTO) {
|
||||
return R.ok(clientDetailsService.updateClientById(clientDetailsDTO));
|
||||
}
|
||||
|
||||
@Inner(false)
|
||||
@GetMapping("/getClientDetailsById/{clientId}")
|
||||
public R getClientDetailsById(@PathVariable String clientId) {
|
||||
return R.ok(clientDetailsService.getOne(
|
||||
Wrappers.<SysOauthClientDetails>lambdaQuery().eq(SysOauthClientDetails::getClientId, clientId), false));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询全部客户端
|
||||
* @return
|
||||
*/
|
||||
@Inner(false)
|
||||
@GetMapping("/list")
|
||||
public R listClients() {
|
||||
return R.ok(clientDetailsService.list());
|
||||
}
|
||||
|
||||
/**
|
||||
* 同步缓存字典
|
||||
* @return R
|
||||
*/
|
||||
@SysLog("同步终端")
|
||||
@PutMapping("/sync")
|
||||
public R sync() {
|
||||
return clientDetailsService.syncClientCache();
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出所有客户端
|
||||
* @return excel
|
||||
*/
|
||||
@ResponseExcel
|
||||
@SysLog("导出excel")
|
||||
@GetMapping("/export")
|
||||
public List<SysOauthClientDetails> export(SysOauthClientDetails sysOauthClientDetails) {
|
||||
return clientDetailsService.list(Wrappers.query(sysOauthClientDetails));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,158 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.controller;
|
||||
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysDept;
|
||||
import com.pig4cloud.pigx.admin.api.vo.DeptExcelVo;
|
||||
import com.pig4cloud.pigx.admin.service.SysDeptService;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.excel.annotation.RequestExcel;
|
||||
import com.pig4cloud.pigx.common.excel.annotation.ResponseExcel;
|
||||
import com.pig4cloud.pigx.common.log.annotation.SysLog;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 部门管理 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author lengleng
|
||||
* @since 2018-01-20
|
||||
*/
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/dept")
|
||||
@Tag(description = "dept", name = "部门管理模块")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class SysDeptController {
|
||||
|
||||
private final SysDeptService sysDeptService;
|
||||
|
||||
/**
|
||||
* 通过ID查询
|
||||
* @param id ID
|
||||
* @return SysDept
|
||||
*/
|
||||
@GetMapping("/{id}")
|
||||
public R getById(@PathVariable Long id) {
|
||||
return R.ok(sysDeptService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询全部部门
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public R list() {
|
||||
return R.ok(sysDeptService.list());
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回树形菜单集合
|
||||
* @param deptName 部门名称
|
||||
* @return 树形菜单
|
||||
*/
|
||||
@GetMapping(value = "/tree")
|
||||
public R getTree(String deptName, Long parentId) {
|
||||
return R.ok(sysDeptService.selectTree(deptName, parentId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
* @param sysDept 实体
|
||||
* @return success/false
|
||||
*/
|
||||
@SysLog("添加部门")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('sys_dept_add')")
|
||||
public R save(@Valid @RequestBody SysDept sysDept) {
|
||||
return R.ok(sysDeptService.save(sysDept));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param id ID
|
||||
* @return success/false
|
||||
*/
|
||||
@SysLog("删除部门")
|
||||
@DeleteMapping("/{id}")
|
||||
@PreAuthorize("@pms.hasPermission('sys_dept_del')")
|
||||
public R removeById(@PathVariable Long id) {
|
||||
return R.ok(sysDeptService.removeDeptById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param sysDept 实体
|
||||
* @return success/false
|
||||
*/
|
||||
@SysLog("编辑部门")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('sys_dept_edit')")
|
||||
public R update(@Valid @RequestBody SysDept sysDept) {
|
||||
sysDept.setUpdateTime(LocalDateTime.now());
|
||||
return R.ok(sysDeptService.updateById(sysDept));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查收子级列表
|
||||
* @return 返回子级
|
||||
*/
|
||||
@GetMapping(value = "/getDescendantList/{deptId}")
|
||||
public R getDescendantList(@PathVariable Long deptId) {
|
||||
return R.ok(sysDeptService.listDescendant(deptId));
|
||||
}
|
||||
|
||||
@GetMapping(value = "/leader/{deptId}")
|
||||
public R getAllDeptLeader(@PathVariable Long deptId) {
|
||||
return R.ok(sysDeptService.listDeptLeader(deptId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出部门
|
||||
* @return
|
||||
*/
|
||||
@ResponseExcel
|
||||
@GetMapping("/export")
|
||||
public List<DeptExcelVo> export() {
|
||||
return sysDeptService.listExcelVo();
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入部门
|
||||
* @param excelVOList
|
||||
* @param bindingResult
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("import")
|
||||
public R importDept(@RequestExcel List<DeptExcelVo> excelVOList, BindingResult bindingResult) {
|
||||
return sysDeptService.importDept(excelVOList, bindingResult);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,242 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.controller;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysDict;
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysDictItem;
|
||||
import com.pig4cloud.pigx.admin.service.SysDictItemService;
|
||||
import com.pig4cloud.pigx.admin.service.SysDictService;
|
||||
import com.pig4cloud.pigx.common.core.constant.CacheConstants;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.excel.annotation.ResponseExcel;
|
||||
import com.pig4cloud.pigx.common.log.annotation.SysLog;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springdoc.api.annotations.ParameterObject;
|
||||
import org.springframework.cache.annotation.CacheEvict;
|
||||
import org.springframework.cache.annotation.Cacheable;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 字典表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author lengleng
|
||||
* @since 2019-03-19
|
||||
*/
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/dict")
|
||||
@Tag(description = "dict", name = "字典管理模块")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class SysDictController {
|
||||
|
||||
private final SysDictService sysDictService;
|
||||
|
||||
private final SysDictItemService sysDictItemService;
|
||||
|
||||
/**
|
||||
* 通过ID查询字典信息
|
||||
* @param id ID
|
||||
* @return 字典信息
|
||||
*/
|
||||
@GetMapping("/details/{id}")
|
||||
public R getById(@PathVariable Long id) {
|
||||
return R.ok(sysDictService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询字典信息
|
||||
* @param query 查询信息
|
||||
* @return 字典信息
|
||||
*/
|
||||
@GetMapping("/details")
|
||||
public R getDetails(@ParameterObject SysDict query) {
|
||||
return R.ok(sysDictService.getOne(Wrappers.query(query), false));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询字典信息
|
||||
* @param page 分页对象
|
||||
* @return 分页对象
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
public R<IPage> getDictPage(@ParameterObject Page page, @ParameterObject SysDict sysDict) {
|
||||
return R.ok(sysDictService.page(page,
|
||||
Wrappers.<SysDict>lambdaQuery()
|
||||
.eq(StrUtil.isNotBlank(sysDict.getSystemFlag()), SysDict::getSystemFlag,
|
||||
sysDict.getSystemFlag())
|
||||
.like(StrUtil.isNotBlank(sysDict.getDictType()), SysDict::getDictType, sysDict.getDictType())));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过字典类型查找字典
|
||||
* @param type 类型
|
||||
* @return 同类型字典
|
||||
*/
|
||||
@GetMapping("/type/{type}")
|
||||
@Cacheable(value = CacheConstants.DICT_DETAILS, key = "#type", unless = "#result.data.isEmpty()")
|
||||
public R<List<SysDictItem>> getDictByType(@PathVariable String type) {
|
||||
return R.ok(sysDictItemService.list(Wrappers.<SysDictItem>query().lambda().eq(SysDictItem::getDictType, type)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加字典
|
||||
* @param sysDict 字典信息
|
||||
* @return success、false
|
||||
*/
|
||||
@SysLog("添加字典")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('sys_dict_add')")
|
||||
public R save(@Valid @RequestBody SysDict sysDict) {
|
||||
sysDictService.save(sysDict);
|
||||
return R.ok(sysDict);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除字典,并且清除字典缓存
|
||||
* @param ids ID
|
||||
* @return R
|
||||
*/
|
||||
@SysLog("删除字典")
|
||||
@DeleteMapping
|
||||
@PreAuthorize("@pms.hasPermission('sys_dict_del')")
|
||||
@CacheEvict(value = CacheConstants.DICT_DETAILS, allEntries = true)
|
||||
public R removeById(@RequestBody Long[] ids) {
|
||||
return R.ok(sysDictService.removeDictByIds(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改字典
|
||||
* @param sysDict 字典信息
|
||||
* @return success/false
|
||||
*/
|
||||
@PutMapping
|
||||
@SysLog("修改字典")
|
||||
@PreAuthorize("@pms.hasPermission('sys_dict_edit')")
|
||||
public R updateById(@Valid @RequestBody SysDict sysDict) {
|
||||
return sysDictService.updateDict(sysDict);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param name 名称或者字典项
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public R getDictList(String name) {
|
||||
return R.ok(sysDictService
|
||||
.list(Wrappers.<SysDict>lambdaQuery().like(StrUtil.isNotBlank(name), SysDict::getDictType, name).or()
|
||||
.like(StrUtil.isNotBlank(name), SysDict::getDescription, name)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
* @param sysDictItem 字典项
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/item/page")
|
||||
public R getSysDictItemPage(Page page, SysDictItem sysDictItem) {
|
||||
return R.ok(sysDictItemService.page(page, Wrappers.query(sysDictItem)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询字典项
|
||||
* @param id id
|
||||
* @return R
|
||||
*/
|
||||
@GetMapping("/item/details/{id}")
|
||||
public R getDictItemById(@PathVariable("id") Long id) {
|
||||
return R.ok(sysDictItemService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询字典项详情
|
||||
* @param query 查询条件
|
||||
* @return R
|
||||
*/
|
||||
@GetMapping("/item/details")
|
||||
public R getDictItemDetails(SysDictItem query) {
|
||||
return R.ok(sysDictItemService.getOne(Wrappers.query(query), false));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增字典项
|
||||
* @param sysDictItem 字典项
|
||||
* @return R
|
||||
*/
|
||||
@SysLog("新增字典项")
|
||||
@PostMapping("/item")
|
||||
@CacheEvict(value = CacheConstants.DICT_DETAILS, allEntries = true)
|
||||
public R save(@RequestBody SysDictItem sysDictItem) {
|
||||
return R.ok(sysDictItemService.save(sysDictItem));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改字典项
|
||||
* @param sysDictItem 字典项
|
||||
* @return R
|
||||
*/
|
||||
@SysLog("修改字典项")
|
||||
@PutMapping("/item")
|
||||
public R updateById(@RequestBody SysDictItem sysDictItem) {
|
||||
return sysDictItemService.updateDictItem(sysDictItem);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除字典项
|
||||
* @param id id
|
||||
* @return R
|
||||
*/
|
||||
@SysLog("删除字典项")
|
||||
@DeleteMapping("/item/{id}")
|
||||
public R removeDictItemById(@PathVariable Long id) {
|
||||
return sysDictItemService.removeDictItem(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 同步缓存字典
|
||||
* @return R
|
||||
*/
|
||||
@SysLog("同步字典")
|
||||
@PutMapping("/sync")
|
||||
public R sync() {
|
||||
return sysDictService.syncDictCache();
|
||||
}
|
||||
|
||||
@ResponseExcel
|
||||
@GetMapping("/export")
|
||||
public List<SysDictItem> export(SysDictItem sysDictItem) {
|
||||
return sysDictItemService.list(Wrappers.query(sysDictItem));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,187 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.controller;
|
||||
|
||||
import cn.hutool.core.io.IoUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.pig4cloud.pigx.admin.api.dto.SysFileGroupDTO;
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysFile;
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysFileGroup;
|
||||
import com.pig4cloud.pigx.admin.service.SysFileService;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.log.annotation.SysLog;
|
||||
import com.pig4cloud.pigx.common.security.annotation.Inner;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.SneakyThrows;
|
||||
import org.springdoc.api.annotations.ParameterObject;
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 文件管理
|
||||
*
|
||||
* @author Luckly
|
||||
* @date 2019-06-18 17:18:42
|
||||
*/
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/sys-file")
|
||||
@Tag(description = "sys-file", name = "文件管理")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class SysFileController {
|
||||
|
||||
private final SysFileService sysFileService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
* @param sysFile 文件管理
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "分页查询", description = "分页查询")
|
||||
@GetMapping("/page")
|
||||
public R getSysFilePage(@ParameterObject Page page, @ParameterObject SysFile sysFile) {
|
||||
LambdaQueryWrapper<SysFile> wrapper = Wrappers.<SysFile>lambdaQuery()
|
||||
.eq(StrUtil.isNotBlank(sysFile.getType()), SysFile::getType, sysFile.getType())
|
||||
.eq(Objects.nonNull(sysFile.getGroupId()), SysFile::getGroupId, sysFile.getGroupId())
|
||||
.like(StrUtil.isNotBlank(sysFile.getOriginal()), SysFile::getOriginal, sysFile.getOriginal());
|
||||
return R.ok(sysFileService.page(page, wrapper));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除文件管理
|
||||
* @param ids id 列表
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "通过id删除文件管理", description = "通过id删除文件管理")
|
||||
@SysLog("删除文件管理")
|
||||
@DeleteMapping
|
||||
@PreAuthorize("@pms.hasPermission('sys_file_del')")
|
||||
public R removeById(@RequestBody Long[] ids) {
|
||||
for (Long id : ids) {
|
||||
sysFileService.deleteFile(id);
|
||||
}
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@PutMapping("/rename")
|
||||
public R rename(@RequestBody SysFile sysFile) {
|
||||
return R.ok(sysFileService.updateById(sysFile));
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传文件 文件名采用uuid,避免原始文件名中带"-"符号导致下载的时候解析出现异常
|
||||
* @param file 资源
|
||||
* @return R(/ admin / bucketName / filename)
|
||||
*/
|
||||
@PostMapping(value = "/upload")
|
||||
public R upload(@RequestPart("file") MultipartFile file,
|
||||
@RequestParam(value = "groupId", required = false) Long groupId,
|
||||
@RequestParam(value = "type", required = false) String type) {
|
||||
return sysFileService.uploadFile(file, groupId, type);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文件
|
||||
* @param bucket 桶名称
|
||||
* @param fileName 文件空间/名称
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@Inner(false)
|
||||
@GetMapping("/{bucket}/{fileName}")
|
||||
public void file(@PathVariable String bucket, @PathVariable String fileName, HttpServletResponse response) {
|
||||
sysFileService.getFile(bucket, fileName, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取本地(resources)文件
|
||||
* @param fileName 文件名称
|
||||
* @param response 本地文件
|
||||
*/
|
||||
@SneakyThrows
|
||||
@GetMapping("/local/file/{fileName}")
|
||||
public void localFile(@PathVariable String fileName, HttpServletResponse response) {
|
||||
ClassPathResource resource = new ClassPathResource("file/" + fileName);
|
||||
response.setContentType("application/octet-stream; charset=UTF-8");
|
||||
IoUtil.copy(resource.getInputStream(), response.getOutputStream());
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询文件组列表
|
||||
* @param fileGroup SysFileGroup对象,用于筛选条件
|
||||
* @return 包含文件组列表的R对象
|
||||
*/
|
||||
@GetMapping("/group/list")
|
||||
public R listGroup(SysFileGroup fileGroup) {
|
||||
return R.ok(sysFileService.listFileGroup(fileGroup));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加文件组
|
||||
* @param fileGroup SysFileGroup对象,要添加的文件组信息
|
||||
* @return 包含添加结果的R对象
|
||||
*/
|
||||
@PostMapping("/group/add")
|
||||
public R addGroup(@RequestBody SysFileGroup fileGroup) {
|
||||
return R.ok(sysFileService.saveOrUpdateGroup(fileGroup));
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新文件组
|
||||
* @param fileGroup SysFileGroup对象,要更新的文件组信息
|
||||
* @return 包含更新结果的R对象
|
||||
*/
|
||||
@PutMapping("/group/update")
|
||||
public R updateGroup(@RequestBody SysFileGroup fileGroup) {
|
||||
return R.ok(sysFileService.saveOrUpdateGroup(fileGroup));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除文件组
|
||||
* @param id 待删除文件组的ID
|
||||
* @return 包含删除结果的R对象
|
||||
*/
|
||||
@DeleteMapping("/group/delete/{id}")
|
||||
public R updateGroup(@PathVariable Long id) {
|
||||
return R.ok(sysFileService.deleteGroup(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 移动文件组
|
||||
* @param fileGroupDTO SysFileGroupDTO对象,要移动的文件组信息
|
||||
* @return 包含移动结果的R对象
|
||||
*/
|
||||
@PutMapping("/group/move")
|
||||
public R moveFileGroup(@RequestBody SysFileGroupDTO fileGroupDTO) {
|
||||
return R.ok(sysFileService.moveFileGroup(fileGroupDTO));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,169 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.controller;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysI18nEntity;
|
||||
import com.pig4cloud.pigx.admin.service.SysI18nService;
|
||||
import com.pig4cloud.pigx.common.core.constant.CacheConstants;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.excel.annotation.ResponseExcel;
|
||||
import com.pig4cloud.pigx.common.log.annotation.SysLog;
|
||||
import com.pig4cloud.pigx.common.security.annotation.Inner;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springdoc.api.annotations.ParameterObject;
|
||||
import org.springframework.cache.annotation.CacheEvict;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 系统表-国际化
|
||||
*
|
||||
* @author PIG
|
||||
* @date 2023-02-14 09:07:01
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/i18n")
|
||||
@Tag(description = "i18n", name = "系统表-国际化管理")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class SysI18nController {
|
||||
|
||||
private final SysI18nService sysI18nService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
* @param sysI18n 系统表-国际化
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "分页查询", description = "分页查询")
|
||||
@GetMapping("/page")
|
||||
@PreAuthorize("@pms.hasPermission('sys_i18n_view')")
|
||||
public R getsysI18nPage(@ParameterObject Page page, @ParameterObject SysI18nEntity sysI18n) {
|
||||
LambdaQueryWrapper<SysI18nEntity> wrapper = Wrappers.lambdaQuery();
|
||||
wrapper.like(StrUtil.isNotBlank(sysI18n.getName()), SysI18nEntity::getName, sysI18n.getName());
|
||||
wrapper.like(StrUtil.isNotBlank(sysI18n.getZhCn()), SysI18nEntity::getZhCn, sysI18n.getZhCn());
|
||||
wrapper.like(StrUtil.isNotBlank(sysI18n.getEn()), SysI18nEntity::getEn, sysI18n.getEn());
|
||||
return R.ok(sysI18nService.page(page, wrapper));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询系统表-国际化
|
||||
* @param id id
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "通过id查询", description = "通过id查询")
|
||||
@GetMapping("/details/{id}")
|
||||
public R getById(@PathVariable("id") Long id) {
|
||||
return R.ok(sysI18nService.getById(id));
|
||||
}
|
||||
|
||||
@GetMapping("/details")
|
||||
public R getDetails(@ParameterObject SysI18nEntity entity) {
|
||||
return R.ok(sysI18nService.getOne(Wrappers.query(entity)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增系统表-国际化
|
||||
* @param sysI18n 系统表-国际化
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "新增系统表-国际化", description = "新增系统表-国际化")
|
||||
@SysLog("新增系统表-国际化")
|
||||
@PostMapping
|
||||
@CacheEvict(value = CacheConstants.I18N_DETAILS, allEntries = true)
|
||||
@PreAuthorize("@pms.hasPermission('sys_i18n_add')")
|
||||
public R save(@RequestBody SysI18nEntity sysI18n) {
|
||||
return R.ok(sysI18nService.save(sysI18n));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改系统表-国际化
|
||||
* @param sysI18n 系统表-国际化
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "修改系统表-国际化", description = "修改系统表-国际化")
|
||||
@SysLog("修改系统表-国际化")
|
||||
@PutMapping
|
||||
@CacheEvict(value = CacheConstants.I18N_DETAILS, allEntries = true)
|
||||
@PreAuthorize("@pms.hasPermission('sys_i18n_edit')")
|
||||
public R updateById(@RequestBody SysI18nEntity sysI18n) {
|
||||
return R.ok(sysI18nService.updateById(sysI18n));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除系统表-国际化
|
||||
* @param ids id 列表
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "通过id删除系统表-国际化", description = "通过id删除系统表-国际化")
|
||||
@SysLog("通过id删除系统表-国际化")
|
||||
@DeleteMapping
|
||||
@CacheEvict(value = CacheConstants.I18N_DETAILS, allEntries = true)
|
||||
@PreAuthorize("@pms.hasPermission('sys_i18n_del')")
|
||||
public R removeById(@RequestBody Long[] ids) {
|
||||
return R.ok(sysI18nService.removeBatchByIds(CollUtil.toList(ids)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel 表格
|
||||
* @param sysI18n 查询条件
|
||||
* @return excel 文件流
|
||||
*/
|
||||
@ResponseExcel
|
||||
@GetMapping("/export")
|
||||
@PreAuthorize("@pms.hasPermission('sys_i18n_export')")
|
||||
public List<SysI18nEntity> export(SysI18nEntity sysI18n, Long[] ids) {
|
||||
return sysI18nService
|
||||
.list(Wrappers.lambdaQuery(sysI18n).in(ArrayUtil.isNotEmpty(ids), SysI18nEntity::getId, ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取系统I18N配置
|
||||
* @return I18N 配置
|
||||
*/
|
||||
@Operation(summary = "获取系统配置-国际化", description = "获取系统配置-国际化")
|
||||
@Inner(false)
|
||||
@GetMapping("/info")
|
||||
public R list() {
|
||||
return R.ok(sysI18nService.listMap());
|
||||
}
|
||||
|
||||
/**
|
||||
* 同步数据
|
||||
* @return R
|
||||
*/
|
||||
@SysLog("同步数据")
|
||||
@PutMapping("/sync")
|
||||
public R sync() {
|
||||
return sysI18nService.syncI18nCache();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.controller;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.pig4cloud.pigx.admin.api.dto.SysLogDTO;
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysLog;
|
||||
import com.pig4cloud.pigx.admin.api.vo.PreLogVO;
|
||||
import com.pig4cloud.pigx.admin.service.SysLogService;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.excel.annotation.ResponseExcel;
|
||||
import com.pig4cloud.pigx.common.security.annotation.Inner;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springdoc.api.annotations.ParameterObject;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 日志表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author lengleng
|
||||
* @since 2017-11-20
|
||||
*/
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/log")
|
||||
@Tag(description = "log", name = "日志管理模块")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class SysLogController {
|
||||
|
||||
private final SysLogService sysLogService;
|
||||
|
||||
/**
|
||||
* 简单分页查询
|
||||
* @param page 分页对象
|
||||
* @param sysLog 系统日志
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
public R getLogPage(@ParameterObject Page page, @ParameterObject SysLogDTO sysLog) {
|
||||
return R.ok(sysLogService.getLogByPage(page, sysLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除日志
|
||||
* @param ids ID
|
||||
* @return success/false
|
||||
*/
|
||||
@DeleteMapping
|
||||
@PreAuthorize("@pms.hasPermission('sys_log_del')")
|
||||
public R removeByIds(@RequestBody Long[] ids) {
|
||||
return R.ok(sysLogService.removeBatchByIds(CollUtil.toList(ids)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 插入日志
|
||||
* @param sysLog 日志实体
|
||||
* @return success/false
|
||||
*/
|
||||
@Inner
|
||||
@PostMapping("/save")
|
||||
public R save(@Valid @RequestBody SysLogDTO sysLog) {
|
||||
return R.ok(sysLogService.saveLog(sysLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量插入前端异常日志
|
||||
* @param preLogVoList 日志实体
|
||||
* @return success/false
|
||||
*/
|
||||
@PostMapping("/logs")
|
||||
public R saveBatchLogs(@RequestBody List<PreLogVO> preLogVoList) {
|
||||
return R.ok(sysLogService.saveBatchLogs(preLogVoList));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel 表格
|
||||
* @param sysLog 查询条件
|
||||
* @return
|
||||
*/
|
||||
@ResponseExcel
|
||||
@GetMapping("/export")
|
||||
@PreAuthorize("@pms.hasPermission('sys_log_export')")
|
||||
public List<SysLog> export(SysLog sysLog, Long[] ids) {
|
||||
return sysLogService.list(Wrappers.lambdaQuery(sysLog).in(Objects.nonNull(ids), SysLog::getId, ids));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,135 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.controller;
|
||||
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysMenu;
|
||||
import com.pig4cloud.pigx.admin.service.SysMenuService;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.log.annotation.SysLog;
|
||||
import com.pig4cloud.pigx.common.security.util.SecurityUtils;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2017/10/31
|
||||
*/
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/menu")
|
||||
@Tag(description = "menu", name = "菜单管理模块")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class SysMenuController {
|
||||
|
||||
private final SysMenuService sysMenuService;
|
||||
|
||||
/**
|
||||
* 返回当前用户的树形菜单集合
|
||||
* @param type 类型
|
||||
* @param parentId 父节点ID
|
||||
* @return 当前用户的树形菜单
|
||||
*/
|
||||
@GetMapping
|
||||
public R getUserMenu(String type, Long parentId) {
|
||||
// 获取符合条件的菜单
|
||||
Set<SysMenu> all = new HashSet<>();
|
||||
SecurityUtils.getRoles().forEach(roleId -> all.addAll(sysMenuService.findMenuByRoleId(roleId)));
|
||||
return R.ok(sysMenuService.filterMenu(all, type, parentId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回树形菜单集合
|
||||
* @param parentId 父节点ID
|
||||
* @param menuName 菜单名称
|
||||
* @return 树形菜单
|
||||
*/
|
||||
@GetMapping(value = "/tree")
|
||||
public R getTree(Long parentId, String menuName, String type) {
|
||||
return R.ok(sysMenuService.treeMenu(parentId, menuName, type));
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回角色的菜单集合
|
||||
* @param roleId 角色ID
|
||||
* @return 属性集合
|
||||
*/
|
||||
@GetMapping("/tree/{roleId}")
|
||||
public R getRoleTree(@PathVariable Long roleId) {
|
||||
return R.ok(
|
||||
sysMenuService.findMenuByRoleId(roleId).stream().map(SysMenu::getMenuId).collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过ID查询菜单的详细信息
|
||||
* @param id 菜单ID
|
||||
* @return 菜单详细信息
|
||||
*/
|
||||
@GetMapping("/{id}")
|
||||
public R getById(@PathVariable Long id) {
|
||||
return R.ok(sysMenuService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增菜单
|
||||
* @param sysMenu 菜单信息
|
||||
* @return success/false
|
||||
*/
|
||||
@SysLog("新增菜单")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('sys_menu_add')")
|
||||
public R save(@Valid @RequestBody SysMenu sysMenu) {
|
||||
sysMenuService.save(sysMenu);
|
||||
return R.ok(sysMenu);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除菜单
|
||||
* @param id 菜单ID
|
||||
* @return success/false
|
||||
*/
|
||||
@SysLog("删除菜单")
|
||||
@DeleteMapping("/{id}")
|
||||
@PreAuthorize("@pms.hasPermission('sys_menu_del')")
|
||||
public R removeById(@PathVariable Long id) {
|
||||
return sysMenuService.removeMenuById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新菜单
|
||||
* @param sysMenu
|
||||
* @return
|
||||
*/
|
||||
@SysLog("更新菜单")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('sys_menu_edit')")
|
||||
public R update(@Valid @RequestBody SysMenu sysMenu) {
|
||||
return R.ok(sysMenuService.updateMenuById(sysMenu));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,167 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.controller;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysPost;
|
||||
import com.pig4cloud.pigx.admin.api.vo.PostExcelVO;
|
||||
import com.pig4cloud.pigx.admin.service.SysPostService;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.excel.annotation.RequestExcel;
|
||||
import com.pig4cloud.pigx.common.excel.annotation.ResponseExcel;
|
||||
import com.pig4cloud.pigx.common.log.annotation.SysLog;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springdoc.api.annotations.ParameterObject;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 岗位信息表
|
||||
*
|
||||
* @author fxz
|
||||
* @date 2022-03-26 12:50:43
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/post")
|
||||
@Tag(description = "post", name = "岗位信息表管理")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class SysPostController {
|
||||
|
||||
private final SysPostService sysPostService;
|
||||
|
||||
/**
|
||||
* 获取岗位列表
|
||||
* @return 岗位列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public R<List<SysPost>> listPosts() {
|
||||
return R.ok(sysPostService.list(Wrappers.emptyWrapper()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
* @param sysPost 岗位信息表
|
||||
* @return
|
||||
*/
|
||||
@Operation(description = "分页查询", summary = "分页查询")
|
||||
@GetMapping("/page")
|
||||
@PreAuthorize("@pms.hasPermission('sys_post_view')")
|
||||
public R getSysPostPage(@ParameterObject Page page, @ParameterObject SysPost sysPost) {
|
||||
return R.ok(sysPostService.page(page, Wrappers.<SysPost>lambdaQuery()
|
||||
.like(StrUtil.isNotBlank(sysPost.getPostName()), SysPost::getPostName, sysPost.getPostName())));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询岗位信息表
|
||||
* @param postId id
|
||||
* @return R
|
||||
*/
|
||||
@Operation(description = "通过id查询", summary = "通过id查询")
|
||||
@GetMapping("/details/{postId}")
|
||||
@PreAuthorize("@pms.hasPermission('sys_post_view')")
|
||||
public R getById(@PathVariable("postId") Long postId) {
|
||||
return R.ok(sysPostService.getById(postId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询岗位信息信息
|
||||
* @param query 查询条件
|
||||
* @return R
|
||||
*/
|
||||
@Operation(description = "查询角色信息", summary = "查询角色信息")
|
||||
@GetMapping("/details")
|
||||
@PreAuthorize("@pms.hasPermission('sys_post_view')")
|
||||
public R getDetails(@ParameterObject SysPost query) {
|
||||
return R.ok(sysPostService.getOne(Wrappers.query(query), false));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增岗位信息表
|
||||
* @param sysPost 岗位信息表
|
||||
* @return R
|
||||
*/
|
||||
@Operation(description = "新增岗位信息表", summary = "新增岗位信息表")
|
||||
@SysLog("新增岗位信息表")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('sys_post_add')")
|
||||
public R save(@RequestBody SysPost sysPost) {
|
||||
return R.ok(sysPostService.save(sysPost));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改岗位信息表
|
||||
* @param sysPost 岗位信息表
|
||||
* @return R
|
||||
*/
|
||||
@Operation(description = "修改岗位信息表", summary = "修改岗位信息表")
|
||||
@SysLog("修改岗位信息表")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('sys_post_edit')")
|
||||
public R updateById(@RequestBody SysPost sysPost) {
|
||||
return R.ok(sysPostService.updateById(sysPost));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除岗位信息表
|
||||
* @param ids id 列表
|
||||
* @return R
|
||||
*/
|
||||
@Operation(description = "通过id删除岗位信息表", summary = "通过id删除岗位信息表")
|
||||
@SysLog("通过id删除岗位信息表")
|
||||
@DeleteMapping
|
||||
@PreAuthorize("@pms.hasPermission('sys_post_del')")
|
||||
public R removeById(@RequestBody Long[] ids) {
|
||||
return R.ok(sysPostService.removeBatchByIds(CollUtil.toList(ids)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel 表格
|
||||
* @return excel 文件流
|
||||
*/
|
||||
@ResponseExcel
|
||||
@GetMapping("/export")
|
||||
@PreAuthorize("@pms.hasPermission('sys_post_export')")
|
||||
public List<PostExcelVO> export(SysPost post, Long[] ids) {
|
||||
return sysPostService.listPost(post, ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入岗位
|
||||
* @param excelVOList 岗位列表
|
||||
* @param bindingResult 错误信息列表
|
||||
* @return ok fail
|
||||
*/
|
||||
@PostMapping("/import")
|
||||
@PreAuthorize("@pms.hasPermission('sys_post_export')")
|
||||
public R importRole(@RequestExcel List<PostExcelVO> excelVOList, BindingResult bindingResult) {
|
||||
return sysPostService.importPost(excelVOList, bindingResult);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,179 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.controller;
|
||||
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysPublicParam;
|
||||
import com.pig4cloud.pigx.admin.service.SysPublicParamService;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.excel.annotation.ResponseExcel;
|
||||
import com.pig4cloud.pigx.common.log.annotation.SysLog;
|
||||
import com.pig4cloud.pigx.common.security.annotation.Inner;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springdoc.api.annotations.ParameterObject;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 公共参数
|
||||
*
|
||||
* @author Lucky
|
||||
* @date 2019-04-29
|
||||
*/
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/param")
|
||||
@Tag(description = "param", name = "公共参数配置")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class SysPublicParamController {
|
||||
|
||||
private final SysPublicParamService sysPublicParamService;
|
||||
|
||||
/**
|
||||
* 通过key查询公共参数值
|
||||
* @param publicKey
|
||||
* @return
|
||||
*/
|
||||
@Inner(value = false)
|
||||
@Operation(description = "查询公共参数值", summary = "根据key查询公共参数值")
|
||||
@GetMapping("/publicValue/{publicKey}")
|
||||
public R publicKey(@PathVariable("publicKey") String publicKey) {
|
||||
return R.ok(sysPublicParamService.getSysPublicParamKeyToValue(publicKey));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过key查询公共参数值
|
||||
* @param keys
|
||||
* @return
|
||||
*/
|
||||
@Inner(value = false)
|
||||
@Operation(description = "查询公共参数值", summary = "根据key查询公共参数值")
|
||||
@GetMapping("/publicValues")
|
||||
public R publicKeys(String[] keys) {
|
||||
return R.ok(sysPublicParamService.getSysPublicParamsKeyToValue(keys));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
* @param sysPublicParam 公共参数
|
||||
* @return
|
||||
*/
|
||||
@Operation(description = "分页查询", summary = "分页查询")
|
||||
@GetMapping("/page")
|
||||
public R getSysPublicParamPage(@ParameterObject Page page, @ParameterObject SysPublicParam sysPublicParam) {
|
||||
LambdaUpdateWrapper<SysPublicParam> wrapper = Wrappers.<SysPublicParam>lambdaUpdate()
|
||||
.like(StrUtil.isNotBlank(sysPublicParam.getPublicName()), SysPublicParam::getPublicName,
|
||||
sysPublicParam.getPublicName())
|
||||
.like(StrUtil.isNotBlank(sysPublicParam.getPublicKey()), SysPublicParam::getPublicKey,
|
||||
sysPublicParam.getPublicKey())
|
||||
.eq(StrUtil.isNotBlank(sysPublicParam.getSystemFlag()), SysPublicParam::getSystemFlag,
|
||||
sysPublicParam.getSystemFlag());
|
||||
|
||||
return R.ok(sysPublicParamService.page(page, wrapper));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询公共参数
|
||||
* @param publicId id
|
||||
* @return R
|
||||
*/
|
||||
@Operation(description = "通过id查询公共参数", summary = "通过id查询公共参数")
|
||||
@GetMapping("/details/{publicId}")
|
||||
public R getById(@PathVariable("publicId") Long publicId) {
|
||||
return R.ok(sysPublicParamService.getById(publicId));
|
||||
}
|
||||
|
||||
@GetMapping("/details")
|
||||
public R getDetail(@ParameterObject SysPublicParam param) {
|
||||
return R.ok(sysPublicParamService.getOne(Wrappers.query(param), false));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增公共参数
|
||||
* @param sysPublicParam 公共参数
|
||||
* @return R
|
||||
*/
|
||||
@Operation(description = "新增公共参数", summary = "新增公共参数")
|
||||
@SysLog("新增公共参数")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('sys_syspublicparam_add')")
|
||||
public R save(@RequestBody SysPublicParam sysPublicParam) {
|
||||
return R.ok(sysPublicParamService.save(sysPublicParam));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改公共参数
|
||||
* @param sysPublicParam 公共参数
|
||||
* @return R
|
||||
*/
|
||||
@Operation(description = "修改公共参数", summary = "修改公共参数")
|
||||
@SysLog("修改公共参数")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('sys_syspublicparam_edit')")
|
||||
public R updateById(@RequestBody SysPublicParam sysPublicParam) {
|
||||
return sysPublicParamService.updateParam(sysPublicParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除公共参数
|
||||
* @param publicId id
|
||||
* @return R
|
||||
*/
|
||||
@Operation(description = "删除公共参数", summary = "删除公共参数")
|
||||
@SysLog("删除公共参数")
|
||||
@DeleteMapping
|
||||
@PreAuthorize("@pms.hasPermission('sys_syspublicparam_del')")
|
||||
public R removeById(@RequestBody Long[] ids) {
|
||||
return R.ok(sysPublicParamService.removeParamByIds(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel 表格
|
||||
* @return
|
||||
*/
|
||||
@ResponseExcel
|
||||
@GetMapping("/export")
|
||||
@PreAuthorize("@pms.hasPermission('sys_syspublicparam_edit')")
|
||||
public List<SysPublicParam> export(SysPublicParam param, Long[] ids) {
|
||||
return sysPublicParamService
|
||||
.list(Wrappers.lambdaQuery(param).in(ArrayUtil.isNotEmpty(ids), SysPublicParam::getPublicId, ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 同步参数
|
||||
* @return R
|
||||
*/
|
||||
@SysLog("同步参数")
|
||||
@PutMapping("/sync")
|
||||
@PreAuthorize("@pms.hasPermission('sys_syspublicparam_edit')")
|
||||
public R sync() {
|
||||
return sysPublicParamService.syncParamCache();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,188 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.controller;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysRole;
|
||||
import com.pig4cloud.pigx.admin.api.vo.RoleExcelVO;
|
||||
import com.pig4cloud.pigx.admin.api.vo.RoleVO;
|
||||
import com.pig4cloud.pigx.admin.service.SysRoleService;
|
||||
import com.pig4cloud.pigx.common.core.constant.CacheConstants;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.excel.annotation.RequestExcel;
|
||||
import com.pig4cloud.pigx.common.excel.annotation.ResponseExcel;
|
||||
import com.pig4cloud.pigx.common.log.annotation.SysLog;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springdoc.api.annotations.ParameterObject;
|
||||
import org.springframework.cache.annotation.CacheEvict;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2020-02-10
|
||||
*/
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/role")
|
||||
@Tag(description = "role", name = "角色管理模块")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class SysRoleController {
|
||||
|
||||
private final SysRoleService sysRoleService;
|
||||
|
||||
/**
|
||||
* 通过ID查询角色信息
|
||||
* @param id ID
|
||||
* @return 角色信息
|
||||
*/
|
||||
@GetMapping("/details/{id}")
|
||||
public R getById(@PathVariable Long id) {
|
||||
return R.ok(sysRoleService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询角色信息
|
||||
* @param query 查询条件
|
||||
* @return 角色信息
|
||||
*/
|
||||
@GetMapping("/details")
|
||||
public R getDetails(@ParameterObject SysRole query) {
|
||||
return R.ok(sysRoleService.getOne(Wrappers.query(query), false));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加角色
|
||||
* @param sysRole 角色信息
|
||||
* @return success、false
|
||||
*/
|
||||
@SysLog("添加角色")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('sys_role_add')")
|
||||
@CacheEvict(value = CacheConstants.ROLE_DETAILS, allEntries = true)
|
||||
public R save(@Valid @RequestBody SysRole sysRole) {
|
||||
return R.ok(sysRoleService.save(sysRole));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改角色
|
||||
* @param sysRole 角色信息
|
||||
* @return success/false
|
||||
*/
|
||||
@SysLog("修改角色")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('sys_role_edit')")
|
||||
@CacheEvict(value = CacheConstants.ROLE_DETAILS, allEntries = true)
|
||||
public R update(@Valid @RequestBody SysRole sysRole) {
|
||||
return R.ok(sysRoleService.updateById(sysRole));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除角色
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@SysLog("删除角色")
|
||||
@DeleteMapping
|
||||
@PreAuthorize("@pms.hasPermission('sys_role_del')")
|
||||
@CacheEvict(value = CacheConstants.ROLE_DETAILS, allEntries = true)
|
||||
public R removeById(@RequestBody Long[] ids) {
|
||||
return R.ok(sysRoleService.removeRoleByIds(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取角色列表
|
||||
* @return 角色列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public R listRoles() {
|
||||
return R.ok(sysRoleService.list(Wrappers.emptyWrapper()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询角色信息
|
||||
* @param page 分页对象
|
||||
* @param role 查询条件
|
||||
* @return 分页对象
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
public R getRolePage(Page page, SysRole role) {
|
||||
return R.ok(sysRoleService.page(page, Wrappers.<SysRole>lambdaQuery()
|
||||
.like(StrUtil.isNotBlank(role.getRoleName()), SysRole::getRoleName, role.getRoleName())));
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新角色菜单
|
||||
* @param roleVo 角色对象
|
||||
* @return success、false
|
||||
*/
|
||||
@SysLog("更新角色菜单")
|
||||
@PutMapping("/menu")
|
||||
@PreAuthorize("@pms.hasPermission('sys_role_perm')")
|
||||
public R saveRoleMenus(@RequestBody RoleVO roleVo) {
|
||||
return R.ok(sysRoleService.updateRoleMenus(roleVo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过角色ID 查询角色列表
|
||||
* @param roleIdList 角色ID
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/getRoleList")
|
||||
public R getRoleList(@RequestBody List<Long> roleIdList) {
|
||||
return R.ok(sysRoleService.findRolesByRoleIds(roleIdList, CollUtil.join(roleIdList, StrUtil.UNDERLINE)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel 表格
|
||||
* @param sysRole 查询条件
|
||||
* @param ids 导出ids
|
||||
* @return
|
||||
*/
|
||||
@ResponseExcel
|
||||
@GetMapping("/export")
|
||||
@PreAuthorize("@pms.hasPermission('sys_role_export')")
|
||||
public List<RoleExcelVO> export(SysRole sysRole, Long[] ids) {
|
||||
return sysRoleService.listRole(sysRole, ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入角色
|
||||
* @param excelVOList 角色列表
|
||||
* @param bindingResult 错误信息列表
|
||||
* @return ok fail
|
||||
*/
|
||||
@PostMapping("/import")
|
||||
@PreAuthorize("@pms.hasPermission('sys_role_export')")
|
||||
public R importRole(@RequestExcel List<RoleExcelVO> excelVOList, BindingResult bindingResult) {
|
||||
return sysRoleService.importRole(excelVOList, bindingResult);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.controller;
|
||||
|
||||
import cn.hutool.json.JSONArray;
|
||||
import com.pig4cloud.pigx.admin.service.SysRouteConfService;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.log.annotation.SysLog;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 路由
|
||||
*
|
||||
* @author lengleng
|
||||
* @date 2018-11-06 10:17:18
|
||||
*/
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/route")
|
||||
@Tag(description = "route", name = "动态路由管理模块")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class SysRouteConfController {
|
||||
|
||||
private final SysRouteConfService sysRouteConfService;
|
||||
|
||||
/**
|
||||
* 获取当前定义的路由信息
|
||||
* @return
|
||||
*/
|
||||
@GetMapping
|
||||
public R listRoutes() {
|
||||
return R.ok(sysRouteConfService.list());
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改路由
|
||||
* @param routes 路由定义
|
||||
* @return
|
||||
*/
|
||||
@SysLog("修改路由")
|
||||
@PutMapping
|
||||
public R updateRoutes(@RequestBody JSONArray routes) {
|
||||
return R.ok(sysRouteConfService.updateRoutes(routes));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.controller;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysScheduleEntity;
|
||||
import com.pig4cloud.pigx.admin.service.SysScheduleService;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.excel.annotation.ResponseExcel;
|
||||
import com.pig4cloud.pigx.common.log.annotation.SysLog;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springdoc.api.annotations.ParameterObject;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 日程
|
||||
*
|
||||
* @author aeizzz
|
||||
* @date 2023-03-06 14:26:23
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/schedule")
|
||||
@Tag(description = "schedule", name = "日程管理")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class SysScheduleController {
|
||||
|
||||
private final SysScheduleService sysScheduleService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
* @param sysSchedule 日程
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "分页查询", description = "分页查询")
|
||||
@GetMapping("/page")
|
||||
public R getSchedulePage(@ParameterObject Page page, @ParameterObject SysScheduleEntity sysSchedule) {
|
||||
return R.ok(sysScheduleService.getScheduleByScope(page, sysSchedule));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询日程
|
||||
* @param id id
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "通过id查询", description = "通过id查询")
|
||||
@GetMapping("/{id}")
|
||||
public R getById(@PathVariable("id") Long id) {
|
||||
return R.ok(sysScheduleService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增日程
|
||||
* @param sysSchedule 日程
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "新增日程", description = "新增日程")
|
||||
@SysLog("新增日程")
|
||||
@PostMapping
|
||||
public R save(@RequestBody SysScheduleEntity sysSchedule) {
|
||||
return R.ok(sysScheduleService.save(sysSchedule));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改日程
|
||||
* @param sysSchedule 日程
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "修改日程", description = "修改日程")
|
||||
@SysLog("修改日程")
|
||||
@PutMapping
|
||||
public R updateById(@RequestBody SysScheduleEntity sysSchedule) {
|
||||
return R.ok(sysScheduleService.updateById(sysSchedule));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除日程
|
||||
* @param ids id列表
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "通过id删除日程", description = "通过id删除日程")
|
||||
@SysLog("通过id删除日程")
|
||||
@DeleteMapping
|
||||
public R removeById(@RequestBody Long[] ids) {
|
||||
return R.ok(sysScheduleService.removeBatchByIds(CollUtil.toList(ids)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel 表格
|
||||
* @param sysSchedule 查询条件
|
||||
* @return excel 文件流
|
||||
*/
|
||||
@ResponseExcel
|
||||
@GetMapping("/export")
|
||||
public List<SysScheduleEntity> export(SysScheduleEntity sysSchedule) {
|
||||
return sysScheduleService.list(Wrappers.query(sysSchedule));
|
||||
}
|
||||
|
||||
@Operation(summary = "列表查询", description = "列表查询")
|
||||
@GetMapping("/list")
|
||||
public R list(String month) {
|
||||
List<SysScheduleEntity> list = sysScheduleService.selectListByScope(month);
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,152 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.controller;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysSocialDetails;
|
||||
import com.pig4cloud.pigx.admin.service.SysSocialDetailsService;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.core.util.ValidGroup;
|
||||
import com.pig4cloud.pigx.common.log.annotation.SysLog;
|
||||
import com.pig4cloud.pigx.common.security.annotation.Inner;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springdoc.api.annotations.ParameterObject;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 系统社交登录账号表
|
||||
*
|
||||
* @author lengleng
|
||||
* @date 2018-08-16 21:30:41
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/social")
|
||||
@AllArgsConstructor
|
||||
@Tag(description = "social", name = "三方账号管理模块")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class SysSocialDetailsController {
|
||||
|
||||
private final SysSocialDetailsService sysSocialDetailsService;
|
||||
|
||||
/**
|
||||
* 社交登录账户简单分页查询
|
||||
* @param page 分页对象
|
||||
* @param sysSocialDetails 社交登录
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
public R getSocialDetailsPage(@ParameterObject Page page, @ParameterObject SysSocialDetails sysSocialDetails) {
|
||||
return R.ok(sysSocialDetailsService.page(page, Wrappers.query(sysSocialDetails)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 信息
|
||||
* @param type 类型
|
||||
* @return R
|
||||
*/
|
||||
@GetMapping("/{type}")
|
||||
public R getByType(@PathVariable("type") String type) {
|
||||
return R.ok(sysSocialDetailsService
|
||||
.list(Wrappers.<SysSocialDetails>lambdaQuery().eq(SysSocialDetails::getType, type)));
|
||||
}
|
||||
|
||||
@GetMapping("/getById/{id}")
|
||||
public R info(@PathVariable("id") Long id) {
|
||||
return R.ok(sysSocialDetailsService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
* @param sysSocialDetails
|
||||
* @return R
|
||||
*/
|
||||
@SysLog("保存三方信息")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('sys_social_details_add')")
|
||||
public R save(@Valid @RequestBody SysSocialDetails sysSocialDetails) {
|
||||
return R.ok(sysSocialDetailsService.save(sysSocialDetails));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
* @param sysSocialDetails
|
||||
* @return R
|
||||
*/
|
||||
@SysLog("修改三方信息")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('sys_social_details_edit')")
|
||||
public R updateById(@Validated({ ValidGroup.Update.class }) @RequestBody SysSocialDetails sysSocialDetails) {
|
||||
sysSocialDetailsService.updateById(sysSocialDetails);
|
||||
return R.ok(Boolean.TRUE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param ids id 列表
|
||||
* @return R
|
||||
*/
|
||||
@SysLog("删除三方信息")
|
||||
@DeleteMapping
|
||||
@PreAuthorize("@pms.hasPermission('sys_social_details_del')")
|
||||
public R removeById(@RequestBody Long[] ids) {
|
||||
return R.ok(sysSocialDetailsService.removeBatchByIds(CollUtil.toList(ids)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过社交账号、手机号查询用户、角色信息
|
||||
* @param inStr appid@code
|
||||
* @return
|
||||
*/
|
||||
@Inner
|
||||
@GetMapping("/info/{inStr}")
|
||||
public R getUserInfo(@PathVariable String inStr) {
|
||||
return R.ok(sysSocialDetailsService.getUserInfo(inStr));
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定社交账号
|
||||
* @param state 类型
|
||||
* @param code code
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/bind")
|
||||
public R bindSocial(String state, String code) {
|
||||
return R.ok(sysSocialDetailsService.bindSocial(state, code));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出
|
||||
*/
|
||||
@GetMapping("/export")
|
||||
public List<SysSocialDetails> export(SysSocialDetails sysSocialDetails, Long[] ids) {
|
||||
return sysSocialDetailsService.list(
|
||||
Wrappers.lambdaQuery(sysSocialDetails).in(ArrayUtil.isNotEmpty(ids), SysSocialDetails::getId, ids));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package com.pig4cloud.pigx.admin.controller;
|
||||
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.data.redis.connection.RedisServerCommands;
|
||||
import org.springframework.data.redis.core.RedisCallback;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/system")
|
||||
@RequiredArgsConstructor
|
||||
@Tag(description = "system", name = "系统监控")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class SysSystemInfoController {
|
||||
|
||||
private final RedisTemplate<String, String> redisTemplate;
|
||||
|
||||
/**
|
||||
* 缓存监控
|
||||
* @return R<Object>
|
||||
*/
|
||||
@GetMapping("/cache")
|
||||
public R cache() {
|
||||
Properties info = (Properties) redisTemplate.execute((RedisCallback<Object>) RedisServerCommands::info);
|
||||
Properties commandStats = (Properties) redisTemplate
|
||||
.execute((RedisCallback<Object>) connection -> connection.info("commandstats"));
|
||||
Object dbSize = redisTemplate.execute((RedisCallback<Object>) RedisServerCommands::dbSize);
|
||||
|
||||
if (commandStats == null) {
|
||||
return R.failed("获取异常");
|
||||
}
|
||||
|
||||
Map<String, Object> result = new HashMap<>(3);
|
||||
result.put("info", info);
|
||||
result.put("dbSize", dbSize);
|
||||
|
||||
List<Map<String, String>> pieList = new ArrayList<>();
|
||||
commandStats.stringPropertyNames().forEach(key -> {
|
||||
Map<String, String> data = new HashMap<>(2);
|
||||
String property = commandStats.getProperty(key);
|
||||
data.put("name", StringUtils.removeStart(key, "cmdstat_"));
|
||||
data.put("value", StringUtils.substringBetween(property, "calls=", ",usec"));
|
||||
pieList.add(data);
|
||||
});
|
||||
|
||||
result.put("commandStats", pieList);
|
||||
return R.ok(result);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,175 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.controller;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.lang.tree.Tree;
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysTenant;
|
||||
import com.pig4cloud.pigx.admin.service.SysMenuService;
|
||||
import com.pig4cloud.pigx.admin.service.SysTenantService;
|
||||
import com.pig4cloud.pigx.common.core.constant.CacheConstants;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.data.resolver.ParamResolver;
|
||||
import com.pig4cloud.pigx.common.data.tenant.TenantBroker;
|
||||
import com.pig4cloud.pigx.common.excel.annotation.ResponseExcel;
|
||||
import com.pig4cloud.pigx.common.log.annotation.SysLog;
|
||||
import com.pig4cloud.pigx.common.security.annotation.Inner;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springdoc.api.annotations.ParameterObject;
|
||||
import org.springframework.cache.annotation.CacheEvict;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 租户管理
|
||||
*
|
||||
* @author lengleng
|
||||
* @date 2019-05-15 15:55:41
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/tenant")
|
||||
@Tag(description = "tenant", name = "租户管理")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class SysTenantController {
|
||||
|
||||
private final SysTenantService sysTenantService;
|
||||
|
||||
private final SysMenuService sysMenuService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
* @param sysTenant 租户
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
public R getSysTenantPage(@ParameterObject Page page, @ParameterObject SysTenant sysTenant) {
|
||||
return R.ok(sysTenantService.page(page, Wrappers.<SysTenant>lambdaQuery()
|
||||
.like(StrUtil.isNotBlank(sysTenant.getName()), SysTenant::getName, sysTenant.getName())));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过ID 查询租户信息
|
||||
* @param id ID
|
||||
* @return R
|
||||
*/
|
||||
@GetMapping("/details/{id}")
|
||||
public R getById(@PathVariable Long id) {
|
||||
return R.ok(sysTenantService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询租户信息
|
||||
* @param query 查询条件
|
||||
* @return 租户信息
|
||||
*/
|
||||
@GetMapping("/details")
|
||||
public R getDetails(@ParameterObject SysTenant query) {
|
||||
return R.ok(sysTenantService.getOne(Wrappers.query(query), false));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增租户
|
||||
* @param sysTenant 租户
|
||||
* @return R
|
||||
*/
|
||||
@SysLog("新增租户")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('sys_systenant_add')")
|
||||
@CacheEvict(value = CacheConstants.TENANT_DETAILS, allEntries = true)
|
||||
public R save(@RequestBody SysTenant sysTenant) {
|
||||
return R.ok(sysTenantService.saveTenant(sysTenant));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改租户
|
||||
* @param sysTenant 租户
|
||||
* @return R
|
||||
*/
|
||||
@SysLog("修改租户")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('sys_systenant_edit')")
|
||||
public R updateById(@RequestBody SysTenant sysTenant) {
|
||||
return R.ok(sysTenantService.updateTenant(sysTenant));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除租户
|
||||
* <p>
|
||||
* 为了保证安全,这里只删除租户表的数据,不删除基础表中的租户初始化数据。
|
||||
* @param ids id 列表
|
||||
* @return R
|
||||
*/
|
||||
@SysLog("删除租户")
|
||||
@DeleteMapping
|
||||
@PreAuthorize("@pms.hasPermission('sys_systenant_del')")
|
||||
@CacheEvict(value = CacheConstants.TENANT_DETAILS, allEntries = true)
|
||||
public R removeById(@RequestBody Long[] ids) {
|
||||
return R.ok(sysTenantService.removeBatchByIds(CollUtil.toList(ids)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询全部有效的租户
|
||||
* @return
|
||||
*/
|
||||
@Inner(value = false)
|
||||
@GetMapping("/list")
|
||||
public R list() {
|
||||
List<SysTenant> tenants = sysTenantService.getNormalTenant().stream()
|
||||
.filter(tenant -> tenant.getStartTime().isBefore(LocalDateTime.now()))
|
||||
.filter(tenant -> tenant.getEndTime().isAfter(LocalDateTime.now())).collect(Collectors.toList());
|
||||
return R.ok(tenants);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel 表格
|
||||
* @return
|
||||
*/
|
||||
@ResponseExcel
|
||||
@GetMapping("/export")
|
||||
@PreAuthorize("@pms.hasPermission('sys_systenant_export')")
|
||||
public List<SysTenant> export(SysTenant sysTenant, Long[] ids) {
|
||||
return sysTenantService
|
||||
.list(Wrappers.lambdaQuery(sysTenant).in(ArrayUtil.isNotEmpty(ids), SysTenant::getId, ids));
|
||||
}
|
||||
|
||||
@GetMapping(value = "/tree/menu")
|
||||
public R getTree() {
|
||||
Long defaultId = ParamResolver.getLong("TENANT_DEFAULT_ID", 1L);
|
||||
List<Tree<Long>> trees = new ArrayList<>();
|
||||
TenantBroker.runAs(defaultId, (id) -> {
|
||||
trees.addAll(sysMenuService.treeMenu(null, null, null));
|
||||
});
|
||||
|
||||
return R.ok(trees);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.controller;
|
||||
|
||||
import com.pig4cloud.pigx.admin.api.feign.RemoteTokenService;
|
||||
import com.pig4cloud.pigx.common.core.constant.SecurityConstants;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.log.annotation.SysLog;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2018/9/4 getTokenPage 管理
|
||||
*/
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/token")
|
||||
@Tag(description = "token", name = "令牌管理模块")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class SysTokenController {
|
||||
|
||||
private final RemoteTokenService remoteTokenService;
|
||||
|
||||
/**
|
||||
* 分页token 信息
|
||||
* @param params 参数集
|
||||
* @return token集合
|
||||
*/
|
||||
@RequestMapping("/page")
|
||||
public R getTokenPage(@RequestBody Map<String, Object> params) {
|
||||
return remoteTokenService.getTokenPage(params, SecurityConstants.FROM_IN);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param token getTokenPage
|
||||
* @return success/false
|
||||
*/
|
||||
@SysLog("删除用户token")
|
||||
@DeleteMapping("/delete")
|
||||
@PreAuthorize("@pms.hasPermission('sys_token_del')")
|
||||
public R removeById(@RequestBody String[] tokens) {
|
||||
for (String token : tokens) {
|
||||
remoteTokenService.removeTokenById(token, SecurityConstants.FROM_IN);
|
||||
}
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,279 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.controller;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.pig4cloud.pigx.admin.api.dto.UserDTO;
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysUser;
|
||||
import com.pig4cloud.pigx.admin.api.vo.UserExcelVO;
|
||||
import com.pig4cloud.pigx.admin.service.SysUserService;
|
||||
import com.pig4cloud.pigx.common.core.constant.CommonConstants;
|
||||
import com.pig4cloud.pigx.common.core.exception.ErrorCodes;
|
||||
import com.pig4cloud.pigx.common.core.util.MsgUtils;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.excel.annotation.RequestExcel;
|
||||
import com.pig4cloud.pigx.common.excel.annotation.ResponseExcel;
|
||||
import com.pig4cloud.pigx.common.log.annotation.SysLog;
|
||||
import com.pig4cloud.pigx.common.security.annotation.Inner;
|
||||
import com.pig4cloud.pigx.common.security.util.SecurityUtils;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springdoc.api.annotations.ParameterObject;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2018/12/16
|
||||
*/
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/user")
|
||||
@Tag(description = "user", name = "用户管理模块")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class SysUserController {
|
||||
|
||||
private final SysUserService userService;
|
||||
|
||||
/**
|
||||
* 获取指定用户全部信息
|
||||
* @return 用户信息
|
||||
*/
|
||||
@Inner
|
||||
@GetMapping("/info/{username}")
|
||||
public R info(@PathVariable String username) {
|
||||
SysUser user = userService.getOne(Wrappers.<SysUser>query().lambda().eq(SysUser::getUsername, username));
|
||||
if (user == null) {
|
||||
return R.failed(MsgUtils.getMessage(ErrorCodes.SYS_USER_USERINFO_EMPTY, username));
|
||||
}
|
||||
return R.ok(userService.findUserInfo(user));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前用户全部信息
|
||||
* @return 用户信息
|
||||
*/
|
||||
@GetMapping(value = { "/info" })
|
||||
public R info() {
|
||||
String username = SecurityUtils.getUser().getUsername();
|
||||
SysUser user = userService.getOne(Wrappers.<SysUser>query().lambda().eq(SysUser::getUsername, username));
|
||||
if (user == null) {
|
||||
return R.failed(MsgUtils.getMessage(ErrorCodes.SYS_USER_QUERY_ERROR));
|
||||
}
|
||||
return R.ok(userService.findUserInfo(user));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过ID查询用户信息
|
||||
* @param id ID
|
||||
* @return 用户信息
|
||||
*/
|
||||
@GetMapping("/details/{id}")
|
||||
public R user(@PathVariable Long id) {
|
||||
return R.ok(userService.selectUserVoById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户信息
|
||||
* @param query 查询条件
|
||||
* @return 不为空返回用户名
|
||||
*/
|
||||
@Inner(value = false)
|
||||
@GetMapping("/details")
|
||||
public R getDetails(@ParameterObject SysUser query) {
|
||||
SysUser sysUser = userService.getOne(Wrappers.query(query), false);
|
||||
return R.ok(sysUser == null ? null : CommonConstants.SUCCESS);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户信息
|
||||
* @param ids ID
|
||||
* @return R
|
||||
*/
|
||||
@SysLog("删除用户信息")
|
||||
@DeleteMapping
|
||||
@PreAuthorize("@pms.hasPermission('sys_user_del')")
|
||||
@Operation(summary = "删除用户", description = "根据ID删除用户")
|
||||
public R userDel(@RequestBody Long[] ids) {
|
||||
return R.ok(userService.deleteUserByIds(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加用户
|
||||
* @param userDto 用户信息
|
||||
* @return success/false
|
||||
*/
|
||||
@SysLog("添加用户")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('sys_user_add')")
|
||||
public R user(@RequestBody UserDTO userDto) {
|
||||
return R.ok(userService.saveUser(userDto));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询用户
|
||||
* @param page 参数集
|
||||
* @param userDTO 查询参数列表
|
||||
* @return 用户集合
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
public R getUserPage(@ParameterObject Page page, @ParameterObject UserDTO userDTO) {
|
||||
return R.ok(userService.getUsersWithRolePage(page, userDTO));
|
||||
}
|
||||
|
||||
/**
|
||||
* 管理员更新用户信息
|
||||
* @param userDto 用户信息
|
||||
* @return R
|
||||
*/
|
||||
@SysLog("更新用户信息")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('sys_user_edit')")
|
||||
public R updateUser(@Valid @RequestBody UserDTO userDto) {
|
||||
return R.ok(userService.updateUser(userDto));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改个人信息 (当前用户)
|
||||
* @param userDto userDto
|
||||
* @return success/false
|
||||
*/
|
||||
@SysLog("修改个人信息")
|
||||
@PutMapping("/personal/edit")
|
||||
public R updateUserInfo(@Valid @RequestBody UserDTO userDto) {
|
||||
return userService.updateUserInfo(userDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改个人密码 (当前用户)
|
||||
* @param userDto 用户DTO对象,包含需要修改密码的用户信息
|
||||
* @return R 返回结果对象,包含修改密码操作的结果信息
|
||||
*/
|
||||
@PutMapping("/personal/password")
|
||||
public R updatePassword(@RequestBody UserDTO userDto) {
|
||||
String username = SecurityUtils.getUser().getUsername();
|
||||
userDto.setUsername(username);
|
||||
return userService.changePassword(userDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param username 用户名称
|
||||
* @return 上级部门用户列表
|
||||
*/
|
||||
@GetMapping("/ancestor/{username}")
|
||||
public R listAncestorUsers(@PathVariable String username) {
|
||||
return R.ok(userService.listAncestorUsers(username));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel 表格
|
||||
* @param userDTO 查询条件
|
||||
* @return
|
||||
*/
|
||||
@ResponseExcel
|
||||
@GetMapping("/export")
|
||||
@PreAuthorize("@pms.hasPermission('sys_user_export')")
|
||||
public List export(UserDTO userDTO, Long[] ids) {
|
||||
return userService.listUser(userDTO, ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入用户
|
||||
* @param excelVOList 用户列表
|
||||
* @param bindingResult 错误信息列表
|
||||
* @return R
|
||||
*/
|
||||
@PostMapping("/import")
|
||||
@PreAuthorize("@pms.hasPermission('sys_user_export')")
|
||||
public R importUser(@RequestExcel List<UserExcelVO> excelVOList, BindingResult bindingResult) {
|
||||
return userService.importUser(excelVOList, bindingResult);
|
||||
}
|
||||
|
||||
/**
|
||||
* 锁定指定用户
|
||||
* @param username 用户名
|
||||
* @return R
|
||||
*/
|
||||
@Inner
|
||||
@PutMapping("/lock/{username}")
|
||||
public R lockUser(@PathVariable String username) {
|
||||
return userService.lockUser(username);
|
||||
}
|
||||
|
||||
/**
|
||||
* 解绑定接口
|
||||
* @param type 需要解绑定的类型
|
||||
* @return R 返回结果对象,包含解绑定操作的结果信息
|
||||
*/
|
||||
@PostMapping("/unbinding")
|
||||
public R unbinding(String type) {
|
||||
return userService.unbinding(type);
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验密码接口
|
||||
* @param password 需要校验的密码
|
||||
* @return R 返回结果对象,包含校验密码操作的结果信息
|
||||
*/
|
||||
@PostMapping("/check")
|
||||
public R check(String password) {
|
||||
return userService.checkPassword(password);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据角色ID列表获取用户ID列表接口
|
||||
* @param roleIdList 角色ID列表
|
||||
* @return R 返回结果对象,包含根据角色ID列表获取到的用户ID列表信息
|
||||
*/
|
||||
@GetMapping("/getUserIdListByRoleIdList")
|
||||
public R<List<Long>> getUserIdListByRoleIdList(Long[] roleIdList) {
|
||||
return R.ok(userService.listUserIdByRoleIds(CollUtil.toList(roleIdList)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据部门ID列表获取用户ID列表接口
|
||||
* @param deptIdList 部门ID列表
|
||||
* @return R 返回结果对象,包含根据部门ID列表获取到的用户ID列表信息
|
||||
*/
|
||||
@GetMapping("/getUserIdListByDeptIdList")
|
||||
public R<List<SysUser>> getUserIdListByDeptIdList(Long[] deptIdList) {
|
||||
return R.ok(userService.listUserIdByDeptIds(CollUtil.toList(deptIdList)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据用户名获取用户列表
|
||||
* @param username 用户名
|
||||
* @return 用户列表
|
||||
*/
|
||||
@GetMapping("/getUserListByUserName")
|
||||
public R<List<SysUser>> getUserListByUserName(String username) {
|
||||
return R.ok(userService.list(Wrappers.<SysUser>lambdaQuery().like(SysUser::getUsername, username)));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.handler;
|
||||
|
||||
import com.pig4cloud.pigx.admin.api.dto.UserInfo;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2018/11/18
|
||||
*/
|
||||
public abstract class AbstractLoginHandler implements LoginHandler {
|
||||
|
||||
/***
|
||||
* 数据合法性校验
|
||||
* @param loginStr 通过用户传入获取唯一标识
|
||||
* @return 默认不校验
|
||||
*/
|
||||
@Override
|
||||
public Boolean check(String loginStr) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理方法
|
||||
* @param loginStr 登录参数
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public UserInfo handle(String loginStr) {
|
||||
if (!check(loginStr)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
String identify = identify(loginStr);
|
||||
return info(identify);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.handler;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.pig4cloud.pigx.admin.api.dto.UserInfo;
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysSocialDetails;
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysUser;
|
||||
import com.pig4cloud.pigx.admin.mapper.SysSocialDetailsMapper;
|
||||
import com.pig4cloud.pigx.admin.service.SysUserService;
|
||||
import com.pig4cloud.pigx.common.core.constant.enums.LoginTypeEnum;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jasig.cas.client.validation.Assertion;
|
||||
import org.jasig.cas.client.validation.Cas30ProxyTicketValidator;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2018/11/18
|
||||
*/
|
||||
@Slf4j
|
||||
@Component("CAS")
|
||||
@AllArgsConstructor
|
||||
public class CasLoginHandler extends AbstractLoginHandler {
|
||||
|
||||
private final SysSocialDetailsMapper sysSocialDetailsMapper;
|
||||
|
||||
private final SysUserService sysUserService;
|
||||
|
||||
/**
|
||||
* cas 回到的ticket
|
||||
* <p>
|
||||
* 通过ticket 调用CAS获取唯一标识
|
||||
* @param ticket
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@SneakyThrows
|
||||
public String identify(String ticket) {
|
||||
SysSocialDetails condition = new SysSocialDetails();
|
||||
condition.setType(LoginTypeEnum.CAS.getType());
|
||||
SysSocialDetails socialDetails = sysSocialDetailsMapper.selectOne(new QueryWrapper<>(condition));
|
||||
// remark 字段填写 CAS 服务器的URL
|
||||
Cas30ProxyTicketValidator cas30ProxyTicketValidator = new Cas30ProxyTicketValidator(socialDetails.getRemark());
|
||||
Assertion validate = cas30ProxyTicketValidator.validate(ticket, socialDetails.getRedirectUrl());
|
||||
return validate.getPrincipal().getName();
|
||||
}
|
||||
|
||||
/**
|
||||
* username 获取用户信息
|
||||
* @param username
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public UserInfo info(String username) {
|
||||
SysUser user = sysUserService.getOne(Wrappers.<SysUser>query().lambda().eq(SysUser::getUsername, username));
|
||||
|
||||
if (user == null) {
|
||||
log.info("CAS 不存在用户:{}", username);
|
||||
return null;
|
||||
}
|
||||
return sysUserService.findUserInfo(user);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.handler;
|
||||
|
||||
import cn.hutool.core.util.URLUtil;
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.pig4cloud.pigx.admin.api.dto.UserInfo;
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysSocialDetails;
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysUser;
|
||||
import com.pig4cloud.pigx.admin.mapper.SysSocialDetailsMapper;
|
||||
import com.pig4cloud.pigx.admin.service.SysUserService;
|
||||
import com.pig4cloud.pigx.common.core.constant.SecurityConstants;
|
||||
import com.pig4cloud.pigx.common.core.constant.enums.LoginTypeEnum;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2019/4/8
|
||||
* <p>
|
||||
* 码云登录
|
||||
*/
|
||||
@Slf4j
|
||||
@Component("GITEE")
|
||||
@AllArgsConstructor
|
||||
public class GiteeLoginHandler extends AbstractLoginHandler {
|
||||
|
||||
private final SysSocialDetailsMapper sysSocialDetailsMapper;
|
||||
|
||||
private final SysUserService sysUserService;
|
||||
|
||||
/**
|
||||
* 码云登录传入code
|
||||
* <p>
|
||||
* 通过code 调用qq 获取唯一标识
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String identify(String code) {
|
||||
SysSocialDetails condition = new SysSocialDetails();
|
||||
condition.setType(LoginTypeEnum.GITEE.getType());
|
||||
SysSocialDetails socialDetails = sysSocialDetailsMapper.selectOne(new QueryWrapper<>(condition));
|
||||
|
||||
String url = String.format(SecurityConstants.GITEE_AUTHORIZATION_CODE_URL, code, socialDetails.getAppId(),
|
||||
URLUtil.encode(socialDetails.getRedirectUrl()), socialDetails.getAppSecret());
|
||||
String result = HttpUtil.post(url, new HashMap<>(0));
|
||||
log.debug("码云响应报文:{}", result);
|
||||
|
||||
String accessToken = JSONUtil.parseObj(result).getStr("access_token");
|
||||
String userUrl = String.format(SecurityConstants.GITEE_USER_INFO_URL, accessToken);
|
||||
String resp = HttpUtil.get(userUrl);
|
||||
log.debug("码云获取个人信息返回报文{}", resp);
|
||||
|
||||
JSONObject userInfo = JSONUtil.parseObj(resp);
|
||||
// 码云唯一标识
|
||||
return userInfo.getStr("login");
|
||||
}
|
||||
|
||||
/**
|
||||
* identify 获取用户信息
|
||||
* @param identify identify
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public UserInfo info(String identify) {
|
||||
|
||||
SysUser user = sysUserService.getOne(Wrappers.<SysUser>query().lambda().eq(SysUser::getGiteeLogin, identify));
|
||||
|
||||
if (user == null) {
|
||||
log.info("码云未绑定:{}", identify);
|
||||
return null;
|
||||
}
|
||||
return sysUserService.findUserInfo(user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定逻辑
|
||||
* @param user 用户实体
|
||||
* @param identify 渠道返回唯一标识
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Boolean bind(SysUser user, String identify) {
|
||||
user.setGiteeLogin(identify);
|
||||
sysUserService.updateById(user);
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.handler;
|
||||
|
||||
import com.pig4cloud.pigx.admin.api.dto.UserInfo;
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysUser;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2018/11/18
|
||||
* <p>
|
||||
* 登录处理器
|
||||
*/
|
||||
public interface LoginHandler {
|
||||
|
||||
/***
|
||||
* 数据合法性校验
|
||||
* @param loginStr 通过用户传入获取唯一标识
|
||||
* @return
|
||||
*/
|
||||
Boolean check(String loginStr);
|
||||
|
||||
/**
|
||||
* 通过用户传入获取唯一标识
|
||||
* @param loginStr
|
||||
* @return
|
||||
*/
|
||||
String identify(String loginStr);
|
||||
|
||||
/**
|
||||
* 通过openId 获取用户信息
|
||||
* @param identify
|
||||
* @return
|
||||
*/
|
||||
UserInfo info(String identify);
|
||||
|
||||
/**
|
||||
* 处理方法
|
||||
* @param loginStr 登录参数
|
||||
* @return
|
||||
*/
|
||||
UserInfo handle(String loginStr);
|
||||
|
||||
/**
|
||||
* 绑定逻辑
|
||||
* @param user 用户实体
|
||||
* @param identify 渠道返回唯一标识
|
||||
* @return
|
||||
*/
|
||||
default Boolean bind(SysUser user, String identify) {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.handler;
|
||||
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.pig4cloud.pigx.admin.api.dto.UserInfo;
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysSocialDetails;
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysUser;
|
||||
import com.pig4cloud.pigx.admin.mapper.SysSocialDetailsMapper;
|
||||
import com.pig4cloud.pigx.admin.service.SysUserService;
|
||||
import com.pig4cloud.pigx.common.core.constant.SecurityConstants;
|
||||
import com.pig4cloud.pigx.common.core.constant.enums.LoginTypeEnum;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2019年11月02日
|
||||
* <p>
|
||||
* 微信小程序
|
||||
*/
|
||||
@Slf4j
|
||||
@Component("MINI")
|
||||
@AllArgsConstructor
|
||||
public class MiniAppLoginHandler extends AbstractLoginHandler {
|
||||
|
||||
private final SysUserService sysUserService;
|
||||
|
||||
private final SysSocialDetailsMapper sysSocialDetailsMapper;
|
||||
|
||||
/**
|
||||
* 小程序登录传入code
|
||||
* <p>
|
||||
* 通过code 调用qq 获取唯一标识
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String identify(String code) {
|
||||
SysSocialDetails condition = new SysSocialDetails();
|
||||
condition.setType(LoginTypeEnum.MINI_APP.getType());
|
||||
SysSocialDetails socialDetails = sysSocialDetailsMapper.selectOne(new QueryWrapper<>(condition));
|
||||
|
||||
String url = String.format(SecurityConstants.MINI_APP_AUTHORIZATION_CODE_URL, socialDetails.getAppId(),
|
||||
socialDetails.getAppSecret(), code);
|
||||
String result = HttpUtil.get(url);
|
||||
log.debug("微信小程序响应报文:{}", result);
|
||||
|
||||
Object obj = JSONUtil.parseObj(result).get("openid");
|
||||
return obj.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* openId 获取用户信息
|
||||
* @param openId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public UserInfo info(String openId) {
|
||||
SysUser user = sysUserService.getOne(Wrappers.<SysUser>query().lambda().eq(SysUser::getMiniOpenid, openId));
|
||||
|
||||
if (user == null) {
|
||||
log.info("微信小程序未绑定:{}", openId);
|
||||
return null;
|
||||
}
|
||||
return sysUserService.findUserInfo(user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定逻辑
|
||||
* @param user 用户实体
|
||||
* @param identify 渠道返回唯一标识
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Boolean bind(SysUser user, String identify) {
|
||||
user.setMiniOpenid(identify);
|
||||
sysUserService.updateById(user);
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,121 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.handler;
|
||||
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.pig4cloud.pigx.admin.api.dto.UserInfo;
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysSocialDetails;
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysUser;
|
||||
import com.pig4cloud.pigx.admin.mapper.SysSocialDetailsMapper;
|
||||
import com.pig4cloud.pigx.admin.service.SysUserService;
|
||||
import com.pig4cloud.pigx.common.core.constant.SecurityConstants;
|
||||
import com.pig4cloud.pigx.common.core.constant.enums.LoginTypeEnum;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2019/4/8
|
||||
* <p>
|
||||
* 开源中国登录
|
||||
*/
|
||||
@Slf4j
|
||||
@Component("OSC")
|
||||
@AllArgsConstructor
|
||||
public class OscChinaLoginHandler extends AbstractLoginHandler {
|
||||
|
||||
private final SysSocialDetailsMapper sysSocialDetailsMapper;
|
||||
|
||||
private final SysUserService sysUserService;
|
||||
|
||||
/**
|
||||
* 开源中国传入code
|
||||
* <p>
|
||||
* 通过code 调用qq 获取唯一标识
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String identify(String code) {
|
||||
SysSocialDetails condition = new SysSocialDetails();
|
||||
condition.setType(LoginTypeEnum.OSC.getType());
|
||||
SysSocialDetails socialDetails = sysSocialDetailsMapper.selectOne(new QueryWrapper<>(condition));
|
||||
|
||||
Map<String, Object> params = new HashMap<>(8);
|
||||
|
||||
params.put("client_id", socialDetails.getAppId());
|
||||
params.put("client_secret", socialDetails.getAppSecret());
|
||||
params.put("grant_type", "authorization_code");
|
||||
params.put("redirect_uri", socialDetails.getRedirectUrl());
|
||||
params.put("code", code);
|
||||
params.put("dataType", "json");
|
||||
|
||||
String result = HttpUtil.post(SecurityConstants.OSC_AUTHORIZATION_CODE_URL, params);
|
||||
log.debug("开源中国响应报文:{}", result);
|
||||
|
||||
String accessToken = JSONUtil.parseObj(result).getStr("access_token");
|
||||
|
||||
String url = String.format(SecurityConstants.OSC_USER_INFO_URL, accessToken);
|
||||
String resp = HttpUtil.get(url);
|
||||
log.debug("开源中国获取个人信息返回报文{}", resp);
|
||||
|
||||
JSONObject userInfo = JSONUtil.parseObj(resp);
|
||||
// 开源中国唯一标识
|
||||
String id = userInfo.getStr("id");
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* identify 获取用户信息
|
||||
* @param identify 开源中国表示
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public UserInfo info(String identify) {
|
||||
|
||||
SysUser user = sysUserService.getOne(Wrappers.<SysUser>query().lambda().eq(SysUser::getOscId, identify));
|
||||
|
||||
if (user == null) {
|
||||
log.info("开源中国未绑定:{}", identify);
|
||||
return null;
|
||||
}
|
||||
return sysUserService.findUserInfo(user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定逻辑
|
||||
* @param user 用户实体
|
||||
* @param identify 渠道返回唯一标识
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Boolean bind(SysUser user, String identify) {
|
||||
user.setOscId(identify);
|
||||
sysUserService.updateById(user);
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.handler;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.pig4cloud.pigx.admin.api.dto.UserInfo;
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysUser;
|
||||
import com.pig4cloud.pigx.admin.service.SysUserService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2018/11/18
|
||||
*/
|
||||
@Slf4j
|
||||
@Component("SMS")
|
||||
@AllArgsConstructor
|
||||
public class SmsLoginHandler extends AbstractLoginHandler {
|
||||
|
||||
private final SysUserService sysUserService;
|
||||
|
||||
/**
|
||||
* 验证码登录传入为手机号 不用不处理
|
||||
* @param mobile
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String identify(String mobile) {
|
||||
return mobile;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过mobile 获取用户信息
|
||||
* @param identify
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public UserInfo info(String identify) {
|
||||
SysUser user = sysUserService.getOne(Wrappers.<SysUser>query().lambda().eq(SysUser::getPhone, identify));
|
||||
|
||||
if (user == null) {
|
||||
log.info("手机号未注册:{}", identify);
|
||||
return null;
|
||||
}
|
||||
return sysUserService.findUserInfo(user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定逻辑
|
||||
* @param user 用户实体
|
||||
* @param identify 渠道返回唯一标识
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Boolean bind(SysUser user, String identify) {
|
||||
user.setPhone(identify);
|
||||
sysUserService.updateById(user);
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.handler;
|
||||
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.pig4cloud.pigx.admin.api.dto.UserInfo;
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysSocialDetails;
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysUser;
|
||||
import com.pig4cloud.pigx.admin.mapper.SysSocialDetailsMapper;
|
||||
import com.pig4cloud.pigx.admin.service.SysUserService;
|
||||
import com.pig4cloud.pigx.common.core.constant.SecurityConstants;
|
||||
import com.pig4cloud.pigx.common.core.constant.enums.LoginTypeEnum;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2018/11/18
|
||||
*/
|
||||
@Slf4j
|
||||
@Component("QQ")
|
||||
@AllArgsConstructor
|
||||
public class TencentLoginHandler extends AbstractLoginHandler {
|
||||
|
||||
private final SysUserService sysUserService;
|
||||
|
||||
private final SysSocialDetailsMapper sysSocialDetailsMapper;
|
||||
|
||||
/**
|
||||
* QQ登录传入code
|
||||
* <p>
|
||||
* 通过code 调用qq 获取唯一标识
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String identify(String code) {
|
||||
SysSocialDetails condition = new SysSocialDetails();
|
||||
condition.setType(LoginTypeEnum.QQ.getType());
|
||||
SysSocialDetails socialDetails = sysSocialDetailsMapper.selectOne(new QueryWrapper<>(condition));
|
||||
|
||||
String url = String.format(SecurityConstants.QQ_AUTHORIZATION_CODE_URL, socialDetails.getAppId(),
|
||||
socialDetails.getAppSecret(), code);
|
||||
String result = HttpUtil.get(url);
|
||||
log.debug("QQ响应报文:{}", result);
|
||||
|
||||
String accessToken = JSONUtil.parseObj(result).getStr("access_token");
|
||||
String userUrl = String.format(SecurityConstants.QQ_USER_INFO_URL, accessToken);
|
||||
String resp = HttpUtil.get(userUrl);
|
||||
log.debug("QQ获取个人信息返回报文{}", resp);
|
||||
|
||||
JSONObject userInfo = JSONUtil.parseObj(resp);
|
||||
// QQ唯一标识
|
||||
String openid = userInfo.getStr("openid");
|
||||
return openid;
|
||||
}
|
||||
|
||||
/**
|
||||
* openId 获取用户信息
|
||||
* @param openId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public UserInfo info(String openId) {
|
||||
SysUser user = sysUserService.getOne(Wrappers.<SysUser>query().lambda().eq(SysUser::getQqOpenid, openId));
|
||||
|
||||
if (user == null) {
|
||||
log.info("QQ未绑定:{}", openId);
|
||||
return null;
|
||||
}
|
||||
return sysUserService.findUserInfo(user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定逻辑
|
||||
* @param user 用户实体
|
||||
* @param identify 渠道返回唯一标识
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Boolean bind(SysUser user, String identify) {
|
||||
user.setQqOpenid(identify);
|
||||
sysUserService.updateById(user);
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.handler;
|
||||
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.pig4cloud.pigx.admin.api.dto.UserInfo;
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysSocialDetails;
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysUser;
|
||||
import com.pig4cloud.pigx.admin.mapper.SysSocialDetailsMapper;
|
||||
import com.pig4cloud.pigx.admin.service.SysUserService;
|
||||
import com.pig4cloud.pigx.common.core.constant.SecurityConstants;
|
||||
import com.pig4cloud.pigx.common.core.constant.enums.LoginTypeEnum;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2018/11/18
|
||||
*/
|
||||
@Slf4j
|
||||
@Component("WX")
|
||||
@AllArgsConstructor
|
||||
public class WeChatLoginHandler extends AbstractLoginHandler {
|
||||
|
||||
private final SysUserService sysUserService;
|
||||
|
||||
private final SysSocialDetailsMapper sysSocialDetailsMapper;
|
||||
|
||||
/**
|
||||
* 微信登录传入code
|
||||
* <p>
|
||||
* 通过code 调用qq 获取唯一标识
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String identify(String code) {
|
||||
SysSocialDetails condition = new SysSocialDetails();
|
||||
condition.setType(LoginTypeEnum.WECHAT.getType());
|
||||
SysSocialDetails socialDetails = sysSocialDetailsMapper.selectOne(new QueryWrapper<>(condition));
|
||||
|
||||
String url = String.format(SecurityConstants.WX_AUTHORIZATION_CODE_URL, socialDetails.getAppId(),
|
||||
socialDetails.getAppSecret(), code);
|
||||
String result = HttpUtil.get(url);
|
||||
log.debug("微信响应报文:{}", result);
|
||||
|
||||
Object obj = JSONUtil.parseObj(result).get("openid");
|
||||
return obj.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* openId 获取用户信息
|
||||
* @param openId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public UserInfo info(String openId) {
|
||||
SysUser user = sysUserService.getOne(Wrappers.<SysUser>query().lambda().eq(SysUser::getWxOpenid, openId));
|
||||
|
||||
if (user == null) {
|
||||
log.info("微信未绑定:{}", openId);
|
||||
return null;
|
||||
}
|
||||
return sysUserService.findUserInfo(user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定逻辑
|
||||
* @param user 用户实体
|
||||
* @param identify 渠道返回唯一标识
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Boolean bind(SysUser user, String identify) {
|
||||
user.setWxOpenid(identify);
|
||||
sysUserService.updateById(user);
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.handler;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.pig4cloud.pigx.admin.api.dto.UserInfo;
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysUser;
|
||||
import com.pig4cloud.pigx.admin.service.ConnectService;
|
||||
import com.pig4cloud.pigx.admin.service.SysUserService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import me.chanjar.weixin.cp.api.WxCpService;
|
||||
import me.chanjar.weixin.cp.api.impl.WxCpServiceImpl;
|
||||
import me.chanjar.weixin.cp.bean.WxCpOauth2UserInfo;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2022/7/19
|
||||
*
|
||||
* 企业微信免密登录
|
||||
*/
|
||||
@Slf4j
|
||||
@Component("WEIXIN_CP")
|
||||
@AllArgsConstructor
|
||||
public class WxCpLoginHandler extends AbstractLoginHandler {
|
||||
|
||||
private ConnectService connectService;
|
||||
|
||||
private final SysUserService sysUserService;
|
||||
|
||||
/**
|
||||
* 微信登录传入code
|
||||
* <p>
|
||||
* 通过code 调用qq 获取唯一标识
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@SneakyThrows
|
||||
public String identify(String code) {
|
||||
WxCpService wxCpService = new WxCpServiceImpl();
|
||||
wxCpService.setWxCpConfigStorage(connectService.getCpConfig());
|
||||
|
||||
WxCpOauth2UserInfo userInfo = wxCpService.getOauth2Service().getUserInfo(code);
|
||||
log.info("企业微信返回报文:{}", userInfo);
|
||||
return userInfo.getUserId();
|
||||
}
|
||||
|
||||
/**
|
||||
* openId 获取用户信息
|
||||
* @param openId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public UserInfo info(String openId) {
|
||||
SysUser user = sysUserService.getOne(Wrappers.<SysUser>query().lambda().eq(SysUser::getWxOpenid, openId));
|
||||
|
||||
if (user == null) {
|
||||
log.info("企业微信未绑定:{}", openId);
|
||||
return null;
|
||||
}
|
||||
return sysUserService.findUserInfo(user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定逻辑
|
||||
* @param user 用户实体
|
||||
* @param identify 渠道返回唯一标识
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Boolean bind(SysUser user, String identify) {
|
||||
user.setWxOpenid(identify);
|
||||
sysUserService.updateById(user);
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.mapper;
|
||||
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysAuditLog;
|
||||
import com.pig4cloud.pigx.common.data.datascope.PigxBaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 审计记录表
|
||||
*
|
||||
* @author PIG
|
||||
* @date 2023-02-28 20:12:23
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysAuditLogMapper extends PigxBaseMapper<SysAuditLog> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.mapper;
|
||||
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysDept;
|
||||
import com.pig4cloud.pigx.common.data.datascope.PigxBaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 部门管理 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author lengleng
|
||||
* @since 2018-01-20
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysDeptMapper extends PigxBaseMapper<SysDept> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
package com.pig4cloud.pigx.admin.mapper;
|
||||
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysDictItem;
|
||||
import com.pig4cloud.pigx.common.data.datascope.PigxBaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 字典项
|
||||
*
|
||||
* @author lengleng
|
||||
* @date 2019/03/19
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysDictItemMapper extends PigxBaseMapper<SysDictItem> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.mapper;
|
||||
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysDict;
|
||||
import com.pig4cloud.pigx.common.data.datascope.PigxBaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 字典表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author lengleng
|
||||
* @since 2017-11-19
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysDictMapper extends PigxBaseMapper<SysDict> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.mapper;
|
||||
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysFileGroup;
|
||||
import com.pig4cloud.pigx.common.data.datascope.PigxBaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 文件分组管理
|
||||
*
|
||||
* @author lbw
|
||||
* @date 2023年07月25日21:31:48
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysFileGroupMapper extends PigxBaseMapper<SysFileGroup> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.mapper;
|
||||
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysFile;
|
||||
import com.pig4cloud.pigx.common.data.datascope.PigxBaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 文件管理
|
||||
*
|
||||
* @author Luckly
|
||||
* @date 2019-06-18 17:18:42
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysFileMapper extends PigxBaseMapper<SysFile> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.mapper;
|
||||
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysI18nEntity;
|
||||
import com.pig4cloud.pigx.common.data.datascope.PigxBaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 系统表-国际化
|
||||
*
|
||||
* @author PIG
|
||||
* @date 2023-02-14 09:07:01
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysI18nMapper extends PigxBaseMapper<SysI18nEntity> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.mapper;
|
||||
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysLog;
|
||||
import com.pig4cloud.pigx.common.data.datascope.PigxBaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 日志表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author lengleng
|
||||
* @since 2017-11-20
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysLogMapper extends PigxBaseMapper<SysLog> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.mapper;
|
||||
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysMenu;
|
||||
import com.pig4cloud.pigx.common.data.datascope.PigxBaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 菜单权限表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author lengleng
|
||||
* @since 2017-10-29
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysMenuMapper extends PigxBaseMapper<SysMenu> {
|
||||
|
||||
/**
|
||||
* 通过角色编号查询菜单
|
||||
* @param roleId 角色ID
|
||||
* @return
|
||||
*/
|
||||
List<SysMenu> listMenusByRoleId(Long roleId);
|
||||
|
||||
/**
|
||||
* 通过角色ID查询权限
|
||||
* @param roleIds Ids
|
||||
* @return
|
||||
*/
|
||||
List<String> listPermissionsByRoleIds(String roleIds);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.mapper;
|
||||
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysOauthClientDetails;
|
||||
import com.pig4cloud.pigx.common.data.datascope.PigxBaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author lengleng
|
||||
* @since 2018-05-15
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysOauthClientDetailsMapper extends PigxBaseMapper<SysOauthClientDetails> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.mapper;
|
||||
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysPost;
|
||||
import com.pig4cloud.pigx.common.data.datascope.PigxBaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 岗位信息表
|
||||
*
|
||||
* @author fxz
|
||||
* @date 2022-03-26 12:50:43
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysPostMapper extends PigxBaseMapper<SysPost> {
|
||||
|
||||
/**
|
||||
* 通过用户ID,查询岗位信息
|
||||
* @param userId 用户id
|
||||
* @return 岗位信息
|
||||
*/
|
||||
List<SysPost> listPostsByUserId(Long userId);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
package com.pig4cloud.pigx.admin.mapper;
|
||||
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysPublicParam;
|
||||
import com.pig4cloud.pigx.common.data.datascope.PigxBaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 公共参数配置
|
||||
*
|
||||
* @author Lucky
|
||||
* @date 2019-04-29
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysPublicParamMapper extends PigxBaseMapper<SysPublicParam> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.mapper;
|
||||
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysRole;
|
||||
import com.pig4cloud.pigx.common.data.datascope.PigxBaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author lengleng
|
||||
* @since 2017-10-29
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysRoleMapper extends PigxBaseMapper<SysRole> {
|
||||
|
||||
/**
|
||||
* 通过用户ID,查询角色信息
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
List<SysRole> listRolesByUserId(Long userId);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.admin.mapper;
|
||||
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysRoleMenu;
|
||||
import com.pig4cloud.pigx.common.data.datascope.PigxBaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 角色菜单表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author lengleng
|
||||
* @since 2017-10-29
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysRoleMenuMapper extends PigxBaseMapper<SysRoleMenu> {
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user