维护入口
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
{"file": ".trellis/spec/backend/index.md", "reason": "Verify category maintenance against backend core module expectations."}
|
||||
{"file": ".trellis/spec/backend/database-guidelines.md", "reason": "Verify category DAO/service contracts and book-category integrity behavior."}
|
||||
{"file": ".trellis/spec/backend/error-handling.md", "reason": "Verify validation and safe fallback messages."}
|
||||
{"file": ".trellis/spec/backend/quality-guidelines.md", "reason": "Verify layer boundaries and test expectations."}
|
||||
{"file": ".trellis/spec/frontend/index.md", "reason": "Verify JSP/CSS work stays in the approved frontend stack."}
|
||||
{"file": ".trellis/spec/frontend/component-guidelines.md", "reason": "Verify page composition uses existing forms/tables/navigation patterns."}
|
||||
{"file": ".trellis/spec/frontend/quality-guidelines.md", "reason": "Verify JSP safety, empty states, errors, and permission-specific navigation."}
|
||||
@@ -0,0 +1,8 @@
|
||||
{"file": ".trellis/spec/backend/index.md", "reason": "Category maintenance must follow backend layer and core module expectations."}
|
||||
{"file": ".trellis/spec/backend/database-guidelines.md", "reason": "Defines book/category data contracts, DAO responsibilities, validation, and DB integrity rules."}
|
||||
{"file": ".trellis/spec/backend/error-handling.md", "reason": "Guides safe service errors, field validation, and controller behavior."}
|
||||
{"file": ".trellis/spec/backend/logging-guidelines.md", "reason": "Category maintenance is a key book operation and should preserve logging expectations."}
|
||||
{"file": ".trellis/spec/backend/quality-guidelines.md", "reason": "Implementation must preserve Servlet-Service-DAO separation and validation checks."}
|
||||
{"file": ".trellis/spec/frontend/index.md", "reason": "JSP/CSS changes must remain within the server-rendered frontend conventions."}
|
||||
{"file": ".trellis/spec/frontend/component-guidelines.md", "reason": "Category pages should reuse existing form, table, empty-state, and navigation patterns."}
|
||||
{"file": ".trellis/spec/frontend/quality-guidelines.md", "reason": "Check JSP safety, forms, tables, permissions, and accessibility basics."}
|
||||
@@ -0,0 +1,93 @@
|
||||
# Core Function Gap Check
|
||||
|
||||
## Goal
|
||||
|
||||
Check the current MZH Library Management implementation against the documented
|
||||
core modules and complete the highest-confidence missing core feature slice
|
||||
without broad redesign.
|
||||
|
||||
## What I Already Know
|
||||
|
||||
* The user asked to check whether core functionality is still missing and to
|
||||
complete it.
|
||||
* The app is a Java 11 Maven WAR using JSP + Servlet + MySQL and JDBC DAOs.
|
||||
* Existing implemented slices cover login/permissions, dashboard navigation,
|
||||
book catalog/search, book CRUD, reader management, borrowing circulation,
|
||||
reader loan history, reports, administrator user management, and system-log
|
||||
viewing.
|
||||
* Existing lightweight checks pass with `javac -Xlint:all` for non-Servlet
|
||||
layers and all service check mains. Maven is unavailable in this environment.
|
||||
* The clearest missing core requirement is book category maintenance. The
|
||||
schema and selectors already have `book_categories`, but there is no route,
|
||||
controller, JSP, DAO/service mutation API, or test coverage for maintaining
|
||||
categories.
|
||||
|
||||
## Requirements
|
||||
|
||||
* Preserve the existing JSP -> Servlet -> Service -> DAO -> MySQL layering.
|
||||
* Keep category maintenance under the existing `MANAGE_BOOKS` permission.
|
||||
* Add a staff-only category management flow for listing, creating, editing, and
|
||||
deleting book categories.
|
||||
* Validate required category name, name length, description length, duplicate
|
||||
names, and invalid IDs with field-level service errors.
|
||||
* Prevent deleting categories that still have book records, returning a safe
|
||||
validation message instead of surfacing a database constraint failure.
|
||||
* Reuse the existing book management visual patterns, flash messages, and
|
||||
table/form conventions.
|
||||
* Link category maintenance from the book management surface and staff
|
||||
navigation where appropriate.
|
||||
* Update focused service checks and fallback validation commands.
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
* [x] A user with `MANAGE_BOOKS` can open a category management page.
|
||||
* [x] Staff can create and update category names/descriptions.
|
||||
* [x] Duplicate category names are rejected with a field error.
|
||||
* [x] Categories used by books cannot be deleted.
|
||||
* [x] Readers or unauthenticated users cannot mutate categories.
|
||||
* [x] Book forms/search continue to load categories from the shared DAO/service
|
||||
path.
|
||||
* [x] JSPs do not contain SQL/JDBC/scriptlet logic.
|
||||
* [x] Existing lightweight checks pass; Maven limitation is documented if still
|
||||
unavailable.
|
||||
|
||||
## Definition of Done
|
||||
|
||||
* Tests/checks updated where practical.
|
||||
* Lint/type-check/compile equivalent checks pass in this environment.
|
||||
* Docs/notes updated if behavior changes.
|
||||
* No broad framework or visual redesign.
|
||||
|
||||
## Out of Scope
|
||||
|
||||
* Role/permission editor UI.
|
||||
* Full database dump/restore execution from the web app.
|
||||
* Audit logging expansion for every non-user operation.
|
||||
* Automatic reader-account/profile linking changes.
|
||||
|
||||
## Technical Notes
|
||||
|
||||
* Relevant specs:
|
||||
`.trellis/spec/backend/index.md`,
|
||||
`.trellis/spec/backend/database-guidelines.md`,
|
||||
`.trellis/spec/backend/error-handling.md`,
|
||||
`.trellis/spec/backend/logging-guidelines.md`,
|
||||
`.trellis/spec/backend/quality-guidelines.md`,
|
||||
`.trellis/spec/frontend/index.md`,
|
||||
`.trellis/spec/frontend/component-guidelines.md`,
|
||||
`.trellis/spec/frontend/quality-guidelines.md`.
|
||||
* Current files most likely affected:
|
||||
`BookDao`, `JdbcBookDao`, `BookService`, `BookServiceImpl`,
|
||||
`BookManagementServlet`, `web.xml`, book JSPs, shared CSS, and
|
||||
`BookServiceCheck`.
|
||||
* Initial verification before implementation:
|
||||
`javac -Xlint:all` over non-Servlet app layers and tests passed; all eight
|
||||
service check mains passed. `mvn` is not installed.
|
||||
* Final verification after implementation:
|
||||
`javac -Xlint:all` over non-Servlet app layers and tests passed;
|
||||
`PermissionPolicyCheck`, `AuthServiceCheck`, `BookServiceCheck`,
|
||||
`ReaderServiceCheck`, `BorrowingServiceCheck`, `ReportServiceCheck`,
|
||||
`UserAccountServiceCheck`, and `SystemLogServiceCheck` passed;
|
||||
JSP/static scriptlet and SQL/JDBC scan returned no matches;
|
||||
`git diff --check` passed; `mvn clean package` remains blocked because `mvn`
|
||||
is not installed.
|
||||
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"id": "core-function-gap-check",
|
||||
"name": "core-function-gap-check",
|
||||
"title": "检查并补全核心功能",
|
||||
"description": "",
|
||||
"status": "in_progress",
|
||||
"dev_type": null,
|
||||
"scope": null,
|
||||
"package": null,
|
||||
"priority": "P2",
|
||||
"creator": "Zzzz",
|
||||
"assignee": "Zzzz",
|
||||
"createdAt": "2026-04-27",
|
||||
"completedAt": null,
|
||||
"branch": null,
|
||||
"base_branch": "master",
|
||||
"worktree_path": null,
|
||||
"commit": null,
|
||||
"pr_url": null,
|
||||
"subtasks": [],
|
||||
"children": [],
|
||||
"parent": null,
|
||||
"relatedFiles": [],
|
||||
"notes": "",
|
||||
"meta": {}
|
||||
}
|
||||
Reference in New Issue
Block a user