feat: 接口字段补 @Schema 中文说明 + 精简冗余字段 + 接入 Prometheus 监控
- 全部 VO 字段补 @Schema(description) 中文说明,在线文档字段可读 - AppEpisodeVO 精简 duration/isFree 冗余字段(保留 durationSec/locked) - framework 引入 actuator + micrometer-registry-prometheus - SecurityConfig 放行 /actuator/prometheus,双服务配置 management 暴露指标 - 新增 deploy/docker-compose.yml + prometheus.yml 监控部署配置
This commit is contained in:
1 parent
efe8af6c9b
commit
5f9483a86c
140 files changed
+1357
-19
No files matched your search
+6
@@ -2,6 +2,7 @@
|
||||
|
||||
package com.fruitshorts.system.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.fruitshorts.common.pojo.PageParam;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
@@ -10,7 +11,12 @@ import lombok.EqualsAndHashCode;
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class AdminUserPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "用户名")
|
||||
private String username;
|
||||
|
||||
@Schema(description = "角色ID")
|
||||
private Long roleId;
|
||||
|
||||
@Schema(description = "状态")
|
||||
private Integer status;
|
||||
}
|
||||
+22
@@ -2,6 +2,7 @@
|
||||
|
||||
package com.fruitshorts.system.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -10,20 +11,41 @@ import java.time.LocalDateTime;
|
||||
@Data
|
||||
public class AdminUserRespVO {
|
||||
|
||||
@Schema(description = "ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "用户名")
|
||||
private String username;
|
||||
|
||||
@Schema(description = "姓名")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "角色ID")
|
||||
private Long roleId;
|
||||
|
||||
@Schema(description = "角色")
|
||||
private String role;
|
||||
|
||||
@Schema(description = "IP白名单")
|
||||
private String ipWhitelist;
|
||||
|
||||
@Schema(description = "状态")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "状态文本")
|
||||
private String statusText;
|
||||
|
||||
@Schema(description = "两步验证")
|
||||
private Integer twoFactor;
|
||||
|
||||
@Schema(description = "两步验证文本")
|
||||
private String twoFactorText;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "最后登录时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime lastLogin;
|
||||
}
|
||||
+10
@@ -2,6 +2,7 @@
|
||||
|
||||
package com.fruitshorts.system.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
@@ -10,17 +11,26 @@ import lombok.Data;
|
||||
public class AdminUserSaveReqVO {
|
||||
|
||||
/** 新增时必填,编辑时忽略 */
|
||||
@Schema(description = "用户名")
|
||||
private String username;
|
||||
|
||||
@Schema(description = "密码")
|
||||
private String password;
|
||||
|
||||
@Schema(description = "姓名")
|
||||
@NotBlank(message = "请输入姓名")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "角色ID")
|
||||
@NotNull(message = "请选择角色")
|
||||
private Long roleId;
|
||||
|
||||
@Schema(description = "IP白名单")
|
||||
private String ipWhitelist;
|
||||
|
||||
@Schema(description = "状态")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "两步验证")
|
||||
private Integer twoFactor;
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
package com.fruitshorts.system.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -9,7 +10,12 @@ import lombok.Data;
|
||||
@AllArgsConstructor
|
||||
public class ConfigItemVO {
|
||||
|
||||
@Schema(description = "键")
|
||||
private String key;
|
||||
|
||||
@Schema(description = "值")
|
||||
private String value;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
}
|
||||
@@ -2,15 +2,18 @@
|
||||
|
||||
package com.fruitshorts.system.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class LoginReqVO {
|
||||
|
||||
@Schema(description = "用户名")
|
||||
@NotBlank(message = "请输入账号")
|
||||
private String username;
|
||||
|
||||
@Schema(description = "密码")
|
||||
@NotBlank(message = "请输入密码")
|
||||
private String password;
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
package com.fruitshorts.system.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -11,16 +12,35 @@ import java.util.List;
|
||||
@Builder
|
||||
public class LoginRespVO {
|
||||
|
||||
@Schema(description = "令牌")
|
||||
private String token;
|
||||
|
||||
@Schema(description = "用户ID")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "用户名")
|
||||
private String username;
|
||||
|
||||
@Schema(description = "姓名")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "头像")
|
||||
private String avatar;
|
||||
|
||||
/** 角色编码,如 super_admin */
|
||||
@Schema(description = "角色编码")
|
||||
private String role;
|
||||
|
||||
@Schema(description = "角色名称")
|
||||
private String roleName;
|
||||
|
||||
@Schema(description = "角色ID")
|
||||
private Long roleId;
|
||||
|
||||
@Schema(description = "权限码列表")
|
||||
private List<String> permissions;
|
||||
|
||||
/** 首登强制改密:前端据此弹出改密对话框 */
|
||||
@Schema(description = "是否必须修改密码")
|
||||
private Boolean mustChangePassword;
|
||||
}
|
||||
@@ -2,25 +2,47 @@
|
||||
|
||||
package com.fruitshorts.system.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class MenuSaveReqVO {
|
||||
|
||||
@Schema(description = "父级ID")
|
||||
private Long parentId;
|
||||
|
||||
@Schema(description = "菜单名称")
|
||||
@NotBlank(message = "请输入菜单名称")
|
||||
private String title;
|
||||
|
||||
@Schema(description = "路由路径")
|
||||
private String routePath;
|
||||
|
||||
@Schema(description = "路由名称")
|
||||
private String routeName;
|
||||
|
||||
@Schema(description = "组件")
|
||||
private String component;
|
||||
|
||||
@Schema(description = "重定向地址")
|
||||
private String redirect;
|
||||
|
||||
@Schema(description = "图标")
|
||||
private String icon;
|
||||
|
||||
@Schema(description = "权限编码")
|
||||
private String permissionCode;
|
||||
|
||||
@Schema(description = "类型")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "排序")
|
||||
private Integer sort;
|
||||
|
||||
@Schema(description = "是否可见")
|
||||
private Integer visible;
|
||||
|
||||
@Schema(description = "状态")
|
||||
private Integer status;
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
package com.fruitshorts.system.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
@@ -14,31 +15,68 @@ import java.util.List;
|
||||
@Data
|
||||
public class MenuVO {
|
||||
|
||||
@Schema(description = "ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "父级ID")
|
||||
private Long parentId;
|
||||
|
||||
@Schema(description = "路由路径")
|
||||
private String path;
|
||||
|
||||
@Schema(description = "路由名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "组件")
|
||||
private String component;
|
||||
|
||||
@Schema(description = "重定向地址")
|
||||
private String redirect;
|
||||
|
||||
@Schema(description = "图标")
|
||||
private String icon;
|
||||
|
||||
/** CATALOG / MENU / BUTTON */
|
||||
@Schema(description = "类型")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "权限编码")
|
||||
private String permissionCode;
|
||||
|
||||
@Schema(description = "排序")
|
||||
private Integer sort;
|
||||
|
||||
@Schema(description = "是否可见")
|
||||
private Integer visible;
|
||||
|
||||
@Schema(description = "状态")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "元数据")
|
||||
private Meta meta;
|
||||
|
||||
@Schema(description = "子菜单列表")
|
||||
private List<MenuVO> children;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public static class Meta {
|
||||
|
||||
@Schema(description = "标题")
|
||||
private String title;
|
||||
|
||||
@Schema(description = "图标")
|
||||
private String icon;
|
||||
|
||||
@Schema(description = "是否总是显示")
|
||||
private Boolean alwaysShow;
|
||||
|
||||
@Schema(description = "是否固定")
|
||||
private Boolean affix;
|
||||
|
||||
/** visible=0 的菜单:路由要注册(详情页靠它),但不进侧边栏 */
|
||||
@Schema(description = "是否隐藏")
|
||||
private Boolean hidden;
|
||||
}
|
||||
}
|
||||
+10
@@ -2,6 +2,7 @@
|
||||
|
||||
package com.fruitshorts.system.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.fruitshorts.common.pojo.PageParam;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
@@ -14,17 +15,26 @@ import java.time.LocalDateTime;
|
||||
public class OperationLogPageReqVO extends PageParam {
|
||||
|
||||
/** 操作人账号,模糊匹配 */
|
||||
@Schema(description = "操作人账号")
|
||||
private String username;
|
||||
|
||||
/** 模块,精确匹配 */
|
||||
@Schema(description = "模块")
|
||||
private String module;
|
||||
|
||||
/** 动作,模糊匹配 */
|
||||
@Schema(description = "动作")
|
||||
private String action;
|
||||
|
||||
/** SUCCESS / FAIL */
|
||||
@Schema(description = "状态")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "开始时间")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime startTime;
|
||||
|
||||
@Schema(description = "结束时间")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime endTime;
|
||||
}
|
||||
+31
@@ -2,6 +2,7 @@
|
||||
|
||||
package com.fruitshorts.system.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -10,22 +11,52 @@ import java.time.LocalDateTime;
|
||||
@Data
|
||||
public class OperationLogRespVO {
|
||||
|
||||
@Schema(description = "ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "用户ID")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "用户名")
|
||||
private String username;
|
||||
|
||||
@Schema(description = "模块")
|
||||
private String module;
|
||||
|
||||
@Schema(description = "操作")
|
||||
private String action;
|
||||
|
||||
@Schema(description = "请求方法")
|
||||
private String requestMethod;
|
||||
|
||||
@Schema(description = "请求地址")
|
||||
private String requestUrl;
|
||||
|
||||
@Schema(description = "请求参数")
|
||||
private String requestParams;
|
||||
|
||||
@Schema(description = "请求体")
|
||||
private String requestBody;
|
||||
|
||||
@Schema(description = "响应体")
|
||||
private String responseBody;
|
||||
|
||||
@Schema(description = "状态")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "状态文本")
|
||||
private String statusText;
|
||||
|
||||
@Schema(description = "错误信息")
|
||||
private String errorMsg;
|
||||
|
||||
@Schema(description = "耗时(毫秒)")
|
||||
private Integer durationMs;
|
||||
|
||||
@Schema(description = "IP地址")
|
||||
private String ip;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime createdAt;
|
||||
}
|
||||
+3
@@ -2,6 +2,7 @@
|
||||
|
||||
package com.fruitshorts.system.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.Data;
|
||||
@@ -9,9 +10,11 @@ import lombok.Data;
|
||||
@Data
|
||||
public class PasswordChangeReqVO {
|
||||
|
||||
@Schema(description = "原密码")
|
||||
@NotBlank(message = "请输入原密码")
|
||||
private String oldPassword;
|
||||
|
||||
@Schema(description = "新密码")
|
||||
@NotBlank(message = "请输入新密码")
|
||||
@Size(min = 6, max = 32, message = "新密码长度需在 6-32 位之间")
|
||||
private String newPassword;
|
||||
|
||||
+8
@@ -2,6 +2,7 @@
|
||||
|
||||
package com.fruitshorts.system.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -11,13 +12,20 @@ import java.util.List;
|
||||
@AllArgsConstructor
|
||||
public class PermissionGroupVO {
|
||||
|
||||
@Schema(description = "名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "权限项列表")
|
||||
private List<Item> items;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
public static class Item {
|
||||
|
||||
@Schema(description = "编码")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "名称")
|
||||
private String name;
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
package com.fruitshorts.system.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -14,15 +15,32 @@ import java.util.List;
|
||||
@Builder
|
||||
public class ProfileRespVO {
|
||||
|
||||
@Schema(description = "用户ID")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "用户名")
|
||||
private String username;
|
||||
|
||||
@Schema(description = "姓名")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "头像")
|
||||
private String avatar;
|
||||
|
||||
/** 角色编码,如 super_admin */
|
||||
@Schema(description = "角色编码")
|
||||
private String role;
|
||||
|
||||
@Schema(description = "角色名称")
|
||||
private String roleName;
|
||||
|
||||
@Schema(description = "角色ID")
|
||||
private Long roleId;
|
||||
|
||||
@Schema(description = "权限码列表")
|
||||
private List<String> permissions;
|
||||
|
||||
/** 首登强制改密:刷新页面后仍然要能拦住 */
|
||||
@Schema(description = "是否必须修改密码")
|
||||
private Boolean mustChangePassword;
|
||||
}
|
||||
+8
@@ -2,13 +2,21 @@
|
||||
|
||||
package com.fruitshorts.system.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class RoleCategoryRespVO {
|
||||
|
||||
@Schema(description = "ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "描述")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "角色数量")
|
||||
private Integer roleCount;
|
||||
}
|
||||
+3
@@ -2,14 +2,17 @@
|
||||
|
||||
package com.fruitshorts.system.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class RoleCategorySaveReqVO {
|
||||
|
||||
@Schema(description = "分类名称")
|
||||
@NotBlank(message = "请输入分类名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "描述")
|
||||
private String description;
|
||||
}
|
||||
+2
@@ -2,6 +2,7 @@
|
||||
|
||||
package com.fruitshorts.system.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -10,6 +11,7 @@ import java.util.List;
|
||||
@Data
|
||||
public class RolePermissionSaveReqVO {
|
||||
|
||||
@Schema(description = "权限码列表")
|
||||
@NotNull(message = "权限不能为空")
|
||||
private List<String> permissions;
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
package com.fruitshorts.system.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
@@ -9,16 +10,39 @@ import java.util.List;
|
||||
@Data
|
||||
public class RoleRespVO {
|
||||
|
||||
@Schema(description = "ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "编码")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "描述")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "分类ID")
|
||||
private Long categoryId;
|
||||
|
||||
@Schema(description = "分类")
|
||||
private String category;
|
||||
|
||||
@Schema(description = "级别")
|
||||
private Integer level;
|
||||
|
||||
@Schema(description = "状态")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "状态文本")
|
||||
private String statusText;
|
||||
|
||||
@Schema(description = "是否内置")
|
||||
private Boolean builtin;
|
||||
|
||||
@Schema(description = "成员数量")
|
||||
private Integer memberCount;
|
||||
|
||||
@Schema(description = "权限码列表")
|
||||
private List<String> permissions;
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
package com.fruitshorts.system.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -10,17 +11,27 @@ import java.util.List;
|
||||
@Data
|
||||
public class RoleSaveReqVO {
|
||||
|
||||
@Schema(description = "角色名称")
|
||||
@NotBlank(message = "请输入角色名称")
|
||||
private String name;
|
||||
|
||||
/** 不传时按名称生成 */
|
||||
@Schema(description = "角色编码")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "描述")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "分类ID")
|
||||
private Long categoryId;
|
||||
|
||||
@Schema(description = "级别")
|
||||
private Integer level;
|
||||
|
||||
@Schema(description = "状态")
|
||||
private Integer status;
|
||||
|
||||
/** 角色权限码,传则整体覆盖 */
|
||||
@Schema(description = "角色权限码列表")
|
||||
private List<String> permissions;
|
||||
}
|
||||
Reference in new issue
Block a user