Skip to content

Commit d94f8d9

Browse files
authored
fix:fix block function (#172)
1 parent 8b8730a commit d94f8d9

File tree

6 files changed

+30
-43
lines changed

6 files changed

+30
-43
lines changed

README.zh-CN.md

Lines changed: 26 additions & 27 deletions
Large diffs are not rendered by default.

app/src/main/resources/sql/mysql/create_all_tables_ddl_v1.mysql.sql

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,6 @@ create table `t_block_history`
237237
`npm_name` varchar(255) comment 'npm包名',
238238
`i18n` longtext NULL COMMENT '国际化',
239239
`content_blocks` longtext comment '设计预留字段',
240-
`block_group_id` int comment '区块分组id',
241240
`tenant_id` varchar(60) not null comment '租户id',
242241
`renter_id` varchar(60) comment '业务租户id',
243242
`site_id` varchar(60) comment '站点id,设计预留字段',

base/src/main/java/com/tinyengine/it/mapper/BlockGroupBlockMapper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public interface BlockGroupBlockMapper extends BaseMapper<BlockGroupBlock> {
9090
List<BlockGroupBlock> findBlockGroupBlockByBlockGroupId(Integer blockGroupId);
9191

9292
/**
93-
* 通过区块分组id查询分组下区块
93+
* 通过区块分组id和区块删除区块与分组关联关系
9494
* @param blockId the block id
9595
* @param groupId the block group id
9696
* @return the list

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,6 @@ public class BlockHistory extends HistoryEntity {
110110
@TableField(typeHandler = MapTypeHandler.class)
111111
private Map<String, Object> i18n;
112112

113-
@Schema(name = "blockGroupId", description = "区块分组关联Id")
114-
private Integer blockGroupId;
115-
116113
@Schema(name = "contentBlocks", description = "*暂不清楚*")
117114
@TableField(typeHandler = MapTypeHandler.class)
118115
private List<BlockVersionDto> contentBlocks;

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ public Result<BlockDto> createBlock(BlockParam blockParam) {
254254
if (groupResult < 1) {
255255
return Result.failed(ExceptionEnum.CM001);
256256
}
257-
return Result.success(blocksResult);
257+
return Result.success(queryBlockById(id));
258258
}
259259

260260
/**
@@ -555,6 +555,7 @@ public Result<BlockDto> deploy(BlockBuildDto blockBuildDto) {
555555
blockParam.setLatestHistoryId(blockHistory);
556556
blockParam.setLatestVersion(blockHistory.getVersion());
557557
blockParam.setId(blockDto.getId());
558+
blockParam.setGroups(null);
558559

559560
return updateBlockById(blockParam, blockDto.getAppId());
560561
} catch (Exception e) {

base/src/main/resources/mappers/BlockHistoryMapper.xml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<sql id="Base_Column_List">
99
id
1010
, ref_id, message, version, label, name, framework, content, assets, build_info, screenshot, path, description,
11-
tags, is_official, public, is_default, tiny_reserved, mode, platform_id, app_id, npm_name, i18n, block_group_id,
11+
tags, is_official, public, is_default, tiny_reserved, mode, platform_id, app_id, npm_name, i18n,
1212
content_blocks, created_by, last_updated_by, created_time, last_updated_time, tenant_id, renter_id, site_id
1313
</sql>
1414

@@ -80,9 +80,6 @@
8080
<if test="i18n!=null and i18n!=''">
8181
AND i18n = #{i18n}
8282
</if>
83-
<if test="blockGroupId!=null and blockGroupId!=''">
84-
AND block_group_id = #{blockGroupId}
85-
</if>
8683
<if test="contentBlocks!=null and contentBlocks!=''">
8784
AND content_blocks = #{contentBlocks}
8885
</if>
@@ -177,9 +174,6 @@
177174
<if test="i18n!=null and i18n!=''">
178175
i18n = #{i18n},
179176
</if>
180-
<if test="blockGroupId!=null and blockGroupId!=''">
181-
block_group_id = #{blockGroupId},
182-
</if>
183177
<if test="contentBlocks!=null and contentBlocks!=''">
184178
content_blocks = #{contentBlocks},
185179
</if>
@@ -232,7 +226,6 @@
232226
<result column="app_id" property="appId"/>
233227
<result column="npm_name" property="npmName"/>
234228
<result column="i18n" property="i18n"/>
235-
<result column="block_group_id" property="blockGroupId"/>
236229
<result column="content_blocks" property="contentBlocks"/>
237230
<result column="created_by" property="createdBy"/>
238231
<result column="last_updated_by" property="lastUpdatedBy"/>
@@ -325,7 +318,6 @@
325318
, app_id
326319
, npm_name
327320
, i18n
328-
, block_group_id
329321
, content_blocks
330322
, created_by
331323
, last_updated_by
@@ -357,7 +349,6 @@
357349
, #{appId}
358350
, #{npmName}
359351
, #{i18n}
360-
, #{blockGroupId}
361352
, #{contentBlocks}
362353
, #{createdBy}
363354
, #{lastUpdatedBy}

0 commit comments

Comments
 (0)