Skip to content
Merged
Show file tree
Hide file tree
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 Dec 26, 2024
d30877c
fix: format code and fix style issue
lu-yg Jan 7, 2025
33316bf
Merge branch 'develop' of github.com:lu-yg/tiny-engine-backend-java i…
lu-yg Jan 7, 2025
7fc6507
fix: modify page histiry entity
lu-yg Jan 7, 2025
64be7b4
Merge branch 'opentiny:develop' into develop
lu-yg Jan 9, 2025
24474b8
feat: add code submission rules
lu-yg Jan 9, 2025
9745b66
Merge branch 'develop' of github.com:lu-yg/tiny-engine-backend-java i…
lu-yg Jan 9, 2025
239c624
Merge branch 'opentiny:develop' into develop
lu-yg Jan 9, 2025
b77f2f4
fix: modify app schema for test
lu-yg Jan 9, 2025
feeb8f7
Merge branch 'develop' of github.com:lu-yg/tiny-engine-backend-java i…
lu-yg Jan 9, 2025
7d52937
fix: modify block group
lu-yg Jan 22, 2025
6559bec
fix: modify t_i18n_entry u_idx_i18n_entity
lu-yg Jan 22, 2025
2a7fc44
Merge branch 'opentiny:develop' into develop
lu-yg Jan 22, 2025
656a4a1
fix: modify t_i18n_entry u_idx_i18n_entity
lu-yg Jan 22, 2025
9de10c5
Merge branch 'develop' of github.com:lu-yg/tiny-engine-backend-java i…
lu-yg Jan 22, 2025
e9aa592
fix: modify block update api
lu-yg Jan 23, 2025
aff95bb
Merge branch 'opentiny:develop' into develop
lu-yg Jan 23, 2025
02607e4
Merge branch 'develop' of github.com:lu-yg/tiny-engine-backend-java i…
lu-yg Jan 23, 2025
ed7483d
fix: Modify code format
lu-yg Jan 23, 2025
48267d6
fix: Modify code format
lu-yg Jan 23, 2025
cabb309
fix: Modify code format
lu-yg Jan 23, 2025
83cb48a
fix: Modify code format
lu-yg Jan 24, 2025
486944b
fix: Modify code format
lu-yg Jan 24, 2025
751f331
Merge branch 'opentiny:develop' into develop
lu-yg Jan 26, 2025
48645e1
fix: modify block group api
lu-yg Jan 26, 2025
d2f2406
fix: modify block group mapper
lu-yg Jan 26, 2025
e24d0ec
Merge branch 'develop' of github.com:lu-yg/tiny-engine-backend-java i…
lu-yg Jan 26, 2025
ee8219f
fix: modify workflows
lu-yg Jan 26, 2025
efad29b
fix: Update checkstyle.yml
lu-yg Jan 26, 2025
6868add
fix: modify workflows
lu-yg Jan 26, 2025
2e131ff
fix: Modify block create and update api
lu-yg Jan 27, 2025
9c1225a
Merge branch 'opentiny:develop' into develop
lu-yg Jan 27, 2025
8cc8ca5
fix: Modify code format
lu-yg Jan 27, 2025
4ba0818
fix: Modify code format
lu-yg Jan 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 5 additions & 13 deletions .github/workflows/checkstyle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,16 @@ jobs:
uses: actions/setup-java@v4
with:
java-version: '8.*'
distribution: 'temurin'

# 安装 Checkstyle(如果你是用 Maven 或 Gradle
- name: Install dependencies
# 安装依赖并运行 Checkstyle(如果是 Maven 项目
- name: Install dependencies and run Checkstyle
run: |
./mvnw install # 如果是 Maven 项目
# 或者
# ./gradlew build # 如果是 Gradle 项目

# 运行 Checkstyle
- name: Run Checkstyle
run: |
./mvnw checkstyle:check # 如果是 Maven 项目
# 或者
# ./gradlew check # 如果是 Gradle 项目
mvn checkstyle:check

