Skip to content

Commit fb123c6

Browse files
committed
feat: component library api
1 parent 8373484 commit fb123c6

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

base/src/main/java/com/tinyengine/it/controller/ComponentController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public Result<BundleResultDto> bundleSplit(@RequestParam MultipartFile file) {
104104
* @return result
105105
*/
106106
@Operation(summary = "批量创建自定义组件", description = "批量创建自定义组件", parameters = {
107-
@Parameter(name = "file", description = "文件参数对象")}, responses = {
107+
@Parameter(name = "custComponentDto", description = "自定义组件对象")}, responses = {
108108
@ApiResponse(responseCode = "200", description = "返回信息",
109109
content = @Content(mediaType = "application/json", schema = @Schema())),
110110
@ApiResponse(responseCode = "400", description = "请求失败")})

base/src/main/java/com/tinyengine/it/service/material/impl/ComponentLibraryServiceImpl.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,14 @@ public List<ComponentLibrary> queryComponentLibraryByCondition(ComponentLibrary
7878
*/
7979
@Override
8080
public Result<ComponentLibrary> deleteComponentLibraryById(@Param("id") Integer id) {
81+
Result<ComponentLibrary> result = this.queryComponentLibraryById(id);
82+
if(result.getData() == null || result.getData().getId() == null){
83+
return Result.success();
84+
}
8185
int deleteResult = componentLibraryMapper.deleteComponentLibraryById(id);
8286
if(deleteResult != 1){
8387
return Result.failed(ExceptionEnum.CM008);
8488
}
85-
Result<ComponentLibrary> result = this.queryComponentLibraryById(id);
8689
return result;
8790

8891
}

0 commit comments

Comments
 (0)