-
Notifications
You must be signed in to change notification settings - Fork 69
fix:fix block function #172
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
Conversation
WalkthroughThis pull request updates documentation, SQL DDL scripts, and Java code related to the database schema. It standardizes naming conventions (camelCase to snake_case), removes obsolete tables and fields (notably the Changes
Sequence Diagram(s)sequenceDiagram
participant U as User
participant S as BlockServiceImpl
participant DB as Database
U->>S: Call createBlock(blockParam)
S->>DB: Insert new block record
S->>DB: Query block by id (queryBlockById)
DB-->>S: Return block details
S-->>U: Return Result.success(block details)
sequenceDiagram
participant U as User
participant S as BlockServiceImpl
participant DB as Database
U->>S: Call deploy(blockBuildDto)
S->>S: Clear block groups (setGroups(null))
S->>DB: Update block record
DB-->>S: Confirmation
S-->>U: Return deployment result
Possibly related PRs
Suggested reviewers
Poem
Tip 🌐 Web search-backed reviews and chat
✨ Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
README.zh-CN.md (1)
185-187: Fix unordered list style for consistency.The unordered list items use dash (-) instead of asterisk (*). For consistency with the rest of the document, use asterisk for all list items.
- - 数据库表关系更清晰明了,删除了一些没用的表关系,比如区块和区块历史的表关系,是直接在区块历史表里t_block_history加区块的id即ref_id做为外键 - - 删除了block_categories区块分类,把区块分组和分类合并成了区块分组,考虑到分组和分类差不多的功能和作用 - - 预留了业务分类表t_business_category、物料与业务分类的关系表r_material_category + * 数据库表关系更清晰明了,删除了一些没用的表关系,比如区块和区块历史的表关系,是直接在区块历史表里t_block_history加区块的id即ref_id做为外键 + * 删除了block_categories区块分类,把区块分组和分类合并成了区块分组,考虑到分组和分类差不多的功能和作用 + * 预留了业务分类表t_business_category、物料与业务分类的关系表r_material_category🧰 Tools
🪛 markdownlint-cli2 (0.17.2)
185-185: Unordered list style
Expected: asterisk; Actual: dash(MD004, ul-style)
186-186: Unordered list style
Expected: asterisk; Actual: dash(MD004, ul-style)
187-187: Unordered list style
Expected: asterisk; Actual: dash(MD004, ul-style)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
README.zh-CN.md(1 hunks)app/src/main/resources/sql/mysql/create_all_tables_ddl_v1.mysql.sql(0 hunks)base/src/main/java/com/tinyengine/it/mapper/BlockGroupBlockMapper.java(1 hunks)base/src/main/java/com/tinyengine/it/model/entity/BlockHistory.java(0 hunks)base/src/main/java/com/tinyengine/it/service/material/impl/BlockServiceImpl.java(2 hunks)base/src/main/resources/mappers/BlockHistoryMapper.xml(1 hunks)
💤 Files with no reviewable changes (2)
- base/src/main/java/com/tinyengine/it/model/entity/BlockHistory.java
- app/src/main/resources/sql/mysql/create_all_tables_ddl_v1.mysql.sql
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
README.zh-CN.md
185-185: Unordered list style
Expected: asterisk; Actual: dash
(MD004, ul-style)
186-186: Unordered list style
Expected: asterisk; Actual: dash
(MD004, ul-style)
187-187: Unordered list style
Expected: asterisk; Actual: dash
(MD004, ul-style)
🔇 Additional comments (5)
base/src/main/java/com/tinyengine/it/mapper/BlockGroupBlockMapper.java (1)
92-99: LGTM! Comment accurately reflects the method's functionality.The updated comment now correctly describes that the method deletes the association between a block and a block group, rather than querying blocks. This improves code documentation accuracy.
base/src/main/java/com/tinyengine/it/service/material/impl/BlockServiceImpl.java (2)
257-257: LGTM! Improved data consistency.The change ensures that the most up-to-date block data is returned by querying the database after creation, rather than using potentially stale data from
blocksResult.
558-558: LGTM! Prevents unintended group associations.Setting groups to null during deployment is a good practice as it prevents any unintended group associations from being carried over during the block update process.
base/src/main/resources/mappers/BlockHistoryMapper.xml (1)
11-11: LGTM! Column list aligns with schema changes.The removal of block_group_id from the column list is consistent with the database schema changes that simplify block-group relationships.
README.zh-CN.md (1)
190-214: LGTM! Comprehensive database mapping documentation.The table provides a clear and detailed mapping between the old and new database schemas, including all added, deleted, and modified attributes. This documentation will be valuable for understanding the database changes and migrations.
English | 简体中文
PR
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
Background and solution
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information
Summary by CodeRabbit