# 查看 Checkstyle 检查报告
- name: Upload Checkstyle report
uses: actions/upload-artifact@v4
with:
name: checkstyle-report
path: target/checkstyle-result.xml # 如果是 Maven 项目
path: target/checkstyle-result.xml # 这个路径应该是 Maven 生成的检查报告路径
35 changes: 0 additions & 35 deletions .github/workflows/maven.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ create table `t_block`
`platform_id` int not null comment '设计器id',
`app_id` int not null comment '创建区块时所在appid',
`content_blocks` longtext comment '设计预留字段',
`block_group_id` int comment '区块分组id',
`tenant_id` varchar(60) not null comment '租户id',
`renter_id` varchar(60) comment '业务租户id',
`site_id` varchar(60) comment '站点id,设计预留字段',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import com.tinyengine.it.mapper.TenantMapper;
import com.tinyengine.it.model.dto.BlockBuildDto;
import com.tinyengine.it.model.dto.BlockDto;
import com.tinyengine.it.model.dto.BlockParam;
import com.tinyengine.it.model.dto.BlockParamDto;
import com.tinyengine.it.model.dto.NotGroupDto;
import com.tinyengine.it.model.entity.Block;
Expand Down Expand Up @@ -150,13 +151,13 @@ public Result<BlockDto> getBlocksById(@PathVariable Integer id) {
/**
* 创建block
*
* @param blockDto the block dto
* @param blockParam the blockParam
* @return BlockDto
*/
@Operation(summary = "创建block",
description = "创建block",
parameters = {
@Parameter(name = "blockDto", description = "入参对象")
@Parameter(name = "blockParam", description = "入参对象")
},
responses = {
@ApiResponse(responseCode = "200", description = "返回信息",
Expand All @@ -166,8 +167,8 @@ public Result<BlockDto> getBlocksById(@PathVariable Integer id) {
)
@SystemControllerLog(description = "区块创建api")
@PostMapping("/block/create")
public Result<BlockDto> createBlocks(@Valid @RequestBody BlockDto blockDto) {
return blockService.createBlock(blockDto);
public Result<BlockDto> createBlocks(@Valid @RequestBody BlockParam blockParam) {
return blockService.createBlock(blockParam);
}


Expand Down Expand Up @@ -268,7 +269,7 @@ public Result<List<String>> allTags() {
@GetMapping("/block/notgroup/{groupId}")
public Result<List<BlockDto>> findBlocksNotInGroup(@PathVariable Integer groupId,
@RequestParam(value = "label_contains", required = false) String label,
@RequestParam(value = "tags_contains", required = false) String [] tags,
@RequestParam(value = "tags_contains", required = false) String[] tags,
@RequestParam(value = "createdBy", required = false) String createdBy) {
NotGroupDto notGroupDto = new NotGroupDto();
notGroupDto.setGroupId(groupId);
Expand Down Expand Up @@ -378,14 +379,14 @@ public Result<List<Block>> getBlockGroups(
/**
* 修改block
*
* @param blockDto blockDto
* @param blockParam blockParam
* @param id id
* @return block dto
*/
@Operation(summary = "修改区块",
description = "修改区块",
parameters = {
@Parameter(name = "blockDto", description = "入参对象"),
@Parameter(name = "blockParam", description = "入参对象"),
@Parameter(name = "id", description = "区块id")
},
responses = {
Expand All @@ -396,10 +397,10 @@ public Result<List<Block>> getBlockGroups(
)
@SystemControllerLog(description = "区块修改api")
@PostMapping("/block/update/{id}")
public Result<BlockDto> updateBlocks(@Valid @RequestBody BlockDto blockDto, @PathVariable Integer id,
public Result<BlockDto> updateBlocks(@Valid @RequestBody BlockParam blockParam, @PathVariable Integer id,
@RequestParam(value = "appId", required = false) Integer appId) {
blockDto.setId(id);
return blockService.updateBlockById(blockDto, appId);
blockParam.setId(id);
return blockService.updateBlockById(blockParam, appId);
}

/**
Expand Down
3 changes: 2 additions & 1 deletion base/src/main/java/com/tinyengine/it/model/dto/BlockDto.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
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.BlockGroup;
import com.tinyengine.it.model.entity.BlockHistory;
import com.tinyengine.it.model.entity.User;

Expand Down Expand Up @@ -133,7 +134,7 @@ public class BlockDto extends BaseEntity {

@TableField(exist = false)
@Schema(name = "groups", type = " List<BlockGroup>", description = "区块分组")
private List<Object> groups = new ArrayList<>();
private List<BlockGroup> groups = new ArrayList<>();

@TableField(exist = false)
@Schema(name = "histories", type = " List<BlockHistory>", description = "区块历史")
Expand Down
164 changes: 164 additions & 0 deletions base/src/main/java/com/tinyengine/it/model/dto/BlockParam.java
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;
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import com.tinyengine.it.common.base.Result;
import com.tinyengine.it.model.dto.BlockBuildDto;
import com.tinyengine.it.model.dto.BlockDto;
import com.tinyengine.it.model.dto.BlockParam;
import com.tinyengine.it.model.dto.BlockParamDto;
import com.tinyengine.it.model.dto.NotGroupDto;
import com.tinyengine.it.model.entity.Block;
Expand Down Expand Up @@ -66,18 +67,18 @@ public interface BlockService {
/**
* 根据主键id更新表t_block信息
*
* @param blockDto the block dto
* @param blockParam the block param
* @return the BlockDto
*/
Result<BlockDto> updateBlockById(BlockDto blockDto, Integer appId);
Result<BlockDto> updateBlockById(BlockParam blockParam, Integer appId);

/**
* 新增表t_block数据
*
* @param blockDto the block dto
* @param blockParam the blockParam
* @return the result
*/
Result<BlockDto> createBlock(BlockDto blockDto);
Result<BlockDto> createBlock(BlockParam blockParam);

/**
* 区块分页查询
Expand Down
Loading
Loading