intent-flow 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- intent_flow/__init__.py +1 -0
- intent_flow/_assets/agents/backend-java-ddd-design.yaml +23 -0
- intent_flow/_assets/agents/backend-java-ddd-implementer.yaml +24 -0
- intent_flow/_assets/agents/backend-java-ddd-verify.yaml +26 -0
- intent_flow/_assets/agents/ddd-schema-designer.yaml +21 -0
- intent_flow/_assets/agents/prd-writer.yaml +22 -0
- intent_flow/_assets/agents/project-decomposer.yaml +24 -0
- intent_flow/_assets/agents/requirement-intake.yaml +19 -0
- intent_flow/_assets/flow/stages.yaml +26 -0
- intent_flow/_assets/flow/status.yaml +17 -0
- intent_flow/_assets/flow/transitions.yaml +23 -0
- intent_flow/_assets/intent-flow.yaml.example +33 -0
- intent_flow/_assets/manifest.yaml +13 -0
- intent_flow/_assets/roles/developer.yaml +28 -0
- intent_flow/_assets/roles/fullstack.yaml +35 -0
- intent_flow/_assets/roles/product-manager.yaml +13 -0
- intent_flow/_assets/skills/backend-java-ddd/design/SKILL.md +442 -0
- intent_flow/_assets/skills/backend-java-ddd/design/examples/country/SPEC.md +80 -0
- intent_flow/_assets/skills/backend-java-ddd/design/examples/country/acceptance/acceptance.md +37 -0
- intent_flow/_assets/skills/backend-java-ddd/design/examples/country/application/country-create.md +113 -0
- intent_flow/_assets/skills/backend-java-ddd/design/examples/country/application/country-detail.md +97 -0
- intent_flow/_assets/skills/backend-java-ddd/design/examples/country/application/country-disable.md +97 -0
- intent_flow/_assets/skills/backend-java-ddd/design/examples/country/application/country-enable.md +90 -0
- intent_flow/_assets/skills/backend-java-ddd/design/examples/country/application/country-page.md +113 -0
- intent_flow/_assets/skills/backend-java-ddd/design/examples/country/application/country-update.md +102 -0
- intent_flow/_assets/skills/backend-java-ddd/design/examples/country/change/260227-01-/321/205/320/253/342/225/234/321/205/320/276/342/225/242/321/207/320/276/320/261/321/207/320/240/320/226/321/206/320/270/320/261/321/205/320/255/320/247.md +63 -0
- intent_flow/_assets/skills/backend-java-ddd/design/examples/country/change/260315-02-/321/205/320/253/342/225/234/321/205/320/276/342/225/242/321/211/342/225/227/320/250/321/210/320/276/320/264/321/205/342/225/225/320/221/321/207/320/267/320/235/321/205/320/262/320/256/321/205/342/225/235/342/225/221.md +53 -0
- intent_flow/_assets/skills/backend-java-ddd/design/examples/country/constraints/ddd-implementation.md +7 -0
- intent_flow/_assets/skills/backend-java-ddd/design/examples/country/core/create.md +110 -0
- intent_flow/_assets/skills/backend-java-ddd/design/examples/country/core/disable.md +85 -0
- intent_flow/_assets/skills/backend-java-ddd/design/examples/country/core/enable.md +85 -0
- intent_flow/_assets/skills/backend-java-ddd/design/examples/country/core/object-profile.md +106 -0
- intent_flow/_assets/skills/backend-java-ddd/design/examples/country/core/update.md +103 -0
- intent_flow/_assets/skills/backend-java-ddd/design/examples/country/rules/application-rules.md +12 -0
- intent_flow/_assets/skills/backend-java-ddd/design/examples/country/rules/cross-object-rules.md +11 -0
- intent_flow/_assets/skills/backend-java-ddd/design/examples/country/rules/object-rules.md +13 -0
- intent_flow/_assets/skills/backend-java-ddd/design/examples/country/scenarios/create-country.md +26 -0
- intent_flow/_assets/skills/backend-java-ddd/design/examples/country/scenarios/detail-country.md +22 -0
- intent_flow/_assets/skills/backend-java-ddd/design/examples/country/scenarios/disable-country.md +22 -0
- intent_flow/_assets/skills/backend-java-ddd/design/examples/country/scenarios/enable-country.md +22 -0
- intent_flow/_assets/skills/backend-java-ddd/design/examples/country/scenarios/page-country.md +24 -0
- intent_flow/_assets/skills/backend-java-ddd/design/examples/country/scenarios/update-country.md +24 -0
- intent_flow/_assets/skills/backend-java-ddd/design/examples/currency/SPEC.md +79 -0
- intent_flow/_assets/skills/backend-java-ddd/design/examples/currency/acceptance/acceptance.md +36 -0
- intent_flow/_assets/skills/backend-java-ddd/design/examples/currency/application/currency-create.md +80 -0
- intent_flow/_assets/skills/backend-java-ddd/design/examples/currency/application/currency-detail.md +77 -0
- intent_flow/_assets/skills/backend-java-ddd/design/examples/currency/application/currency-disable.md +77 -0
- intent_flow/_assets/skills/backend-java-ddd/design/examples/currency/application/currency-enable.md +70 -0
- intent_flow/_assets/skills/backend-java-ddd/design/examples/currency/application/currency-page.md +89 -0
- intent_flow/_assets/skills/backend-java-ddd/design/examples/currency/application/currency-update.md +75 -0
- intent_flow/_assets/skills/backend-java-ddd/design/examples/currency/change/260303-01-/321/205/342/225/225/320/221/321/207/320/267/320/235/321/207/320/276/320/261/321/207/320/240/320/226.md +64 -0
- intent_flow/_assets/skills/backend-java-ddd/design/examples/currency/constraints/ddd-implementation.md +7 -0
- intent_flow/_assets/skills/backend-java-ddd/design/examples/currency/core/create.md +94 -0
- intent_flow/_assets/skills/backend-java-ddd/design/examples/currency/core/disable.md +85 -0
- intent_flow/_assets/skills/backend-java-ddd/design/examples/currency/core/enable.md +85 -0
- intent_flow/_assets/skills/backend-java-ddd/design/examples/currency/core/object-profile.md +95 -0
- intent_flow/_assets/skills/backend-java-ddd/design/examples/currency/core/update.md +90 -0
- intent_flow/_assets/skills/backend-java-ddd/design/examples/currency/rules/application-rules.md +11 -0
- intent_flow/_assets/skills/backend-java-ddd/design/examples/currency/rules/cross-object-rules.md +10 -0
- intent_flow/_assets/skills/backend-java-ddd/design/examples/currency/rules/object-rules.md +13 -0
- intent_flow/_assets/skills/backend-java-ddd/design/examples/currency/scenarios/create-currency.md +24 -0
- intent_flow/_assets/skills/backend-java-ddd/design/examples/currency/scenarios/detail-currency.md +22 -0
- intent_flow/_assets/skills/backend-java-ddd/design/examples/currency/scenarios/disable-currency.md +22 -0
- intent_flow/_assets/skills/backend-java-ddd/design/examples/currency/scenarios/enable-currency.md +22 -0
- intent_flow/_assets/skills/backend-java-ddd/design/examples/currency/scenarios/page-currency.md +24 -0
- intent_flow/_assets/skills/backend-java-ddd/design/examples/currency/scenarios/update-currency.md +23 -0
- intent_flow/_assets/skills/backend-java-ddd/design/references/INDEX.md +35 -0
- intent_flow/_assets/skills/backend-java-ddd/design/references/concepts/application-vs-core-behavior.md +54 -0
- intent_flow/_assets/skills/backend-java-ddd/design/references/concepts/business-object.md +43 -0
- intent_flow/_assets/skills/backend-java-ddd/design/references/concepts/object-spec-package.md +45 -0
- intent_flow/_assets/skills/backend-java-ddd/design/references/process/generation-process.md +75 -0
- intent_flow/_assets/skills/backend-java-ddd/design/references/rules/business-object-generation-rules.md +82 -0
- intent_flow/_assets/skills/backend-java-ddd/design/references/rules/change-impact-rules.md +45 -0
- intent_flow/_assets/skills/backend-java-ddd/design/references/rules/consistency-check-rules.md +47 -0
- intent_flow/_assets/skills/backend-java-ddd/design/references/rules/extraction-rules.md +126 -0
- intent_flow/_assets/skills/backend-java-ddd/design/references/rules/file-generation-rules.md +275 -0
- intent_flow/_assets/skills/backend-java-ddd/design/references/rules/output-artifact-checklist.md +328 -0
- intent_flow/_assets/skills/backend-java-ddd/design/templates/INDEX.md +22 -0
- intent_flow/_assets/skills/backend-java-ddd/design/templates/object/SPEC.md +34 -0
- intent_flow/_assets/skills/backend-java-ddd/design/templates/object/acceptance.md +13 -0
- intent_flow/_assets/skills/backend-java-ddd/design/templates/object/application-behavior.md +67 -0
- intent_flow/_assets/skills/backend-java-ddd/design/templates/object/change.md +43 -0
- intent_flow/_assets/skills/backend-java-ddd/design/templates/object/constraints.md +19 -0
- intent_flow/_assets/skills/backend-java-ddd/design/templates/object/core-behavior.md +67 -0
- intent_flow/_assets/skills/backend-java-ddd/design/templates/object/object-profile.md +35 -0
- intent_flow/_assets/skills/backend-java-ddd/design/templates/object/rules.md +17 -0
- intent_flow/_assets/skills/backend-java-ddd/design/templates/object/scenario.md +25 -0
- intent_flow/_assets/skills/backend-java-ddd/implementer/00-core/anti-patterns/SKILL.md +488 -0
- intent_flow/_assets/skills/backend-java-ddd/implementer/00-core/bootstrap/SKILL.md +171 -0
- intent_flow/_assets/skills/backend-java-ddd/implementer/00-core/code-generation-workflow/SKILL.md +755 -0
- intent_flow/_assets/skills/backend-java-ddd/implementer/00-core/code-style/code-formatting/SKILL.md +297 -0
- intent_flow/_assets/skills/backend-java-ddd/implementer/00-core/code-style/comment-javadoc/SKILL.md +494 -0
- intent_flow/_assets/skills/backend-java-ddd/implementer/00-core/code-style/imports/SKILL.md +237 -0
- intent_flow/_assets/skills/backend-java-ddd/implementer/00-core/coding-standards/SKILL.md +304 -0
- intent_flow/_assets/skills/backend-java-ddd/implementer/00-core/exception-logging/SKILL.md +318 -0
- intent_flow/_assets/skills/backend-java-ddd/implementer/00-core/loading-strategy/SKILL.md +193 -0
- intent_flow/_assets/skills/backend-java-ddd/implementer/00-core/naming-convention/SKILL.md +223 -0
- intent_flow/_assets/skills/backend-java-ddd/implementer/00-core/project-architecture/SKILL.md +132 -0
- intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/adapter/controller/SKILL.md +488 -0
- intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/adapter/controller/examples/complete-controller.md +382 -0
- intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/adapter/controller/examples/pagination.md +103 -0
- intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/application/appservice/SKILL.md +216 -0
- intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/application/appservice/examples/async.md +446 -0
- intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/application/appservice/examples/batch.md +555 -0
- intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/application/appservice/examples/conditional.md +549 -0
- intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/application/appservice/examples/cross-domain-cmdexe.md +417 -0
- intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/application/appservice/examples/cross-domain.md +491 -0
- intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/application/appservice/examples/distributed-tx.md +406 -0
- intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/application/appservice/examples/mixed.md +470 -0
- intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/application/appservice/examples/simple-cmdexe.md +512 -0
- intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/application/appservice/examples/simple-qryexe.md +434 -0
- intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/application/cmdexe/SKILL.md +288 -0
- intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/application/cmdexe/examples/action.md +648 -0
- intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/application/cmdexe/examples/create.md +775 -0
- intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/application/cmdexe/examples/update.md +721 -0
- intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/application/convertor/SKILL.md +231 -0
- intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/application/convertor/examples/convertor.md +612 -0
- intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/application/dto/SKILL.md +75 -0
- intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/application/dto/examples/cmd.md +205 -0
- intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/application/dto/examples/co.md +168 -0
- intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/application/dto/examples/qry.md +208 -0
- intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/application/qryexe/SKILL.md +354 -0
- intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/application/qryexe/examples/detail.md +156 -0
- intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/application/qryexe/examples/pagination.md +145 -0
- intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/domain/entity/SKILL.md +280 -0
- intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/domain/entity/examples/aggregate-creation.md +1009 -0
- intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/domain/entity/examples/aggregate-design.md +728 -0
- intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/domain/entity/examples/method-design.md +640 -0
- intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/domain/entity/examples/update-patterns.md +503 -0
- intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/domain/gateway/SKILL.md +181 -0
- intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/domain/gateway/examples/gateway-capabilities.md +536 -0
- intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/domain/gateway/examples/gateway-interface.md +270 -0
- intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/infrastructure/external/SKILL.md +142 -0
- intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/infrastructure/gatewayimpl/SKILL.md +197 -0
- intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/infrastructure/gatewayimpl/examples/cascade-mechanism.md +353 -0
- intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/infrastructure/gatewayimpl/examples/gateway.md +316 -0
- intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/infrastructure/repository/SKILL.md +294 -0
- intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/infrastructure/repository/examples/pagination.md +439 -0
- intent_flow/_assets/skills/backend-java-ddd/implementer/02-plugins/enum-dict-plugin/SKILL.md +239 -0
- intent_flow/_assets/skills/backend-java-ddd/implementer/02-plugins/pagination-backend/SKILL.md +411 -0
- intent_flow/_assets/skills/backend-java-ddd/implementer/02-plugins/repository-methods/SKILL.md +229 -0
- intent_flow/_assets/skills/backend-java-ddd/implementer/02-plugins/seata-xa/SKILL.md +268 -0
- intent_flow/_assets/skills/backend-java-ddd/implementer/02-plugins/spring-cache/SKILL.md +252 -0
- intent_flow/_assets/skills/backend-java-ddd/implementer/10-learning/README.md +45 -0
- intent_flow/_assets/skills/backend-java-ddd/implementer/10-learning/architecture/ddd-architecture.md +101 -0
- intent_flow/_assets/skills/backend-java-ddd/implementer/10-learning/architecture/project-structure.md +143 -0
- intent_flow/_assets/skills/backend-java-ddd/implementer/10-learning/ddd-concepts/aggregate-update.md +432 -0
- intent_flow/_assets/skills/backend-java-ddd/implementer/10-learning/ddd-concepts/method-design.md +344 -0
- intent_flow/_assets/skills/backend-java-ddd/implementer/10-learning/ddd-concepts/parameter-object.md +416 -0
- intent_flow/_assets/skills/backend-java-ddd/implementer/10-learning/ddd-concepts/rich-model.md +270 -0
- intent_flow/_assets/skills/backend-java-ddd/implementer/10-learning/ddd-concepts/value-object.md +375 -0
- intent_flow/_assets/skills/backend-java-ddd/scaffold/README.md +17 -0
- intent_flow/_assets/skills/backend-java-ddd/scaffold/add-service-module/SKILL.md +77 -0
- intent_flow/_assets/skills/backend-java-ddd/scaffold/examples/service-basis.md +27 -0
- intent_flow/_assets/skills/backend-java-ddd/scaffold/init-multi-module-project/SKILL.md +137 -0
- intent_flow/_assets/skills/backend-java-ddd/scaffold/init-single-module-project/SKILL.md +115 -0
- intent_flow/_assets/skills/backend-java-ddd/scaffold/references/INDEX.md +19 -0
- intent_flow/_assets/skills/backend-java-ddd/scaffold/references/config-conventions.md +29 -0
- intent_flow/_assets/skills/backend-java-ddd/scaffold/references/input-checklist.md +19 -0
- intent_flow/_assets/skills/backend-java-ddd/scaffold/references/project-structure.md +29 -0
- intent_flow/_assets/skills/backend-java-ddd/scaffold/references/what-is-scaffold.md +18 -0
- intent_flow/_assets/skills/backend-java-ddd/scaffold/templates/INDEX.md +8 -0
- intent_flow/_assets/skills/backend-java-ddd/scaffold/templates/files.md +33 -0
- intent_flow/_assets/skills/backend-java-ddd/scaffold/templates/module-layout.md +23 -0
- intent_flow/_assets/skills/code-repository/commit-changes/SKILL.md +41 -0
- intent_flow/_assets/skills/code-repository/commit-changes/mappings/git.yaml +12 -0
- intent_flow/_assets/skills/code-repository/commit-changes/references/commit.md +19 -0
- intent_flow/_assets/skills/code-repository/create-branch/SKILL.md +41 -0
- intent_flow/_assets/skills/code-repository/create-branch/mappings/git.yaml +12 -0
- intent_flow/_assets/skills/code-repository/create-branch/references/create.md +19 -0
- intent_flow/_assets/skills/code-repository/diff-changes/SKILL.md +41 -0
- intent_flow/_assets/skills/code-repository/diff-changes/mappings/git.yaml +12 -0
- intent_flow/_assets/skills/code-repository/diff-changes/references/diff.md +19 -0
- intent_flow/_assets/skills/code-repository/read-file/SKILL.md +41 -0
- intent_flow/_assets/skills/code-repository/read-file/mappings/git.yaml +12 -0
- intent_flow/_assets/skills/code-repository/read-file/references/read.md +19 -0
- intent_flow/_assets/skills/decomposition/analyze-impact/SKILL.md +41 -0
- intent_flow/_assets/skills/decomposition/analyze-impact/references/analyze.md +19 -0
- intent_flow/_assets/skills/decomposition/create-project-changes/SKILL.md +41 -0
- intent_flow/_assets/skills/decomposition/create-project-changes/references/create.md +19 -0
- intent_flow/_assets/skills/decomposition/normalize-requirement/SKILL.md +41 -0
- intent_flow/_assets/skills/decomposition/normalize-requirement/references/normalize.md +19 -0
- intent_flow/_assets/skills/decomposition/normalize-requirement/templates/normalized-requirement.template.md +34 -0
- intent_flow/_assets/skills/domains.yaml +207 -0
- intent_flow/_assets/skills/local-workspace/list-artifacts/SKILL.md +41 -0
- intent_flow/_assets/skills/local-workspace/list-artifacts/references/list.md +19 -0
- intent_flow/_assets/skills/local-workspace/read-artifact/SKILL.md +41 -0
- intent_flow/_assets/skills/local-workspace/read-artifact/references/read.md +19 -0
- intent_flow/_assets/skills/local-workspace/read-meta/SKILL.md +41 -0
- intent_flow/_assets/skills/local-workspace/read-meta/references/read.md +19 -0
- intent_flow/_assets/skills/local-workspace/write-artifact/SKILL.md +41 -0
- intent_flow/_assets/skills/local-workspace/write-artifact/references/write.md +19 -0
- intent_flow/_assets/skills/local-workspace/write-meta/SKILL.md +41 -0
- intent_flow/_assets/skills/local-workspace/write-meta/references/write.md +19 -0
- intent_flow/_assets/skills/project-management/create-work-item/SKILL.md +43 -0
- intent_flow/_assets/skills/project-management/create-work-item/mappings/jira.yaml +29 -0
- intent_flow/_assets/skills/project-management/create-work-item/mappings/tapd.yaml +29 -0
- intent_flow/_assets/skills/project-management/create-work-item/mappings/yunxiao.yaml +36 -0
- intent_flow/_assets/skills/project-management/create-work-item/references/create.md +22 -0
- intent_flow/_assets/skills/project-management/query-work-item/SKILL.md +41 -0
- intent_flow/_assets/skills/project-management/query-work-item/mappings/jira.yaml +15 -0
- intent_flow/_assets/skills/project-management/query-work-item/mappings/tapd.yaml +15 -0
- intent_flow/_assets/skills/project-management/query-work-item/mappings/yunxiao.yaml +15 -0
- intent_flow/_assets/skills/project-management/query-work-item/references/query.md +19 -0
- intent_flow/_assets/skills/project-management/sync-stage/SKILL.md +41 -0
- intent_flow/_assets/skills/project-management/sync-stage/mappings/jira.yaml +15 -0
- intent_flow/_assets/skills/project-management/sync-stage/mappings/tapd.yaml +15 -0
- intent_flow/_assets/skills/project-management/sync-stage/mappings/yunxiao.yaml +15 -0
- intent_flow/_assets/skills/project-management/sync-stage/references/sync.md +19 -0
- intent_flow/_assets/skills/project-management/update-status/SKILL.md +41 -0
- intent_flow/_assets/skills/project-management/update-status/mappings/jira.yaml +31 -0
- intent_flow/_assets/skills/project-management/update-status/mappings/tapd.yaml +31 -0
- intent_flow/_assets/skills/project-management/update-status/mappings/yunxiao.yaml +32 -0
- intent_flow/_assets/skills/project-management/update-status/references/update.md +19 -0
- intent_flow/_assets/skills/project-management/update-work-item/SKILL.md +41 -0
- intent_flow/_assets/skills/project-management/update-work-item/mappings/jira.yaml +15 -0
- intent_flow/_assets/skills/project-management/update-work-item/mappings/tapd.yaml +15 -0
- intent_flow/_assets/skills/project-management/update-work-item/mappings/yunxiao.yaml +15 -0
- intent_flow/_assets/skills/project-management/update-work-item/references/update.md +19 -0
- intent_flow/_assets/skills/remote-document/create-doc/SKILL.md +41 -0
- intent_flow/_assets/skills/remote-document/create-doc/mappings/feishu.yaml +12 -0
- intent_flow/_assets/skills/remote-document/create-doc/mappings/yuque.yaml +12 -0
- intent_flow/_assets/skills/remote-document/create-doc/references/create.md +19 -0
- intent_flow/_assets/skills/remote-document/publish-doc/SKILL.md +41 -0
- intent_flow/_assets/skills/remote-document/publish-doc/mappings/feishu.yaml +12 -0
- intent_flow/_assets/skills/remote-document/publish-doc/mappings/yuque.yaml +12 -0
- intent_flow/_assets/skills/remote-document/publish-doc/references/publish.md +19 -0
- intent_flow/_assets/skills/remote-document/read-doc/SKILL.md +41 -0
- intent_flow/_assets/skills/remote-document/read-doc/mappings/feishu.yaml +12 -0
- intent_flow/_assets/skills/remote-document/read-doc/mappings/yuque.yaml +12 -0
- intent_flow/_assets/skills/remote-document/read-doc/references/read.md +19 -0
- intent_flow/_assets/skills/remote-document/search-doc/SKILL.md +41 -0
- intent_flow/_assets/skills/remote-document/search-doc/mappings/feishu.yaml +12 -0
- intent_flow/_assets/skills/remote-document/search-doc/mappings/yuque.yaml +12 -0
- intent_flow/_assets/skills/remote-document/search-doc/references/search.md +19 -0
- intent_flow/_assets/skills/remote-document/update-doc/SKILL.md +41 -0
- intent_flow/_assets/skills/remote-document/update-doc/mappings/feishu.yaml +12 -0
- intent_flow/_assets/skills/remote-document/update-doc/mappings/yuque.yaml +12 -0
- intent_flow/_assets/skills/remote-document/update-doc/references/update.md +19 -0
- intent_flow/_assets/skills/requirement/analyze-requirement/SKILL.md +41 -0
- intent_flow/_assets/skills/requirement/analyze-requirement/references/analyze.md +19 -0
- intent_flow/_assets/skills/requirement/generate-prd/SKILL.md +41 -0
- intent_flow/_assets/skills/requirement/generate-prd/references/generate.md +19 -0
- intent_flow/_assets/skills/requirement/generate-prd/templates/prd.template.md +24 -0
- intent_flow/_assets/skills/requirement/generate-prototype/SKILL.md +41 -0
- intent_flow/_assets/skills/requirement/generate-prototype/references/generate.md +19 -0
- intent_flow/_assets/skills/requirement/generate-prototype/templates/prototype.template.md +26 -0
- intent_flow/_assets/skills/requirement/generate-scope/SKILL.md +41 -0
- intent_flow/_assets/skills/requirement/generate-scope/references/generate.md +19 -0
- intent_flow/_assets/skills/requirement/generate-scope/templates/scope.template.md +13 -0
- intent_flow/_assets/skills/requirement/intake-requirement/SKILL.md +41 -0
- intent_flow/_assets/skills/requirement/intake-requirement/references/intake.md +19 -0
- intent_flow/_assets/skills/resolution.yaml +17 -0
- intent_flow/adapters/__init__.py +1 -0
- intent_flow/adapters/opencode/__init__.py +1 -0
- intent_flow/adapters/opencode/adapter.yaml +31 -0
- intent_flow/adapters/opencode/build_runtime.py +1207 -0
- intent_flow/adapters/opencode/intent-flow.plugin.js +161 -0
- intent_flow/cli.py +1067 -0
- intent_flow-0.1.0.dist-info/METADATA +10 -0
- intent_flow-0.1.0.dist-info/RECORD +264 -0
- intent_flow-0.1.0.dist-info/WHEEL +5 -0
- intent_flow-0.1.0.dist-info/entry_points.txt +2 -0
- intent_flow-0.1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,354 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: application-qryexe
|
|
3
|
+
description: QryExe 查询执行器编写规范。当编写 QryExe 或处理读操作时使用。
|
|
4
|
+
globs:
|
|
5
|
+
- "**/application/**/command/query/*QryExe.java"
|
|
6
|
+
- "**/application/**/command/query/*PageQryExe.java"
|
|
7
|
+
- "**/application/**/command/query/*DetailQryExe.java"
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Application 层 - QryExe 查询执行器规范
|
|
11
|
+
|
|
12
|
+
## 核心职责
|
|
13
|
+
|
|
14
|
+
- **聚合根查询**:使用 Gateway(扩展性,自动级联加载子实体)
|
|
15
|
+
- **简单查询**:使用 Repository(性能优化,无需加载子实体)
|
|
16
|
+
- **不加事务注解**
|
|
17
|
+
- 通过 Convertor 进行对象转换
|
|
18
|
+
|
|
19
|
+
## 查询方式选择
|
|
20
|
+
|
|
21
|
+
### 1. Gateway vs Repository 选择
|
|
22
|
+
|
|
23
|
+
| 场景 | 使用 | 原因 |
|
|
24
|
+
|------|------|------|
|
|
25
|
+
| **聚合根详情** | Gateway.findById() | ✅ 扩展性:将来添加子实体无需改代码 |
|
|
26
|
+
| **聚合根写操作** | Gateway(必须) | ✅ 整存整取:自动级联保存/删除子实体 |
|
|
27
|
+
| **简单列表/下拉** | Repository | ✅ 性能:只查询必要字段,无需加载子实体 |
|
|
28
|
+
| **子实体列表查询** | SubEntityRepository | ✅ 直接查子实体表,不走聚合根整存整取 |
|
|
29
|
+
| **分页查询** | Repository | ✅ 插件支持:filtering + aggregate 自动处理 |
|
|
30
|
+
| **复杂查询** | Repository | ✅ 自定义 SQL:多表关联、聚合统计 |
|
|
31
|
+
|
|
32
|
+
> ⚠️ **子实体列表查询的常见误区**:
|
|
33
|
+
>
|
|
34
|
+
> 当需要查询"某聚合根下的子实体列表"时(如查询某平台类型下的所有站点),
|
|
35
|
+
> **不要**在 Gateway 接口上定义 `findXxxByParentId()` 方法,
|
|
36
|
+
> **应该**直接在 QryExe 中注入 `SubEntityRepository` 并使用 `lambdaQuery()`。
|
|
37
|
+
>
|
|
38
|
+
> ```java
|
|
39
|
+
> // ❌ 错误:QryExe 调用 Gateway 的自定义方法
|
|
40
|
+
> public class PlatformSiteListQryExe {
|
|
41
|
+
> private final PlatformTypeGateway platformTypeGateway; // ❌ QryExe 不能引用 Gateway
|
|
42
|
+
>
|
|
43
|
+
> public List<PlatformSiteCO> execute(PlatformSiteListQry qry) {
|
|
44
|
+
> List<PlatformSite> sites = platformTypeGateway.findSitesByPlatformTypeId(qry.getPlatformTypeId());
|
|
45
|
+
> return PlatformTypeConvertor.toSiteCOList(sites);
|
|
46
|
+
> }
|
|
47
|
+
> }
|
|
48
|
+
>
|
|
49
|
+
> // ✅ 正确:QryExe 直接使用 SubEntityRepository
|
|
50
|
+
> public class PlatformSiteListQryExe {
|
|
51
|
+
> private final PlatformSiteRepository platformSiteRepository; // ✅ 正确
|
|
52
|
+
>
|
|
53
|
+
> public List<PlatformSiteCO> execute(PlatformSiteListQry qry) {
|
|
54
|
+
> List<PlatformSite> sites = platformSiteRepository.lambdaQuery()
|
|
55
|
+
> .eq(PlatformSite::getSitType, qry.getPlatformTypeId())
|
|
56
|
+
> .list();
|
|
57
|
+
> return PlatformTypeConvertor.toSiteCOList(sites);
|
|
58
|
+
> }
|
|
59
|
+
> }
|
|
60
|
+
> ```
|
|
61
|
+
|
|
62
|
+
### 2. Repository 两种查询方式
|
|
63
|
+
|
|
64
|
+
| 查询类型 | 方式 | 返回类型 | 需要 Convertor | 适用场景 |
|
|
65
|
+
|---------|------|---------|---------------|---------|
|
|
66
|
+
| **LambdaQuery** | `repository.lambdaQuery()` | Entity | ✅ 是 | 单表简单查询 |
|
|
67
|
+
| **自定义 SQL** | `repository.page()`<br>`repository.findXxx()` | CO | ❌ 否 | 多表关联、聚合统计、分页 |
|
|
68
|
+
|
|
69
|
+
**LambdaQuery 示例**(需要 Convertor):
|
|
70
|
+
```java
|
|
71
|
+
@Component
|
|
72
|
+
@RequiredArgsConstructor
|
|
73
|
+
public class CountryDropdownQryExe {
|
|
74
|
+
private final CountryRepository countryRepository;
|
|
75
|
+
private final CountryConvertor countryConvertor;
|
|
76
|
+
|
|
77
|
+
public List<DropdownOptionCO> execute(String keyword) {
|
|
78
|
+
// 1. 查询 Entity
|
|
79
|
+
List<Country> countries = countryRepository.lambdaQuery()
|
|
80
|
+
.eq(Country::getStatus, StatusEnum.ENABLE)
|
|
81
|
+
.like(StringUtils.isNotBlank(keyword), Country::getCountryName, keyword)
|
|
82
|
+
.orderByDesc(Country::getUpdateTime)
|
|
83
|
+
.list();
|
|
84
|
+
|
|
85
|
+
// 2. 通过 Convertor 转换为 CO
|
|
86
|
+
return countries.stream()
|
|
87
|
+
.map(countryConvertor::toDropdownOption)
|
|
88
|
+
.toList();
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
**自定义 SQL 示例**(直接返回 CO):
|
|
94
|
+
```java
|
|
95
|
+
@Component
|
|
96
|
+
@RequiredArgsConstructor
|
|
97
|
+
public class CountryPageQryExe {
|
|
98
|
+
private final CountryRepository countryRepository;
|
|
99
|
+
|
|
100
|
+
public PageResult<CountryCO> execute(PageRequest pageRequest) {
|
|
101
|
+
// 直接返回 CO,不需要 Convertor
|
|
102
|
+
return countryRepository.page(pageRequest);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
**Repository 接口定义**:
|
|
108
|
+
```java
|
|
109
|
+
@Mapper
|
|
110
|
+
public interface CountryRepository extends BaseReadOnlyRepository<Country> {
|
|
111
|
+
/**
|
|
112
|
+
* 分页查询(自定义 SQL,直接返回 CO)
|
|
113
|
+
*
|
|
114
|
+
* ⚠️ Mapper XML 中直接映射为 CountryCO
|
|
115
|
+
*/
|
|
116
|
+
PageResult<CountryCO> page(@Param("query") PageRequest pageRequest);
|
|
117
|
+
}
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## 代码模板与示例
|
|
121
|
+
|
|
122
|
+
### 示例索引
|
|
123
|
+
|
|
124
|
+
| 查询类型 | 示例文件 | 说明 |
|
|
125
|
+
|---------|---------|------|
|
|
126
|
+
| **下拉查询** | [examples/dropdown.md](examples/dropdown.md) | LambdaQuery 方式,需要 Convertor |
|
|
127
|
+
| **分页查询** | [examples/pagination.md](examples/pagination.md) | 自定义 SQL,直接返回 CO |
|
|
128
|
+
| **详情查询** | [examples/detail.md](examples/detail.md) | 使用 Gateway 查询聚合根 |
|
|
129
|
+
|
|
130
|
+
### 查询方式选择
|
|
131
|
+
|
|
132
|
+
**LambdaQuery 方式**(无需写 SQL):
|
|
133
|
+
- 适用场景:单表简单查询、下拉框、列表
|
|
134
|
+
- 返回类型:Entity
|
|
135
|
+
- 是否需要 Convertor:✅ 需要
|
|
136
|
+
|
|
137
|
+
**自定义 SQL 方式**(需要写 XML):
|
|
138
|
+
- 适用场景:多表关联、聚合统计、分页查询
|
|
139
|
+
- 返回类型:CO
|
|
140
|
+
- 是否需要 Convertor:❌ 不需要
|
|
141
|
+
|
|
142
|
+
### 关键实现要点
|
|
143
|
+
|
|
144
|
+
**下拉查询执行器**(LambdaQuery 方式):
|
|
145
|
+
- ✅ 使用 `Repository.lambdaQuery()`
|
|
146
|
+
- ✅ 返回 Entity,需要 Convertor 转换
|
|
147
|
+
- ✅ 无需写 SQL
|
|
148
|
+
|
|
149
|
+
**分页查询执行器**(自定义 SQL 方式):
|
|
150
|
+
- ✅ 注入 Repository(不是 Mapper)
|
|
151
|
+
- ✅ 参数是 PageRequest(不是自定义 Query)
|
|
152
|
+
- ✅ 代码超简洁:只需调用 `repository.page()`
|
|
153
|
+
- ✅ 插件自动处理:filtering、aggregate、分页全自动
|
|
154
|
+
- ✅ 无需 Convertor:Mapper XML 直接返回 CO
|
|
155
|
+
- ✅ 详细规范参考:`02-plugins/pagination-backend/`
|
|
156
|
+
|
|
157
|
+
**详情查询执行器**:
|
|
158
|
+
- ✅ 聚合根查询使用 Gateway(扩展性考虑)
|
|
159
|
+
- ✅ 简单查询可用 Repository(如下拉框、列表)
|
|
160
|
+
- ✅ 通过 Convertor 转换为 CO
|
|
161
|
+
|
|
162
|
+
## QryExe vs CmdExe 对比
|
|
163
|
+
|
|
164
|
+
| 特性 | QryExe | CmdExe |
|
|
165
|
+
|------|--------|--------|
|
|
166
|
+
| **职责** | 读操作 | 写操作 |
|
|
167
|
+
| **引用** | Gateway(聚合根)或 Repository(简单查询) | Gateway(必须) |
|
|
168
|
+
| **聚合根** | 通过 Gateway 查询(扩展性) | 编排聚合根 |
|
|
169
|
+
| **事务** | 不加 | 不加(AppService 加) |
|
|
170
|
+
| **转换** | 通过 Convertor | 通过 Convertor |
|
|
171
|
+
|
|
172
|
+
**查询方式选择**:
|
|
173
|
+
- ✅ **聚合根详情查询** → 使用 `Gateway.findById()`(扩展性)
|
|
174
|
+
- ✅ **简单列表/下拉框** → 使用 `Repository.lambdaQuery()`(性能)
|
|
175
|
+
- ✅ **分页查询** → 使用 `Repository.page()`(高级分页插件)
|
|
176
|
+
|
|
177
|
+
## 核心规范
|
|
178
|
+
|
|
179
|
+
## 跨域访问规范
|
|
180
|
+
|
|
181
|
+
### 核心原则
|
|
182
|
+
|
|
183
|
+
**QryExe 只能引用 Repository(本域或其他域),不能调用其他域的 AppService**
|
|
184
|
+
|
|
185
|
+
- ✅ QryExe 可以引用其他域的 Repository(LambdaQuery 或自定义 SQL)
|
|
186
|
+
- ❌ QryExe 不能调用其他域的 AppService(如需调用,在 AppService 层组装)
|
|
187
|
+
- ❌ QryExe 不能引用任何 Gateway(Gateway 是写操作专用)
|
|
188
|
+
|
|
189
|
+
### 允许的跨域方式
|
|
190
|
+
|
|
191
|
+
| 组件 | 本域 Repository | 其他域 Repository | 其他域 AppService | 其他域 Gateway |
|
|
192
|
+
|------|---------------|-----------------|-----------------|---------------|
|
|
193
|
+
| **QryExe** | ✅ 允许 | ✅ 允许 | ❌ 禁止 | ❌ 禁止 |
|
|
194
|
+
| **AppService** | ❌ 禁止 | ❌ 禁止 | ✅ 允许 | ❌ 禁止 |
|
|
195
|
+
|
|
196
|
+
### 跨域查询方式
|
|
197
|
+
|
|
198
|
+
#### QryExe 中跨域查询(引用其他域的 Repository)
|
|
199
|
+
|
|
200
|
+
**QryExe 只能使用 Repository 进行跨域查询**,不能调用其他域的 AppService。
|
|
201
|
+
|
|
202
|
+
**适用场景**:
|
|
203
|
+
- 所有 QryExe 的跨域查询场景
|
|
204
|
+
- 简单的数据查询(不需要复杂业务逻辑)
|
|
205
|
+
|
|
206
|
+
**优点**:
|
|
207
|
+
- ✅ 直接、简洁、性能好
|
|
208
|
+
- ✅ 可以使用 LambdaQuery(无需写 SQL)
|
|
209
|
+
- ✅ 可以使用自定义 SQL(多表 JOIN)
|
|
210
|
+
- ✅ 职责清晰:QryExe 专注于数据查询
|
|
211
|
+
|
|
212
|
+
##### 方式 1:使用 LambdaQuery(推荐:无需写 SQL)
|
|
213
|
+
|
|
214
|
+
```java
|
|
215
|
+
@Component
|
|
216
|
+
@RequiredArgsConstructor
|
|
217
|
+
public class OrderDetailQryExe {
|
|
218
|
+
private final OrderRepository orderRepository;
|
|
219
|
+
private final ProductRepository productRepository; // ✅ 跨域:引用其他域 Repository
|
|
220
|
+
private final CustomerRepository customerRepository; // ✅ 跨域:引用其他域 Repository
|
|
221
|
+
|
|
222
|
+
public OrderDetailCO execute(Integer orderId) {
|
|
223
|
+
// 查询本域数据
|
|
224
|
+
Order order = orderRepository.selectById(orderId);
|
|
225
|
+
|
|
226
|
+
// ✅ 跨域查询:使用其他域 Repository 的 LambdaQuery
|
|
227
|
+
Product product = productRepository.lambdaQuery()
|
|
228
|
+
.eq(Product::getProductId, order.getProductId())
|
|
229
|
+
.one();
|
|
230
|
+
|
|
231
|
+
Customer customer = customerRepository.lambdaQuery()
|
|
232
|
+
.eq(Customer::getCustomerId, order.getCustomerId())
|
|
233
|
+
.one();
|
|
234
|
+
|
|
235
|
+
// 组装数据
|
|
236
|
+
OrderDetailCO result = OrderConvertor.toDetailCO(order);
|
|
237
|
+
result.setProductName(product.getProductName());
|
|
238
|
+
result.setCustomerName(customer.getCustomerName());
|
|
239
|
+
return result;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
##### 方式 2:使用自定义 SQL(推荐:多表 JOIN,性能最好)
|
|
245
|
+
|
|
246
|
+
```java
|
|
247
|
+
@Component
|
|
248
|
+
@RequiredArgsConstructor
|
|
249
|
+
public class OrderListQryExe {
|
|
250
|
+
private final OrderRepository orderRepository;
|
|
251
|
+
|
|
252
|
+
public PageResult<OrderListCO> execute(PageRequest pageRequest) {
|
|
253
|
+
// ✅ Repository 的自定义 SQL 可以 JOIN 其他域的表
|
|
254
|
+
// Mapper XML 中直接 JOIN product、customer 表
|
|
255
|
+
return orderRepository.page(pageRequest);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
**Mapper XML**:
|
|
261
|
+
```xml
|
|
262
|
+
<select id="page" resultType="...OrderListCO">
|
|
263
|
+
SELECT
|
|
264
|
+
o.order_id AS orderId,
|
|
265
|
+
o.order_code AS orderCode,
|
|
266
|
+
p.product_name AS productName, <!-- 跨域:product 表 -->
|
|
267
|
+
c.customer_name AS customerName <!-- 跨域:customer 表 -->
|
|
268
|
+
FROM oms_order AS o
|
|
269
|
+
LEFT JOIN pms_product AS p ON o.product_id = p.product_id
|
|
270
|
+
LEFT JOIN crm_customer AS c ON o.customer_id = c.customer_id
|
|
271
|
+
WHERE o.del_flag = '0'
|
|
272
|
+
</select>
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
---
|
|
276
|
+
|
|
277
|
+
#### AppService 层组装数据(需要调用其他域 AppService 时)
|
|
278
|
+
|
|
279
|
+
**适用场景**:
|
|
280
|
+
- 需要调用其他域的 AppService(包含复杂业务逻辑)
|
|
281
|
+
- 需要复杂的权限校验
|
|
282
|
+
- 需要复杂的数据转换
|
|
283
|
+
|
|
284
|
+
**说明**:
|
|
285
|
+
- ❌ QryExe 不能调用其他域的 AppService
|
|
286
|
+
- ✅ 如果需要调用,必须在 AppService 层组装数据
|
|
287
|
+
|
|
288
|
+
```java
|
|
289
|
+
// AppService 层
|
|
290
|
+
@Service
|
|
291
|
+
@RequiredArgsConstructor
|
|
292
|
+
public class OrderAppServiceImpl implements OrderAppService {
|
|
293
|
+
private final OrderDetailQryExe orderDetailQryExe;
|
|
294
|
+
private final ProductAppService productAppService; // 跨域依赖
|
|
295
|
+
|
|
296
|
+
@Override
|
|
297
|
+
public OrderDetailCO getDetail(Integer orderId) {
|
|
298
|
+
// 1. QryExe 查询本域数据
|
|
299
|
+
OrderDetailCO order = orderDetailQryExe.execute(orderId);
|
|
300
|
+
|
|
301
|
+
// 2. AppService 层调用其他域 AppService
|
|
302
|
+
ProductDetailCO product = productAppService.getById(order.getProductId());
|
|
303
|
+
|
|
304
|
+
// 3. AppService 层组装数据
|
|
305
|
+
order.setProduct(product);
|
|
306
|
+
return order;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
// QryExe 只查询本域
|
|
311
|
+
@Component
|
|
312
|
+
@RequiredArgsConstructor
|
|
313
|
+
public class OrderDetailQryExe {
|
|
314
|
+
private final OrderRepository orderRepository;
|
|
315
|
+
|
|
316
|
+
public OrderDetailCO execute(Integer orderId) {
|
|
317
|
+
Order order = orderRepository.selectById(orderId);
|
|
318
|
+
return OrderConvertor.toDetailCO(order);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
---
|
|
324
|
+
|
|
325
|
+
### 规则总结
|
|
326
|
+
|
|
327
|
+
| 场景 | 在哪里处理 | 使用方式 |
|
|
328
|
+
|------|-----------|---------|
|
|
329
|
+
| **简单列表/分页查询** | QryExe | Repository 自定义 SQL JOIN 其他域的表 |
|
|
330
|
+
| **详情查询(简单数据)** | QryExe | Repository LambdaQuery 查询其他域的表 |
|
|
331
|
+
| **需要其他域的 AppService** | AppService 层 | AppService 调用其他域 AppService,组装数据 |
|
|
332
|
+
| **只查询本域数据** | QryExe | Repository 查询本域表 |
|
|
333
|
+
|
|
334
|
+
**⭐ 核心规则**:
|
|
335
|
+
- ✅ QryExe 只能用 Repository(本域或其他域)
|
|
336
|
+
- ❌ QryExe 不能调用其他域的 AppService
|
|
337
|
+
- ✅ 需要调用其他域 AppService 时,在 AppService 层组装数据
|
|
338
|
+
|
|
339
|
+
### ❌ 禁止的行为
|
|
340
|
+
|
|
341
|
+
- ❌ **QryExe 中调用其他域的 AppService**(如需调用,在 AppService 层组装)
|
|
342
|
+
- ❌ **QryExe 中引用任何 Gateway**(Gateway 是写操作专用)
|
|
343
|
+
- ❌ **QryExe 中调用任何 CmdExe**(查询不应触发写操作)
|
|
344
|
+
|
|
345
|
+
## 检查清单
|
|
346
|
+
|
|
347
|
+
- [ ] 是否**没有**引用任何 Gateway(Gateway 是写操作专用)
|
|
348
|
+
- [ ] 是否**没有**调用其他域的 AppService(如需调用,在 AppService 层组装)
|
|
349
|
+
- [ ] 跨域查询是否只使用 Repository(LambdaQuery 或自定义 SQL)
|
|
350
|
+
- [ ] 是否**没有**添加 `@Transactional` 注解
|
|
351
|
+
- [ ] 是否通过 Convertor 进行对象转换
|
|
352
|
+
- [ ] 是否使用 `toList()` 而不是 `collect(Collectors.toList())`
|
|
353
|
+
- [ ] 分页查询是否遵循分页插件规范
|
|
354
|
+
- [ ] 是否有适当的日志记录
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
# QryExe - 详情查询示例(Country)
|
|
2
|
+
|
|
3
|
+
## 业务场景
|
|
4
|
+
查询国家聚合根的完整详情。
|
|
5
|
+
|
|
6
|
+
## CountryDetailQryExe.java
|
|
7
|
+
|
|
8
|
+
```java
|
|
9
|
+
package com.trob4cloud.service.basis.application.country.command.query;
|
|
10
|
+
|
|
11
|
+
import com.trob4cloud.service.basis.application.country.command.dto.co.CountryDetailCO;
|
|
12
|
+
import com.trob4cloud.service.basis.application.country.convertor.CountryConvertor;
|
|
13
|
+
import com.trob4cloud.service.basis.domain.country.CountryGateway;
|
|
14
|
+
import com.trob4cloud.service.basis.domain.country.model.Country;
|
|
15
|
+
import lombok.RequiredArgsConstructor;
|
|
16
|
+
import lombok.extern.slf4j.Slf4j;
|
|
17
|
+
import org.springframework.stereotype.Component;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* 国家详情查询执行器
|
|
21
|
+
*
|
|
22
|
+
* @author AI Generated
|
|
23
|
+
*/
|
|
24
|
+
@Slf4j
|
|
25
|
+
@Component
|
|
26
|
+
@RequiredArgsConstructor
|
|
27
|
+
public class CountryDetailQryExe {
|
|
28
|
+
|
|
29
|
+
// ✅ 查询聚合根使用 Gateway(即使当前无子实体,也要考虑扩展性)
|
|
30
|
+
private final CountryGateway countryGateway;
|
|
31
|
+
private final CountryConvertor countryConvertor;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* 执行详情查询
|
|
35
|
+
*
|
|
36
|
+
* @param countryId 国家 ID
|
|
37
|
+
* @return 国家详情 CO
|
|
38
|
+
*/
|
|
39
|
+
public CountryDetailCO execute(Integer countryId) {
|
|
40
|
+
log.debug("查询国家详情,ID:{}", countryId);
|
|
41
|
+
|
|
42
|
+
// ✅ 通过 Gateway.findById() 获取聚合根
|
|
43
|
+
// 将来如果有子实体(如省份),会自动级联加载
|
|
44
|
+
Country country = countryGateway.findById(countryId);
|
|
45
|
+
if (country == null) {
|
|
46
|
+
throw new RuntimeException("国家不存在:" + countryId);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return countryConvertor.toDetailCO(country);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## CountryDetailCO.java
|
|
55
|
+
|
|
56
|
+
```java
|
|
57
|
+
package com.trob4cloud.service.basis.application.country.command.dto.co;
|
|
58
|
+
|
|
59
|
+
import lombok.Data;
|
|
60
|
+
import java.time.LocalDateTime;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* 国家详情 CO
|
|
64
|
+
*/
|
|
65
|
+
@Data
|
|
66
|
+
public class CountryDetailCO {
|
|
67
|
+
|
|
68
|
+
private Integer countryId;
|
|
69
|
+
private String countryCode;
|
|
70
|
+
private String countryName;
|
|
71
|
+
private String countryLongCode;
|
|
72
|
+
private String countryShortName;
|
|
73
|
+
private String baseCurrency;
|
|
74
|
+
private String baseCurrencySymbol;
|
|
75
|
+
private String status;
|
|
76
|
+
private LocalDateTime createTime;
|
|
77
|
+
private LocalDateTime updateTime;
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## 关键点检查清单
|
|
82
|
+
|
|
83
|
+
- [ ] 注入 Gateway(不是 Repository)
|
|
84
|
+
- [ ] 使用 `gateway.findById()` 查询聚合根
|
|
85
|
+
- [ ] 进行空值检查(抛出异常或返回 null)
|
|
86
|
+
- [ ] 通过 Convertor 转换为 DetailCO
|
|
87
|
+
- [ ] 不添加事务注解
|
|
88
|
+
|
|
89
|
+
## 为什么使用 Gateway 而不是 Repository?
|
|
90
|
+
|
|
91
|
+
### 扩展性考虑
|
|
92
|
+
|
|
93
|
+
**当前情况**:Country 无子实体
|
|
94
|
+
```java
|
|
95
|
+
// 当前用 Repository 也可以
|
|
96
|
+
Country country = countryRepository.getById(countryId);
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
**未来扩展**:Country 添加了子实体(Province)
|
|
100
|
+
```java
|
|
101
|
+
// 如果用 Repository,需要改代码
|
|
102
|
+
Country country = countryRepository.getById(countryId);
|
|
103
|
+
List<Province> provinces = provinceRepository.listByCountryId(countryId);
|
|
104
|
+
country.setProvinces(provinces); // 手动关联
|
|
105
|
+
|
|
106
|
+
// 如果用 Gateway,代码无需改动
|
|
107
|
+
Country country = countryGateway.findById(countryId);
|
|
108
|
+
// Gateway 自动级联加载 provinces
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
✅ **最佳实践**:聚合根查询统一使用 Gateway,即使当前无子实体。
|
|
112
|
+
|
|
113
|
+
## Gateway vs Repository 使用场景
|
|
114
|
+
|
|
115
|
+
| 场景 | 使用 | 原因 |
|
|
116
|
+
|------|------|------|
|
|
117
|
+
| **聚合根详情** | Gateway.findById() | ✅ 扩展性:将来添加子实体无需改代码 |
|
|
118
|
+
| **聚合根写操作** | Gateway(必须) | ✅ 整存整取:自动级联保存/删除子实体 |
|
|
119
|
+
| **简单列表/下拉** | Repository | ✅ 性能:只查询必要字段,无需加载子实体 |
|
|
120
|
+
| **分页查询** | Repository | ✅ 插件支持:filtering + aggregate 自动处理 |
|
|
121
|
+
|
|
122
|
+
## 常见错误
|
|
123
|
+
|
|
124
|
+
```java
|
|
125
|
+
// ❌ 错误 1:聚合根查询使用 Repository
|
|
126
|
+
private final CountryRepository countryRepository;
|
|
127
|
+
|
|
128
|
+
public CountryDetailCO execute(Integer countryId) {
|
|
129
|
+
Country country = countryRepository.getById(countryId);
|
|
130
|
+
// 将来有子实体时需要改代码
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// ✅ 正确:使用 Gateway
|
|
134
|
+
private final CountryGateway countryGateway;
|
|
135
|
+
|
|
136
|
+
public CountryDetailCO execute(Integer countryId) {
|
|
137
|
+
Country country = countryGateway.findById(countryId);
|
|
138
|
+
// 将来有子实体时代码无需改动
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// ❌ 错误 2:不做空值检查
|
|
142
|
+
Country country = countryGateway.findById(countryId);
|
|
143
|
+
return countryConvertor.toDetailCO(country); // country 可能为 null
|
|
144
|
+
|
|
145
|
+
// ✅ 正确:空值检查
|
|
146
|
+
Country country = countryGateway.findById(countryId);
|
|
147
|
+
if (country == null) {
|
|
148
|
+
throw new RuntimeException("国家不存在:" + countryId);
|
|
149
|
+
}
|
|
150
|
+
return countryConvertor.toDetailCO(country);
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
## 相关文件
|
|
154
|
+
|
|
155
|
+
- Gateway 示例:[infrastructure/gatewayimpl/examples/gateway.md](../../../infrastructure/gatewayimpl/examples/gateway.md)
|
|
156
|
+
- Convertor 示例:[../convertor/examples/entity-to-co.md](../convertor/examples/entity-to-co.md)
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
# QryExe - 分页查询示例(Country)
|
|
2
|
+
|
|
3
|
+
## 业务场景
|
|
4
|
+
国家基础数据的分页查询,支持动态过滤和聚合统计。
|
|
5
|
+
|
|
6
|
+
## CountryPageQryExe.java
|
|
7
|
+
|
|
8
|
+
```java
|
|
9
|
+
package com.trob4cloud.service.basis.application.country.command.query;
|
|
10
|
+
|
|
11
|
+
import com.trob4cloud.common.mybatis.core.entity.PageRequest;
|
|
12
|
+
import com.trob4cloud.common.mybatis.core.entity.PageResult;
|
|
13
|
+
import com.trob4cloud.service.basis.application.country.command.dto.co.CountryCO;
|
|
14
|
+
import com.trob4cloud.service.basis.infrastructure.gatewayimpl.database.repository.CountryRepository;
|
|
15
|
+
import lombok.RequiredArgsConstructor;
|
|
16
|
+
import lombok.extern.slf4j.Slf4j;
|
|
17
|
+
import org.springframework.stereotype.Component;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* 国家分页查询执行器
|
|
21
|
+
*
|
|
22
|
+
* @author AI Generated
|
|
23
|
+
*/
|
|
24
|
+
@Slf4j
|
|
25
|
+
@Component
|
|
26
|
+
@RequiredArgsConstructor
|
|
27
|
+
public class CountryPageQryExe {
|
|
28
|
+
|
|
29
|
+
private final CountryRepository countryRepository;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* 执行分页查询
|
|
33
|
+
*
|
|
34
|
+
* @param pageRequest 分页请求
|
|
35
|
+
* @return 分页结果
|
|
36
|
+
*/
|
|
37
|
+
public PageResult<CountryCO> execute(PageRequest pageRequest) {
|
|
38
|
+
log.debug("分页查询国家,页码:{},每页:{}",pageRequest.getPageNum(), pageRequest.getPageSize());
|
|
39
|
+
|
|
40
|
+
// 直接调用 Repository 的分页方法
|
|
41
|
+
// 分页插件会自动处理 filtering 和 aggregate
|
|
42
|
+
PageResult<CountryCO> result = countryRepository.page(pageRequest);
|
|
43
|
+
|
|
44
|
+
log.debug("分页查询结果,总记录数:{},当前页:{},每页大小:{}", result.getTotal(), result.getPage(), result.getSize());
|
|
45
|
+
return result;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## 前端请求示例
|
|
51
|
+
|
|
52
|
+
```json
|
|
53
|
+
{
|
|
54
|
+
"pageNum": 1,
|
|
55
|
+
"pageSize": 20,
|
|
56
|
+
"filtering": [
|
|
57
|
+
{
|
|
58
|
+
"field": "status",
|
|
59
|
+
"operator": "EQUAL",
|
|
60
|
+
"value": "ENABLE"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"field": "countryName",
|
|
64
|
+
"operator": "LIKE",
|
|
65
|
+
"value": "中"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"field": "createTime",
|
|
69
|
+
"operator": "BETWEEN",
|
|
70
|
+
"value": ["2026-01-01 00:00:00", "2026-12-31 23:59:59"]
|
|
71
|
+
}
|
|
72
|
+
],
|
|
73
|
+
"aggregate": [
|
|
74
|
+
{
|
|
75
|
+
"field": "countryId",
|
|
76
|
+
"function": "COUNT"
|
|
77
|
+
}
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## 返回结果示例
|
|
83
|
+
|
|
84
|
+
```json
|
|
85
|
+
{
|
|
86
|
+
"code": 200,
|
|
87
|
+
"msg": "操作成功",
|
|
88
|
+
"data": {
|
|
89
|
+
"total": 100,
|
|
90
|
+
"page": 1,
|
|
91
|
+
"size": 20,
|
|
92
|
+
"pages": 5,
|
|
93
|
+
"records": [
|
|
94
|
+
{
|
|
95
|
+
"countryId": 1,
|
|
96
|
+
"countryCode": "CN",
|
|
97
|
+
"countryName": "中国",
|
|
98
|
+
"status": "ENABLE",
|
|
99
|
+
"createTime": "2026-02-10 10:00:00"
|
|
100
|
+
}
|
|
101
|
+
],
|
|
102
|
+
"aggregateRecord": {
|
|
103
|
+
"countryId": 100
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## 关键点检查清单
|
|
110
|
+
|
|
111
|
+
- [ ] 注入 Repository(不是 Mapper)
|
|
112
|
+
- [ ] 参数是 `PageRequest`(不是自定义 Query)
|
|
113
|
+
- [ ] 直接调用 `repository.page()`(无需构建查询条件)
|
|
114
|
+
- [ ] 添加 DEBUG 日志(记录查询参数和结果)
|
|
115
|
+
- [ ] 不添加事务注解(查询操作无需事务)
|
|
116
|
+
|
|
117
|
+
## 常见错误
|
|
118
|
+
|
|
119
|
+
```java
|
|
120
|
+
// ❌ 错误 1:注入 Mapper 而非 Repository
|
|
121
|
+
private final CountryMapper countryMapper;
|
|
122
|
+
|
|
123
|
+
// ✅ 正确
|
|
124
|
+
private final CountryRepository countryRepository;
|
|
125
|
+
|
|
126
|
+
// ❌ 错误 2:使用自定义 Query 对象
|
|
127
|
+
public PageResult<CountryCO> execute(CountryPageQry qry)
|
|
128
|
+
|
|
129
|
+
// ✅ 正确
|
|
130
|
+
public PageResult<CountryCO> execute(PageRequest pageRequest)
|
|
131
|
+
|
|
132
|
+
// ❌ 错误 3:手动构建查询条件
|
|
133
|
+
LambdaQueryWrapper<Country> wrapper = new LambdaQueryWrapper<>();
|
|
134
|
+
wrapper.eq(Country::getStatus, qry.getStatus());
|
|
135
|
+
|
|
136
|
+
// ✅ 正确:直接调用 repository.page(),由插件处理
|
|
137
|
+
return countryRepository.page(pageRequest);
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## 相关文件
|
|
141
|
+
|
|
142
|
+
- Repository 示例:[infrastructure/repository/examples/pagination-simple.md](../../../infrastructure/repository/examples/pagination-simple.md)
|
|
143
|
+
- AppService 示例:[../appservice/examples/pagination.md](../appservice/examples/pagination.md)
|
|
144
|
+
- Controller 示例:[adapter/controller/examples/pagination.md](../../../adapter/controller/examples/pagination.md)
|
|
145
|
+
- 分页插件规范:[02-plugins/pagination-backend/SKILL.md](../../../../02-plugins/pagination-backend/SKILL.md)
|