1. 实现集中式的附件统一管理,统一上传统一预览(代码生成器,公共组件,公共附件元数据定义)
2. 实现统一的 DB 字段数据库定义(代码生成器,共用规范检查)
(cherry picked from commit c2195ee3cf)
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
package cn.iocoder.yudao.module.infra.api.businessfile;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.infra.api.businessfile.dto.BusinessFileSaveReqDTO;
|
||||
import cn.iocoder.yudao.module.infra.enums.ApiConstants;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author chenbowen
|
||||
*/
|
||||
@FeignClient(name = ApiConstants.NAME)
|
||||
@Tag(name = "RPC 服务 - 业务附件关联")
|
||||
public interface BusinessFileApi {
|
||||
|
||||
String PREFIX = ApiConstants.PREFIX + "/business-file";
|
||||
|
||||
@PostMapping(PREFIX + "/batch-create")
|
||||
@Operation(summary = "批量新增业务附件关联")
|
||||
CommonResult<List<Long>> batchCreateBusinessFile(@RequestBody List<BusinessFileSaveReqDTO> createReqDTOList);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package cn.iocoder.yudao.module.infra.api.businessfile.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 业务附件关联保存请求 DTO
|
||||
* @author chenbowen
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class BusinessFileSaveReqDTO implements Serializable {
|
||||
/** 业务Id */
|
||||
private Long businessId;
|
||||
/** 业务编码 */
|
||||
private String businessCode;
|
||||
/** 文件名 */
|
||||
private String fileName;
|
||||
private Long fileId;
|
||||
/** 业务来源 */
|
||||
private String source;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
|
||||
package cn.iocoder.yudao.module.infra.api.stdnms;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.infra.api.stdnms.dto.StdNmsRespDTO;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Parameters;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
@FeignClient(name = "stdnms-api") // 可根据实际服务名调整
|
||||
@Tag(name = "RPC 服务 - 数据命名与简写标准")
|
||||
public interface StdNmsApi {
|
||||
|
||||
String PREFIX = "/api/stdnms";
|
||||
|
||||
@DeleteMapping(PREFIX + "/delete")
|
||||
@Operation(summary = "删除数据命名与简写标准")
|
||||
@Parameters({
|
||||
@Parameter(name = "id", description = "主键ID", example = "1001", required = true)
|
||||
})
|
||||
CommonResult<Boolean> deleteStdNms(@RequestParam("id") Long id);
|
||||
|
||||
@DeleteMapping(PREFIX + "/delete-batch")
|
||||
@Operation(summary = "批量删除数据命名与简写标准")
|
||||
@Parameters({
|
||||
@Parameter(name = "ids", description = "主键ID集合", example = "[1001,1002]", required = true)
|
||||
})
|
||||
CommonResult<Boolean> deleteStdNmsList(@RequestParam("ids") List<Long> ids);
|
||||
|
||||
@GetMapping(PREFIX + "/get")
|
||||
@Operation(summary = "根据主键获取数据命名与简写标准")
|
||||
@Parameters({
|
||||
@Parameter(name = "id", description = "主键ID", example = "1001", required = true)
|
||||
})
|
||||
CommonResult<StdNmsRespDTO> getStdNms(@RequestParam("id") Long id);
|
||||
|
||||
@GetMapping(PREFIX + "/get-by-abbr")
|
||||
@Operation(summary = "根据缩写获取数据命名与简写标准")
|
||||
@Parameters({
|
||||
@Parameter(name = "abbr", description = "简写/缩写", example = "devNm", required = true)
|
||||
})
|
||||
CommonResult<StdNmsRespDTO> getStdNmsByAbbr(@RequestParam("abbr") String abbr);
|
||||
|
||||
@GetMapping(PREFIX + "/list-by-abbrs")
|
||||
@Operation(summary = "根据缩写列表查询数据命名与简写标准")
|
||||
@Parameters({
|
||||
@Parameter(name = "abbrs", description = "简写/缩写集合", example = "[devNm,devType]", required = true)
|
||||
})
|
||||
CommonResult<List<StdNmsRespDTO>> getStdNmsListByAbbrs(@RequestParam("abbrs") Collection<String> abbrs);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package cn.iocoder.yudao.module.infra.api.stdnms.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Schema(description = "数据命名与简写标准响应 DTO")
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class StdNmsRespDTO implements Serializable {
|
||||
|
||||
@Schema(description = "主键ID", example = "1001")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "名称", example = "设备名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "简写/缩写", example = "devNm")
|
||||
private String abbr;
|
||||
|
||||
// 可根据实际需求补充其他字段
|
||||
}
|
||||
@@ -79,4 +79,11 @@ public interface ErrorCodeConstants {
|
||||
ErrorCode DEMO03_GRADE_NOT_EXISTS = new ErrorCode(1_001_201_009, "学生班级不存在");
|
||||
ErrorCode DEMO03_GRADE_EXISTS = new ErrorCode(1_001_201_010, "学生班级已存在");
|
||||
|
||||
// ========== 业务附件关联 ==========
|
||||
ErrorCode BUSINESS_FILE_NOT_EXISTS = new ErrorCode(1_002_201_010, "业务附件关联不存在");
|
||||
|
||||
// ========== 数据命名与简写标准 ==========
|
||||
ErrorCode STD_NMS_NOT_EXISTS = new ErrorCode(1_002_030_000, "数据命名与简写标准不存在");
|
||||
|
||||
ErrorCode STD_ABBR_NOT_EXISTS = new ErrorCode(1_002_030_001, "字段名 {} 不存在命名规范定义,请核对字段定义");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user