-
Notifications
You must be signed in to change notification settings - Fork 69
fix: Modify block create and update api #171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
b97583e
fix: update page history bug
lu-yg d30877c
fix: format code and fix style issue
lu-yg 33316bf
Merge branch 'develop' of github.com:lu-yg/tiny-engine-backend-java i…
lu-yg 7fc6507
fix: modify page histiry entity
lu-yg 64be7b4
Merge branch 'opentiny:develop' into develop
lu-yg 24474b8
feat: add code submission rules
lu-yg 9745b66
Merge branch 'develop' of github.com:lu-yg/tiny-engine-backend-java i…
lu-yg 239c624
Merge branch 'opentiny:develop' into develop
lu-yg b77f2f4
fix: modify app schema for test
lu-yg feeb8f7
Merge branch 'develop' of github.com:lu-yg/tiny-engine-backend-java i…
lu-yg 7d52937
fix: modify block group
lu-yg 6559bec
fix: modify t_i18n_entry u_idx_i18n_entity
lu-yg 2a7fc44
Merge branch 'opentiny:develop' into develop
lu-yg 656a4a1
fix: modify t_i18n_entry u_idx_i18n_entity
lu-yg 9de10c5
Merge branch 'develop' of github.com:lu-yg/tiny-engine-backend-java i…
lu-yg e9aa592
fix: modify block update api
lu-yg aff95bb
Merge branch 'opentiny:develop' into develop
lu-yg 02607e4
Merge branch 'develop' of github.com:lu-yg/tiny-engine-backend-java i…
lu-yg ed7483d
fix: Modify code format
lu-yg 48267d6
fix: Modify code format
lu-yg cabb309
fix: Modify code format
lu-yg 83cb48a
fix: Modify code format
lu-yg 486944b
fix: Modify code format
lu-yg 751f331
Merge branch 'opentiny:develop' into develop
lu-yg 48645e1
fix: modify block group api
lu-yg d2f2406
fix: modify block group mapper
lu-yg e24d0ec
Merge branch 'develop' of github.com:lu-yg/tiny-engine-backend-java i…
lu-yg ee8219f
fix: modify workflows
lu-yg efad29b
fix: Update checkstyle.yml
lu-yg 6868add
fix: modify workflows
lu-yg 2e131ff
fix: Modify block create and update api
lu-yg 9c1225a
Merge branch 'opentiny:develop' into develop
lu-yg 8cc8ca5
fix: Modify code format
lu-yg 4ba0818
fix: Modify code format
lu-yg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
164 changes: 164 additions & 0 deletions
164
base/src/main/java/com/tinyengine/it/model/dto/BlockParam.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,164 @@ | ||
| /** | ||
| * Copyright (c) 2023 - present TinyEngine Authors. | ||
| * Copyright (c) 2023 - present Huawei Cloud Computing Technologies Co., Ltd. | ||
| * | ||
| * Use of this source code is governed by an MIT-style license. | ||
| * | ||
| * THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, | ||
| * BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR | ||
| * A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS. | ||
| * | ||
| */ | ||
|
|
||
| package com.tinyengine.it.model.dto; | ||
|
|
||
| import com.baomidou.mybatisplus.annotation.TableField; | ||
| import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler; | ||
| import com.fasterxml.jackson.annotation.JsonProperty; | ||
| import com.tinyengine.it.common.base.BaseEntity; | ||
| import com.tinyengine.it.common.handler.ListTypeHandler; | ||
| import com.tinyengine.it.common.handler.MapTypeHandler; | ||
| import com.tinyengine.it.model.entity.BlockHistory; | ||
| import com.tinyengine.it.model.entity.User; | ||
| import io.swagger.v3.oas.annotations.media.Schema; | ||
| import lombok.Data; | ||
|
|
||
| import java.util.ArrayList; | ||
| import java.util.Arrays; | ||
| import java.util.List; | ||
| import java.util.Map; | ||
|
|
||
| /** | ||
| * <p> | ||
| * 区块param | ||
| * </p> | ||
| * This class serves as a parameter object for block creation and updates, | ||
| * working in conjunction with {@link BlockDto}. While BlockDto represents | ||
| * the full block data model, BlockParam is specifically designed for | ||
| * handling input parameters during block operations. | ||
| * @author lu-yg | ||
| * @since 2024-01-27 | ||
| */ | ||
| @Data | ||
| public class BlockParam extends BaseEntity { | ||
| private static final long serialVersionUID = 1L; | ||
|
|
||
| @Schema(name = "label", description = "区块显示名称,严格大小写格式") | ||
| private String label; | ||
|
|
||
| @Schema(name = "name", description = "区块名称") | ||
| @JsonProperty("name_cn") | ||
| private String name; | ||
|
|
||
| @Schema(name = "framework", description = "技术栈") | ||
| private String framework; | ||
|
|
||
| @TableField(typeHandler = JacksonTypeHandler.class) | ||
| @Schema(name = "assets", description = "构建资源") | ||
| private Map<String, Object> assets; | ||
|
|
||
| @JsonProperty("last_build_info") | ||
| @TableField(typeHandler = JacksonTypeHandler.class) | ||
| @Schema(name = "lastBuildInfo", description = "最新一次构建信息") | ||
| private Map<String, Object> lastBuildInfo; | ||
|
|
||
| @TableField(typeHandler = JacksonTypeHandler.class) | ||
| @Schema(name = "content", description = "区块内容") | ||
| private Map<String, Object> content; | ||
|
|
||
| @Schema(name = "description", description = "描述") | ||
| private String description; | ||
|
|
||
| @Schema(name = "tags", description = "标签") | ||
| @TableField(typeHandler = ListTypeHandler.class) | ||
| private List<String> tags; | ||
|
|
||
| @Schema(name = "latestHistoryId", description = "当前历史记录表ID") | ||
| @JsonProperty("current_history") | ||
| private BlockHistory latestHistoryId; | ||
|
|
||
| @Schema(name = "screenshot", description = "截屏") | ||
| private String screenshot; | ||
|
|
||
| @Schema(name = "path", description = "区块路径") | ||
| private String path; | ||
|
|
||
| @Schema(name = "latestVersion", description = "当前历史记录表最新版本") | ||
| @JsonProperty("version") | ||
| private String latestVersion; | ||
|
|
||
| @Schema(name = "occupierId", description = "当前锁定人id") | ||
| private String occupierId; | ||
|
|
||
| @Schema(name = "isOfficial", description = "是否是官方") | ||
| @JsonProperty("is_official") | ||
| private Boolean isOfficial; | ||
|
|
||
| @Schema(name = "isDefault", description = "是否是默认") | ||
| @JsonProperty("is_default") | ||
| private Boolean isDefault; | ||
|
|
||
| @Schema(name = "tinyReserved", description = "是否是tiny专有") | ||
| @JsonProperty("tiny_reserved") | ||
| private Boolean isTinyReserved; | ||
|
|
||
| @Schema(name = "npmName", description = "npm包名") | ||
| @JsonProperty("npm_name") | ||
| private String npmName; | ||
|
|
||
| @Schema(name = "public", description = "公开状态:0,1,2") | ||
| @JsonProperty("public") | ||
| private Integer publicStatus; | ||
|
|
||
| @Schema(name = "i18n", description = "国际化") | ||
| @TableField(typeHandler = MapTypeHandler.class) | ||
| private Map<String, Map<String, String>> i18n; | ||
|
|
||
| @Schema(name = "appId", description = "创建区块时所在appId") | ||
| @JsonProperty("created_app") | ||
| private Integer appId; | ||
|
|
||
| @Schema(name = "contentBlocks", description = "*设计预留字段用途*") | ||
| @JsonProperty("content_blocks") | ||
| private String contentBlocks; | ||
|
|
||
| @Schema(name = "platformId", description = "设计器ID") | ||
| @JsonProperty("platform_id") | ||
| private Integer platformId; | ||
|
|
||
| @JsonProperty("occupier") | ||
| @Schema(name = "occupierBy", description = "当前锁定人") | ||
| private User occupier; | ||
|
|
||
| @TableField(exist = false) | ||
| @JsonProperty("public_scope_tenants") | ||
| private List<Object> publicScopeTenants = new ArrayList<>(); | ||
|
|
||
| @TableField(exist = false) | ||
| @Schema(name = "groups", type = " List<BlockGroup>", description = "区块分组") | ||
| private List<Integer> groups = new ArrayList<>(); | ||
|
|
||
| @TableField(exist = false) | ||
| @Schema(name = "histories", type = " List<BlockHistory>", description = "区块历史") | ||
| private List<BlockHistory> histories = new ArrayList<>(); | ||
|
|
||
| @TableField(exist = false) | ||
| @JsonProperty("histories_length") | ||
| private Integer historiesLength = 0; | ||
|
|
||
| @TableField(exist = false) | ||
| @JsonProperty("is_published") | ||
| private Boolean isPublished; | ||
|
|
||
| @TableField(exist = false) | ||
| @JsonProperty("current_version") | ||
| private String currentVersion; | ||
| @JsonProperty("public") | ||
| public Integer getPublic() { | ||
| if (this.publicStatus != null && !Arrays.asList(0, 1, 2).contains(this.publicStatus)) { | ||
| throw new IllegalStateException("Invalid public status value: " + this.publicStatus); | ||
| } | ||
| return this.publicStatus; | ||
| } | ||
| } | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.