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,536 @@
|
|
|
1
|
+
# Gateway 能力列表与使用指南
|
|
2
|
+
|
|
3
|
+
> **面向对象**:AI 代码生成
|
|
4
|
+
> **组织方式**:按业务场景分类
|
|
5
|
+
> **核心原则**:大部分场景无需自定义方法,直接使用继承的能力
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 第一部分:完整能力清单
|
|
10
|
+
|
|
11
|
+
Gateway 接口继承 `BaseGateway<T, ID>`,自动拥有以下 12 个方法:
|
|
12
|
+
|
|
13
|
+
| 方法签名 | 功能 | 参数 | 返回值 | 注意事项 |
|
|
14
|
+
|---------|------|------|--------|---------|
|
|
15
|
+
| `findById(ID id)` | 根据主键查询聚合根 | 主键 ID | 聚合根对象(可能为 null) | ✅ 自动级联加载 @OneToMany 子实体 |
|
|
16
|
+
| `findByIds(Collection<ID> ids)` | 根据主键列表批量查询 | 主键 ID 集合 | 聚合根列表 | ✅ 自动级联加载子实体 |
|
|
17
|
+
| `findByCode(Object... values)` | 根据唯一键查询聚合根 | 唯一键值(按 order 顺序) | 聚合根对象(可能为 null) | ✅ 自动匹配 @AggregateKey 唯一键 |
|
|
18
|
+
| `findByCodes(List<String> codes)` | 根据单字段唯一键列表批量查询 | 唯一键值列表(单字段) | 聚合根列表 | ✅ 仅支持单字段唯一键 |
|
|
19
|
+
| `findByCodes(Collection<Object[]> keys)` | 根据组合唯一键列表批量查询 | 唯一键数组集合(多字段) | 聚合根列表 | ✅ 支持组合唯一键 |
|
|
20
|
+
| `findAll()` | 查询所有聚合根 | 无 | 聚合根列表 | ⚠️ 慎用,数据量大时影响性能 |
|
|
21
|
+
| `save(T entity)` | 保存聚合根 | 聚合根对象 | void | ✅ 自动级联保存/删除子实体<br>✅ 脏检查,只更新变更字段<br>✅ 自动设置子实体外键 |
|
|
22
|
+
| `saveBatch(Collection<T> entities)` | 批量保存聚合根 | 聚合根集合 | void | ✅ 批量优化,减少数据库交互 |
|
|
23
|
+
| `deleteById(ID id)` | 根据主键删除聚合根 | 主键 ID | void | ✅ 自动级联删除 @OneToMany 子实体 |
|
|
24
|
+
| `delete(T entity)` | 删除聚合根 | 聚合根对象 | void | ✅ 自动级联删除子实体 |
|
|
25
|
+
| `existsByCode(Object... values)` | 校验唯一键是否存在 | 唯一键值(按 order 顺序) | boolean | ✅ 自动匹配 @AggregateKey 唯一键 |
|
|
26
|
+
| `existsByCodeExcludeId(ID excludeId, Object... values)` | 校验唯一键是否存在(排除指定ID) | 排除的 ID + 唯一键值 | boolean | ✅ 更新时使用,排除自身 |
|
|
27
|
+
|
|
28
|
+
**关键特性**:
|
|
29
|
+
- ✅ **自动级联**:查询/保存/删除自动处理 @OneToMany 子实体
|
|
30
|
+
- ✅ **脏检查**:save() 时只更新变更的字段
|
|
31
|
+
- ✅ **批量优化**:批量操作减少数据库交互次数
|
|
32
|
+
- ✅ **外键管理**:自动设置子实体的 @AggregateKey 外键
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## 第二部分:按场景使用指南
|
|
37
|
+
|
|
38
|
+
### 场景 1:创建聚合根(无子实体)
|
|
39
|
+
|
|
40
|
+
**使用方法**:`save(T entity)`
|
|
41
|
+
|
|
42
|
+
```java
|
|
43
|
+
// CmdExe 中的核心代码
|
|
44
|
+
if (countryGateway.existsByCode(cmd.getCountryCode())) {
|
|
45
|
+
throw new BusinessException("国家代码已存在");
|
|
46
|
+
}
|
|
47
|
+
Country country = Country.create(cmd.getCountryCode(), cmd.getCountryName());
|
|
48
|
+
countryGateway.save(country); // INSERT 聚合根
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
**关键点**:
|
|
52
|
+
- ✅ 先用 `existsByCode` 校验唯一性
|
|
53
|
+
- ✅ 调用 Entity 的工厂方法创建聚合根
|
|
54
|
+
- ✅ `save()` 自动执行 INSERT
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
### 场景 2:创建聚合根(带子实体)
|
|
59
|
+
|
|
60
|
+
**使用方法**:`save(T entity)`
|
|
61
|
+
|
|
62
|
+
```java
|
|
63
|
+
// CmdExe 中的核心代码
|
|
64
|
+
PlatformType platform = PlatformType.create(cmd.getPlatformCode(), cmd.getPlatformName());
|
|
65
|
+
cmd.getSites().forEach(siteCmd ->
|
|
66
|
+
platform.addSite(PlatformSite.create(siteCmd.getCountryCode(), siteCmd.getSiteName()))
|
|
67
|
+
);
|
|
68
|
+
platformGateway.save(platform); // INSERT 聚合根 + 批量 INSERT 子实体
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
**关键点**:
|
|
72
|
+
- ✅ 通过聚合根的 `addSite()` 方法添加子实体
|
|
73
|
+
- ✅ `save()` 自动级联保存所有子实体
|
|
74
|
+
- ✅ 自动设置子实体的外键(@AggregateKey)
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
### 场景 3:更新聚合根(无子实体)
|
|
79
|
+
|
|
80
|
+
**使用方法**:`findById()` + `save()`
|
|
81
|
+
|
|
82
|
+
```java
|
|
83
|
+
// CmdExe 中的核心代码
|
|
84
|
+
if (countryGateway.existsByCodeExcludeId(cmd.getCountryId(), cmd.getCountryCode())) {
|
|
85
|
+
throw new BusinessException("国家代码已被其他记录使用");
|
|
86
|
+
}
|
|
87
|
+
Country country = countryGateway.findById(cmd.getCountryId());
|
|
88
|
+
country.update(cmd.getCountryName());
|
|
89
|
+
countryGateway.save(country); // UPDATE 变更的字段
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
**关键点**:
|
|
93
|
+
- ✅ 先用 `existsByCodeExcludeId` 校验唯一性(排除自身)
|
|
94
|
+
- ✅ 用 `findById` 加载聚合根
|
|
95
|
+
- ✅ 调用 Entity 的业务方法更新
|
|
96
|
+
- ✅ `save()` 自动脏检查,只更新变更字段
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
### 场景 4:更新聚合根(添加子实体)
|
|
101
|
+
|
|
102
|
+
**使用方法**:`findById()` + `save()`
|
|
103
|
+
|
|
104
|
+
```java
|
|
105
|
+
// CmdExe 中的核心代码
|
|
106
|
+
PlatformType platform = platformGateway.findById(cmd.getPlatformId());
|
|
107
|
+
platform.addSite(PlatformSite.create(cmd.getCountryCode(), cmd.getSiteName()));
|
|
108
|
+
platformGateway.save(platform); // INSERT 新子实体
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
**关键点**:
|
|
112
|
+
- ✅ 通过聚合根的 `addSite()` 方法添加子实体
|
|
113
|
+
- ✅ `save()` 自动 INSERT 新子实体
|
|
114
|
+
- ✅ 自动设置子实体的外键
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
### 场景 5:更新聚合根(删除子实体)
|
|
119
|
+
|
|
120
|
+
**使用方法**:`findById()` + `save()`
|
|
121
|
+
|
|
122
|
+
```java
|
|
123
|
+
// CmdExe 中的核心代码
|
|
124
|
+
PlatformType platform = platformGateway.findById(cmd.getPlatformId());
|
|
125
|
+
platform.removeSite(cmd.getSiteId());
|
|
126
|
+
platformGateway.save(platform); // DELETE 移除的子实体(orphanRemoval=true)
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
**关键点**:
|
|
130
|
+
- ✅ 通过聚合根的 `removeSite()` 方法移除子实体
|
|
131
|
+
- ✅ `save()` 自动 DELETE 从集合中移除的子实体
|
|
132
|
+
- ✅ 需要 @OneToMany 配置 `orphanRemoval=true`
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
### 场景 6:删除聚合根
|
|
137
|
+
|
|
138
|
+
**使用方法**:`deleteById(ID id)` 或 `delete(T entity)`
|
|
139
|
+
|
|
140
|
+
```java
|
|
141
|
+
// CmdExe 中的核心代码(方式1)
|
|
142
|
+
countryGateway.deleteById(cmd.getCountryId()); // DELETE 聚合根
|
|
143
|
+
|
|
144
|
+
// 方式2:先查询再删除(需要业务校验时)
|
|
145
|
+
Country country = countryGateway.findById(cmd.getCountryId());
|
|
146
|
+
if (country.hasRelatedData()) {
|
|
147
|
+
throw new BusinessException("国家被引用,无法删除");
|
|
148
|
+
}
|
|
149
|
+
countryGateway.delete(country); // DELETE 聚合根
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
**关键点**:
|
|
153
|
+
- ✅ 如果有 @OneToMany 子实体,自动级联删除
|
|
154
|
+
- ✅ 先删除子实体,再删除聚合根
|
|
155
|
+
- ✅ 方式1更简洁,方式2适合需要业务校验的场景
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
### 场景 7:根据主键查询单个聚合根
|
|
160
|
+
|
|
161
|
+
**使用方法**:`findById(ID id)`
|
|
162
|
+
|
|
163
|
+
```java
|
|
164
|
+
// CmdExe 中的核心代码
|
|
165
|
+
Country country = countryGateway.findById(cmd.getCountryId());
|
|
166
|
+
if (country == null) {
|
|
167
|
+
throw new BusinessException("国家不存在");
|
|
168
|
+
}
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
**关键点**:
|
|
172
|
+
- ✅ 返回值可能为 null,需要判空
|
|
173
|
+
- ✅ 如果有 @OneToMany 子实体,自动级联加载
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
### 场景 8:根据唯一键查询单个聚合根
|
|
178
|
+
|
|
179
|
+
**使用方法**:`findByCode(Object... values)`
|
|
180
|
+
|
|
181
|
+
```java
|
|
182
|
+
// 单字段唯一键
|
|
183
|
+
Country country = countryGateway.findByCode("CN");
|
|
184
|
+
|
|
185
|
+
// 组合唯一键(2个字段)
|
|
186
|
+
// Entity: @AggregateKey(name="uk_tenant_order", order=1) 标注在 tenantId
|
|
187
|
+
// @AggregateKey(name="uk_tenant_order", order=2) 标注在 orderNo
|
|
188
|
+
Order order = orderGateway.findByCode(100L, "ORD-001");
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
**关键点**:
|
|
192
|
+
- ✅ 参数顺序必须与 @AggregateKey 的 order 一致
|
|
193
|
+
- ✅ 自动根据参数数量匹配对应的唯一键
|
|
194
|
+
- ✅ 返回值可能为 null
|
|
195
|
+
|
|
196
|
+
---
|
|
197
|
+
|
|
198
|
+
### 场景 9:根据主键列表批量查询
|
|
199
|
+
|
|
200
|
+
**使用方法**:`findByIds(Collection<ID> ids)`
|
|
201
|
+
|
|
202
|
+
```java
|
|
203
|
+
// CmdExe 中的核心代码
|
|
204
|
+
List<Integer> countryIds = cmd.getCountryIds();
|
|
205
|
+
List<Country> countries = countryGateway.findByIds(countryIds);
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
**关键点**:
|
|
209
|
+
- ✅ 返回列表,不会为 null(可能为空列表)
|
|
210
|
+
- ✅ 如果有 @OneToMany 子实体,自动级联加载
|
|
211
|
+
|
|
212
|
+
---
|
|
213
|
+
|
|
214
|
+
### 场景 10:根据唯一键列表批量查询(单字段)
|
|
215
|
+
|
|
216
|
+
**使用方法**:`findByCodes(List<String> codes)`
|
|
217
|
+
|
|
218
|
+
```java
|
|
219
|
+
// CmdExe 中的核心代码
|
|
220
|
+
List<String> countryCodes = List.of("CN", "US", "JP");
|
|
221
|
+
List<Country> countries = countryGateway.findByCodes(countryCodes);
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
**关键点**:
|
|
225
|
+
- ✅ 仅支持单字段唯一键
|
|
226
|
+
- ✅ 返回列表,不会为 null
|
|
227
|
+
|
|
228
|
+
---
|
|
229
|
+
|
|
230
|
+
### 场景 11:根据组合唯一键列表批量查询
|
|
231
|
+
|
|
232
|
+
**使用方法**:`findByCodes(Collection<Object[]> keys)`
|
|
233
|
+
|
|
234
|
+
```java
|
|
235
|
+
// CmdExe 中的核心代码
|
|
236
|
+
List<Object[]> keys = List.of(
|
|
237
|
+
new Object[]{100L, "ORD-001"},
|
|
238
|
+
new Object[]{100L, "ORD-002"},
|
|
239
|
+
new Object[]{200L, "ORD-001"}
|
|
240
|
+
);
|
|
241
|
+
List<Order> orders = orderGateway.findByCodes(keys);
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
**关键点**:
|
|
245
|
+
- ✅ 支持组合唯一键
|
|
246
|
+
- ✅ 每个数组的元素顺序必须与 @AggregateKey 的 order 一致
|
|
247
|
+
|
|
248
|
+
---
|
|
249
|
+
|
|
250
|
+
### 场景 12:查询所有聚合根
|
|
251
|
+
|
|
252
|
+
**使用方法**:`findAll()`
|
|
253
|
+
|
|
254
|
+
```java
|
|
255
|
+
// CmdExe 中的核心代码
|
|
256
|
+
List<Country> allCountries = countryGateway.findAll();
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
**关键点**:
|
|
260
|
+
- ⚠️ 慎用,数据量大时影响性能
|
|
261
|
+
- ✅ 如果有 @OneToMany 子实体,自动级联加载
|
|
262
|
+
- ✅ 适用于配置类数据(如国家、币种等)
|
|
263
|
+
|
|
264
|
+
---
|
|
265
|
+
|
|
266
|
+
### 场景 13:批量保存聚合根
|
|
267
|
+
|
|
268
|
+
**使用方法**:`saveBatch(Collection<T> entities)`
|
|
269
|
+
|
|
270
|
+
```java
|
|
271
|
+
// CmdExe 中的核心代码
|
|
272
|
+
List<Country> countries = cmd.getCountries().stream()
|
|
273
|
+
.map(c -> Country.create(c.getCode(), c.getName()))
|
|
274
|
+
.toList();
|
|
275
|
+
countryGateway.saveBatch(countries);
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
**关键点**:
|
|
279
|
+
- ✅ 批量优化,减少数据库交互次数
|
|
280
|
+
- ✅ 适用于批量导入场景
|
|
281
|
+
|
|
282
|
+
---
|
|
283
|
+
|
|
284
|
+
### 场景 14:创建时校验唯一性(单字段)
|
|
285
|
+
|
|
286
|
+
**使用方法**:`existsByCode(Object... values)`
|
|
287
|
+
|
|
288
|
+
```java
|
|
289
|
+
// CmdExe 中的核心代码
|
|
290
|
+
if (countryGateway.existsByCode(cmd.getCountryCode())) {
|
|
291
|
+
throw new BusinessException("国家代码已存在");
|
|
292
|
+
}
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
**关键点**:
|
|
296
|
+
- ✅ 自动匹配 @AggregateKey 唯一键
|
|
297
|
+
- ✅ 返回 true 表示已存在
|
|
298
|
+
|
|
299
|
+
---
|
|
300
|
+
|
|
301
|
+
### 场景 15:创建时校验唯一性(组合键)
|
|
302
|
+
|
|
303
|
+
**使用方法**:`existsByCode(Object... values)`
|
|
304
|
+
|
|
305
|
+
```java
|
|
306
|
+
// CmdExe 中的核心代码
|
|
307
|
+
// Entity: @AggregateKey(name="uk_tenant_order", order=1) 标注在 tenantId
|
|
308
|
+
// @AggregateKey(name="uk_tenant_order", order=2) 标注在 orderNo
|
|
309
|
+
if (orderGateway.existsByCode(cmd.getTenantId(), cmd.getOrderNo())) {
|
|
310
|
+
throw new BusinessException("订单号已存在");
|
|
311
|
+
}
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
**关键点**:
|
|
315
|
+
- ✅ 参数顺序必须与 @AggregateKey 的 order 一致
|
|
316
|
+
- ✅ 自动根据参数数量匹配对应的唯一键
|
|
317
|
+
|
|
318
|
+
---
|
|
319
|
+
|
|
320
|
+
### 场景 16:更新时校验唯一性(单字段)
|
|
321
|
+
|
|
322
|
+
**使用方法**:`existsByCodeExcludeId(ID excludeId, Object... values)`
|
|
323
|
+
|
|
324
|
+
```java
|
|
325
|
+
// CmdExe 中的核心代码
|
|
326
|
+
if (countryGateway.existsByCodeExcludeId(cmd.getCountryId(), cmd.getCountryCode())) {
|
|
327
|
+
throw new BusinessException("国家代码已被其他记录使用");
|
|
328
|
+
}
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
**关键点**:
|
|
332
|
+
- ✅ 第1个参数是要排除的 ID
|
|
333
|
+
- ✅ 后面参数是唯一键值
|
|
334
|
+
- ✅ 排除自身,只检查其他记录
|
|
335
|
+
|
|
336
|
+
---
|
|
337
|
+
|
|
338
|
+
### 场景 17:更新时校验唯一性(组合键)
|
|
339
|
+
|
|
340
|
+
**使用方法**:`existsByCodeExcludeId(ID excludeId, Object... values)`
|
|
341
|
+
|
|
342
|
+
```java
|
|
343
|
+
// CmdExe 中的核心代码
|
|
344
|
+
if (orderGateway.existsByCodeExcludeId(cmd.getOrderId(), cmd.getTenantId(), cmd.getOrderNo())) {
|
|
345
|
+
throw new BusinessException("订单号已被其他记录使用");
|
|
346
|
+
}
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
**关键点**:
|
|
350
|
+
- ✅ 第1个参数是要排除的 ID
|
|
351
|
+
- ✅ 后面参数按 @AggregateKey 的 order 顺序
|
|
352
|
+
|
|
353
|
+
---
|
|
354
|
+
|
|
355
|
+
## 第三部分:何时需要自定义方法
|
|
356
|
+
|
|
357
|
+
### 决策指南
|
|
358
|
+
|
|
359
|
+
✅ **无需自定义方法的场景**(直接使用继承的 12 个方法):
|
|
360
|
+
- 根据主键查询/删除
|
|
361
|
+
- 根据唯一键查询/校验
|
|
362
|
+
- 批量查询(根据主键或唯一键)
|
|
363
|
+
- 整存整取(保存聚合根 + 子实体)
|
|
364
|
+
|
|
365
|
+
⚠️ **需要自定义方法的场景**:
|
|
366
|
+
- 根据非唯一键字段查询(如根据状态、类型等)
|
|
367
|
+
- 跨子实体查询(如查询聚合根下的某个子实体)
|
|
368
|
+
- 复杂条件查询(如多条件组合、分页、排序)
|
|
369
|
+
- 业务规则校验(如检查是否存在关联数据)
|
|
370
|
+
- 统计查询(如计数、求和等)
|
|
371
|
+
|
|
372
|
+
---
|
|
373
|
+
|
|
374
|
+
### 自定义示例 1:根据非唯一键字段查询
|
|
375
|
+
|
|
376
|
+
**场景**:查询指定状态的国家列表
|
|
377
|
+
|
|
378
|
+
```java
|
|
379
|
+
// Gateway 接口
|
|
380
|
+
public interface CountryGateway extends BaseGateway<Country, Integer> {
|
|
381
|
+
List<Country> findByStatus(StatusEnum status);
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
// GatewayImpl 实现
|
|
385
|
+
@Component
|
|
386
|
+
public class CountryGatewayImpl extends AbstractAggregateRepository<Country, Integer>
|
|
387
|
+
implements CountryGateway {
|
|
388
|
+
|
|
389
|
+
@Override
|
|
390
|
+
public List<Country> findByStatus(StatusEnum status) {
|
|
391
|
+
return selectList(Wrappers.lambdaQuery(Country.class)
|
|
392
|
+
.eq(Country::getStatus, status));
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
// CmdExe 使用
|
|
397
|
+
List<Country> activeCountries = countryGateway.findByStatus(StatusEnum.ENABLE);
|
|
398
|
+
```
|
|
399
|
+
|
|
400
|
+
---
|
|
401
|
+
|
|
402
|
+
### 自定义示例 2:跨子实体查询
|
|
403
|
+
|
|
404
|
+
**场景**:查询平台类型下的所有站点
|
|
405
|
+
|
|
406
|
+
```java
|
|
407
|
+
// Gateway 接口
|
|
408
|
+
public interface PlatformGateway extends BaseGateway<PlatformType, Integer> {
|
|
409
|
+
List<PlatformSite> findSitesByPlatformId(Integer platformTypeId);
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
// GatewayImpl 实现
|
|
413
|
+
@Component
|
|
414
|
+
public class PlatformGatewayImpl extends AbstractAggregateRepository<PlatformType, Integer>
|
|
415
|
+
implements PlatformGateway {
|
|
416
|
+
|
|
417
|
+
@Override
|
|
418
|
+
public List<PlatformSite> findSitesByPlatformId(Integer platformTypeId) {
|
|
419
|
+
return MapperDb.selectList(PlatformSite.class,
|
|
420
|
+
Wrappers.lambdaQuery(PlatformSite.class)
|
|
421
|
+
.eq(PlatformSite::getPlatformTypeId, platformTypeId));
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
// CmdExe 使用
|
|
426
|
+
List<PlatformSite> sites = platformGateway.findSitesByPlatformId(1);
|
|
427
|
+
```
|
|
428
|
+
|
|
429
|
+
---
|
|
430
|
+
|
|
431
|
+
### 自定义示例 3:业务规则校验
|
|
432
|
+
|
|
433
|
+
**场景**:检查平台类型下是否存在指定国家的站点
|
|
434
|
+
|
|
435
|
+
```java
|
|
436
|
+
// Gateway 接口
|
|
437
|
+
public interface PlatformGateway extends BaseGateway<PlatformType, Integer> {
|
|
438
|
+
boolean existsSiteByPlatformAndCountry(Integer platformTypeId, Integer countryId);
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
// GatewayImpl 实现
|
|
442
|
+
@Component
|
|
443
|
+
public class PlatformGatewayImpl extends AbstractAggregateRepository<PlatformType, Integer>
|
|
444
|
+
implements PlatformGateway {
|
|
445
|
+
|
|
446
|
+
@Override
|
|
447
|
+
public boolean existsSiteByPlatformAndCountry(Integer platformTypeId, Integer countryId) {
|
|
448
|
+
return MapperDb.selectCount(PlatformSite.class,
|
|
449
|
+
Wrappers.lambdaQuery(PlatformSite.class)
|
|
450
|
+
.eq(PlatformSite::getPlatformTypeId, platformTypeId)
|
|
451
|
+
.eq(PlatformSite::getCountryId, countryId)) > 0;
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
// CmdExe 使用
|
|
456
|
+
if (platformGateway.existsSiteByPlatformAndCountry(1, 100)) {
|
|
457
|
+
throw new BusinessException("该平台已存在该国家的站点");
|
|
458
|
+
}
|
|
459
|
+
```
|
|
460
|
+
|
|
461
|
+
---
|
|
462
|
+
|
|
463
|
+
### 自定义示例 4:复杂条件查询(多条件组合)
|
|
464
|
+
|
|
465
|
+
**场景**:根据多个条件查询国家列表
|
|
466
|
+
|
|
467
|
+
```java
|
|
468
|
+
// Gateway 接口
|
|
469
|
+
public interface CountryGateway extends BaseGateway<Country, Integer> {
|
|
470
|
+
List<Country> findByConditions(CountryQueryParam param);
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
// GatewayImpl 实现
|
|
474
|
+
@Component
|
|
475
|
+
public class CountryGatewayImpl extends AbstractAggregateRepository<Country, Integer>
|
|
476
|
+
implements CountryGateway {
|
|
477
|
+
|
|
478
|
+
@Override
|
|
479
|
+
public List<Country> findByConditions(CountryQueryParam param) {
|
|
480
|
+
return selectList(Wrappers.lambdaQuery(Country.class)
|
|
481
|
+
.like(StringUtils.isNotBlank(param.getCountryName()),
|
|
482
|
+
Country::getCountryName, param.getCountryName())
|
|
483
|
+
.eq(param.getStatus() != null,
|
|
484
|
+
Country::getStatus, param.getStatus())
|
|
485
|
+
.orderByDesc(Country::getCreateTime));
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
// CmdExe 使用
|
|
490
|
+
CountryQueryParam param = new CountryQueryParam();
|
|
491
|
+
param.setCountryName("中国");
|
|
492
|
+
param.setStatus(StatusEnum.ENABLE);
|
|
493
|
+
List<Country> countries = countryGateway.findByConditions(param);
|
|
494
|
+
```
|
|
495
|
+
|
|
496
|
+
**关键点**:
|
|
497
|
+
- ✅ 参数 ≥3 个时,使用 Param 对象封装
|
|
498
|
+
- ✅ 使用条件构造器实现动态查询
|
|
499
|
+
- ✅ 参数详见:`domain/entity/examples/method-design.md`
|
|
500
|
+
|
|
501
|
+
---
|
|
502
|
+
|
|
503
|
+
### 自定义示例 5:统计查询
|
|
504
|
+
|
|
505
|
+
**场景**:统计指定状态的国家数量
|
|
506
|
+
|
|
507
|
+
```java
|
|
508
|
+
// Gateway 接口
|
|
509
|
+
public interface CountryGateway extends BaseGateway<Country, Integer> {
|
|
510
|
+
long countByStatus(StatusEnum status);
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
// GatewayImpl 实现
|
|
514
|
+
@Component
|
|
515
|
+
public class CountryGatewayImpl extends AbstractAggregateRepository<Country, Integer>
|
|
516
|
+
implements CountryGateway {
|
|
517
|
+
|
|
518
|
+
@Override
|
|
519
|
+
public long countByStatus(StatusEnum status) {
|
|
520
|
+
return selectCount(Wrappers.lambdaQuery(Country.class)
|
|
521
|
+
.eq(Country::getStatus, status));
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
// CmdExe 使用
|
|
526
|
+
long activeCount = countryGateway.countByStatus(StatusEnum.ENABLE);
|
|
527
|
+
```
|
|
528
|
+
|
|
529
|
+
---
|
|
530
|
+
|
|
531
|
+
## 相关文档
|
|
532
|
+
|
|
533
|
+
- Gateway 接口编写规范:[../SKILL.md](../SKILL.md)
|
|
534
|
+
- GatewayImpl 实现规范:[../../../infrastructure/gatewayimpl/SKILL.md](../../../infrastructure/gatewayimpl/SKILL.md)
|
|
535
|
+
- 自动级联原理详解:[../../../infrastructure/gatewayimpl/examples/cascade-mechanism.md](../../../infrastructure/gatewayimpl/examples/cascade-mechanism.md)
|
|
536
|
+
- Domain 方法参数规范:[../../entity/examples/method-design.md](../../entity/examples/method-design.md)
|