♻️ Refactoring code. 使用openapi3 替代swagger2
This commit is contained in:
1 parent
032c1b54d3
commit
eb3387da9f
165 files changed
+1188
-1635
No files matched your search
+3
-4
@@ -1,22 +1,21 @@
|
||||
package com.pig4cloud.pigx.app.api.dto;
|
||||
|
||||
import com.pig4cloud.pigx.app.api.entity.AppUser;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@ApiModel(value = "APP用户传输对象")
|
||||
@Schema(description = "APP用户传输对象")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class AppUserDTO extends AppUser {
|
||||
|
||||
/**
|
||||
* 角色ID
|
||||
*/
|
||||
@ApiModelProperty(value = "角色id集合")
|
||||
@Schema(description = "角色id集合")
|
||||
private List<Long> role;
|
||||
|
||||
}
|
||||
+5
-6
@@ -20,8 +20,7 @@
|
||||
package com.pig4cloud.pigx.app.api.dto;
|
||||
|
||||
import com.pig4cloud.pigx.app.api.entity.AppUser;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
@@ -31,25 +30,25 @@ import java.io.Serializable;
|
||||
* @date 2017/11/11
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "用户信息")
|
||||
@Schema(description = "用户信息")
|
||||
public class AppUserInfo implements Serializable {
|
||||
|
||||
/**
|
||||
* 用户基本信息
|
||||
*/
|
||||
@ApiModelProperty(value = "用户基本信息")
|
||||
@Schema(description = "用户基本信息")
|
||||
private AppUser appUser;
|
||||
|
||||
/**
|
||||
* 权限标识集合
|
||||
*/
|
||||
@ApiModelProperty(value = "权限标识集合")
|
||||
@Schema(description = "权限标识集合")
|
||||
private String[] permissions;
|
||||
|
||||
/**
|
||||
* 角色集合
|
||||
*/
|
||||
@ApiModelProperty(value = "角色标识集合")
|
||||
@Schema(description = "角色标识集合")
|
||||
private Long[] roles;
|
||||
|
||||
}
|
||||
+16
-17
@@ -21,8 +21,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@@ -37,7 +36,7 @@ import java.time.LocalDateTime;
|
||||
@Data
|
||||
@TableName("app_menu")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel(value = "菜单权限表")
|
||||
@Schema(description = "菜单权限表")
|
||||
public class AppMenu extends Model<AppMenu> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@@ -46,85 +45,85 @@ public class AppMenu extends Model<AppMenu> {
|
||||
* 菜单ID
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "菜单ID")
|
||||
@Schema(description = "菜单ID")
|
||||
private Long menuId;
|
||||
|
||||
/**
|
||||
* name
|
||||
*/
|
||||
@ApiModelProperty(value = "name")
|
||||
@Schema(description = "name")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* permission
|
||||
*/
|
||||
@ApiModelProperty(value = "permission")
|
||||
@Schema(description = "permission")
|
||||
private String permission;
|
||||
|
||||
/**
|
||||
* path
|
||||
*/
|
||||
@ApiModelProperty(value = "path")
|
||||
@Schema(description = "path")
|
||||
private String path;
|
||||
|
||||
/**
|
||||
* 父菜单ID
|
||||
*/
|
||||
@ApiModelProperty(value = "父菜单ID")
|
||||
@Schema(description = "父菜单ID")
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 是否显示
|
||||
*/
|
||||
@ApiModelProperty(value = "是否显示")
|
||||
@Schema(description = "是否显示")
|
||||
private String visible;
|
||||
|
||||
/**
|
||||
* 排序值
|
||||
*/
|
||||
@ApiModelProperty(value = "排序值")
|
||||
@Schema(description = "排序值")
|
||||
private Integer sortOrder;
|
||||
|
||||
/**
|
||||
* menuType
|
||||
*/
|
||||
@ApiModelProperty(value = "menuType")
|
||||
@Schema(description = "menuType")
|
||||
private String menuType;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@ApiModelProperty(value = "创建人")
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@ApiModelProperty(value = "修改人")
|
||||
@Schema(description = "修改人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* delFlag
|
||||
*/
|
||||
@ApiModelProperty(value = "delFlag")
|
||||
@Schema(description = "delFlag")
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
@ApiModelProperty(value = "租户ID", hidden = true)
|
||||
@Schema(description = "租户ID", hidden = true)
|
||||
private Long tenantId;
|
||||
|
||||
}
|
||||
+12
-13
@@ -21,8 +21,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@@ -37,7 +36,7 @@ import java.time.LocalDateTime;
|
||||
@Data
|
||||
@TableName("app_role")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel(value = "app角色表")
|
||||
@Schema(description = "app角色表")
|
||||
public class AppRole extends Model<AppRole> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@@ -46,61 +45,61 @@ public class AppRole extends Model<AppRole> {
|
||||
* roleId
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "roleId")
|
||||
@Schema(description = "roleId")
|
||||
private Long roleId;
|
||||
|
||||
/**
|
||||
* roleName
|
||||
*/
|
||||
@ApiModelProperty(value = "roleName")
|
||||
@Schema(description = "roleName")
|
||||
private String roleName;
|
||||
|
||||
/**
|
||||
* roleCode
|
||||
*/
|
||||
@ApiModelProperty(value = "roleCode")
|
||||
@Schema(description = "roleCode")
|
||||
private String roleCode;
|
||||
|
||||
/**
|
||||
* roleDesc
|
||||
*/
|
||||
@ApiModelProperty(value = "roleDesc")
|
||||
@Schema(description = "roleDesc")
|
||||
private String roleDesc;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@ApiModelProperty(value = "创建人")
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@ApiModelProperty(value = "修改人")
|
||||
@Schema(description = "修改人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* createTime
|
||||
*/
|
||||
@ApiModelProperty(value = "createTime")
|
||||
@Schema(description = "createTime")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* updateTime
|
||||
*/
|
||||
@ApiModelProperty(value = "updateTime")
|
||||
@Schema(description = "updateTime")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* delFlag
|
||||
*/
|
||||
@ApiModelProperty(value = "delFlag")
|
||||
@Schema(description = "delFlag")
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* tenantId
|
||||
*/
|
||||
@ApiModelProperty(value = "tenantId", hidden = true)
|
||||
@Schema(description = "tenantId", hidden = true)
|
||||
private Long tenantId;
|
||||
|
||||
}
|
||||
+4
-5
@@ -21,8 +21,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@@ -35,7 +34,7 @@ import lombok.EqualsAndHashCode;
|
||||
@Data
|
||||
@TableName("app_role_menu")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel(value = "角色菜单表")
|
||||
@Schema(description = "角色菜单表")
|
||||
public class AppRoleMenu extends Model<AppRoleMenu> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@@ -44,13 +43,13 @@ public class AppRoleMenu extends Model<AppRoleMenu> {
|
||||
* 角色ID
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "角色ID")
|
||||
@Schema(description = "角色ID")
|
||||
private Long roleId;
|
||||
|
||||
/**
|
||||
* 菜单ID
|
||||
*/
|
||||
@ApiModelProperty(value = "菜单ID")
|
||||
@Schema(description = "菜单ID")
|
||||
private Long menuId;
|
||||
|
||||
}
|
||||
+14
-15
@@ -21,8 +21,7 @@ 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.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@@ -33,7 +32,7 @@ import java.time.LocalDateTime;
|
||||
* app 社交账号登录
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "第三方账号信息")
|
||||
@Schema(description = "第三方账号信息")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class AppSocialDetails extends Model<AppSocialDetails> {
|
||||
|
||||
@@ -43,20 +42,20 @@ public class AppSocialDetails extends Model<AppSocialDetails> {
|
||||
* 主鍵
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "主键")
|
||||
@Schema(description = "主键")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
@NotBlank(message = "类型不能为空")
|
||||
@ApiModelProperty(value = "账号类型")
|
||||
@Schema(description = "账号类型")
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
@ApiModelProperty(value = "描述")
|
||||
@Schema(description = "描述")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
@@ -64,7 +63,7 @@ public class AppSocialDetails extends Model<AppSocialDetails> {
|
||||
*/
|
||||
@Sensitive(prefixNoMaskLen = 4, suffixNoMaskLen = 4)
|
||||
@NotBlank(message = "账号不能为空")
|
||||
@ApiModelProperty(value = "appId")
|
||||
@Schema(description = "appId")
|
||||
private String appId;
|
||||
|
||||
/**
|
||||
@@ -72,46 +71,46 @@ public class AppSocialDetails extends Model<AppSocialDetails> {
|
||||
*/
|
||||
@Sensitive(prefixNoMaskLen = 9, suffixNoMaskLen = 9)
|
||||
@NotBlank(message = "密钥不能为空", groups = { ValidGroup.Insert.class })
|
||||
@ApiModelProperty(value = "app secret")
|
||||
@Schema(description = "app secret")
|
||||
private String appSecret;
|
||||
|
||||
/**
|
||||
* 回调地址
|
||||
*/
|
||||
@ApiModelProperty(value = "回调地址")
|
||||
@Schema(description = "回调地址")
|
||||
private String redirectUrl;
|
||||
|
||||
/**
|
||||
* 拓展字段
|
||||
*/
|
||||
@ApiModelProperty(value = "拓展字段")
|
||||
@Schema(description = "拓展字段")
|
||||
private String ext;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@ApiModelProperty(value = "创建人")
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
@ApiModelProperty(value = "修改人")
|
||||
@Schema(description = "修改人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@Schema(description = "创建时间")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
@Schema(description = "更新时间")
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
@@ -120,7 +119,7 @@ public class AppSocialDetails extends Model<AppSocialDetails> {
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@ApiModelProperty(value = "删除标记,1:已删除,0:正常")
|
||||
@Schema(description = "删除标记,1:已删除,0:正常")
|
||||
private String delFlag;
|
||||
|
||||
}
|
||||
+20
-21
@@ -20,8 +20,7 @@ package com.pig4cloud.pigx.app.api.entity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@@ -36,7 +35,7 @@ import java.time.LocalDateTime;
|
||||
@Data
|
||||
@TableName("app_user")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel(value = "app用户表")
|
||||
@Schema(description = "app用户表")
|
||||
public class AppUser extends Model<AppUser> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@@ -45,90 +44,90 @@ public class AppUser extends Model<AppUser> {
|
||||
* userId
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "userId")
|
||||
@Schema(description = "userId")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
@ApiModelProperty(value = "用户名")
|
||||
@Schema(description = "用户名")
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
@ApiModelProperty(value = "密码")
|
||||
@Schema(description = "密码")
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 随机盐
|
||||
*/
|
||||
@JsonIgnore
|
||||
@ApiModelProperty(value = "随机盐")
|
||||
@Schema(description = "随机盐")
|
||||
private String salt;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@ApiModelProperty(value = "手机号")
|
||||
@Schema(description = "手机号")
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 头像
|
||||
*/
|
||||
@ApiModelProperty(value = "头像")
|
||||
@Schema(description = "头像")
|
||||
private String avatar;
|
||||
|
||||
/**
|
||||
* 昵称
|
||||
*/
|
||||
@ApiModelProperty(value = "拓展字段:昵称")
|
||||
@Schema(description = "拓展字段:昵称")
|
||||
private String nickname;
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
@ApiModelProperty(value = "拓展字段:姓名")
|
||||
@Schema(description = "拓展字段:姓名")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
@ApiModelProperty(value = "拓展字段:邮箱")
|
||||
@Schema(description = "拓展字段:邮箱")
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@ApiModelProperty(value = "创建人")
|
||||
@Schema(description = "创建人")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@ApiModelProperty(value = "修改人")
|
||||
@Schema(description = "修改人")
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@Schema(description = "创建时间")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
@Schema(description = "修改时间")
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 删除标记
|
||||
*/
|
||||
@ApiModelProperty(value = "删除标记,1:已删除,0:正常")
|
||||
@Schema(description = "删除标记,1:已删除,0:正常")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@TableLogic
|
||||
private String delFlag;
|
||||
@@ -136,25 +135,25 @@ public class AppUser extends Model<AppUser> {
|
||||
/**
|
||||
* 所属租户
|
||||
*/
|
||||
@ApiModelProperty(value = "所属租户", hidden = true)
|
||||
@Schema(description = "所属租户", hidden = true)
|
||||
private Long tenantId;
|
||||
|
||||
/**
|
||||
* 最后一次密码修改时间
|
||||
*/
|
||||
@ApiModelProperty(value = "最后一次密码修改时间")
|
||||
@Schema(description = "最后一次密码修改时间")
|
||||
private LocalDateTime lastModifiedTime;
|
||||
|
||||
/**
|
||||
* 锁定标记
|
||||
*/
|
||||
@ApiModelProperty(value = "锁定标记")
|
||||
@Schema(description = "锁定标记")
|
||||
private String lockFlag;
|
||||
|
||||
/**
|
||||
* 微信小程序登录openId
|
||||
*/
|
||||
@ApiModelProperty(value = "微信小程序登录openId")
|
||||
@Schema(description = "微信小程序登录openId")
|
||||
private String wxOpenid;
|
||||
|
||||
}
|
||||
+4
-5
@@ -21,8 +21,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@@ -35,7 +34,7 @@ import lombok.EqualsAndHashCode;
|
||||
@Data
|
||||
@TableName("app_user_role")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel(value = "用户角色表")
|
||||
@Schema(description = "用户角色表")
|
||||
public class AppUserRole extends Model<AppUserRole> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@@ -44,13 +43,13 @@ public class AppUserRole extends Model<AppUserRole> {
|
||||
* 用户ID
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "用户ID")
|
||||
@Schema(description = "用户ID")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 角色ID
|
||||
*/
|
||||
@ApiModelProperty(value = "角色ID")
|
||||
@Schema(description = "角色ID")
|
||||
private Long roleId;
|
||||
|
||||
}
|
||||
+2
-2
@@ -17,7 +17,7 @@
|
||||
|
||||
package com.pig4cloud.pigx.app.api.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
@@ -25,7 +25,7 @@ import lombok.Data;
|
||||
* @date 2020/2/10
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "前端角色展示对象")
|
||||
@Schema(description = "前端角色展示对象")
|
||||
public class AppRoleVO {
|
||||
|
||||
/**
|
||||
|
||||
+15
-15
@@ -3,7 +3,7 @@ package com.pig4cloud.pigx.app.api.vo;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppRole;
|
||||
import com.pig4cloud.pigx.common.core.sensitive.Sensitive;
|
||||
import com.pig4cloud.pigx.common.core.sensitive.SensitiveTypeEnum;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
@@ -16,86 +16,86 @@ public class AppUserVo implements Serializable {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@ApiModelProperty(value = "主键")
|
||||
@Schema(description = "主键")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
@ApiModelProperty(value = "用户名")
|
||||
@Schema(description = "用户名")
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
@ApiModelProperty(value = "密码")
|
||||
@Schema(description = "密码")
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@ApiModelProperty(value = "手机号")
|
||||
@Schema(description = "手机号")
|
||||
@Sensitive(type = SensitiveTypeEnum.MOBILE_PHONE)
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 头像
|
||||
*/
|
||||
@ApiModelProperty(value = "头像")
|
||||
@Schema(description = "头像")
|
||||
private String avatar;
|
||||
|
||||
/**
|
||||
* 昵称
|
||||
*/
|
||||
@ApiModelProperty(value = "拓展字段:昵称")
|
||||
@Schema(description = "拓展字段:昵称")
|
||||
private String nickname;
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
@ApiModelProperty(value = "拓展字段:姓名")
|
||||
@Schema(description = "拓展字段:姓名")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
@ApiModelProperty(value = "拓展字段:邮箱")
|
||||
@Schema(description = "拓展字段:邮箱")
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 删除标记
|
||||
*/
|
||||
@ApiModelProperty(value = "删除标记,1:已删除,0:正常")
|
||||
@Schema(description = "删除标记,1:已删除,0:正常")
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 所属租户
|
||||
*/
|
||||
@ApiModelProperty(value = "所属租户")
|
||||
@Schema(description = "所属租户")
|
||||
private Long tenantId;
|
||||
|
||||
/**
|
||||
* 最后一次密码修改时间
|
||||
*/
|
||||
@ApiModelProperty(value = "最后一次密码修改时间")
|
||||
@Schema(description = "最后一次密码修改时间")
|
||||
private LocalDateTime lastModifiedTime;
|
||||
|
||||
/**
|
||||
* 锁定标记
|
||||
*/
|
||||
@ApiModelProperty(value = "锁定标记")
|
||||
@Schema(description = "锁定标记")
|
||||
private String lockFlag;
|
||||
|
||||
/**
|
||||
* 角色列表
|
||||
*/
|
||||
@ApiModelProperty(value = "拥有的角色列表")
|
||||
@Schema(description = "拥有的角色列表")
|
||||
private List<AppRole> roleList;
|
||||
|
||||
}
|
||||
@@ -89,11 +89,6 @@
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-swagger</artifactId>
|
||||
</dependency>
|
||||
<!--测试: spring boot test-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
|
||||
+2
-2
@@ -2,7 +2,7 @@ package com.pig4cloud.pigx.app;
|
||||
|
||||
import com.pig4cloud.pigx.common.feign.annotation.EnablePigxFeignClients;
|
||||
import com.pig4cloud.pigx.common.security.annotation.EnablePigxResourceServer;
|
||||
import com.pig4cloud.pigx.common.swagger.annotation.EnablePigxSwagger2;
|
||||
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;
|
||||
@@ -12,7 +12,7 @@ import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||
* <p>
|
||||
* 项目启动类
|
||||
*/
|
||||
@EnablePigxSwagger2
|
||||
@EnableOpenApi("app")
|
||||
@EnablePigxFeignClients
|
||||
@EnableDiscoveryClient
|
||||
@EnablePigxResourceServer
|
||||
|
||||
+8
-11
@@ -17,24 +17,20 @@
|
||||
|
||||
package com.pig4cloud.pigx.app.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysMenu;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.log.annotation.SysLog;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppMenu;
|
||||
import com.pig4cloud.pigx.app.service.AppMenuService;
|
||||
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 org.springframework.security.access.prepost.PreAuthorize;
|
||||
import com.pig4cloud.pigx.common.excel.annotation.ResponseExcel;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
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.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -47,7 +43,8 @@ import java.util.stream.Collectors;
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/appmenu")
|
||||
@Api(value = "appmenu", tags = "菜单权限表管理")
|
||||
@Tag(description = "appmenu", name = "菜单权限表管理")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class AppMenuController {
|
||||
|
||||
private final AppMenuService appMenuService;
|
||||
|
||||
+16
-14
@@ -19,17 +19,18 @@ package com.pig4cloud.pigx.app.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.pig4cloud.pigx.admin.api.vo.RoleVO;
|
||||
import com.pig4cloud.pigx.app.api.vo.AppRoleVO;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.log.annotation.SysLog;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppRole;
|
||||
import com.pig4cloud.pigx.app.api.vo.AppRoleVO;
|
||||
import com.pig4cloud.pigx.app.service.AppRoleService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.excel.annotation.ResponseExcel;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
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.springframework.http.HttpHeaders;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
@@ -43,7 +44,8 @@ import java.util.List;
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/approle")
|
||||
@Api(value = "approle", tags = "app角色表管理")
|
||||
@Tag(description = "approle", name = "app角色表管理")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class AppRoleController {
|
||||
|
||||
private final AppRoleService appRoleService;
|
||||
@@ -54,7 +56,7 @@ public class AppRoleController {
|
||||
* @param appRole app角色表
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询", notes = "分页查询")
|
||||
@Operation(summary = "分页查询", description = "分页查询")
|
||||
@GetMapping("/page")
|
||||
public R getAppRolePage(Page page, AppRole appRole) {
|
||||
return R.ok(appRoleService.page(page, Wrappers.query(appRole)));
|
||||
@@ -64,7 +66,7 @@ public class AppRoleController {
|
||||
* 查询全部角色
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "查询全部", notes = "查询全部")
|
||||
@Operation(summary = "查询全部", description = "查询全部")
|
||||
@GetMapping("/list")
|
||||
public R list() {
|
||||
return R.ok(appRoleService.list(Wrappers.emptyWrapper()));
|
||||
@@ -75,7 +77,7 @@ public class AppRoleController {
|
||||
* @param roleId id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id查询", notes = "通过id查询")
|
||||
@Operation(summary = "通过id查询", description = "通过id查询")
|
||||
@GetMapping("/{roleId}")
|
||||
@PreAuthorize("@pms.hasPermission('app_approle_view')")
|
||||
public R getById(@PathVariable("roleId") Long roleId) {
|
||||
@@ -87,7 +89,7 @@ public class AppRoleController {
|
||||
* @param appRole app角色表
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "新增app角色表", notes = "新增app角色表")
|
||||
@Operation(summary = "新增app角色表", description = "新增app角色表")
|
||||
@SysLog("新增app角色表")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('app_approle_add')")
|
||||
@@ -100,7 +102,7 @@ public class AppRoleController {
|
||||
* @param appRole app角色表
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "修改app角色表", notes = "修改app角色表")
|
||||
@Operation(summary = "修改app角色表", description = "修改app角色表")
|
||||
@SysLog("修改app角色表")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('app_approle_edit')")
|
||||
@@ -113,7 +115,7 @@ public class AppRoleController {
|
||||
* @param roleId id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id删除app角色表", notes = "通过id删除app角色表")
|
||||
@Operation(summary = "通过id删除app角色表", description = "通过id删除app角色表")
|
||||
@SysLog("通过id删除app角色表")
|
||||
@DeleteMapping("/{roleId}")
|
||||
@PreAuthorize("@pms.hasPermission('app_approle_del')")
|
||||
|
||||
+14
-11
@@ -19,15 +19,17 @@ package com.pig4cloud.pigx.app.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.log.annotation.SysLog;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppRoleMenu;
|
||||
import com.pig4cloud.pigx.app.service.AppRoleMenuService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.excel.annotation.ResponseExcel;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
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.springframework.http.HttpHeaders;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
@@ -41,7 +43,8 @@ import java.util.List;
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/approlemenu")
|
||||
@Api(value = "approlemenu", tags = "角色菜单表管理")
|
||||
@Tag(description = "approlemenu", name = "角色菜单表管理")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class AppRoleMenuController {
|
||||
|
||||
private final AppRoleMenuService appRoleMenuService;
|
||||
@@ -52,7 +55,7 @@ public class AppRoleMenuController {
|
||||
* @param appRoleMenu 角色菜单表
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询", notes = "分页查询")
|
||||
@Operation(summary = "分页查询", description = "分页查询")
|
||||
@GetMapping("/page")
|
||||
@PreAuthorize("@pms.hasPermission('app_approlemenu_view')")
|
||||
public R getAppRoleMenuPage(Page page, AppRoleMenu appRoleMenu) {
|
||||
@@ -64,7 +67,7 @@ public class AppRoleMenuController {
|
||||
* @param roleId id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id查询", notes = "通过id查询")
|
||||
@Operation(summary = "通过id查询", description = "通过id查询")
|
||||
@GetMapping("/{roleId}")
|
||||
@PreAuthorize("@pms.hasPermission('app_approlemenu_view')")
|
||||
public R getById(@PathVariable("roleId") Long roleId) {
|
||||
@@ -76,7 +79,7 @@ public class AppRoleMenuController {
|
||||
* @param appRoleMenu 角色菜单表
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "新增角色菜单表", notes = "新增角色菜单表")
|
||||
@Operation(summary = "新增角色菜单表", description = "新增角色菜单表")
|
||||
@SysLog("新增角色菜单表")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('app_approlemenu_add')")
|
||||
@@ -89,7 +92,7 @@ public class AppRoleMenuController {
|
||||
* @param appRoleMenu 角色菜单表
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "修改角色菜单表", notes = "修改角色菜单表")
|
||||
@Operation(summary = "修改角色菜单表", description = "修改角色菜单表")
|
||||
@SysLog("修改角色菜单表")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('app_approlemenu_edit')")
|
||||
@@ -102,7 +105,7 @@ public class AppRoleMenuController {
|
||||
* @param roleId id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id删除角色菜单表", notes = "通过id删除角色菜单表")
|
||||
@Operation(summary = "通过id删除角色菜单表", description = "通过id删除角色菜单表")
|
||||
@SysLog("通过id删除角色菜单表")
|
||||
@DeleteMapping("/{roleId}")
|
||||
@PreAuthorize("@pms.hasPermission('app_approlemenu_del')")
|
||||
|
||||
+5
-2
@@ -25,8 +25,10 @@ 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.annotations.Api;
|
||||
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.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -36,7 +38,8 @@ import javax.validation.Valid;
|
||||
@RestController
|
||||
@RequestMapping("/social")
|
||||
@AllArgsConstructor
|
||||
@Api(value = "social", tags = "三方账号管理模块")
|
||||
@Tag(description = "social", name = "三方账号管理模块")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class AppSocialDetailsController {
|
||||
|
||||
private final AppSocialDetailsService appSocialDetailsService;
|
||||
|
||||
+15
-13
@@ -19,22 +19,23 @@ package com.pig4cloud.pigx.app.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysUser;
|
||||
import com.pig4cloud.pigx.app.api.dto.AppUserDTO;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppUser;
|
||||
import com.pig4cloud.pigx.app.api.vo.AppUserExcelVO;
|
||||
import com.pig4cloud.pigx.app.service.AppUserService;
|
||||
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.ResponseExcel;
|
||||
import com.pig4cloud.pigx.common.log.annotation.SysLog;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppUser;
|
||||
import com.pig4cloud.pigx.app.service.AppUserService;
|
||||
import com.pig4cloud.pigx.common.security.annotation.Inner;
|
||||
import com.pig4cloud.pigx.common.security.util.SecurityUtils;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import com.pig4cloud.pigx.common.excel.annotation.ResponseExcel;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
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.springframework.http.HttpHeaders;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
@@ -48,7 +49,8 @@ import java.util.List;
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/appuser")
|
||||
@Api(value = "appuser", tags = "app用户表管理")
|
||||
@Tag(description = "appuser", name = "app用户表管理")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class AppUserController {
|
||||
|
||||
private final AppUserService appUserService;
|
||||
@@ -83,7 +85,7 @@ public class AppUserController {
|
||||
* @param appUserDTO app用户表
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询", notes = "分页查询")
|
||||
@Operation(summary = "分页查询", description = "分页查询")
|
||||
@GetMapping("/page")
|
||||
public R getAppUserPage(Page page, AppUserDTO appUserDTO) {
|
||||
return R.ok(appUserService.getUsersWithRolePage(page, appUserDTO));
|
||||
@@ -94,7 +96,7 @@ public class AppUserController {
|
||||
* @param userId id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id查询", notes = "通过id查询")
|
||||
@Operation(summary = "通过id查询", description = "通过id查询")
|
||||
@GetMapping("/{userId}")
|
||||
public R getById(@PathVariable("userId") Long userId) {
|
||||
return R.ok(appUserService.getById(userId));
|
||||
@@ -105,7 +107,7 @@ public class AppUserController {
|
||||
* @param appUser app用户表
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "新增app用户表", notes = "新增app用户表")
|
||||
@Operation(summary = "新增app用户表", description = "新增app用户表")
|
||||
@SysLog("新增app用户表")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('app_appuser_add')")
|
||||
@@ -118,7 +120,7 @@ public class AppUserController {
|
||||
* @param appUser app用户表
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "修改app用户表", notes = "修改app用户表")
|
||||
@Operation(summary = "修改app用户表", description = "修改app用户表")
|
||||
@SysLog("修改app用户表")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('app_appuser_edit')")
|
||||
@@ -131,7 +133,7 @@ public class AppUserController {
|
||||
* @param userId id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id删除app用户表", notes = "通过id删除app用户表")
|
||||
@Operation(summary = "通过id删除app用户表", description = "通过id删除app用户表")
|
||||
@SysLog("通过id删除app用户表")
|
||||
@DeleteMapping("/{userId}")
|
||||
@PreAuthorize("@pms.hasPermission('app_appuser_del')")
|
||||
|
||||
+14
-11
@@ -19,15 +19,17 @@ package com.pig4cloud.pigx.app.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.log.annotation.SysLog;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppUserRole;
|
||||
import com.pig4cloud.pigx.app.service.AppUserRoleService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.excel.annotation.ResponseExcel;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
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.springframework.http.HttpHeaders;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
@@ -41,7 +43,8 @@ import java.util.List;
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/appuserrole")
|
||||
@Api(value = "appuserrole", tags = "用户角色表管理")
|
||||
@Tag(description = "appuserrole", name = "用户角色表管理")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class AppUserRoleController {
|
||||
|
||||
private final AppUserRoleService appUserRoleService;
|
||||
@@ -52,7 +55,7 @@ public class AppUserRoleController {
|
||||
* @param appUserRole 用户角色表
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询", notes = "分页查询")
|
||||
@Operation(summary = "分页查询", description = "分页查询")
|
||||
@GetMapping("/page")
|
||||
@PreAuthorize("@pms.hasPermission('app_appuserrole_view')")
|
||||
public R getAppUserRolePage(Page page, AppUserRole appUserRole) {
|
||||
@@ -64,7 +67,7 @@ public class AppUserRoleController {
|
||||
* @param userId id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id查询", notes = "通过id查询")
|
||||
@Operation(summary = "通过id查询", description = "通过id查询")
|
||||
@GetMapping("/{userId}")
|
||||
@PreAuthorize("@pms.hasPermission('app_appuserrole_view')")
|
||||
public R getById(@PathVariable("userId") Long userId) {
|
||||
@@ -76,7 +79,7 @@ public class AppUserRoleController {
|
||||
* @param appUserRole 用户角色表
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "新增用户角色表", notes = "新增用户角色表")
|
||||
@Operation(summary = "新增用户角色表", description = "新增用户角色表")
|
||||
@SysLog("新增用户角色表")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('app_appuserrole_add')")
|
||||
@@ -89,7 +92,7 @@ public class AppUserRoleController {
|
||||
* @param appUserRole 用户角色表
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "修改用户角色表", notes = "修改用户角色表")
|
||||
@Operation(summary = "修改用户角色表", description = "修改用户角色表")
|
||||
@SysLog("修改用户角色表")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('app_appuserrole_edit')")
|
||||
@@ -102,7 +105,7 @@ public class AppUserRoleController {
|
||||
* @param userId id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id删除用户角色表", notes = "通过id删除用户角色表")
|
||||
@Operation(summary = "通过id删除用户角色表", description = "通过id删除用户角色表")
|
||||
@SysLog("通过id删除用户角色表")
|
||||
@DeleteMapping("/{userId}")
|
||||
@PreAuthorize("@pms.hasPermission('app_appuserrole_del')")
|
||||
|
||||
+5
-2
@@ -20,8 +20,10 @@ package com.pig4cloud.pigx.app.controller;
|
||||
import com.pig4cloud.pigx.app.service.MobileService;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.security.annotation.Inner;
|
||||
import io.swagger.annotations.Api;
|
||||
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;
|
||||
@@ -36,7 +38,8 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/mobile")
|
||||
@Api(value = "mobile", tags = "手机管理模块")
|
||||
@Tag(description = "mobile", name = "手机管理模块")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class MobileController {
|
||||
|
||||
private final MobileService mobileService;
|
||||
|
||||
-1
@@ -17,7 +17,6 @@
|
||||
|
||||
package com.pig4cloud.pigx.app.handler;
|
||||
|
||||
import com.pig4cloud.pigx.admin.api.dto.UserInfo;
|
||||
import com.pig4cloud.pigx.app.api.dto.AppUserInfo;
|
||||
|
||||
/**
|
||||
|
||||
-2
@@ -17,8 +17,6 @@
|
||||
|
||||
package com.pig4cloud.pigx.app.handler;
|
||||
|
||||
import com.pig4cloud.pigx.admin.api.dto.UserInfo;
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysUser;
|
||||
import com.pig4cloud.pigx.app.api.dto.AppUserInfo;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppUser;
|
||||
|
||||
|
||||
+1
-1
@@ -17,8 +17,8 @@
|
||||
|
||||
package com.pig4cloud.pigx.app.mapper;
|
||||
|
||||
import com.pig4cloud.pigx.common.data.datascope.PigxBaseMapper;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppMenu;
|
||||
import com.pig4cloud.pigx.common.data.datascope.PigxBaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
+1
-1
@@ -17,8 +17,8 @@
|
||||
|
||||
package com.pig4cloud.pigx.app.mapper;
|
||||
|
||||
import com.pig4cloud.pigx.common.data.datascope.PigxBaseMapper;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppRole;
|
||||
import com.pig4cloud.pigx.common.data.datascope.PigxBaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
+1
-1
@@ -17,8 +17,8 @@
|
||||
|
||||
package com.pig4cloud.pigx.app.mapper;
|
||||
|
||||
import com.pig4cloud.pigx.common.data.datascope.PigxBaseMapper;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppRoleMenu;
|
||||
import com.pig4cloud.pigx.common.data.datascope.PigxBaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
|
||||
+1
-1
@@ -20,9 +20,9 @@ package com.pig4cloud.pigx.app.mapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.pig4cloud.pigx.app.api.dto.AppUserDTO;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppUser;
|
||||
import com.pig4cloud.pigx.app.api.vo.AppUserVo;
|
||||
import com.pig4cloud.pigx.common.data.datascope.PigxBaseMapper;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppUser;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
|
||||
+1
-1
@@ -17,8 +17,8 @@
|
||||
|
||||
package com.pig4cloud.pigx.app.mapper;
|
||||
|
||||
import com.pig4cloud.pigx.common.data.datascope.PigxBaseMapper;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppUserRole;
|
||||
import com.pig4cloud.pigx.common.data.datascope.PigxBaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
|
||||
-1
@@ -19,7 +19,6 @@ package com.pig4cloud.pigx.app.service;
|
||||
|
||||
import cn.hutool.core.lang.tree.Tree;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysMenu;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppMenu;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
|
||||
|
||||
-1
@@ -21,7 +21,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppRole;
|
||||
import com.pig4cloud.pigx.app.api.vo.AppRoleVO;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
||||
-2
@@ -18,8 +18,6 @@
|
||||
package com.pig4cloud.pigx.app.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.pig4cloud.pigx.admin.api.dto.UserInfo;
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysSocialDetails;
|
||||
import com.pig4cloud.pigx.app.api.dto.AppUserInfo;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppSocialDetails;
|
||||
|
||||
|
||||
-3
@@ -23,8 +23,6 @@ import cn.hutool.core.lang.tree.TreeUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysMenu;
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysRoleMenu;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppMenu;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppRoleMenu;
|
||||
import com.pig4cloud.pigx.app.mapper.AppMenuMapper;
|
||||
@@ -39,7 +37,6 @@ import com.pig4cloud.pigx.common.core.util.R;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.cache.annotation.CacheEvict;
|
||||
import org.springframework.cache.annotation.Cacheable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
|
||||
-2
@@ -19,11 +19,9 @@ package com.pig4cloud.pigx.app.service.impl;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysRoleMenu;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppRoleMenu;
|
||||
import com.pig4cloud.pigx.app.mapper.AppRoleMenuMapper;
|
||||
import com.pig4cloud.pigx.app.service.AppRoleMenuService;
|
||||
import com.pig4cloud.pigx.common.core.constant.CacheConstants;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
+1
-6
@@ -23,30 +23,25 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysMenu;
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysRole;
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysUserRole;
|
||||
import com.pig4cloud.pigx.app.api.dto.AppUserDTO;
|
||||
import com.pig4cloud.pigx.app.api.dto.AppUserInfo;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppMenu;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppRole;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppUser;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppUserRole;
|
||||
import com.pig4cloud.pigx.app.api.vo.AppUserExcelVO;
|
||||
import com.pig4cloud.pigx.app.mapper.AppUserMapper;
|
||||
import com.pig4cloud.pigx.app.service.AppMenuService;
|
||||
import com.pig4cloud.pigx.app.service.AppRoleService;
|
||||
import com.pig4cloud.pigx.app.service.AppUserRoleService;
|
||||
import com.pig4cloud.pigx.app.service.AppUserService;
|
||||
import com.pig4cloud.pigx.app.api.vo.AppUserExcelVO;
|
||||
import com.pig4cloud.pigx.common.core.constant.CommonConstants;
|
||||
import com.pig4cloud.pigx.common.data.resolver.ParamResolver;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
<properties>
|
||||
<pigx.version>4.6.0</pigx.version>
|
||||
<mybatis-plus.version>3.5.1</mybatis-plus.version>
|
||||
<mybatis-plus.version>3.5.3.1</mybatis-plus.version>
|
||||
<dynamic-ds.version>3.5.2</dynamic-ds.version>
|
||||
<druid.version>1.2.9</druid.version>
|
||||
<hutool.version>5.8.10</hutool.version>
|
||||
@@ -26,7 +26,8 @@
|
||||
<oracle.version>21.3.0.0</oracle.version>
|
||||
<sqlserver.version>8.4.1.jre8</sqlserver.version>
|
||||
<dm.version>8.1.2.79</dm.version>
|
||||
<swagger.core.version>1.5.22</swagger.core.version>
|
||||
<swagger.core.version>2.2.0</swagger.core.version>
|
||||
<springdoc.version>1.6.9</springdoc.version>
|
||||
<mp.weixin.version>4.4.0</mp.weixin.version>
|
||||
<ijpay.version>2.8.0</ijpay.version>
|
||||
<groovy.version>3.0.3</groovy.version>
|
||||
@@ -229,15 +230,26 @@
|
||||
<version>${fastjson.version}</version>
|
||||
</dependency>
|
||||
<!--swagger 最新依赖内置版本-->
|
||||
<!--springdoc -->
|
||||
<dependency>
|
||||
<groupId>io.swagger</groupId>
|
||||
<artifactId>swagger-models</artifactId>
|
||||
<groupId>org.springdoc</groupId>
|
||||
<artifactId>springdoc-openapi-webmvc-core</artifactId>
|
||||
<version>${springdoc.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.swagger.core.v3</groupId>
|
||||
<artifactId>swagger-annotations</artifactId>
|
||||
<version>${swagger.core.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.swagger</groupId>
|
||||
<artifactId>swagger-annotations</artifactId>
|
||||
<version>${swagger.core.version}</version>
|
||||
<groupId>org.springdoc</groupId>
|
||||
<artifactId>springdoc-openapi-webflux-ui</artifactId>
|
||||
<version>${springdoc.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springdoc</groupId>
|
||||
<artifactId>springdoc-openapi-security</artifactId>
|
||||
<version>${springdoc.version}</version>
|
||||
</dependency>
|
||||
<!--微信依赖-->
|
||||
<dependency>
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
</dependency>
|
||||
<!--swagger 依赖-->
|
||||
<dependency>
|
||||
<groupId>io.swagger</groupId>
|
||||
<groupId>io.swagger.core.v3</groupId>
|
||||
<artifactId>swagger-annotations</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
+5
-6
@@ -20,8 +20,7 @@
|
||||
package com.pig4cloud.pigx.common.core.util;
|
||||
|
||||
import com.pig4cloud.pigx.common.core.constant.CommonConstants;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@@ -38,24 +37,24 @@ import java.io.Serializable;
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value = "响应信息主体")
|
||||
@Schema(description = "响应信息主体")
|
||||
public class R<T> implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ApiModelProperty(value = "返回标记:成功标记=0,失败标记=1")
|
||||
@Schema(description = "返回标记:成功标记=0,失败标记=1")
|
||||
private int code;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ApiModelProperty(value = "返回信息")
|
||||
@Schema(description = "返回信息")
|
||||
private String msg;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ApiModelProperty(value = "数据")
|
||||
@Schema(description = "数据")
|
||||
private T data;
|
||||
|
||||
public static <T> R<T> ok() {
|
||||
|
||||
-10
@@ -23,8 +23,6 @@ import com.pig4cloud.pigx.common.gateway.support.DynamicRouteHealthIndicator;
|
||||
import com.pig4cloud.pigx.common.gateway.support.RouteCacheHolder;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
|
||||
import org.springframework.cloud.gateway.config.GatewayProperties;
|
||||
import org.springframework.cloud.gateway.config.PropertiesRouteDefinitionLocator;
|
||||
import org.springframework.cloud.gateway.event.RefreshRoutesEvent;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
@@ -47,14 +45,6 @@ import org.springframework.data.redis.serializer.StringRedisSerializer;
|
||||
@ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.REACTIVE)
|
||||
public class DynamicRouteAutoConfiguration {
|
||||
|
||||
/**
|
||||
* 配置文件设置为空 redis 加载为准
|
||||
* @return
|
||||
*/
|
||||
@Bean
|
||||
public PropertiesRouteDefinitionLocator propertiesRouteDefinitionLocator() {
|
||||
return new PropertiesRouteDefinitionLocator(new GatewayProperties());
|
||||
}
|
||||
|
||||
/**
|
||||
* redis 监听配置
|
||||
|
||||
@@ -19,70 +19,59 @@
|
||||
-->
|
||||
|
||||
<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>pigx-common</artifactId>
|
||||
<version>4.6.0</version>
|
||||
</parent>
|
||||
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>pigx-common</artifactId>
|
||||
<version>4.6.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>pigx-common-swagger</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<artifactId>pigx-common-swagger</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<description>pigx 接口文档</description>
|
||||
<description>pigx 接口文档</description>
|
||||
|
||||
|
||||
<dependencies>
|
||||
<!--接口文档-->
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-swagger-ui</artifactId>
|
||||
<version>${swagger.fox.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-swagger2</artifactId>
|
||||
<version>${swagger.fox.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-oas</artifactId>
|
||||
<version>${swagger.fox.version}</version>
|
||||
</dependency>
|
||||
<!--knife4j spring ui -->
|
||||
<dependency>
|
||||
<groupId>com.github.xiaoymin</groupId>
|
||||
<artifactId>knife4j-spring-ui</artifactId>
|
||||
<version>${knife4j.version}</version>
|
||||
</dependency>
|
||||
<!--knife4j是为Java MVC框架集成Swagger生成Api文档的增强-->
|
||||
<dependency>
|
||||
<groupId>com.github.xiaoymin</groupId>
|
||||
<artifactId>knife4j-micro-spring-boot-starter</artifactId>
|
||||
<version>${knife4j.version}</version>
|
||||
</dependency>
|
||||
<!--webflux 相关包-->
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-webflux</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<!--网关 swagger 聚合依赖-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-gateway-server</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-commons</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-webmvc</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<dependencies>
|
||||
<!--接口文档-->
|
||||
<dependency>
|
||||
<groupId>org.springdoc</groupId>
|
||||
<artifactId>springdoc-openapi-webmvc-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springdoc</groupId>
|
||||
<artifactId>springdoc-openapi-security</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.swagger.core.v3</groupId>
|
||||
<artifactId>swagger-annotations</artifactId>
|
||||
</dependency>
|
||||
<!--webflux 相关包-->
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-webflux</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<!--网关 swagger 聚合依赖-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-gateway-server</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-commons</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-webmvc</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-core</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
-41
@@ -1,41 +0,0 @@
|
||||
/*
|
||||
* 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.common.swagger.annotation;
|
||||
|
||||
import com.pig4cloud.pigx.common.swagger.support.SwaggerBeanDefinitionRegistrar;
|
||||
import com.pig4cloud.pigx.common.swagger.support.SwaggerProperties;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.context.annotation.Import;
|
||||
import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2020/10/2 开启pigx swagger
|
||||
*/
|
||||
@Target({ ElementType.TYPE })
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
@Inherited
|
||||
@EnableSwagger2
|
||||
@EnableConfigurationProperties(SwaggerProperties.class)
|
||||
@Import({ SwaggerBeanDefinitionRegistrar.class })
|
||||
public @interface EnablePigxSwagger2 {
|
||||
|
||||
}
|
||||
-88
@@ -1,88 +0,0 @@
|
||||
package com.pig4cloud.pigx.common.swagger.config;
|
||||
|
||||
import com.pig4cloud.pigx.common.swagger.support.*;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.ObjectProvider;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
|
||||
import org.springframework.cloud.client.discovery.DiscoveryClient;
|
||||
import org.springframework.cloud.gateway.route.RouteDefinitionRepository;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Primary;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.reactive.function.server.RequestPredicates;
|
||||
import org.springframework.web.reactive.function.server.RouterFunction;
|
||||
import org.springframework.web.reactive.function.server.RouterFunctions;
|
||||
import org.springframework.web.reactive.function.server.ServerResponse;
|
||||
import springfox.documentation.swagger.web.SecurityConfiguration;
|
||||
import springfox.documentation.swagger.web.SecurityConfigurationBuilder;
|
||||
import springfox.documentation.swagger.web.UiConfiguration;
|
||||
import springfox.documentation.swagger.web.UiConfigurationBuilder;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2020/10/2
|
||||
* <p>
|
||||
* 网关swagger 配置类,仅在webflux 环境生效哦
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.REACTIVE)
|
||||
public class GatewaySwaggerAutoConfiguration {
|
||||
|
||||
@Bean
|
||||
@Primary
|
||||
public SwaggerProvider swaggerProvider(RouteDefinitionRepository repository, SwaggerProperties swaggerProperties,
|
||||
DiscoveryClient discoveryClient) {
|
||||
return new SwaggerProvider(repository, swaggerProperties, discoveryClient);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public SwaggerResourceHandler swaggerResourceHandler(SwaggerProvider swaggerProvider) {
|
||||
return new SwaggerResourceHandler(swaggerProvider);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public WebFluxSwaggerConfiguration fluxSwaggerConfiguration() {
|
||||
return new WebFluxSwaggerConfiguration();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public SwaggerSecurityHandler swaggerSecurityHandler(
|
||||
ObjectProvider<SecurityConfiguration> securityConfigurationObjectProvider) {
|
||||
SecurityConfiguration securityConfiguration = securityConfigurationObjectProvider
|
||||
.getIfAvailable(() -> SecurityConfigurationBuilder.builder().build());
|
||||
return new SwaggerSecurityHandler(securityConfiguration);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public SwaggerUiHandler swaggerUiHandler(ObjectProvider<UiConfiguration> uiConfigurationObjectProvider) {
|
||||
UiConfiguration uiConfiguration = uiConfigurationObjectProvider
|
||||
.getIfAvailable(() -> UiConfigurationBuilder.builder().build());
|
||||
return new SwaggerUiHandler(uiConfiguration);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public RouterFunction swaggerRouterFunction(SwaggerProperties swaggerProperties, SwaggerUiHandler swaggerUiHandler,
|
||||
SwaggerSecurityHandler swaggerSecurityHandler, SwaggerResourceHandler swaggerResourceHandler) {
|
||||
// 开启swagger 正常执行路由
|
||||
if (swaggerProperties.getEnabled()) {
|
||||
return RouterFunctions
|
||||
.route(RequestPredicates.GET("/swagger-resources").and(RequestPredicates.accept(MediaType.ALL)),
|
||||
swaggerResourceHandler)
|
||||
.andRoute(RequestPredicates.GET("/swagger-resources/configuration/ui")
|
||||
.and(RequestPredicates.accept(MediaType.ALL)), swaggerUiHandler)
|
||||
.andRoute(RequestPredicates.GET("/swagger-resources/configuration/security")
|
||||
.and(RequestPredicates.accept(MediaType.ALL)), swaggerSecurityHandler);
|
||||
}
|
||||
else {
|
||||
// 关闭时,返回404
|
||||
return RouterFunctions
|
||||
.route(RequestPredicates.GET("/*/v2/api-docs").and(RequestPredicates.accept(MediaType.ALL)),
|
||||
serverRequest -> ServerResponse.notFound().build())
|
||||
.andRoute(RequestPredicates.GET("/swagger-ui/**").and(RequestPredicates.accept(MediaType.ALL)),
|
||||
serverRequest -> ServerResponse.notFound().build())
|
||||
.andRoute(RequestPredicates.GET("/doc.html").and(RequestPredicates.accept(MediaType.ALL)),
|
||||
serverRequest -> ServerResponse.notFound().build());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+96
@@ -0,0 +1,96 @@
|
||||
/*
|
||||
* 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.common.swagger.config;
|
||||
|
||||
import com.pig4cloud.pigx.common.swagger.support.SwaggerProperties;
|
||||
import io.swagger.v3.oas.models.OpenAPI;
|
||||
import io.swagger.v3.oas.models.info.Info;
|
||||
import io.swagger.v3.oas.models.security.OAuthFlow;
|
||||
import io.swagger.v3.oas.models.security.OAuthFlows;
|
||||
import io.swagger.v3.oas.models.security.Scopes;
|
||||
import io.swagger.v3.oas.models.security.SecurityScheme;
|
||||
import io.swagger.v3.oas.models.servers.Server;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.cloud.client.ServiceInstance;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ApplicationContextAware;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* swagger配置
|
||||
*
|
||||
* <p>
|
||||
* 禁用方法1:使用注解@Profile({"dev","test"})
|
||||
*
|
||||
* 表示在开发或测试环境开启,而在生产关闭。(推荐使用) 禁用方法2:使用注解@ConditionalOnProperty(name = "swagger.enable",
|
||||
*
|
||||
* havingValue = "true") 然后在测试配置或者开发配置中添加swagger.enable=true即可开启,生产环境不填则默认关闭Swagger.
|
||||
* </p>
|
||||
*
|
||||
* @author lengleng
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@ConditionalOnProperty(name = "swagger.enabled", matchIfMissing = true)
|
||||
public class OpenAPIDefinition extends OpenAPI implements InitializingBean, ApplicationContextAware {
|
||||
|
||||
@Setter
|
||||
private String path;
|
||||
|
||||
private ApplicationContext applicationContext;
|
||||
|
||||
private SecurityScheme securityScheme(SwaggerProperties swaggerProperties) {
|
||||
OAuthFlow clientCredential = new OAuthFlow();
|
||||
clientCredential.setTokenUrl(swaggerProperties.getTokenUrl());
|
||||
clientCredential.setScopes(new Scopes().addString(swaggerProperties.getScope(), swaggerProperties.getScope()));
|
||||
OAuthFlows oauthFlows = new OAuthFlows();
|
||||
oauthFlows.password(clientCredential);
|
||||
SecurityScheme securityScheme = new SecurityScheme();
|
||||
securityScheme.setType(SecurityScheme.Type.OAUTH2);
|
||||
securityScheme.setFlows(oauthFlows);
|
||||
return securityScheme;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() throws Exception {
|
||||
SwaggerProperties swaggerProperties = applicationContext.getBean(SwaggerProperties.class);
|
||||
this.info(new Info().title(swaggerProperties.getTitle()));
|
||||
// oauth2.0 password
|
||||
this.schemaRequirement(HttpHeaders.AUTHORIZATION, this.securityScheme(swaggerProperties));
|
||||
// servers
|
||||
List<Server> serverList = new ArrayList<>();
|
||||
serverList.add(new Server().url(swaggerProperties.getGateway() + "/" + path));
|
||||
this.servers(serverList);
|
||||
|
||||
// 修改 ServiceInstance Metadata
|
||||
ServiceInstance serviceInstance = applicationContext.getBean(ServiceInstance.class);
|
||||
serviceInstance.getMetadata().put("spring-doc", path);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
|
||||
this.applicationContext = applicationContext;
|
||||
}
|
||||
|
||||
}
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
package com.pig4cloud.pigx.common.swagger.config;
|
||||
|
||||
import com.pig4cloud.pigx.common.swagger.annotation.EnableOpenApi;
|
||||
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
|
||||
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
|
||||
import org.springframework.context.annotation.ImportBeanDefinitionRegistrar;
|
||||
import org.springframework.core.type.AnnotationMetadata;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* openapi 配置类
|
||||
*
|
||||
* @author lengleng
|
||||
* @date 2023/1/1
|
||||
*/
|
||||
public class OpenAPIDefinitionImportSelector implements ImportBeanDefinitionRegistrar {
|
||||
|
||||
@Override
|
||||
public void registerBeanDefinitions(AnnotationMetadata metadata, BeanDefinitionRegistry registry) {
|
||||
|
||||
Map<String, Object> annotationAttributes = metadata.getAnnotationAttributes(EnableOpenApi.class.getName(),
|
||||
true);
|
||||
Object value = annotationAttributes.get("value");
|
||||
if (Objects.isNull(value)) {
|
||||
return;
|
||||
}
|
||||
|
||||
BeanDefinitionBuilder definition = BeanDefinitionBuilder.genericBeanDefinition(OpenAPIDefinition.class);
|
||||
definition.addPropertyValue("path", value);
|
||||
|
||||
registry.registerBeanDefinition("openAPIDefinition", definition.getBeanDefinition());
|
||||
}
|
||||
|
||||
}
|
||||
-182
@@ -1,182 +0,0 @@
|
||||
/*
|
||||
* 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.common.swagger.config;
|
||||
|
||||
import com.pig4cloud.pigx.common.swagger.support.SwaggerProperties;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.beans.factory.config.BeanPostProcessor;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.util.ReflectionUtils;
|
||||
import org.springframework.web.servlet.mvc.method.RequestMappingInfoHandlerMapping;
|
||||
import springfox.documentation.builders.ApiInfoBuilder;
|
||||
import springfox.documentation.builders.PathSelectors;
|
||||
import springfox.documentation.builders.RequestHandlerSelectors;
|
||||
import springfox.documentation.builders.RequestParameterBuilder;
|
||||
import springfox.documentation.schema.ScalarType;
|
||||
import springfox.documentation.service.*;
|
||||
import springfox.documentation.spi.DocumentationType;
|
||||
import springfox.documentation.spi.service.contexts.SecurityContext;
|
||||
import springfox.documentation.spring.web.plugins.ApiSelectorBuilder;
|
||||
import springfox.documentation.spring.web.plugins.Docket;
|
||||
import springfox.documentation.spring.web.plugins.WebMvcRequestHandlerProvider;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author lengleng swagger配置 禁用方法1:使用注解@Profile({"dev","test"})
|
||||
* 表示在开发或测试环境开启,而在生产关闭。(推荐使用) 禁用方法2:使用注解@ConditionalOnProperty(name = "swagger.enable",
|
||||
* havingValue = "true") 然后在测试配置或者开发配置中添加swagger.enable=true即可开启,生产环境不填则默认关闭Swagger.
|
||||
*/
|
||||
@Configuration
|
||||
@EnableAutoConfiguration
|
||||
@RequiredArgsConstructor
|
||||
@ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.SERVLET)
|
||||
public class SwaggerAutoConfiguration {
|
||||
|
||||
/**
|
||||
* 默认的排除路径,排除Spring Boot默认的错误处理路径和端点
|
||||
*/
|
||||
private static final List<String> DEFAULT_EXCLUDE_PATH = Arrays.asList("/error", "/actuator/**");
|
||||
|
||||
private static final String BASE_PATH = "/**";
|
||||
|
||||
private final SwaggerProperties swaggerProperties;
|
||||
|
||||
@Bean
|
||||
@ConditionalOnProperty(name = "swagger.enabled", matchIfMissing = true)
|
||||
public Docket api() {
|
||||
// base-path处理
|
||||
if (swaggerProperties.getBasePath().isEmpty()) {
|
||||
swaggerProperties.getBasePath().add(BASE_PATH);
|
||||
}
|
||||
|
||||
// exclude-path处理
|
||||
if (swaggerProperties.getExcludePath().isEmpty()) {
|
||||
swaggerProperties.getExcludePath().addAll(DEFAULT_EXCLUDE_PATH);
|
||||
}
|
||||
List<Predicate<String>> excludePath = new ArrayList<>();
|
||||
swaggerProperties.getExcludePath().forEach(path -> excludePath.add(PathSelectors.ant(path)));
|
||||
|
||||
// 版本请求头处理
|
||||
List<RequestParameter> pars = new ArrayList<>();
|
||||
|
||||
RequestParameterBuilder versionPar = new RequestParameterBuilder().description("灰度路由版本信息")
|
||||
.in(ParameterType.HEADER).name("VERSION").required(false)
|
||||
.query(param -> param.model(model -> model.scalarModel(ScalarType.STRING)));
|
||||
|
||||
pars.add(versionPar.build());
|
||||
|
||||
ApiSelectorBuilder builder = new Docket(DocumentationType.SWAGGER_2).host(swaggerProperties.getHost())
|
||||
.apiInfo(apiInfo(swaggerProperties)).globalRequestParameters(pars).select()
|
||||
.apis(RequestHandlerSelectors.basePackage(swaggerProperties.getBasePackage()));
|
||||
|
||||
swaggerProperties.getBasePath().forEach(p -> builder.paths(PathSelectors.ant(p)));
|
||||
swaggerProperties.getExcludePath().forEach(p -> builder.paths(PathSelectors.ant(p).negate()));
|
||||
|
||||
return builder.build().securitySchemes(Collections.singletonList(securitySchema()))
|
||||
.securityContexts(Collections.singletonList(securityContext())).pathMapping("/");
|
||||
}
|
||||
|
||||
/**
|
||||
* 配置默认的全局鉴权策略的开关,通过正则表达式进行匹配;默认匹配所有URL
|
||||
* @return
|
||||
*/
|
||||
private SecurityContext securityContext() {
|
||||
return SecurityContext.builder().securityReferences(defaultAuth()).build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 默认的全局鉴权策略
|
||||
* @return
|
||||
*/
|
||||
private List<SecurityReference> defaultAuth() {
|
||||
ArrayList<AuthorizationScope> authorizationScopeList = new ArrayList<>();
|
||||
swaggerProperties.getAuthorization().getAuthorizationScopeList()
|
||||
.forEach(authorizationScope -> authorizationScopeList.add(
|
||||
new AuthorizationScope(authorizationScope.getScope(), authorizationScope.getDescription())));
|
||||
AuthorizationScope[] authorizationScopes = new AuthorizationScope[authorizationScopeList.size()];
|
||||
return Collections
|
||||
.singletonList(SecurityReference.builder().reference(swaggerProperties.getAuthorization().getName())
|
||||
.scopes(authorizationScopeList.toArray(authorizationScopes)).build());
|
||||
}
|
||||
|
||||
private OAuth securitySchema() {
|
||||
ArrayList<AuthorizationScope> authorizationScopeList = new ArrayList<>();
|
||||
swaggerProperties.getAuthorization().getAuthorizationScopeList()
|
||||
.forEach(authorizationScope -> authorizationScopeList.add(
|
||||
new AuthorizationScope(authorizationScope.getScope(), authorizationScope.getDescription())));
|
||||
ArrayList<GrantType> grantTypes = new ArrayList<>();
|
||||
swaggerProperties.getAuthorization().getTokenUrlList()
|
||||
.forEach(tokenUrl -> grantTypes.add(new ResourceOwnerPasswordCredentialsGrant(tokenUrl)));
|
||||
return new OAuth(swaggerProperties.getAuthorization().getName(), authorizationScopeList, grantTypes);
|
||||
}
|
||||
|
||||
private ApiInfo apiInfo(SwaggerProperties swaggerProperties) {
|
||||
return new ApiInfoBuilder().title(swaggerProperties.getTitle()).description(swaggerProperties.getDescription())
|
||||
.license(swaggerProperties.getLicense()).licenseUrl(swaggerProperties.getLicenseUrl())
|
||||
.termsOfServiceUrl(swaggerProperties.getTermsOfServiceUrl())
|
||||
.contact(new Contact(swaggerProperties.getContact().getName(), swaggerProperties.getContact().getUrl(),
|
||||
swaggerProperties.getContact().getEmail()))
|
||||
.version(swaggerProperties.getVersion()).build();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public BeanPostProcessor springfoxHandlerProviderBeanPostProcessor() {
|
||||
return new BeanPostProcessor() {
|
||||
|
||||
@Override
|
||||
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
|
||||
if (bean instanceof WebMvcRequestHandlerProvider) {
|
||||
customizeSpringfoxHandlerMappings(getHandlerMappings(bean));
|
||||
}
|
||||
return bean;
|
||||
}
|
||||
|
||||
private <T extends RequestMappingInfoHandlerMapping> void customizeSpringfoxHandlerMappings(
|
||||
List<T> mappings) {
|
||||
List<T> copy = mappings.stream().filter(mapping -> mapping.getPatternParser() == null)
|
||||
.collect(Collectors.toList());
|
||||
mappings.clear();
|
||||
mappings.addAll(copy);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private List<RequestMappingInfoHandlerMapping> getHandlerMappings(Object bean) {
|
||||
try {
|
||||
Field field = ReflectionUtils.findField(bean.getClass(), "handlerMappings");
|
||||
field.setAccessible(true);
|
||||
return (List<RequestMappingInfoHandlerMapping>) field.get(bean);
|
||||
}
|
||||
catch (IllegalArgumentException | IllegalAccessException e) {
|
||||
throw new IllegalStateException(e);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
-21
@@ -1,21 +0,0 @@
|
||||
package com.pig4cloud.pigx.common.swagger.config;
|
||||
|
||||
import org.springframework.web.reactive.config.ResourceHandlerRegistry;
|
||||
import org.springframework.web.reactive.config.WebFluxConfigurer;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2020/10/2
|
||||
* <p>
|
||||
* webflux 网关 swagger 资源路径配置
|
||||
*/
|
||||
public class WebFluxSwaggerConfiguration implements WebFluxConfigurer {
|
||||
|
||||
@Override
|
||||
public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
||||
registry.addResourceHandler("/swagger-ui/**")
|
||||
.addResourceLocations("classpath:/META-INF/resources/webjars/springfox-swagger-ui/")
|
||||
.resourceChain(false);
|
||||
}
|
||||
|
||||
}
|
||||
-37
@@ -1,37 +0,0 @@
|
||||
package com.pig4cloud.pigx.common.swagger.support;
|
||||
|
||||
import com.pig4cloud.pigx.common.swagger.config.GatewaySwaggerAutoConfiguration;
|
||||
import com.pig4cloud.pigx.common.swagger.config.SwaggerAutoConfiguration;
|
||||
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
|
||||
import org.springframework.beans.factory.support.GenericBeanDefinition;
|
||||
import org.springframework.context.annotation.ImportBeanDefinitionRegistrar;
|
||||
import org.springframework.core.type.AnnotationMetadata;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2022/6/28
|
||||
*/
|
||||
public class SwaggerBeanDefinitionRegistrar implements ImportBeanDefinitionRegistrar {
|
||||
|
||||
/**
|
||||
* 根据注解值动态注入资源服务器的相关属性
|
||||
* @param metadata 注解信息
|
||||
* @param registry 注册器
|
||||
*/
|
||||
@Override
|
||||
public void registerBeanDefinitions(AnnotationMetadata metadata, BeanDefinitionRegistry registry) {
|
||||
|
||||
// swagger 功能依赖系统的动态路由,需要读取路由表中的参数
|
||||
if (registry.isBeanNameInUse("com.pig4cloud.pigx.common.gateway.configuration.DynamicRouteAutoConfiguration")) {
|
||||
GenericBeanDefinition gatewaySwagger = new GenericBeanDefinition();
|
||||
gatewaySwagger.setBeanClass(GatewaySwaggerAutoConfiguration.class);
|
||||
registry.registerBeanDefinition(GatewaySwaggerAutoConfiguration.class.getSimpleName(), gatewaySwagger);
|
||||
}
|
||||
else {
|
||||
GenericBeanDefinition swaggerAutoConfiguration = new GenericBeanDefinition();
|
||||
swaggerAutoConfiguration.setBeanClass(SwaggerAutoConfiguration.class);
|
||||
registry.registerBeanDefinition(SwaggerAutoConfiguration.class.getSimpleName(), swaggerAutoConfiguration);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+16
-98
@@ -17,21 +17,19 @@
|
||||
package com.pig4cloud.pigx.common.swagger.support;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* SwaggerProperties
|
||||
*
|
||||
* @author: lengleng
|
||||
* @date: 2018/7/25 14:00
|
||||
* @author lengleng
|
||||
* @date 2018/7/25 14:00
|
||||
*/
|
||||
@Data
|
||||
@Component
|
||||
@ConfigurationProperties("swagger")
|
||||
public class SwaggerProperties {
|
||||
|
||||
@@ -66,103 +64,23 @@ public class SwaggerProperties {
|
||||
private String title = "";
|
||||
|
||||
/**
|
||||
* 描述
|
||||
**/
|
||||
private String description = "";
|
||||
|
||||
/**
|
||||
* 版本
|
||||
**/
|
||||
private String version = "";
|
||||
|
||||
/**
|
||||
* 许可证
|
||||
**/
|
||||
private String license = "";
|
||||
|
||||
/**
|
||||
* 许可证URL
|
||||
**/
|
||||
private String licenseUrl = "";
|
||||
|
||||
/**
|
||||
* 服务条款URL
|
||||
**/
|
||||
private String termsOfServiceUrl = "";
|
||||
|
||||
/**
|
||||
* host信息
|
||||
**/
|
||||
private String host = "";
|
||||
|
||||
/**
|
||||
* 联系人信息
|
||||
* 网关
|
||||
*/
|
||||
private Contact contact = new Contact();
|
||||
private String gateway;
|
||||
|
||||
/**
|
||||
* 全局统一鉴权配置
|
||||
**/
|
||||
private Authorization authorization = new Authorization();
|
||||
* 获取token
|
||||
*/
|
||||
private String tokenUrl;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public static class Contact {
|
||||
/**
|
||||
* 作用域
|
||||
*/
|
||||
private String scope;
|
||||
|
||||
/**
|
||||
* 联系人
|
||||
**/
|
||||
private String name = "";
|
||||
|
||||
/**
|
||||
* 联系人url
|
||||
**/
|
||||
private String url = "";
|
||||
|
||||
/**
|
||||
* 联系人email
|
||||
**/
|
||||
private String email = "";
|
||||
|
||||
}
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public static class Authorization {
|
||||
|
||||
/**
|
||||
* 鉴权策略ID,需要和SecurityReferences ID保持一致
|
||||
*/
|
||||
private String name = "";
|
||||
|
||||
/**
|
||||
* 需要开启鉴权URL的正则
|
||||
*/
|
||||
private String authRegex = "^.*$";
|
||||
|
||||
/**
|
||||
* 鉴权作用域列表
|
||||
*/
|
||||
private List<AuthorizationScope> authorizationScopeList = new ArrayList<>();
|
||||
|
||||
private List<String> tokenUrlList = new ArrayList<>();
|
||||
|
||||
}
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public static class AuthorizationScope {
|
||||
|
||||
/**
|
||||
* 作用域名称
|
||||
*/
|
||||
private String scope = "";
|
||||
|
||||
/**
|
||||
* 作用域描述
|
||||
*/
|
||||
private String description = "";
|
||||
|
||||
}
|
||||
/**
|
||||
* 服务转发配置
|
||||
*/
|
||||
private Map<String, String> services;
|
||||
|
||||
}
|
||||
-76
@@ -1,76 +0,0 @@
|
||||
/*
|
||||
* 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.common.swagger.support;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.cloud.client.discovery.DiscoveryClient;
|
||||
import org.springframework.cloud.gateway.route.RouteDefinition;
|
||||
import org.springframework.cloud.gateway.route.RouteDefinitionRepository;
|
||||
import org.springframework.cloud.gateway.support.NameUtils;
|
||||
import springfox.documentation.swagger.web.SwaggerResource;
|
||||
import springfox.documentation.swagger.web.SwaggerResourcesProvider;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author Sywd 聚合接口文档注册,和zuul实现类似
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
public class SwaggerProvider implements SwaggerResourcesProvider {
|
||||
|
||||
private static final String API_URI = "/v2/api-docs";
|
||||
|
||||
private final RouteDefinitionRepository routeDefinitionRepository;
|
||||
|
||||
private final SwaggerProperties swaggerProperties;
|
||||
|
||||
private final DiscoveryClient discoveryClient;
|
||||
|
||||
@Override
|
||||
public List<SwaggerResource> get() {
|
||||
List<RouteDefinition> routes = new ArrayList<>();
|
||||
routeDefinitionRepository.getRouteDefinitions()
|
||||
// swagger 显示服务名称根据 路由的order 字段进行升序排列
|
||||
.sort(Comparator.comparingInt(RouteDefinition::getOrder)).subscribe(routes::add);
|
||||
|
||||
return routes.stream()
|
||||
.flatMap(routeDefinition -> routeDefinition.getPredicates().stream()
|
||||
.filter(predicateDefinition -> "Path".equalsIgnoreCase(predicateDefinition.getName()))
|
||||
.filter(predicateDefinition -> !swaggerProperties.getIgnoreProviders()
|
||||
.contains(routeDefinition.getId()))
|
||||
.map(predicateDefinition -> swaggerResource(routeDefinition.getId(),
|
||||
predicateDefinition.getArgs().get(NameUtils.GENERATED_NAME_PREFIX + "0").replace("/**",
|
||||
API_URI))))
|
||||
// 只显示注册中心 内已经正确启动的服务
|
||||
.filter(swaggerResource -> discoveryClient.getServices().stream()
|
||||
.anyMatch(s -> s.equals(swaggerResource.getName())))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
private static SwaggerResource swaggerResource(String name, String location) {
|
||||
SwaggerResource swaggerResource = new SwaggerResource();
|
||||
swaggerResource.setName(name);
|
||||
swaggerResource.setLocation(location);
|
||||
swaggerResource.setSwaggerVersion("2.0");
|
||||
return swaggerResource;
|
||||
}
|
||||
|
||||
}
|
||||
-52
@@ -1,52 +0,0 @@
|
||||
/*
|
||||
* 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.common.swagger.support;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.reactive.function.BodyInserters;
|
||||
import org.springframework.web.reactive.function.server.HandlerFunction;
|
||||
import org.springframework.web.reactive.function.server.ServerRequest;
|
||||
import org.springframework.web.reactive.function.server.ServerResponse;
|
||||
import reactor.core.publisher.Mono;
|
||||
import springfox.documentation.swagger.web.SwaggerResourcesProvider;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2018-07-19 SwaggerResourceHandler
|
||||
*/
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class SwaggerResourceHandler implements HandlerFunction<ServerResponse> {
|
||||
|
||||
private final SwaggerResourcesProvider swaggerResources;
|
||||
|
||||
/**
|
||||
* Handle the given request.
|
||||
* @param request the request to handler
|
||||
* @return the response
|
||||
*/
|
||||
@Override
|
||||
public Mono<ServerResponse> handle(ServerRequest request) {
|
||||
return ServerResponse.status(HttpStatus.OK).contentType(MediaType.APPLICATION_JSON)
|
||||
.body(BodyInserters.fromValue(swaggerResources.get()));
|
||||
}
|
||||
|
||||
}
|
||||
-54
@@ -1,54 +0,0 @@
|
||||
/*
|
||||
* 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.common.swagger.support;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.reactive.function.BodyInserters;
|
||||
import org.springframework.web.reactive.function.server.HandlerFunction;
|
||||
import org.springframework.web.reactive.function.server.ServerRequest;
|
||||
import org.springframework.web.reactive.function.server.ServerResponse;
|
||||
import reactor.core.publisher.Mono;
|
||||
import springfox.documentation.swagger.web.SecurityConfiguration;
|
||||
import springfox.documentation.swagger.web.SecurityConfigurationBuilder;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2018-07-19 SwaggerSecurityHandler
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
public class SwaggerSecurityHandler implements HandlerFunction<ServerResponse> {
|
||||
|
||||
private final SecurityConfiguration securityConfiguration;
|
||||
|
||||
/**
|
||||
* Handle the given request.
|
||||
* @param request the request to handler
|
||||
* @return the response
|
||||
*/
|
||||
@Override
|
||||
public Mono<ServerResponse> handle(ServerRequest request) {
|
||||
return ServerResponse.status(HttpStatus.OK).contentType(MediaType.APPLICATION_JSON)
|
||||
.body(BodyInserters.fromValue(Optional.ofNullable(securityConfiguration)
|
||||
.orElse(SecurityConfigurationBuilder.builder().build())));
|
||||
}
|
||||
|
||||
}
|
||||
-55
@@ -1,55 +0,0 @@
|
||||
/*
|
||||
* 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.common.swagger.support;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.reactive.function.BodyInserters;
|
||||
import org.springframework.web.reactive.function.server.HandlerFunction;
|
||||
import org.springframework.web.reactive.function.server.ServerRequest;
|
||||
import org.springframework.web.reactive.function.server.ServerResponse;
|
||||
import reactor.core.publisher.Mono;
|
||||
import springfox.documentation.swagger.web.UiConfiguration;
|
||||
import springfox.documentation.swagger.web.UiConfigurationBuilder;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2018-07-19 SwaggerUiHandler
|
||||
*/
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
public class SwaggerUiHandler implements HandlerFunction<ServerResponse> {
|
||||
|
||||
private final UiConfiguration uiConfiguration;
|
||||
|
||||
/**
|
||||
* Handle the given request.
|
||||
* @param request the request to handler
|
||||
* @return the response
|
||||
*/
|
||||
@Override
|
||||
public Mono<ServerResponse> handle(ServerRequest request) {
|
||||
return ServerResponse.status(HttpStatus.OK).contentType(MediaType.APPLICATION_JSON).body(BodyInserters
|
||||
.fromValue(Optional.ofNullable(uiConfiguration).orElse(UiConfigurationBuilder.builder().build())));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
# swagger 配置
|
||||
swagger:
|
||||
enabled: true
|
||||
title: PigX Swagger API
|
||||
gateway: http://${GATEWAY-HOST:pigx-gateway}:${GATEWAY-PORT:9999}
|
||||
token-url: ${swagger.gateway}/auth/oauth2/token
|
||||
scope: server
|
||||
@@ -92,10 +92,10 @@
|
||||
<groupId>com.github.ben-manes.caffeine</groupId>
|
||||
<artifactId>caffeine</artifactId>
|
||||
</dependency>
|
||||
<!--swagger 依赖-->
|
||||
<!--接口文档-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-swagger</artifactId>
|
||||
<groupId>org.springdoc</groupId>
|
||||
<artifactId>springdoc-openapi-webflux-ui</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
package com.pig4cloud.pigx.gateway;
|
||||
|
||||
import com.pig4cloud.pigx.common.gateway.annotation.EnablePigxDynamicRoute;
|
||||
import com.pig4cloud.pigx.common.swagger.annotation.EnablePigxSwagger2;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||
@@ -29,7 +28,6 @@ import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||
* @author lengleng
|
||||
* @date 2018年06月21日 网关应用
|
||||
*/
|
||||
@EnablePigxSwagger2
|
||||
@EnablePigxDynamicRoute
|
||||
@EnableDiscoveryClient
|
||||
@SpringBootApplication
|
||||
|
||||
+85
@@ -0,0 +1,85 @@
|
||||
package com.pig4cloud.pigx.gateway.config;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import lombok.Data;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springdoc.core.GroupedOpenApi;
|
||||
import org.springdoc.core.SwaggerUiConfigParameters;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.cloud.client.ServiceInstance;
|
||||
import org.springframework.cloud.client.discovery.DiscoveryClient;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2022/3/26
|
||||
* <p>
|
||||
* swagger 3.0 展示
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
public class SpringDocConfiguration {
|
||||
|
||||
private final DiscoveryClient discoveryClient;
|
||||
|
||||
@Bean
|
||||
@Lazy(false)
|
||||
@ConditionalOnProperty(name = "springdoc.api-docs.enabled", matchIfMissing = true)
|
||||
public List<GroupedOpenApi> apis(SwaggerUiConfigParameters swaggerUiConfigParameters) {
|
||||
List<GroupedOpenApi> groups = new ArrayList<>();
|
||||
|
||||
for (String serviceId : discoveryClient.getServices()) {
|
||||
for (ServiceInstance instance : discoveryClient.getInstances(serviceId)) {
|
||||
String doc = instance.getMetadata().get("spring-doc");
|
||||
if (StrUtil.isNotBlank(doc)){
|
||||
swaggerUiConfigParameters.addGroup(doc,serviceId);
|
||||
}
|
||||
}
|
||||
}
|
||||
return groups;
|
||||
|
||||
}
|
||||
|
||||
@Data
|
||||
@Component
|
||||
@ConfigurationProperties("swagger")
|
||||
public class SwaggerDocProperties {
|
||||
|
||||
private Map<String, String> services;
|
||||
|
||||
/**
|
||||
* 认证参数
|
||||
*/
|
||||
private SwaggerBasic basic = new SwaggerBasic();
|
||||
|
||||
@Data
|
||||
public class SwaggerBasic {
|
||||
|
||||
/**
|
||||
* 是否开启 basic 认证
|
||||
*/
|
||||
private Boolean enabled;
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
private String password;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
+1
-1
@@ -78,7 +78,7 @@ public class PigxRequestGlobalFilter implements GlobalFilter, Ordered {
|
||||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return -1000;
|
||||
return 10;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -10,7 +10,16 @@ spring:
|
||||
server-addr: ${NACOS_HOST:pigx-register}:${NACOS_PORT:8848}
|
||||
config:
|
||||
server-addr: ${spring.cloud.nacos.discovery.server-addr}
|
||||
gateway:
|
||||
routes:
|
||||
# 固定路由转发配置 无修改
|
||||
- id: openapi
|
||||
uri: lb://pigx-gateway
|
||||
predicates:
|
||||
- Path=/v3/api-docs/**
|
||||
filters:
|
||||
- RewritePath=/v3/api-docs/(?<path>.*), /$\{path}/$\{path}/v3/api-docs
|
||||
config:
|
||||
import:
|
||||
- optional:nacos:application-@profiles.active@.yml
|
||||
- optional:nacos:${spring.application.name}-@profiles.active@.yml
|
||||
- optional:nacos:${spring.application.name}-@profiles.active@.yml
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package com.pig4cloud.pigx.admin.api.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
@@ -13,7 +13,7 @@ import java.time.LocalDateTime;
|
||||
* 日志查询传输对象
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "日志查询对象")
|
||||
@Schema(description = "日志查询对象")
|
||||
public class SysLogDTO {
|
||||
|
||||
/**
|
||||
|
||||
@@ -20,8 +20,7 @@
|
||||
package com.pig4cloud.pigx.admin.api.dto;
|
||||
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysUser;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@@ -32,20 +31,20 @@ import java.util.List;
|
||||
* @date 2017/11/5
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "系统用户传输对象")
|
||||
@Schema(description = "系统用户传输对象")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class UserDTO extends SysUser {
|
||||
|
||||
/**
|
||||
* 角色ID
|
||||
*/
|
||||
@ApiModelProperty(value = "角色id集合")
|
||||
@Schema(description = "角色id集合")
|
||||
private List<Long> role;
|
||||
|
||||
/**
|
||||
* 部门id
|
||||
*/
|
||||
@ApiModelProperty(value = "部门id")
|
||||
@Schema(description = "部门id")
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
@@ -56,7 +55,7 @@ public class UserDTO extends SysUser {
|
||||
/**
|
||||
* 新密码
|
||||
*/
|
||||
@ApiModelProperty(value = "新密码")
|
||||
@Schema(description = "新密码")
|
||||
private String newpassword1;
|
||||
|
||||
}
|
||||
+5
-6
@@ -20,8 +20,7 @@
|
||||
package com.pig4cloud.pigx.admin.api.dto;
|
||||
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysUser;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
@@ -31,25 +30,25 @@ import java.io.Serializable;
|
||||
* @date 2017/11/11
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "用户信息")
|
||||
@Schema(description = "用户信息")
|
||||
public class UserInfo implements Serializable {
|
||||
|
||||
/**
|
||||
* 用户基本信息
|
||||
*/
|
||||
@ApiModelProperty(value = "用户基本信息")
|
||||
@Schema(description = "用户基本信息")
|
||||
private SysUser sysUser;
|
||||
|
||||
/**
|
||||
* 权限标识集合
|
||||
*/
|
||||
@ApiModelProperty(value = "权限标识集合")
|
||||
@Schema(description = "权限标识集合")
|
||||
private String[] permissions;
|
||||
|
||||
/**
|
||||
* 角色集合
|
||||
*/
|
||||
@ApiModelProperty(value = "角色标识集合")
|
||||
@Schema(description = "角色标识集合")
|
||||
private Long[] roles;
|
||||
|
||||
}
|
||||
+11
-12
@@ -21,8 +21,7 @@ package com.pig4cloud.pigx.admin.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@@ -39,69 +38,69 @@ import java.time.LocalDateTime;
|
||||
* @since 2018-01-22
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "部门")
|
||||
@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)
|
||||
@ApiModelProperty(value = "部门id")
|
||||
@Schema(description = "部门id")
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
@NotBlank(message = "部门名称不能为空")
|
||||
@ApiModelProperty(value = "部门名称")
|
||||
@Schema(description = "部门名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
@NotNull(message = "排序值不能为空")
|
||||
@ApiModelProperty(value = "排序值")
|
||||
@Schema(description = "排序值")
|
||||
private Integer sortOrder;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@ApiModelProperty(value = "创建人")
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
@ApiModelProperty(value = "修改人")
|
||||
@Schema(description = "修改人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@Schema(description = "创建时间")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
@Schema(description = "修改时间")
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 父级部门id
|
||||
*/
|
||||
@ApiModelProperty(value = "父级部门id")
|
||||
@Schema(description = "父级部门id")
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 是否删除 1:已删除 0:正常
|
||||
*/
|
||||
@TableLogic
|
||||
@ApiModelProperty(value = "删除标记,1:已删除,0:正常")
|
||||
@Schema(description = "删除标记,1:已删除,0:正常")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String delFlag;
|
||||
|
||||
|
||||
+4
-5
@@ -20,8 +20,7 @@
|
||||
package com.pig4cloud.pigx.admin.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@@ -34,7 +33,7 @@ import lombok.EqualsAndHashCode;
|
||||
* @since 2018-01-22
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "部门关系")
|
||||
@Schema(description = "部门关系")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class SysDeptRelation extends Model<SysDeptRelation> {
|
||||
|
||||
@@ -43,13 +42,13 @@ public class SysDeptRelation extends Model<SysDeptRelation> {
|
||||
/**
|
||||
* 祖先节点
|
||||
*/
|
||||
@ApiModelProperty(value = "祖先节点")
|
||||
@Schema(description = "祖先节点")
|
||||
private Long ancestor;
|
||||
|
||||
/**
|
||||
* 后代节点
|
||||
*/
|
||||
@ApiModelProperty(value = "后代节点")
|
||||
@Schema(description = "后代节点")
|
||||
private Long descendant;
|
||||
|
||||
}
|
||||
+12
-13
@@ -18,8 +18,7 @@ package com.pig4cloud.pigx.admin.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@@ -32,7 +31,7 @@ import java.time.LocalDateTime;
|
||||
* @date 2019/03/19
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "字典类型")
|
||||
@Schema(description = "字典类型")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class SysDict extends Model<SysDict> {
|
||||
|
||||
@@ -42,59 +41,59 @@ public class SysDict extends Model<SysDict> {
|
||||
* 编号
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "字典编号")
|
||||
@Schema(description = "字典编号")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
@ApiModelProperty(value = "字典类型")
|
||||
@Schema(description = "字典类型")
|
||||
private String dictType;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
@ApiModelProperty(value = "字典描述")
|
||||
@Schema(description = "字典描述")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@Schema(description = "创建时间")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
@Schema(description = "更新时间")
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 是否是系统内置
|
||||
*/
|
||||
@ApiModelProperty(value = "是否系统内置")
|
||||
@Schema(description = "是否系统内置")
|
||||
private String systemFlag;
|
||||
|
||||
/**
|
||||
* 备注信息
|
||||
*/
|
||||
@ApiModelProperty(value = "备注信息")
|
||||
@Schema(description = "备注信息")
|
||||
private String remarks;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@ApiModelProperty(value = "创建人")
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
@ApiModelProperty(value = "修改人")
|
||||
@Schema(description = "修改人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
@@ -102,7 +101,7 @@ public class SysDict extends Model<SysDict> {
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@ApiModelProperty(value = "删除标记,1:已删除,0:正常")
|
||||
@Schema(description = "删除标记,1:已删除,0:正常")
|
||||
private String delFlag;
|
||||
|
||||
}
|
||||
+15
-16
@@ -19,8 +19,7 @@ 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.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@@ -33,7 +32,7 @@ import java.time.LocalDateTime;
|
||||
* @date 2019/03/19
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "字典项")
|
||||
@Schema(description = "字典项")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class SysDictItem extends Model<SysDictItem> {
|
||||
|
||||
@@ -43,78 +42,78 @@ public class SysDictItem extends Model<SysDictItem> {
|
||||
* 编号
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "字典项id")
|
||||
@Schema(description = "字典项id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 所属字典类id
|
||||
*/
|
||||
@ApiModelProperty(value = "所属字典类id")
|
||||
@Schema(description = "所属字典类id")
|
||||
private Long dictId;
|
||||
|
||||
/**
|
||||
* 数据值
|
||||
*/
|
||||
@ApiModelProperty(value = "数据值")
|
||||
@Schema(description = "数据值")
|
||||
@JsonProperty(value = "value")
|
||||
private String itemValue;
|
||||
|
||||
/**
|
||||
* 标签名
|
||||
*/
|
||||
@ApiModelProperty(value = "标签名")
|
||||
@Schema(description = "标签名")
|
||||
private String label;
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
@ApiModelProperty(value = "类型")
|
||||
@Schema(description = "类型")
|
||||
private String dictType;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
@ApiModelProperty(value = "描述")
|
||||
@Schema(description = "描述")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 排序(升序)
|
||||
*/
|
||||
@ApiModelProperty(value = "排序值,默认升序")
|
||||
@Schema(description = "排序值,默认升序")
|
||||
private Integer sortOrder;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@ApiModelProperty(value = "创建人")
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
@ApiModelProperty(value = "修改人")
|
||||
@Schema(description = "修改人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 备注信息
|
||||
*/
|
||||
@ApiModelProperty(value = "备注信息")
|
||||
@Schema(description = "备注信息")
|
||||
private String remarks;
|
||||
|
||||
/**
|
||||
@@ -122,7 +121,7 @@ public class SysDictItem extends Model<SysDictItem> {
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@ApiModelProperty(value = "删除标记,1:已删除,0:正常")
|
||||
@Schema(description = "删除标记,1:已删除,0:正常")
|
||||
private String delFlag;
|
||||
|
||||
}
|
||||
+13
-14
@@ -19,8 +19,7 @@ package com.pig4cloud.pigx.admin.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@@ -33,7 +32,7 @@ import java.time.LocalDateTime;
|
||||
* @date 2019-06-18 17:18:42
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "文件")
|
||||
@Schema(description = "文件")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class SysFile extends Model<SysFile> {
|
||||
|
||||
@@ -43,65 +42,65 @@ public class SysFile extends Model<SysFile> {
|
||||
* 编号
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "文件编号")
|
||||
@Schema(description = "文件编号")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 文件名
|
||||
*/
|
||||
@ApiModelProperty(value = "文件名")
|
||||
@Schema(description = "文件名")
|
||||
private String fileName;
|
||||
|
||||
/**
|
||||
* 原文件名
|
||||
*/
|
||||
@ApiModelProperty(value = "原始文件名")
|
||||
@Schema(description = "原始文件名")
|
||||
private String original;
|
||||
|
||||
/**
|
||||
* 容器名称
|
||||
*/
|
||||
@ApiModelProperty(value = "存储桶名称")
|
||||
@Schema(description = "存储桶名称")
|
||||
private String bucketName;
|
||||
|
||||
/**
|
||||
* 文件类型
|
||||
*/
|
||||
@ApiModelProperty(value = "文件类型")
|
||||
@Schema(description = "文件类型")
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 文件大小
|
||||
*/
|
||||
@ApiModelProperty(value = "文件大小")
|
||||
@Schema(description = "文件大小")
|
||||
private Long fileSize;
|
||||
|
||||
/**
|
||||
* 上传人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@ApiModelProperty(value = "创建者")
|
||||
@Schema(description = "创建者")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 上传时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@ApiModelProperty(value = "更新者")
|
||||
@Schema(description = "更新者")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
@@ -109,7 +108,7 @@ public class SysFile extends Model<SysFile> {
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@ApiModelProperty(value = "删除标记,1:已删除,0:正常")
|
||||
@Schema(description = "删除标记,1:已删除,0:正常")
|
||||
private String delFlag;
|
||||
|
||||
}
|
||||
+17
-18
@@ -22,8 +22,7 @@ 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.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
@@ -39,7 +38,7 @@ import java.time.LocalDateTime;
|
||||
* @since 2017-11-20
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "日志")
|
||||
@Schema(description = "日志")
|
||||
public class SysLog implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@@ -49,7 +48,7 @@ public class SysLog implements Serializable {
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ExcelProperty("日志编号")
|
||||
@ApiModelProperty(value = "日志编号")
|
||||
@Schema(description = "日志编号")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
@@ -57,7 +56,7 @@ public class SysLog implements Serializable {
|
||||
*/
|
||||
@NotBlank(message = "日志类型不能为空")
|
||||
@ExcelProperty("日志类型(0-正常 9-错误)")
|
||||
@ApiModelProperty(value = "日志类型")
|
||||
@Schema(description = "日志类型")
|
||||
private String logType;
|
||||
|
||||
/**
|
||||
@@ -65,7 +64,7 @@ public class SysLog implements Serializable {
|
||||
*/
|
||||
@NotBlank(message = "日志标题不能为空")
|
||||
@ExcelProperty("日志标题")
|
||||
@ApiModelProperty(value = "日志标题")
|
||||
@Schema(description = "日志标题")
|
||||
private String title;
|
||||
|
||||
/**
|
||||
@@ -73,7 +72,7 @@ public class SysLog implements Serializable {
|
||||
*/
|
||||
@ExcelProperty("创建人")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@ApiModelProperty(value = "创建人")
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
@@ -81,7 +80,7 @@ public class SysLog implements Serializable {
|
||||
*/
|
||||
@ExcelProperty("创建时间")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
@@ -89,62 +88,62 @@ public class SysLog implements Serializable {
|
||||
*/
|
||||
@ExcelIgnore
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 操作IP地址
|
||||
*/
|
||||
@ExcelProperty("操作ip地址")
|
||||
@ApiModelProperty(value = "操作ip地址")
|
||||
@Schema(description = "操作ip地址")
|
||||
private String remoteAddr;
|
||||
|
||||
/**
|
||||
* 用户代理
|
||||
*/
|
||||
@ApiModelProperty(value = "用户代理")
|
||||
@Schema(description = "用户代理")
|
||||
private String userAgent;
|
||||
|
||||
/**
|
||||
* 请求URI
|
||||
*/
|
||||
@ExcelProperty("浏览器")
|
||||
@ApiModelProperty(value = "请求uri")
|
||||
@Schema(description = "请求uri")
|
||||
private String requestUri;
|
||||
|
||||
/**
|
||||
* 操作方式
|
||||
*/
|
||||
@ExcelProperty("操作方式")
|
||||
@ApiModelProperty(value = "操作方式")
|
||||
@Schema(description = "操作方式")
|
||||
private String method;
|
||||
|
||||
/**
|
||||
* 操作提交的数据
|
||||
*/
|
||||
@ExcelProperty("提交数据")
|
||||
@ApiModelProperty(value = "提交数据")
|
||||
@Schema(description = "提交数据")
|
||||
private String params;
|
||||
|
||||
/**
|
||||
* 执行时间
|
||||
*/
|
||||
@ExcelProperty("执行时间")
|
||||
@ApiModelProperty(value = "方法执行时间")
|
||||
@Schema(description = "方法执行时间")
|
||||
private Long time;
|
||||
|
||||
/**
|
||||
* 异常信息
|
||||
*/
|
||||
@ExcelProperty("异常信息")
|
||||
@ApiModelProperty(value = "异常信息")
|
||||
@Schema(description = "异常信息")
|
||||
private String exception;
|
||||
|
||||
/**
|
||||
* 服务ID
|
||||
*/
|
||||
@ExcelProperty("应用标识")
|
||||
@ApiModelProperty(value = "应用标识")
|
||||
@Schema(description = "应用标识")
|
||||
private String serviceId;
|
||||
|
||||
/**
|
||||
@@ -153,7 +152,7 @@ public class SysLog implements Serializable {
|
||||
@TableLogic
|
||||
@ExcelIgnore
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@ApiModelProperty(value = "删除标记,1:已删除,0:正常")
|
||||
@Schema(description = "删除标记,1:已删除,0:正常")
|
||||
private String delFlag;
|
||||
|
||||
}
|
||||
+17
-18
@@ -21,8 +21,7 @@ package com.pig4cloud.pigx.admin.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@@ -39,7 +38,7 @@ import java.time.LocalDateTime;
|
||||
* @since 2017-11-08
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "菜单")
|
||||
@Schema(description = "菜单")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class SysMenu extends Model<SysMenu> {
|
||||
|
||||
@@ -49,92 +48,92 @@ public class SysMenu extends Model<SysMenu> {
|
||||
* 菜单ID
|
||||
*/
|
||||
@TableId(value = "menu_id", type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "菜单id")
|
||||
@Schema(description = "菜单id")
|
||||
private Long menuId;
|
||||
|
||||
/**
|
||||
* 菜单名称
|
||||
*/
|
||||
@NotBlank(message = "菜单名称不能为空")
|
||||
@ApiModelProperty(value = "菜单名称")
|
||||
@Schema(description = "菜单名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 菜单权限标识
|
||||
*/
|
||||
@ApiModelProperty(value = "菜单权限标识")
|
||||
@Schema(description = "菜单权限标识")
|
||||
private String permission;
|
||||
|
||||
/**
|
||||
* 父菜单ID
|
||||
*/
|
||||
@NotNull(message = "菜单父ID不能为空")
|
||||
@ApiModelProperty(value = "菜单父id")
|
||||
@Schema(description = "菜单父id")
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 图标
|
||||
*/
|
||||
@ApiModelProperty(value = "菜单图标")
|
||||
@Schema(description = "菜单图标")
|
||||
private String icon;
|
||||
|
||||
/**
|
||||
* 前端路由标识路径,默认和 comment 保持一致 过期
|
||||
*/
|
||||
@ApiModelProperty(value = "前端路由标识路径")
|
||||
@Schema(description = "前端路由标识路径")
|
||||
private String path;
|
||||
|
||||
/**
|
||||
* 排序值
|
||||
*/
|
||||
@ApiModelProperty(value = "排序值")
|
||||
@Schema(description = "排序值")
|
||||
private Integer sortOrder;
|
||||
|
||||
/**
|
||||
* 菜单类型 (0菜单 1按钮)
|
||||
*/
|
||||
@NotNull(message = "菜单类型不能为空")
|
||||
@ApiModelProperty(value = "菜单类型,0:菜单 1:按钮")
|
||||
@Schema(description = "菜单类型,0:菜单 1:按钮")
|
||||
private String menuType;
|
||||
|
||||
/**
|
||||
* 路由缓冲
|
||||
*/
|
||||
@ApiModelProperty(value = "路由缓冲")
|
||||
@Schema(description = "路由缓冲")
|
||||
private String keepAlive;
|
||||
|
||||
/**
|
||||
* 菜单显示隐藏控制
|
||||
*/
|
||||
@ApiModelProperty(value = "菜单是否显示")
|
||||
@Schema(description = "菜单是否显示")
|
||||
private String visible;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@ApiModelProperty(value = "创建人")
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
@ApiModelProperty(value = "修改人")
|
||||
@Schema(description = "修改人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
@@ -142,7 +141,7 @@ public class SysMenu extends Model<SysMenu> {
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@ApiModelProperty(value = "删除标记,1:已删除,0:正常")
|
||||
@Schema(description = "删除标记,1:已删除,0:正常")
|
||||
private String delFlag;
|
||||
|
||||
}
|
||||
+19
-20
@@ -21,8 +21,7 @@ package com.pig4cloud.pigx.admin.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@@ -38,83 +37,83 @@ import java.time.LocalDateTime;
|
||||
* @since 2018-05-15
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "客户端信息")
|
||||
@Schema(description = "客户端信息")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class SysOauthClientDetails extends Model<SysOauthClientDetails> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "id")
|
||||
@Schema(description = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 客户端ID
|
||||
*/
|
||||
@NotBlank(message = "client_id 不能为空")
|
||||
@ApiModelProperty(value = "客户端id")
|
||||
@Schema(description = "客户端id")
|
||||
private String clientId;
|
||||
|
||||
/**
|
||||
* 客户端密钥
|
||||
*/
|
||||
@NotBlank(message = "client_secret 不能为空")
|
||||
@ApiModelProperty(value = "客户端密钥")
|
||||
@Schema(description = "客户端密钥")
|
||||
private String clientSecret;
|
||||
|
||||
/**
|
||||
* 资源ID
|
||||
*/
|
||||
@ApiModelProperty(value = "资源id列表")
|
||||
@Schema(description = "资源id列表")
|
||||
private String resourceIds;
|
||||
|
||||
/**
|
||||
* 作用域
|
||||
*/
|
||||
@NotBlank(message = "scope 不能为空")
|
||||
@ApiModelProperty(value = "作用域")
|
||||
@Schema(description = "作用域")
|
||||
private String scope;
|
||||
|
||||
/**
|
||||
* 授权方式[A,B,C]
|
||||
*/
|
||||
@ApiModelProperty(value = "授权方式")
|
||||
@Schema(description = "授权方式")
|
||||
private String[] authorizedGrantTypes;
|
||||
|
||||
/**
|
||||
* 回调地址
|
||||
*/
|
||||
@ApiModelProperty(value = "回调地址")
|
||||
@Schema(description = "回调地址")
|
||||
private String webServerRedirectUri;
|
||||
|
||||
/**
|
||||
* 权限
|
||||
*/
|
||||
@ApiModelProperty(value = "权限列表")
|
||||
@Schema(description = "权限列表")
|
||||
private String authorities;
|
||||
|
||||
/**
|
||||
* 请求令牌有效时间
|
||||
*/
|
||||
@ApiModelProperty(value = "请求令牌有效时间")
|
||||
@Schema(description = "请求令牌有效时间")
|
||||
private Integer accessTokenValidity;
|
||||
|
||||
/**
|
||||
* 刷新令牌有效时间
|
||||
*/
|
||||
@ApiModelProperty(value = "刷新令牌有效时间")
|
||||
@Schema(description = "刷新令牌有效时间")
|
||||
private Integer refreshTokenValidity;
|
||||
|
||||
/**
|
||||
* 扩展信息
|
||||
*/
|
||||
@ApiModelProperty(value = "扩展信息")
|
||||
@Schema(description = "扩展信息")
|
||||
private String additionalInformation;
|
||||
|
||||
/**
|
||||
* 是否自动放行
|
||||
*/
|
||||
@ApiModelProperty(value = "是否自动放行")
|
||||
@Schema(description = "是否自动放行")
|
||||
private String autoapprove;
|
||||
|
||||
/**
|
||||
@@ -122,35 +121,35 @@ public class SysOauthClientDetails extends Model<SysOauthClientDetails> {
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@ApiModelProperty(value = "删除标记,1:已删除,0:正常")
|
||||
@Schema(description = "删除标记,1:已删除,0:正常")
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@ApiModelProperty(value = "创建人")
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
@ApiModelProperty(value = "修改人")
|
||||
@Schema(description = "修改人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
+12
-13
@@ -19,8 +19,7 @@ package com.pig4cloud.pigx.admin.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@@ -37,7 +36,7 @@ import java.time.LocalDateTime;
|
||||
@Data
|
||||
@TableName("sys_post")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel(value = "岗位信息表")
|
||||
@Schema(description = "岗位信息表")
|
||||
public class SysPost extends Model<SysPost> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@@ -46,48 +45,48 @@ public class SysPost extends Model<SysPost> {
|
||||
* 岗位ID
|
||||
*/
|
||||
@TableId(value = "post_id", type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "岗位ID")
|
||||
@Schema(description = "岗位ID")
|
||||
private Long postId;
|
||||
|
||||
/**
|
||||
* 岗位编码
|
||||
*/
|
||||
@NotBlank(message = "岗位编码不能为空")
|
||||
@ApiModelProperty(value = "岗位编码")
|
||||
@Schema(description = "岗位编码")
|
||||
private String postCode;
|
||||
|
||||
/**
|
||||
* 岗位名称
|
||||
*/
|
||||
@NotBlank(message = "岗位名称不能为空")
|
||||
@ApiModelProperty(value = "岗位名称")
|
||||
@Schema(description = "岗位名称")
|
||||
private String postName;
|
||||
|
||||
/**
|
||||
* 岗位排序
|
||||
*/
|
||||
@NotNull(message = "排序值不能为空")
|
||||
@ApiModelProperty(value = "岗位排序")
|
||||
@Schema(description = "岗位排序")
|
||||
private Integer postSort;
|
||||
|
||||
/**
|
||||
* 岗位描述
|
||||
*/
|
||||
@ApiModelProperty(value = "岗位描述")
|
||||
@Schema(description = "岗位描述")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@ApiModelProperty(value = "创建人")
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
@ApiModelProperty(value = "修改人")
|
||||
@Schema(description = "修改人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
@@ -95,20 +94,20 @@ public class SysPost extends Model<SysPost> {
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@ApiModelProperty(value = "是否删除 -1:已删除 0:正常")
|
||||
@Schema(description = "是否删除 -1:已删除 0:正常")
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@Schema(description = "创建时间")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
@Schema(description = "更新时间")
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
|
||||
+15
-16
@@ -19,8 +19,7 @@ package com.pig4cloud.pigx.admin.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@@ -33,7 +32,7 @@ import java.time.LocalDateTime;
|
||||
* @date 2019-04-29
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "公共参数")
|
||||
@Schema(description = "公共参数")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class SysPublicParam extends Model<SysPublicParam> {
|
||||
|
||||
@@ -43,63 +42,63 @@ public class SysPublicParam extends Model<SysPublicParam> {
|
||||
* 编号
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "公共参数编号")
|
||||
@Schema(description = "公共参数编号")
|
||||
private Long publicId;
|
||||
|
||||
/**
|
||||
* 公共参数名称
|
||||
*/
|
||||
@ApiModelProperty(value = "公共参数名称", required = true, example = "公共参数名称")
|
||||
@Schema(description = "公共参数名称", required = true, example = "公共参数名称")
|
||||
private String publicName;
|
||||
|
||||
/**
|
||||
* 公共参数地址值,英文大写+下划线
|
||||
*/
|
||||
@ApiModelProperty(value = "键[英文大写+下划线]", required = true, example = "PIGX_PUBLIC_KEY")
|
||||
@Schema(description = "键[英文大写+下划线]", required = true, example = "PIGX_PUBLIC_KEY")
|
||||
private String publicKey;
|
||||
|
||||
/**
|
||||
* 值
|
||||
*/
|
||||
@ApiModelProperty(value = "值", required = true, example = "999")
|
||||
@Schema(description = "值", required = true, example = "999")
|
||||
private String publicValue;
|
||||
|
||||
/**
|
||||
* 状态(1有效;2无效;)
|
||||
*/
|
||||
@ApiModelProperty(value = "标识[1有效;2无效]", example = "1")
|
||||
@Schema(description = "标识[1有效;2无效]", example = "1")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 公共参数编码
|
||||
*/
|
||||
@ApiModelProperty(value = "编码", example = "^(PIG|PIGX)$")
|
||||
@Schema(description = "编码", example = "^(PIG|PIGX)$")
|
||||
private String validateCode;
|
||||
|
||||
/**
|
||||
* 是否是系统内置
|
||||
*/
|
||||
@ApiModelProperty(value = "是否是系统内置")
|
||||
@Schema(description = "是否是系统内置")
|
||||
private String systemFlag;
|
||||
|
||||
/**
|
||||
* 配置类型:0-默认;1-检索;2-原文;3-报表;4-安全;5-文档;6-消息;9-其他
|
||||
*/
|
||||
@ApiModelProperty(value = "类型[1-检索;2-原文...]", example = "1")
|
||||
@Schema(description = "类型[1-检索;2-原文...]", example = "1")
|
||||
private String publicType;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@ApiModelProperty(value = "创建人")
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
@ApiModelProperty(value = "修改人")
|
||||
@Schema(description = "修改人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
@@ -107,21 +106,21 @@ public class SysPublicParam extends Model<SysPublicParam> {
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@ApiModelProperty(value = "删除标记,1:已删除,0:正常")
|
||||
@Schema(description = "删除标记,1:已删除,0:正常")
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
+13
-14
@@ -21,8 +21,7 @@ package com.pig4cloud.pigx.admin.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@@ -39,62 +38,62 @@ import java.time.LocalDateTime;
|
||||
* @since 2017-10-29
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "角色")
|
||||
@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)
|
||||
@ApiModelProperty(value = "角色编号")
|
||||
@Schema(description = "角色编号")
|
||||
private Long roleId;
|
||||
|
||||
@NotBlank(message = "角色名称不能为空")
|
||||
@ApiModelProperty(value = "角色名称")
|
||||
@Schema(description = "角色名称")
|
||||
private String roleName;
|
||||
|
||||
@NotBlank(message = "角色标识不能为空")
|
||||
@ApiModelProperty(value = "角色标识")
|
||||
@Schema(description = "角色标识")
|
||||
private String roleCode;
|
||||
|
||||
@ApiModelProperty(value = "角色描述")
|
||||
@Schema(description = "角色描述")
|
||||
private String roleDesc;
|
||||
|
||||
@NotNull(message = "数据权限类型不能为空")
|
||||
@ApiModelProperty(value = "数据权限类型")
|
||||
@Schema(description = "数据权限类型")
|
||||
private Integer dsType;
|
||||
|
||||
/**
|
||||
* 数据权限作用范围
|
||||
*/
|
||||
@ApiModelProperty(value = "数据权限作用范围")
|
||||
@Schema(description = "数据权限作用范围")
|
||||
private String dsScope;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@ApiModelProperty(value = "创建人")
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
@ApiModelProperty(value = "修改人")
|
||||
@Schema(description = "修改人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@Schema(description = "创建时间")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
@Schema(description = "修改时间")
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
@@ -103,7 +102,7 @@ public class SysRole extends Model<SysRole> {
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@ApiModelProperty(value = "删除标记,1:已删除,0:正常")
|
||||
@Schema(description = "删除标记,1:已删除,0:正常")
|
||||
private String delFlag;
|
||||
|
||||
}
|
||||
+4
-5
@@ -20,8 +20,7 @@
|
||||
package com.pig4cloud.pigx.admin.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@@ -34,7 +33,7 @@ import lombok.EqualsAndHashCode;
|
||||
* @since 2017-10-29
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "角色菜单")
|
||||
@Schema(description = "角色菜单")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class SysRoleMenu extends Model<SysRoleMenu> {
|
||||
|
||||
@@ -43,13 +42,13 @@ public class SysRoleMenu extends Model<SysRoleMenu> {
|
||||
/**
|
||||
* 角色ID
|
||||
*/
|
||||
@ApiModelProperty(value = "角色id")
|
||||
@Schema(description = "角色id")
|
||||
private Long roleId;
|
||||
|
||||
/**
|
||||
* 菜单ID
|
||||
*/
|
||||
@ApiModelProperty(value = "菜单id")
|
||||
@Schema(description = "菜单id")
|
||||
private Long menuId;
|
||||
|
||||
}
|
||||
+15
-16
@@ -20,8 +20,7 @@ package com.pig4cloud.pigx.admin.api.entity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@@ -34,7 +33,7 @@ import java.time.LocalDateTime;
|
||||
* @date 2018-11-06 10:17:18
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "网关路由信息")
|
||||
@Schema(description = "网关路由信息")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class SysRouteConf extends Model<SysRouteConf> {
|
||||
|
||||
@@ -42,73 +41,73 @@ public class SysRouteConf extends Model<SysRouteConf> {
|
||||
|
||||
@JsonIgnore
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "主键")
|
||||
@Schema(description = "主键")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 路由ID
|
||||
*/
|
||||
@ApiModelProperty(value = "路由id")
|
||||
@Schema(description = "路由id")
|
||||
private String routeId;
|
||||
|
||||
/**
|
||||
* 路由名称
|
||||
*/
|
||||
@ApiModelProperty(value = "路由名称")
|
||||
@Schema(description = "路由名称")
|
||||
private String routeName;
|
||||
|
||||
/**
|
||||
* 断言
|
||||
*/
|
||||
@ApiModelProperty(value = "断言")
|
||||
@Schema(description = "断言")
|
||||
private String predicates;
|
||||
|
||||
/**
|
||||
* 过滤器
|
||||
*/
|
||||
@ApiModelProperty(value = "过滤器")
|
||||
@Schema(description = "过滤器")
|
||||
private String filters;
|
||||
|
||||
/**
|
||||
* uri
|
||||
*/
|
||||
@ApiModelProperty(value = "请求uri")
|
||||
@Schema(description = "请求uri")
|
||||
private String uri;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
@ApiModelProperty(value = "排序值")
|
||||
@Schema(description = "排序值")
|
||||
private Integer sortOrder;
|
||||
|
||||
@ApiModelProperty(value = "元数据")
|
||||
@Schema(description = "元数据")
|
||||
private String metadata;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@ApiModelProperty(value = "创建人")
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
@ApiModelProperty(value = "修改人")
|
||||
@Schema(description = "修改人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@Schema(description = "创建时间")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
@Schema(description = "修改时间")
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
@@ -116,7 +115,7 @@ public class SysRouteConf extends Model<SysRouteConf> {
|
||||
* 删除标识(0-正常,1-删除)
|
||||
*/
|
||||
@TableLogic
|
||||
@ApiModelProperty(value = "删除标记,1:已删除,0:正常")
|
||||
@Schema(description = "删除标记,1:已删除,0:正常")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String delFlag;
|
||||
|
||||
|
||||
+14
-15
@@ -21,8 +21,7 @@ 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.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@@ -36,7 +35,7 @@ import java.time.LocalDateTime;
|
||||
* @date 2018-08-16 21:30:41
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "第三方账号信息")
|
||||
@Schema(description = "第三方账号信息")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class SysSocialDetails extends Model<SysSocialDetails> {
|
||||
|
||||
@@ -46,20 +45,20 @@ public class SysSocialDetails extends Model<SysSocialDetails> {
|
||||
* 主鍵
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "主键")
|
||||
@Schema(description = "主键")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
@NotBlank(message = "类型不能为空")
|
||||
@ApiModelProperty(value = "账号类型")
|
||||
@Schema(description = "账号类型")
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
@ApiModelProperty(value = "描述")
|
||||
@Schema(description = "描述")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
@@ -67,7 +66,7 @@ public class SysSocialDetails extends Model<SysSocialDetails> {
|
||||
*/
|
||||
@Sensitive(prefixNoMaskLen = 4, suffixNoMaskLen = 4)
|
||||
@NotBlank(message = "账号不能为空")
|
||||
@ApiModelProperty(value = "appId")
|
||||
@Schema(description = "appId")
|
||||
private String appId;
|
||||
|
||||
/**
|
||||
@@ -75,46 +74,46 @@ public class SysSocialDetails extends Model<SysSocialDetails> {
|
||||
*/
|
||||
@Sensitive(prefixNoMaskLen = 9, suffixNoMaskLen = 9)
|
||||
@NotBlank(message = "密钥不能为空", groups = { ValidGroup.Insert.class })
|
||||
@ApiModelProperty(value = "app secret")
|
||||
@Schema(description = "app secret")
|
||||
private String appSecret;
|
||||
|
||||
/**
|
||||
* 回调地址
|
||||
*/
|
||||
@ApiModelProperty(value = "回调地址")
|
||||
@Schema(description = "回调地址")
|
||||
private String redirectUrl;
|
||||
|
||||
/**
|
||||
* 拓展字段
|
||||
*/
|
||||
@ApiModelProperty(value = "拓展字段")
|
||||
@Schema(description = "拓展字段")
|
||||
private String ext;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@ApiModelProperty(value = "创建人")
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
@ApiModelProperty(value = "修改人")
|
||||
@Schema(description = "修改人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@Schema(description = "创建时间")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
@Schema(description = "更新时间")
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
@@ -123,7 +122,7 @@ public class SysSocialDetails extends Model<SysSocialDetails> {
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@ApiModelProperty(value = "删除标记,1:已删除,0:正常")
|
||||
@Schema(description = "删除标记,1:已删除,0:正常")
|
||||
private String delFlag;
|
||||
|
||||
}
|
||||
+15
-16
@@ -19,8 +19,7 @@ package com.pig4cloud.pigx.admin.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@@ -33,7 +32,7 @@ import java.time.LocalDateTime;
|
||||
* @date 2019-05-15 15:55:41
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "租户信息")
|
||||
@Schema(description = "租户信息")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class SysTenant extends Model<SysTenant> {
|
||||
|
||||
@@ -43,60 +42,60 @@ public class SysTenant extends Model<SysTenant> {
|
||||
* 租户id
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "租户id")
|
||||
@Schema(description = "租户id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 租户名称
|
||||
*/
|
||||
@ApiModelProperty(value = "租户名称")
|
||||
@Schema(description = "租户名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 租户编号
|
||||
*/
|
||||
@ApiModelProperty(value = "租户编号")
|
||||
@Schema(description = "租户编号")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 租户域名
|
||||
*/
|
||||
@ApiModelProperty(value = "租户域名")
|
||||
@Schema(description = "租户域名")
|
||||
private String tenantDomain;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
@ApiModelProperty(value = "开始时间")
|
||||
@Schema(description = "开始时间")
|
||||
private LocalDateTime startTime;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
@ApiModelProperty(value = "结束时间")
|
||||
@Schema(description = "结束时间")
|
||||
private LocalDateTime endTime;
|
||||
|
||||
/**
|
||||
* 0正常 9-冻结
|
||||
*/
|
||||
@ApiModelProperty(value = "租户冻结标记,9:冻结,0:正常")
|
||||
@Schema(description = "租户冻结标记,9:冻结,0:正常")
|
||||
private String status;
|
||||
|
||||
@ApiModelProperty("租户菜单ID")
|
||||
@Schema(description = "租户菜单ID")
|
||||
private String menuId;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@ApiModelProperty(value = "创建人")
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
@ApiModelProperty(value = "修改人")
|
||||
@Schema(description = "修改人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
@@ -104,21 +103,21 @@ public class SysTenant extends Model<SysTenant> {
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@ApiModelProperty(value = "删除标记,1:已删除,0:正常")
|
||||
@Schema(description = "删除标记,1:已删除,0:正常")
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
+11
-12
@@ -2,8 +2,7 @@ package com.pig4cloud.pigx.admin.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@@ -13,7 +12,7 @@ import java.time.LocalDateTime;
|
||||
* 租户菜单
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "租户菜单")
|
||||
@Schema(description = "租户菜单")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class SysTenantMenu extends Model<SysTenantMenu> {
|
||||
|
||||
@@ -21,39 +20,39 @@ public class SysTenantMenu extends Model<SysTenantMenu> {
|
||||
* id
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "id")
|
||||
@Schema(description = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 租户菜单名称
|
||||
*/
|
||||
@ApiModelProperty(value = "租户菜单名称")
|
||||
@Schema(description = "租户菜单名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 菜单id集合
|
||||
*/
|
||||
@ApiModelProperty(value = "菜单id集合")
|
||||
@Schema(description = "菜单id集合")
|
||||
private String menuIds;
|
||||
|
||||
/**
|
||||
* 0正常 9-冻结
|
||||
*/
|
||||
@ApiModelProperty(value = "租户菜单,9:冻结,0:正常")
|
||||
@Schema(description = "租户菜单,9:冻结,0:正常")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@ApiModelProperty(value = "创建人")
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
@ApiModelProperty(value = "修改人")
|
||||
@Schema(description = "修改人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
@@ -61,21 +60,21 @@ public class SysTenantMenu extends Model<SysTenantMenu> {
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@ApiModelProperty(value = "删除标记,1:已删除,0:正常")
|
||||
@Schema(description = "删除标记,1:已删除,0:正常")
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
+24
-25
@@ -21,8 +21,7 @@ package com.pig4cloud.pigx.admin.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
@@ -37,7 +36,7 @@ import java.time.LocalDateTime;
|
||||
* @since 2017-10-29
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "用户")
|
||||
@Schema(description = "用户")
|
||||
public class SysUser implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@@ -46,54 +45,54 @@ public class SysUser implements Serializable {
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(value = "user_id", type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "主键id")
|
||||
@Schema(description = "主键id")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
@ApiModelProperty(value = "用户名")
|
||||
@Schema(description = "用户名")
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
@ApiModelProperty(value = "密码")
|
||||
@Schema(description = "密码")
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 随机盐
|
||||
*/
|
||||
@JsonIgnore
|
||||
@ApiModelProperty(value = "随机盐")
|
||||
@Schema(description = "随机盐")
|
||||
private String salt;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@ApiModelProperty(value = "创建人")
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
@ApiModelProperty(value = "修改人")
|
||||
@Schema(description = "修改人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
@Schema(description = "修改时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
@@ -101,85 +100,85 @@ public class SysUser implements Serializable {
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@ApiModelProperty(value = "删除标记,1:已删除,0:正常")
|
||||
@Schema(description = "删除标记,1:已删除,0:正常")
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 锁定标记
|
||||
*/
|
||||
@ApiModelProperty(value = "锁定标记")
|
||||
@Schema(description = "锁定标记")
|
||||
private String lockFlag;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@ApiModelProperty(value = "手机号")
|
||||
@Schema(description = "手机号")
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 头像
|
||||
*/
|
||||
@ApiModelProperty(value = "头像地址")
|
||||
@Schema(description = "头像地址")
|
||||
private String avatar;
|
||||
|
||||
/**
|
||||
* 部门ID
|
||||
*/
|
||||
@ApiModelProperty(value = "用户所属部门id")
|
||||
@Schema(description = "用户所属部门id")
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
@ApiModelProperty(value = "用户所属租户id")
|
||||
@Schema(description = "用户所属租户id")
|
||||
private Long tenantId;
|
||||
|
||||
/**
|
||||
* 微信openid
|
||||
*/
|
||||
@ApiModelProperty(value = "微信openid")
|
||||
@Schema(description = "微信openid")
|
||||
private String wxOpenid;
|
||||
|
||||
/**
|
||||
* 微信小程序openId
|
||||
*/
|
||||
@ApiModelProperty(value = "微信小程序openid")
|
||||
@Schema(description = "微信小程序openid")
|
||||
private String miniOpenid;
|
||||
|
||||
/**
|
||||
* QQ openid
|
||||
*/
|
||||
@ApiModelProperty(value = "QQ openid")
|
||||
@Schema(description = "QQ openid")
|
||||
private String qqOpenid;
|
||||
|
||||
/**
|
||||
* 码云唯一标识
|
||||
*/
|
||||
@ApiModelProperty(value = "码云唯一标识")
|
||||
@Schema(description = "码云唯一标识")
|
||||
private String giteeLogin;
|
||||
|
||||
/**
|
||||
* 开源中国唯一标识
|
||||
*/
|
||||
@ApiModelProperty(value = "开源中国唯一标识")
|
||||
@Schema(description = "开源中国唯一标识")
|
||||
private String oscId;
|
||||
|
||||
/**
|
||||
* 昵称
|
||||
*/
|
||||
@ApiModelProperty(value = "昵称")
|
||||
@Schema(description = "昵称")
|
||||
private String nickname;
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
@ApiModelProperty(value = "姓名")
|
||||
@Schema(description = "姓名")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
@ApiModelProperty(value = "邮箱")
|
||||
@Schema(description = "邮箱")
|
||||
private String email;
|
||||
|
||||
}
|
||||
+3
-3
@@ -17,7 +17,7 @@
|
||||
package com.pig4cloud.pigx.admin.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@@ -37,13 +37,13 @@ public class SysUserPost extends Model<SysUserPost> {
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
@ApiModelProperty(value = "用户id")
|
||||
@Schema(description = "用户id")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 岗位ID
|
||||
*/
|
||||
@ApiModelProperty(value = "岗位id")
|
||||
@Schema(description = "岗位id")
|
||||
private Long postId;
|
||||
|
||||
}
|
||||
+4
-5
@@ -20,8 +20,7 @@
|
||||
package com.pig4cloud.pigx.admin.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@@ -34,7 +33,7 @@ import lombok.EqualsAndHashCode;
|
||||
* @since 2017-10-29
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "用户角色")
|
||||
@Schema(description = "用户角色")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class SysUserRole extends Model<SysUserRole> {
|
||||
|
||||
@@ -43,13 +42,13 @@ public class SysUserRole extends Model<SysUserRole> {
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
@ApiModelProperty(value = "用户id")
|
||||
@Schema(description = "用户id")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 角色ID
|
||||
*/
|
||||
@ApiModelProperty(value = "角色id")
|
||||
@Schema(description = "角色id")
|
||||
private Long roleId;
|
||||
|
||||
}
|
||||
-1
@@ -23,7 +23,6 @@ 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.cloud.openfeign.SpringQueryMap;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@@ -6,7 +6,6 @@ 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;
|
||||
|
||||
/**
|
||||
|
||||
+9
-10
@@ -17,8 +17,7 @@
|
||||
|
||||
package com.pig4cloud.pigx.admin.api.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
@@ -26,49 +25,49 @@ import lombok.Data;
|
||||
* @date 2018/8/27 前端日志vo
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "前端日志展示对象")
|
||||
@Schema(description = "前端日志展示对象")
|
||||
public class PreLogVO {
|
||||
|
||||
/**
|
||||
* 请求url
|
||||
*/
|
||||
@ApiModelProperty(value = "请求url")
|
||||
@Schema(description = "请求url")
|
||||
private String url;
|
||||
|
||||
/**
|
||||
* 请求耗时
|
||||
*/
|
||||
@ApiModelProperty(value = "请求耗时")
|
||||
@Schema(description = "请求耗时")
|
||||
private String time;
|
||||
|
||||
/**
|
||||
* 请求用户
|
||||
*/
|
||||
@ApiModelProperty(value = "请求用户")
|
||||
@Schema(description = "请求用户")
|
||||
private String user;
|
||||
|
||||
/**
|
||||
* 请求结果
|
||||
*/
|
||||
@ApiModelProperty(value = "请求结果0:成功9:失败")
|
||||
@Schema(description = "请求结果0:成功9:失败")
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 请求传递参数
|
||||
*/
|
||||
@ApiModelProperty(value = "请求传递参数")
|
||||
@Schema(description = "请求传递参数")
|
||||
private String message;
|
||||
|
||||
/**
|
||||
* 异常信息
|
||||
*/
|
||||
@ApiModelProperty(value = "异常信息")
|
||||
@Schema(description = "异常信息")
|
||||
private String stack;
|
||||
|
||||
/**
|
||||
* 日志标题
|
||||
*/
|
||||
@ApiModelProperty(value = "日志标题")
|
||||
@Schema(description = "日志标题")
|
||||
private String info;
|
||||
|
||||
}
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
package com.pig4cloud.pigx.admin.api.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
@@ -25,7 +25,7 @@ import lombok.Data;
|
||||
* @date 2020/2/10
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "前端角色展示对象")
|
||||
@Schema(description = "前端角色展示对象")
|
||||
public class RoleVO {
|
||||
|
||||
/**
|
||||
|
||||
@@ -23,8 +23,7 @@ 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.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
@@ -36,7 +35,7 @@ import java.util.List;
|
||||
* @date 2017/10/29
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "前端用户展示对象")
|
||||
@Schema(description = "前端用户展示对象")
|
||||
public class UserVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@@ -44,98 +43,98 @@ public class UserVO implements Serializable {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@ApiModelProperty(value = "主键")
|
||||
@Schema(description = "主键")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
@ApiModelProperty(value = "用户名")
|
||||
@Schema(description = "用户名")
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
@ApiModelProperty(value = "密码")
|
||||
@Schema(description = "密码")
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 随机盐
|
||||
*/
|
||||
@ApiModelProperty(value = "随机盐")
|
||||
@Schema(description = "随机盐")
|
||||
private String salt;
|
||||
|
||||
/**
|
||||
* 微信openid
|
||||
*/
|
||||
@ApiModelProperty(value = "微信open id")
|
||||
@Schema(description = "微信open id")
|
||||
private String wxOpenid;
|
||||
|
||||
/**
|
||||
* QQ openid
|
||||
*/
|
||||
@ApiModelProperty(value = "qq open id")
|
||||
@Schema(description = "qq open id")
|
||||
private String qqOpenid;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
@Schema(description = "修改时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 0-正常,1-删除
|
||||
*/
|
||||
@ApiModelProperty(value = "删除标记,1:已删除,0:正常")
|
||||
@Schema(description = "删除标记,1:已删除,0:正常")
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 锁定标记
|
||||
*/
|
||||
@ApiModelProperty(value = "锁定标记,0:正常,9:已锁定")
|
||||
@Schema(description = "锁定标记,0:正常,9:已锁定")
|
||||
private String lockFlag;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@Sensitive(type = SensitiveTypeEnum.MOBILE_PHONE)
|
||||
@ApiModelProperty(value = "手机号")
|
||||
@Schema(description = "手机号")
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 头像
|
||||
*/
|
||||
@ApiModelProperty(value = "头像")
|
||||
@Schema(description = "头像")
|
||||
private String avatar;
|
||||
|
||||
/**
|
||||
* 部门ID
|
||||
*/
|
||||
@ApiModelProperty(value = "所属部门")
|
||||
@Schema(description = "所属部门")
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
@ApiModelProperty(value = "所属租户")
|
||||
@Schema(description = "所属租户")
|
||||
private Long tenantId;
|
||||
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
@ApiModelProperty(value = "所属部门名称")
|
||||
@Schema(description = "所属部门名称")
|
||||
private String deptName;
|
||||
|
||||
/**
|
||||
* 角色列表
|
||||
*/
|
||||
@ApiModelProperty(value = "拥有的角色列表")
|
||||
@Schema(description = "拥有的角色列表")
|
||||
private List<SysRole> roleList;
|
||||
|
||||
/**
|
||||
@@ -146,19 +145,19 @@ public class UserVO implements Serializable {
|
||||
/**
|
||||
* 昵称
|
||||
*/
|
||||
@ApiModelProperty(value = "昵称")
|
||||
@Schema(description = "昵称")
|
||||
private String nickname;
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
@ApiModelProperty(value = "姓名")
|
||||
@Schema(description = "姓名")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
@ApiModelProperty(value = "邮箱")
|
||||
@Schema(description = "邮箱")
|
||||
private String email;
|
||||
|
||||
}
|
||||
+2
-2
@@ -21,7 +21,7 @@ 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.EnablePigxSwagger2;
|
||||
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;
|
||||
@@ -32,7 +32,7 @@ import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||
* <p>
|
||||
* 用户统一管理系统
|
||||
*/
|
||||
@EnablePigxSwagger2
|
||||
@EnableOpenApi("admin")
|
||||
@EnablePigxFeignClients
|
||||
@EnablePigxResourceServer
|
||||
@EnableDiscoveryClient
|
||||
|
||||
+5
-2
@@ -4,8 +4,10 @@ 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.annotations.Api;
|
||||
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;
|
||||
@@ -20,7 +22,8 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/connect")
|
||||
@Api(value = "connect", tags = "开放互联")
|
||||
@Tag(description = "connect", name = "开放互联")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class ConnectController {
|
||||
|
||||
private final ConnectService connectService;
|
||||
|
||||
+5
-2
@@ -20,8 +20,10 @@ 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.annotations.Api;
|
||||
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;
|
||||
@@ -36,7 +38,8 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/mobile")
|
||||
@Api(value = "mobile", tags = "手机管理模块")
|
||||
@Tag(description = "mobile", name = "手机管理模块")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class MobileController {
|
||||
|
||||
private final MobileService mobileService;
|
||||
|
||||
+3
@@ -5,8 +5,10 @@ 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 io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
@@ -22,6 +24,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
@RequestMapping("/register")
|
||||
@RequiredArgsConstructor
|
||||
@ConditionalOnProperty(name = "register.user", matchIfMissing = true)
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class RegisterController {
|
||||
|
||||
private final SysUserService userService;
|
||||
|
||||
+5
-2
@@ -27,8 +27,10 @@ import com.pig4cloud.pigx.admin.service.SysOauthClientDetailsService;
|
||||
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.annotations.Api;
|
||||
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.*;
|
||||
|
||||
@@ -45,7 +47,8 @@ import javax.validation.Valid;
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/client")
|
||||
@Api(value = "client", tags = "客户端管理模块")
|
||||
@Tag(description = "client", name = "客户端管理模块")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class SysClientController {
|
||||
|
||||
private final SysOauthClientDetailsService clientDetailsService;
|
||||
|
||||
+5
-4
@@ -22,7 +22,6 @@ package com.pig4cloud.pigx.admin.controller;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysDept;
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysDeptRelation;
|
||||
import com.pig4cloud.pigx.admin.api.vo.CpUserExcelVo;
|
||||
import com.pig4cloud.pigx.admin.api.vo.DeptExcelVo;
|
||||
import com.pig4cloud.pigx.admin.service.SysDeptRelationService;
|
||||
import com.pig4cloud.pigx.admin.service.SysDeptService;
|
||||
@@ -30,9 +29,10 @@ 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.annotations.Api;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import oracle.jdbc.proxy.annotation.Post;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -52,7 +52,8 @@ import java.util.List;
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/dept")
|
||||
@Api(value = "dept", tags = "部门管理模块")
|
||||
@Tag(description = "dept", name = "部门管理模块")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class SysDeptController {
|
||||
|
||||
private final SysDeptRelationService relationService;
|
||||
|
||||
+5
-2
@@ -29,10 +29,12 @@ 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.log.annotation.SysLog;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
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.*;
|
||||
|
||||
@@ -50,7 +52,8 @@ import java.util.List;
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/dict")
|
||||
@Api(value = "dict", tags = "字典管理模块")
|
||||
@Tag(description = "dict", name = "字典管理模块")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class SysDictController {
|
||||
|
||||
private final SysDictService sysDictService;
|
||||
|
||||
+8
-5
@@ -25,11 +25,13 @@ 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.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
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.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;
|
||||
@@ -45,7 +47,8 @@ import javax.servlet.http.HttpServletResponse;
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/sys-file")
|
||||
@Api(value = "sys-file", tags = "文件管理")
|
||||
@Tag(description = "sys-file", name = "文件管理")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class SysFileController {
|
||||
|
||||
private final SysFileService sysFileService;
|
||||
@@ -56,7 +59,7 @@ public class SysFileController {
|
||||
* @param sysFile 文件管理
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询", notes = "分页查询")
|
||||
@Operation(summary = "分页查询", description = "分页查询")
|
||||
@GetMapping("/page")
|
||||
public R getSysFilePage(Page page, SysFile sysFile) {
|
||||
return R.ok(sysFileService.page(page, Wrappers.query(sysFile)));
|
||||
@@ -67,7 +70,7 @@ public class SysFileController {
|
||||
* @param id id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id删除文件管理", notes = "通过id删除文件管理")
|
||||
@Operation(summary = "通过id删除文件管理", description = "通过id删除文件管理")
|
||||
@SysLog("删除文件管理")
|
||||
@DeleteMapping("/{id}")
|
||||
@PreAuthorize("@pms.hasPermission('sys_file_del')")
|
||||
|
||||
+5
-2
@@ -29,8 +29,10 @@ 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.annotations.Api;
|
||||
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.*;
|
||||
|
||||
@@ -48,7 +50,8 @@ import java.util.List;
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/log")
|
||||
@Api(value = "log", tags = "日志管理模块")
|
||||
@Tag(description = "log", name = "日志管理模块")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class SysLogController {
|
||||
|
||||
private final SysLogService sysLogService;
|
||||
|
||||
+5
-2
@@ -24,8 +24,10 @@ 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.annotations.Api;
|
||||
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.*;
|
||||
|
||||
@@ -41,7 +43,8 @@ import java.util.stream.Collectors;
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/menu")
|
||||
@Api(value = "menu", tags = "菜单管理模块")
|
||||
@Tag(description = "menu", name = "菜单管理模块")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class SysMenuController {
|
||||
|
||||
private final SysMenuService sysMenuService;
|
||||
|
||||
+11
-8
@@ -26,9 +26,11 @@ 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.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
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.springframework.http.HttpHeaders;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -44,7 +46,8 @@ import java.util.List;
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/post")
|
||||
@Api(value = "post", tags = "岗位信息表管理")
|
||||
@Tag(description = "post", name = "岗位信息表管理")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class SysPostController {
|
||||
|
||||
private final SysPostService sysPostService;
|
||||
@@ -64,7 +67,7 @@ public class SysPostController {
|
||||
* @param sysPost 岗位信息表
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询", notes = "分页查询")
|
||||
@Operation(summary = "分页查询", description = "分页查询")
|
||||
@GetMapping("/page")
|
||||
@PreAuthorize("@pms.hasPermission('sys_post_view')")
|
||||
public R getSysPostPage(Page page, SysPost sysPost) {
|
||||
@@ -76,7 +79,7 @@ public class SysPostController {
|
||||
* @param postId id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id查询", notes = "通过id查询")
|
||||
@Operation(summary = "通过id查询", description = "通过id查询")
|
||||
@GetMapping("/{postId}")
|
||||
@PreAuthorize("@pms.hasPermission('sys_post_view')")
|
||||
public R getById(@PathVariable("postId") Long postId) {
|
||||
@@ -88,7 +91,7 @@ public class SysPostController {
|
||||
* @param sysPost 岗位信息表
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "新增岗位信息表", notes = "新增岗位信息表")
|
||||
@Operation(summary = "新增岗位信息表", description = "新增岗位信息表")
|
||||
@SysLog("新增岗位信息表")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('sys_post_add')")
|
||||
@@ -101,7 +104,7 @@ public class SysPostController {
|
||||
* @param sysPost 岗位信息表
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "修改岗位信息表", notes = "修改岗位信息表")
|
||||
@Operation(summary = "修改岗位信息表", description = "修改岗位信息表")
|
||||
@SysLog("修改岗位信息表")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('sys_post_edit')")
|
||||
@@ -114,7 +117,7 @@ public class SysPostController {
|
||||
* @param postId id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id删除岗位信息表", notes = "通过id删除岗位信息表")
|
||||
@Operation(summary = "通过id删除岗位信息表", description = "通过id删除岗位信息表")
|
||||
@SysLog("通过id删除岗位信息表")
|
||||
@DeleteMapping("/{postId}")
|
||||
@PreAuthorize("@pms.hasPermission('sys_post_del')")
|
||||
|
||||
+12
-9
@@ -24,9 +24,11 @@ import com.pig4cloud.pigx.admin.service.SysPublicParamService;
|
||||
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.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
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.springframework.http.HttpHeaders;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -39,7 +41,8 @@ import org.springframework.web.bind.annotation.*;
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/param")
|
||||
@Api(value = "param", tags = "公共参数配置")
|
||||
@Tag(description = "param", name = "公共参数配置")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class SysPublicParamController {
|
||||
|
||||
private final SysPublicParamService sysPublicParamService;
|
||||
@@ -50,7 +53,7 @@ public class SysPublicParamController {
|
||||
* @return
|
||||
*/
|
||||
@Inner(value = false)
|
||||
@ApiOperation(value = "查询公共参数值", notes = "根据key查询公共参数值")
|
||||
@Operation(summary = "查询公共参数值", description = "根据key查询公共参数值")
|
||||
@GetMapping("/publicValue/{publicKey}")
|
||||
public R publicKey(@PathVariable("publicKey") String publicKey) {
|
||||
return R.ok(sysPublicParamService.getSysPublicParamKeyToValue(publicKey));
|
||||
@@ -62,7 +65,7 @@ public class SysPublicParamController {
|
||||
* @param sysPublicParam 公共参数
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询", notes = "分页查询")
|
||||
@Operation(summary = "分页查询", description = "分页查询")
|
||||
@GetMapping("/page")
|
||||
public R getSysPublicParamPage(Page page, SysPublicParam sysPublicParam) {
|
||||
return R.ok(sysPublicParamService.page(page, Wrappers.query(sysPublicParam)));
|
||||
@@ -73,7 +76,7 @@ public class SysPublicParamController {
|
||||
* @param publicId id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id查询公共参数", notes = "通过id查询公共参数")
|
||||
@Operation(summary = "通过id查询公共参数", description = "通过id查询公共参数")
|
||||
@GetMapping("/{publicId}")
|
||||
public R getById(@PathVariable("publicId") Long publicId) {
|
||||
return R.ok(sysPublicParamService.getById(publicId));
|
||||
@@ -84,7 +87,7 @@ public class SysPublicParamController {
|
||||
* @param sysPublicParam 公共参数
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "新增公共参数", notes = "新增公共参数")
|
||||
@Operation(summary = "新增公共参数", description = "新增公共参数")
|
||||
@SysLog("新增公共参数")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('admin_syspublicparam_add')")
|
||||
@@ -97,7 +100,7 @@ public class SysPublicParamController {
|
||||
* @param sysPublicParam 公共参数
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "修改公共参数", notes = "修改公共参数")
|
||||
@Operation(summary = "修改公共参数", description = "修改公共参数")
|
||||
@SysLog("修改公共参数")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('admin_syspublicparam_edit')")
|
||||
@@ -110,7 +113,7 @@ public class SysPublicParamController {
|
||||
* @param publicId id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "删除公共参数", notes = "删除公共参数")
|
||||
@Operation(summary = "删除公共参数", description = "删除公共参数")
|
||||
@SysLog("删除公共参数")
|
||||
@DeleteMapping("/{publicId}")
|
||||
@PreAuthorize("@pms.hasPermission('admin_syspublicparam_del')")
|
||||
|
||||
+5
-2
@@ -32,9 +32,11 @@ 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.annotations.Api;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
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.*;
|
||||
@@ -49,7 +51,8 @@ import java.util.List;
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/role")
|
||||
@Api(value = "role", tags = "角色管理模块")
|
||||
@Tag(description = "role", name = "角色管理模块")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class SysRoleController {
|
||||
|
||||
private final SysRoleService sysRoleService;
|
||||
|
||||
+5
-2
@@ -21,8 +21,10 @@ 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.annotations.Api;
|
||||
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.*;
|
||||
|
||||
/**
|
||||
@@ -34,7 +36,8 @@ import org.springframework.web.bind.annotation.*;
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/route")
|
||||
@Api(value = "route", tags = "动态路由管理模块")
|
||||
@Tag(description = "route", name = "动态路由管理模块")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class SysRouteConfController {
|
||||
|
||||
private final SysRouteConfService sysRouteConfService;
|
||||
|
||||
+5
-2
@@ -25,8 +25,10 @@ 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.annotations.Api;
|
||||
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.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -42,7 +44,8 @@ import javax.validation.Valid;
|
||||
@RestController
|
||||
@RequestMapping("/social")
|
||||
@AllArgsConstructor
|
||||
@Api(value = "social", tags = "三方账号管理模块")
|
||||
@Tag(description = "social", name = "三方账号管理模块")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class SysSocialDetailsController {
|
||||
|
||||
private final SysSocialDetailsService sysSocialDetailsService;
|
||||
|
||||
+5
-2
@@ -25,9 +25,11 @@ import com.pig4cloud.pigx.common.core.constant.CacheConstants;
|
||||
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.annotations.Api;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.cache.annotation.CacheEvict;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -44,7 +46,8 @@ import java.util.stream.Collectors;
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/tenant")
|
||||
@Api(value = "tenant", tags = "租户管理")
|
||||
@Tag(description = "tenant", name = "租户管理")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class SysTenantController {
|
||||
|
||||
private final SysTenantService sysTenantService;
|
||||
|
||||
+5
-2
@@ -9,9 +9,11 @@ import com.pig4cloud.pigx.common.core.constant.CommonConstants;
|
||||
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.annotations.Api;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.cache.annotation.CacheEvict;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -20,7 +22,8 @@ import java.util.List;
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/tenant-menu")
|
||||
@Api(value = "tenant", tags = "租户菜单管理")
|
||||
@Tag(description = "tenant", name = "租户菜单管理")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class SysTenantMenuController {
|
||||
|
||||
private final SysTenantMenuService sysTenantMenuService;
|
||||
|
||||
+5
-2
@@ -21,8 +21,10 @@ 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.annotations.Api;
|
||||
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.*;
|
||||
|
||||
@@ -35,7 +37,8 @@ import java.util.Map;
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/token")
|
||||
@Api(value = "token", tags = "令牌管理模块")
|
||||
@Tag(description = "token", name = "令牌管理模块")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class SysTokenController {
|
||||
|
||||
private final RemoteTokenService remoteTokenService;
|
||||
|
||||
Loaded 100 of 165 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user