feat: crud from semantic#5
Open
mengnankkkk wants to merge 3 commits into
Open
Conversation
VLSMB
requested changes
May 30, 2026
| @RequestParam(defaultValue = "20") Integer pageSize, | ||
| @RequestParam(name = "keywordPrefix", required = false) String keywordPrefix, | ||
| @RequestParam(defaultValue = "asc") String sortOrder) { | ||
| return Result.success( |
Member
There was a problem hiding this comment.
应该对参数进行基础的合理性校验,比如字符串是否为空,page是否为负数之类的
Member
There was a problem hiding this comment.
下面的也都有这个问题。控制器方法应该做参数校验,否则跟直接使用Service层没有区别了
|
|
||
| private final ColumnSemanticService columnSemanticService; | ||
|
|
||
| public TableColumnSemanticController(ColumnSemanticService columnSemanticService) { |
| import org.springframework.web.bind.annotation.RestController; | ||
|
|
||
| @RestController | ||
| @RequestMapping("/api/semantic/tables/{tableName}/columns") |
Member
There was a problem hiding this comment.
我觉得将变化参数放在路由的最后语义会更清晰一些,/api/semantic/tables/columns/{tableName}或者/api/semantic/table_columns/{tableName}都行
|
|
||
| @RestController | ||
| @RequestMapping("/api/semantic/tables/{tableName}/relations") | ||
| public class TableRelationSemanticController { |
|
|
||
| @RestController | ||
| @RequestMapping("/api/semantic/tables") | ||
| public class TableSemanticController { |
| private final DatasourceService datasourceService; | ||
| private final ColumnSemanticInfoMapper columnSemanticInfoMapper; | ||
|
|
||
| public ColumnSemanticServiceImpl( |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
添加语义层的crud操作
主要修改:
-与其配套的mapper service controller