-
Notifications
You must be signed in to change notification settings - Fork 42
feat: Component library API #203
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
72 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 6d978f1
fix: Modify block group
lu-yg b3f35a0
fix: Modify block group
lu-yg 9717200
fix: Modify block group
lu-yg e757b29
fix: Modify block group
lu-yg 7d90c86
fix: Modify block group api
lu-yg d6856ba
Merge branch 'opentiny:develop' into develop
lu-yg 8a89475
Merge branch 'develop' of github.com:lu-yg/tiny-engine-backend-java i…
lu-yg baa4eeb
fix: Modify block group api
lu-yg 654da8b
fix: Modify block group api
lu-yg a230c24
feat: add code check
lu-yg 6966946
Merge branch 'opentiny:develop' into develop
lu-yg d503c96
Merge branch 'develop' of github.com:lu-yg/tiny-engine-backend-java i…
lu-yg 7f9b378
feat: add code check
lu-yg 2bdf54c
feat: add code check
lu-yg bef4adc
Merge branch 'opentiny:develop' into develop
lu-yg 88dec60
feat: add code check
lu-yg 63efa3c
Merge branch 'opentiny:develop' into develop
lu-yg f05a3ef
fix: Fix code check
lu-yg dbc910c
Merge branch 'opentiny:develop' into develop
lu-yg 8a4041c
fix: Cross domain configuration
lu-yg 57fd35a
fix: Cross domain configuration
lu-yg bff62cc
fix: i18n file upload
lu-yg ededae7
fix: i18n file upload
lu-yg 1fa284b
Merge branch 'opentiny:develop' into develop
lu-yg 7f17fb7
fix: page update api
lu-yg 934130f
fix: page update api
lu-yg a920283
feat: material history api
lu-yg b1e0f83
feat: component library api
lu-yg 5d244ba
Merge branch 'develop' of github.com:lu-yg/tiny-engine-backend-java i…
lu-yg 05f4473
feat: component library api
lu-yg 58ed56b
Merge branch 'develop' of github.com:lu-yg/tiny-engine-backend-java i…
lu-yg 6a5269d
feat: component library api
lu-yg 2f31f88
feat: component library api
lu-yg 9ee1ef1
feat: component library api
lu-yg 59c6ddc
feat: component library api
lu-yg 8373484
feat: component library api
lu-yg fb123c6
feat: component library api
lu-yg 0875559
feat: component library api
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 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
157 changes: 157 additions & 0 deletions
157
base/src/main/java/com/tinyengine/it/controller/ComponentLibraryController.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,157 @@ | ||
/** | ||
* 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.controller; | ||
|
||
import com.tinyengine.it.common.base.Result; | ||
import com.tinyengine.it.common.log.SystemControllerLog; | ||
import com.tinyengine.it.model.entity.ComponentLibrary; | ||
import com.tinyengine.it.service.material.ComponentLibraryService; | ||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.Parameter; | ||
import io.swagger.v3.oas.annotations.media.Content; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import io.swagger.v3.oas.annotations.responses.ApiResponse; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.validation.annotation.Validated; | ||
import org.springframework.web.bind.annotation.DeleteMapping; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.PathVariable; | ||
import org.springframework.web.bind.annotation.PostMapping; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import javax.validation.Valid; | ||
import java.util.List; | ||
|
||
/** | ||
* 组件库API | ||
* | ||
* @since 2025-4-02 | ||
*/ | ||
@Validated | ||
@RestController | ||
@RequestMapping("/material-center/api") | ||
@Tag(name = "组件库") | ||
public class ComponentLibraryController { | ||
/** | ||
* The ComponentLibrary service. | ||
*/ | ||
@Autowired | ||
private ComponentLibraryService componentLibraryService; | ||
|
||
/** | ||
* 查询表ComponentLibrary信息列表 | ||
* | ||
* @return ComponentLibrary信息 all componentLibrary | ||
*/ | ||
@Operation(summary = "查询表ComponentLibrary信息列表", | ||
description = "查询表ComponentLibrary信息列表", | ||
responses = { | ||
@ApiResponse(responseCode = "200", description = "返回信息", | ||
content = @Content(mediaType = "application/json", | ||
schema = @Schema(implementation = ComponentLibrary.class))), | ||
@ApiResponse(responseCode = "400", description = "请求失败")}) | ||
@SystemControllerLog(description = "查询表ComponentLibrary信息列表") | ||
@GetMapping("/component-library/list") | ||
public Result<List<ComponentLibrary>> getAllComponentLibrary() { | ||
List<ComponentLibrary> componentLibraryHistoryList = componentLibraryService.queryAllComponentLibrary(); | ||
return Result.success(componentLibraryHistoryList); | ||
} | ||
|
||
/** | ||
* 创建ComponentLibrary | ||
* | ||
* @param componentLibrary the componentLibrary | ||
* @return ComponentLibrary信息 result | ||
*/ | ||
@Operation(summary = "创建ComponentLibrary", | ||
description = "创建ComponentLibrary", | ||
parameters = { | ||
@Parameter(name = "ComponentLibrary", description = "ComponentLibrary入参对象") | ||
}, | ||
responses = { | ||
@ApiResponse(responseCode = "200", description = "返回信息", | ||
content = @Content(mediaType = "application/json", | ||
schema = @Schema(implementation = ComponentLibrary.class))), | ||
@ApiResponse(responseCode = "400", description = "请求失败")} | ||
) | ||
@SystemControllerLog(description = "创建ComponentLibrary") | ||
@PostMapping("/component-library/create") | ||
public Result<ComponentLibrary> createComponentLibrary(@Valid @RequestBody ComponentLibrary componentLibrary) { | ||
return componentLibraryService.createComponentLibrary(componentLibrary); | ||
} | ||
|
||
/** | ||
* 修改ComponentLibrary信息 | ||
* | ||
* @param id the id | ||
* @param componentLibrary the componentLibrary | ||
* @return ComponentLibrary信息 result | ||
*/ | ||
@Operation(summary = "修改单个ComponentLibrary信息", description = "修改单个ComponentLibrary信息", parameters = { | ||
@Parameter(name = "id", description = "appId"), | ||
@Parameter(name = "ComponentLibrary", description = "入参对象")}, responses = { | ||
@ApiResponse(responseCode = "200", description = "返回信息", | ||
content = @Content(mediaType = "application/json", | ||
schema = @Schema(implementation = ComponentLibrary.class))), | ||
@ApiResponse(responseCode = "400", description = "请求失败")}) | ||
@SystemControllerLog(description = "修改单个ComponentLibrary信息") | ||
@PostMapping("/component-library/update/{id}") | ||
public Result<ComponentLibrary> updateComponentLibrary(@PathVariable Integer id, @RequestBody ComponentLibrary componentLibrary) { | ||
componentLibrary.setId(id); | ||
return componentLibraryService.updateComponentLibraryById(componentLibrary); | ||
} | ||
lu-yg marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
/** | ||
* 删除ComponentLibrary信息 | ||
* | ||
* @param id the id | ||
* @return ComponentLibrary信息 result | ||
*/ | ||
@Operation(summary = "删除ComponentLibrary信息", | ||
description = "删除ComponentLibrary信息", | ||
parameters = { | ||
@Parameter(name = "id", description = "ComponentLibrary主键id") | ||
}, | ||
responses = { | ||
@ApiResponse(responseCode = "200", description = "返回信息", | ||
content = @Content(mediaType = "application/json", | ||
schema = @Schema(implementation = ComponentLibrary.class))), | ||
@ApiResponse(responseCode = "400", description = "请求失败")} | ||
) | ||
@SystemControllerLog(description = "删除ComponentLibrary信息") | ||
@DeleteMapping("/component-library/delete/{id}") | ||
public Result<ComponentLibrary> deleteComponentLibrary(@PathVariable Integer id) { | ||
return componentLibraryService.deleteComponentLibraryById(id); | ||
} | ||
lu-yg marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
/** | ||
* 获取ComponentLibrary信息详情 | ||
* | ||
* @param id the id | ||
* @return the result | ||
*/ | ||
@Operation(summary = "获取ComponentLibrary信息详情", description = "获取ComponentLibrary信息详情", parameters = { | ||
@Parameter(name = "id", description = "appId")}, responses = { | ||
@ApiResponse(responseCode = "200", description = "返回信息", | ||
content = @Content(mediaType = "application/json", | ||
schema = @Schema(implementation = ComponentLibrary.class))), | ||
@ApiResponse(responseCode = "400", description = "请求失败")}) | ||
@SystemControllerLog(description = "获取ComponentLibrary信息详情") | ||
@GetMapping("/component-library/detail/{id}") | ||
public Result<ComponentLibrary> detail(@PathVariable Integer id) { | ||
return componentLibraryService.queryComponentLibraryById(id); | ||
} | ||
} |
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.