feat: add enum dto APIs and batch save

This commit is contained in:
2026-05-20 23:25:30 +08:00
parent 16f9a325d7
commit 7188dd49b5
20 changed files with 571 additions and 24 deletions

View File

@@ -0,0 +1,40 @@
package com.bruce.common.dto.request;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.List;
@Data
@Schema(description = "系统枚举批量保存请求")
public class SysEnumBatchSaveRequest {
@Schema(description = "模块目录")
private String catalog;
@Schema(description = "枚举类型")
private String type;
@Schema(description = "枚举项")
private List<Item> items;
@Data
@Schema(description = "系统枚举批量保存项")
public static class Item {
@Schema(description = "枚举名称")
private String name;
@Schema(description = "整型值")
private Integer value;
@Schema(description = "字符串值")
private String strvalue;
@Schema(description = "排序")
private Integer sort;
@Schema(description = "备注")
private String remark;
}
}

View File

@@ -0,0 +1,18 @@
package com.bruce.common.dto.request;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Data
@Schema(description = "系统枚举管理查询请求")
public class SysEnumManageQueryRequest {
@Schema(description = "模块目录")
private String catalog;
@Schema(description = "枚举类型")
private String type;
@Schema(description = "关键字,匹配目录、类型、名称、字符串值或备注")
private String keyword;
}

View File

@@ -0,0 +1,53 @@
package com.bruce.common.dto.response;
import com.bruce.common.domain.entity.SysAttachment;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.beans.BeanUtils;
@Data
@Schema(description = "系统附件响应")
public class SysAttachmentResponse {
@Schema(description = "主键ID")
private Long id;
@Schema(description = "来源业务类型")
private String sourceType;
@Schema(description = "来源业务ID")
private Long sourceId;
@Schema(description = "原始文件名")
private String originalName;
@Schema(description = "存储文件名")
private String fileName;
@Schema(description = "文件后缀")
private String fileSuffix;
@Schema(description = "文件MIME类型")
private String contentType;
@Schema(description = "文件大小(字节)")
private Long fileSize;
@Schema(description = "存储类型")
private String storageType;
@Schema(description = "文件访问地址")
private String fileUrl;
@Schema(description = "备注")
private String remark;
public static SysAttachmentResponse fromEntity(SysAttachment entity) {
if (entity == null) {
return null;
}
SysAttachmentResponse response = new SysAttachmentResponse();
BeanUtils.copyProperties(entity, response);
return response;
}
}

View File

@@ -0,0 +1,44 @@
package com.bruce.common.dto.response;
import com.bruce.common.domain.entity.SysEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.beans.BeanUtils;
@Data
@Schema(description = "系统枚举响应")
public class SysEnumResponse {
@Schema(description = "主键ID")
private Long id;
@Schema(description = "模块目录")
private String catalog;
@Schema(description = "枚举类型")
private String type;
@Schema(description = "枚举名称")
private String name;
@Schema(description = "整型值")
private Integer value;
@Schema(description = "字符串值")
private String strvalue;
@Schema(description = "排序")
private Integer sort;
@Schema(description = "备注")
private String remark;
public static SysEnumResponse fromEntity(SysEnum entity) {
if (entity == null) {
return null;
}
SysEnumResponse response = new SysEnumResponse();
BeanUtils.copyProperties(entity, response);
return response;
}
}