Skip to content

Commit 3560053

Browse files
authored
fix: Modify bundle split (opentiny#210)
fix: Modify bundle split
1 parent 1e47ff8 commit 3560053

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed

base/src/main/java/com/tinyengine/it/model/entity/User.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
package com.tinyengine.it.model.entity;
1414

15+
import com.baomidou.mybatisplus.annotation.TableField;
1516
import com.baomidou.mybatisplus.annotation.TableName;
1617
import com.tinyengine.it.common.base.BaseEntity;
1718

@@ -38,6 +39,7 @@ public class User extends BaseEntity {
3839
@Schema(name = "email", description = "邮箱")
3940
private String email;
4041

42+
@TableField("enable")
4143
@Schema(name = "enable", description = "账号是否可用")
4244
private Boolean isEnable;
4345

base/src/main/java/com/tinyengine/it/service/material/ComponentService.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
package com.tinyengine.it.service.material;
1414

1515
import com.tinyengine.it.common.base.Result;
16+
import com.tinyengine.it.model.dto.BundleDto;
1617
import com.tinyengine.it.model.dto.BundleResultDto;
1718
import com.tinyengine.it.model.dto.CustComponentDto;
1819
import com.tinyengine.it.model.dto.FileResult;
@@ -92,6 +93,22 @@ public interface ComponentService {
9293
*/
9394
Result<BundleResultDto> bundleSplit(MultipartFile file);
9495

96+
/**
97+
* 解析bundleDto为component集合
98+
*
99+
* @param bundleDto bundleDto
100+
* @return BundleResultDto BundleResultDto
101+
*/
102+
Result<BundleResultDto> parseBundle(BundleDto bundleDto);
103+
104+
/**
105+
* 批量创建/更新组件
106+
*
107+
* @param componentList componentList
108+
* @return FileResult FileResult
109+
*/
110+
Result<FileResult> bulkCreate(List<Component> componentList);
111+
95112
/**
96113
* 批量创建component
97114
*

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,17 @@ public Result<BundleResultDto> bundleSplit(MultipartFile file) {
195195
data = (Map<String, Object>) dataObj;
196196
}
197197
BundleDto bundleDto = BeanUtil.mapToBean(data, BundleDto.class, true);
198+
return this.parseBundle(bundleDto);
199+
}
198200

201+
/**
202+
* 解析bundleDto为component集合
203+
*
204+
* @param bundleDto bundleDto
205+
* @return BundleResultDto BundleResultDto
206+
*/
207+
@Override
208+
public Result<BundleResultDto> parseBundle(BundleDto bundleDto) {
199209
List<Map<String, Object>> components = bundleDto.getMaterials().getComponents();
200210
List<Child> snippets = bundleDto.getMaterials().getSnippets();
201211

0 commit comments

Comments
 (0)