1. 实现集中式的附件统一管理,统一上传统一预览(代码生成器,公共组件,公共附件元数据定义)
2. 实现统一的 DB 字段数据库定义(代码生成器,共用规范检查)
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, "字段名 {} 不存在命名规范定义,请核对字段定义");
|
||||
}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
package cn.iocoder.yudao.module.infra.api.businessfile;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.infra.api.businessfile.dto.BusinessFileSaveReqDTO;
|
||||
import cn.iocoder.yudao.module.infra.controller.admin.businessfile.vo.BusinessFileSaveReqVO;
|
||||
import cn.iocoder.yudao.module.infra.service.businessfile.BusinessFileService;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
/**
|
||||
* 业务附件关联 API 实现
|
||||
* @author chenbowen
|
||||
*/
|
||||
@RestController // 提供 RESTful API 接口,给 Feign 调用
|
||||
@Validated
|
||||
public class BusinessFileApiImpl implements BusinessFileApi {
|
||||
|
||||
@Resource
|
||||
private BusinessFileService businessFileService;
|
||||
|
||||
@Override
|
||||
public CommonResult<List<Long>> batchCreateBusinessFile(List<BusinessFileSaveReqDTO> createReqDTOList) {
|
||||
List<BusinessFileSaveReqVO> createReqVOList = BeanUtils.toBean(createReqDTOList, BusinessFileSaveReqVO.class);
|
||||
List<Long> ids = businessFileService.batchCreateBusinessFile(createReqVOList);
|
||||
return success(ids);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package cn.iocoder.yudao.module.infra.api.stdnms;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.infra.api.stdnms.dto.StdNmsRespDTO;
|
||||
import cn.iocoder.yudao.module.infra.dal.dataobject.stdnms.stdnms.StdNmsDO;
|
||||
import cn.iocoder.yudao.module.infra.stdnms.StdNmsService;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
/**
|
||||
* 数据命名与简写标准 API 实现
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@RestController // 提供 RESTful API 接口,给 Feign 调用
|
||||
@Validated
|
||||
public class StdNmsApiImpl implements StdNmsApi {
|
||||
|
||||
@Resource
|
||||
private StdNmsService stdNmsService;
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> deleteStdNms(Long id) {
|
||||
stdNmsService.deleteStdNms(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> deleteStdNmsList(List<Long> ids) {
|
||||
stdNmsService.deleteStdNmsListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<StdNmsRespDTO> getStdNms(Long id) {
|
||||
StdNmsDO stdNms = stdNmsService.getStdNms(id);
|
||||
return success(BeanUtils.toBean(stdNms, StdNmsRespDTO.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<StdNmsRespDTO> getStdNmsByAbbr(String abbr) {
|
||||
StdNmsDO stdNms = stdNmsService.getStdNmsByAbbr(abbr);
|
||||
return success(BeanUtils.toBean(stdNms, StdNmsRespDTO.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<List<StdNmsRespDTO>> getStdNmsListByAbbrs(Collection<String> abbrs) {
|
||||
List<StdNmsDO> stdNmsList = stdNmsService.getStdNmsListByAbbrs(abbrs);
|
||||
return success(BeanUtils.toBean(stdNmsList, StdNmsRespDTO.class));
|
||||
}
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,35 @@
|
||||
package cn.iocoder.yudao.module.infra.controller.admin.businessfile.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 业务附件关联分页 Request VO")
|
||||
@Data
|
||||
public class BusinessFilePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "业务Id", example = "24322")
|
||||
private Long businessId;
|
||||
|
||||
@Schema(description = "业务编码")
|
||||
private String businessCode;
|
||||
|
||||
@Schema(description = "附件fileId", example = "10125")
|
||||
private Long fileId;
|
||||
|
||||
@Schema(description = "附件名称", example = "李四")
|
||||
private String fileName;
|
||||
|
||||
@Schema(description = "附件来源")
|
||||
private String source;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package cn.iocoder.yudao.module.infra.controller.admin.businessfile.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 业务附件关联 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class BusinessFileRespVO {
|
||||
|
||||
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "29216")
|
||||
@ExcelProperty("主键ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "业务Id", requiredMode = Schema.RequiredMode.REQUIRED, example = "24322")
|
||||
@ExcelProperty("业务Id")
|
||||
private Long businessId;
|
||||
|
||||
@Schema(description = "业务编码")
|
||||
@ExcelProperty("业务编码")
|
||||
private String businessCode;
|
||||
|
||||
@Schema(description = "附件fileId", requiredMode = Schema.RequiredMode.REQUIRED, example = "10125")
|
||||
@ExcelProperty("附件fileId")
|
||||
private Long fileId;
|
||||
|
||||
@Schema(description = "附件名称", example = "李四")
|
||||
@ExcelProperty("附件名称")
|
||||
private String fileName;
|
||||
|
||||
@Schema(description = "附件来源")
|
||||
@ExcelProperty("附件来源")
|
||||
private String source;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user