create-yss-spec 3.2.0 → 3.3.0
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.
- package/README.md +2 -2
- package/package.json +1 -1
- package/template/.agents/skills/code-review/SKILL.md +4 -0
- package/template/.agents/skills/code-review/agents/openai.yaml +1 -1
- package/template/.agents/skills/code-review/references/yss-review-standards.md +9 -2
- package/template/.agents/skills/yss-ddd-scaffold-generator/SKILL.md +1 -1
- package/template/.agents/skills/yss-ddd-scaffold-generator/scripts/generate_scaffold.mjs +7 -3
- package/template/.agents/skills/yss-ddd-scaffold-generator/scripts/run_scaffold_verification.mjs +1 -1
- package/template/.agents/skills/yss-ddd-scaffold-generator/scripts/scaffold-generator.test.mjs +9 -0
- package/template/.agents/skills/yss-frontend-scaffold-generator/SKILL.md +10 -7
- package/template/.agents/skills/yss-frontend-scaffold-generator/scripts/generate_and_verify_scaffold.mjs +10 -0
- package/template/.agents/skills/yss-frontend-scaffold-generator/scripts/generate_scaffold.mjs +107 -0
- package/template/.agents/skills/yss-frontend-scaffold-generator/scripts/run_scaffold_verification.mjs +41 -0
- package/template/.agents/skills/yss-frontend-scaffold-generator/scripts/scaffold-generator.test.mjs +37 -0
- package/template/.agents/skills/yss-implementation-contract-compiler/SKILL.md +1 -1
- package/template/.agents/skills/yss-implementation-contract-compiler/references/boundaries.md +4 -0
- package/template/.agents/skills/yss-implementation-contract-compiler/references/compiler-contract.yaml +25 -0
- package/template/.agents/skills/yss-layered-mvc-scaffold-generator/SKILL.md +2 -2
- package/template/.agents/skills/yss-layered-mvc-scaffold-generator/scripts/generate_scaffold.mjs +8 -5
- package/template/.agents/skills/yss-layered-mvc-scaffold-generator/scripts/scaffold-generator.test.mjs +17 -2
- package/template/.agents/skills/yss-mybatis/SKILL.md +34 -58
- package/template/.agents/skills/yss-mybatis/agents/openai.yaml +2 -2
- package/template/.agents/skills/yss-mybatis/references/source-index.md +88 -68
- package/template/.agents/skills/yss-product-lifecycle/SKILL.md +48 -43
- package/template/.agents/skills/yss-product-lifecycle/references/artifact-dependencies.md +4 -2
- package/template/.agents/skills/yss-product-lifecycle/references/orchestration-contract.yaml +67 -10
- package/template/.agents/skills/yss-product-lifecycle/references/orchestration.md +5 -1
- package/template/.agents/skills/yss-product-lifecycle/references/state-model.md +5 -2
- package/template/.agents/skills/yss-repository/SKILL.md +28 -70
- package/template/.agents/skills/yss-repository/agents/openai.yaml +2 -2
- package/template/.agents/skills/yss-repository/references/profiles/layered-mvc-service.md +19 -1
- package/template/.agents/skills/yss-repository/references/profiles/mvc-data-analysis-v1.md +19 -1
- package/template/.agents/skills/yss-repository/references/profiles/target-domain-model.md +21 -1
- package/template/.agents/skills/yss-repository/tests/profile-routing.test.mjs +59 -0
- package/template/.agents/skills/yss-skill-source-index-refresh/SKILL.md +8 -5
- package/template/.agents/skills/yss-skill-source-index-refresh/references/source-location.md +2 -1
- package/template/.agents/skills/yss-skill-source-index-refresh/scripts/refresh-yss-skill-index.mjs +388 -18
- package/template/.agents/skills/yss-skill-source-index-refresh/scripts/refresh-yss-skill-index.test.mjs +79 -1
- package/template/.claude/skills/code-review/SKILL.md +4 -0
- package/template/.claude/skills/code-review/agents/openai.yaml +1 -1
- package/template/.claude/skills/code-review/references/yss-review-standards.md +9 -2
- package/template/.claude/skills/yss-ddd-scaffold-generator/SKILL.md +1 -1
- package/template/.claude/skills/yss-ddd-scaffold-generator/scripts/generate_scaffold.mjs +7 -3
- package/template/.claude/skills/yss-ddd-scaffold-generator/scripts/run_scaffold_verification.mjs +1 -1
- package/template/.claude/skills/yss-ddd-scaffold-generator/scripts/scaffold-generator.test.mjs +9 -0
- package/template/.claude/skills/yss-frontend-scaffold-generator/SKILL.md +10 -7
- package/template/.claude/skills/yss-frontend-scaffold-generator/scripts/generate_and_verify_scaffold.mjs +10 -0
- package/template/.claude/skills/yss-frontend-scaffold-generator/scripts/generate_scaffold.mjs +107 -0
- package/template/.claude/skills/yss-frontend-scaffold-generator/scripts/run_scaffold_verification.mjs +41 -0
- package/template/.claude/skills/yss-frontend-scaffold-generator/scripts/scaffold-generator.test.mjs +37 -0
- package/template/.claude/skills/yss-implementation-contract-compiler/SKILL.md +1 -1
- package/template/.claude/skills/yss-implementation-contract-compiler/references/boundaries.md +4 -0
- package/template/.claude/skills/yss-implementation-contract-compiler/references/compiler-contract.yaml +25 -0
- package/template/.claude/skills/yss-layered-mvc-scaffold-generator/SKILL.md +2 -2
- package/template/.claude/skills/yss-layered-mvc-scaffold-generator/scripts/generate_scaffold.mjs +8 -5
- package/template/.claude/skills/yss-layered-mvc-scaffold-generator/scripts/scaffold-generator.test.mjs +17 -2
- package/template/.claude/skills/yss-mybatis/SKILL.md +34 -58
- package/template/.claude/skills/yss-mybatis/agents/openai.yaml +2 -2
- package/template/.claude/skills/yss-mybatis/references/source-index.md +88 -68
- package/template/.claude/skills/yss-product-lifecycle/SKILL.md +48 -43
- package/template/.claude/skills/yss-product-lifecycle/references/artifact-dependencies.md +4 -2
- package/template/.claude/skills/yss-product-lifecycle/references/orchestration-contract.yaml +67 -10
- package/template/.claude/skills/yss-product-lifecycle/references/orchestration.md +5 -1
- package/template/.claude/skills/yss-product-lifecycle/references/state-model.md +5 -2
- package/template/.claude/skills/yss-repository/SKILL.md +28 -70
- package/template/.claude/skills/yss-repository/agents/openai.yaml +2 -2
- package/template/.claude/skills/yss-repository/references/profiles/layered-mvc-service.md +19 -1
- package/template/.claude/skills/yss-repository/references/profiles/mvc-data-analysis-v1.md +19 -1
- package/template/.claude/skills/yss-repository/references/profiles/target-domain-model.md +21 -1
- package/template/.claude/skills/yss-repository/tests/profile-routing.test.mjs +59 -0
- package/template/.claude/skills/yss-skill-source-index-refresh/SKILL.md +8 -5
- package/template/.claude/skills/yss-skill-source-index-refresh/references/source-location.md +2 -1
- package/template/.claude/skills/yss-skill-source-index-refresh/scripts/refresh-yss-skill-index.mjs +388 -18
- package/template/.claude/skills/yss-skill-source-index-refresh/scripts/refresh-yss-skill-index.test.mjs +79 -1
- package/template/.codex/skills/code-review/SKILL.md +4 -0
- package/template/.codex/skills/code-review/agents/openai.yaml +1 -1
- package/template/.codex/skills/code-review/references/yss-review-standards.md +9 -2
- package/template/.codex/skills/yss-ddd-scaffold-generator/SKILL.md +1 -1
- package/template/.codex/skills/yss-ddd-scaffold-generator/scripts/generate_scaffold.mjs +7 -3
- package/template/.codex/skills/yss-ddd-scaffold-generator/scripts/run_scaffold_verification.mjs +1 -1
- package/template/.codex/skills/yss-ddd-scaffold-generator/scripts/scaffold-generator.test.mjs +9 -0
- package/template/.codex/skills/yss-frontend-scaffold-generator/SKILL.md +10 -7
- package/template/.codex/skills/yss-frontend-scaffold-generator/scripts/generate_and_verify_scaffold.mjs +10 -0
- package/template/.codex/skills/yss-frontend-scaffold-generator/scripts/generate_scaffold.mjs +107 -0
- package/template/.codex/skills/yss-frontend-scaffold-generator/scripts/run_scaffold_verification.mjs +41 -0
- package/template/.codex/skills/yss-frontend-scaffold-generator/scripts/scaffold-generator.test.mjs +37 -0
- package/template/.codex/skills/yss-implementation-contract-compiler/SKILL.md +1 -1
- package/template/.codex/skills/yss-implementation-contract-compiler/references/boundaries.md +4 -0
- package/template/.codex/skills/yss-implementation-contract-compiler/references/compiler-contract.yaml +25 -0
- package/template/.codex/skills/yss-layered-mvc-scaffold-generator/SKILL.md +2 -2
- package/template/.codex/skills/yss-layered-mvc-scaffold-generator/scripts/generate_scaffold.mjs +8 -5
- package/template/.codex/skills/yss-layered-mvc-scaffold-generator/scripts/scaffold-generator.test.mjs +17 -2
- package/template/.codex/skills/yss-mybatis/SKILL.md +34 -58
- package/template/.codex/skills/yss-mybatis/agents/openai.yaml +2 -2
- package/template/.codex/skills/yss-mybatis/references/source-index.md +88 -68
- package/template/.codex/skills/yss-product-lifecycle/SKILL.md +48 -43
- package/template/.codex/skills/yss-product-lifecycle/references/artifact-dependencies.md +4 -2
- package/template/.codex/skills/yss-product-lifecycle/references/orchestration-contract.yaml +67 -10
- package/template/.codex/skills/yss-product-lifecycle/references/orchestration.md +5 -1
- package/template/.codex/skills/yss-product-lifecycle/references/state-model.md +5 -2
- package/template/.codex/skills/yss-repository/SKILL.md +28 -70
- package/template/.codex/skills/yss-repository/agents/openai.yaml +2 -2
- package/template/.codex/skills/yss-repository/references/profiles/layered-mvc-service.md +19 -1
- package/template/.codex/skills/yss-repository/references/profiles/mvc-data-analysis-v1.md +19 -1
- package/template/.codex/skills/yss-repository/references/profiles/target-domain-model.md +21 -1
- package/template/.codex/skills/yss-repository/tests/profile-routing.test.mjs +59 -0
- package/template/.codex/skills/yss-skill-source-index-refresh/SKILL.md +8 -5
- package/template/.codex/skills/yss-skill-source-index-refresh/references/source-location.md +2 -1
- package/template/.codex/skills/yss-skill-source-index-refresh/scripts/refresh-yss-skill-index.mjs +388 -18
- package/template/.codex/skills/yss-skill-source-index-refresh/scripts/refresh-yss-skill-index.test.mjs +79 -1
- package/template/.cursor/skills/code-review/SKILL.md +4 -0
- package/template/.cursor/skills/code-review/agents/openai.yaml +1 -1
- package/template/.cursor/skills/code-review/references/yss-review-standards.md +9 -2
- package/template/.cursor/skills/yss-ddd-scaffold-generator/SKILL.md +1 -1
- package/template/.cursor/skills/yss-ddd-scaffold-generator/scripts/generate_scaffold.mjs +7 -3
- package/template/.cursor/skills/yss-ddd-scaffold-generator/scripts/run_scaffold_verification.mjs +1 -1
- package/template/.cursor/skills/yss-ddd-scaffold-generator/scripts/scaffold-generator.test.mjs +9 -0
- package/template/.cursor/skills/yss-frontend-scaffold-generator/SKILL.md +10 -7
- package/template/.cursor/skills/yss-frontend-scaffold-generator/scripts/generate_and_verify_scaffold.mjs +10 -0
- package/template/.cursor/skills/yss-frontend-scaffold-generator/scripts/generate_scaffold.mjs +107 -0
- package/template/.cursor/skills/yss-frontend-scaffold-generator/scripts/run_scaffold_verification.mjs +41 -0
- package/template/.cursor/skills/yss-frontend-scaffold-generator/scripts/scaffold-generator.test.mjs +37 -0
- package/template/.cursor/skills/yss-implementation-contract-compiler/SKILL.md +1 -1
- package/template/.cursor/skills/yss-implementation-contract-compiler/references/boundaries.md +4 -0
- package/template/.cursor/skills/yss-implementation-contract-compiler/references/compiler-contract.yaml +25 -0
- package/template/.cursor/skills/yss-layered-mvc-scaffold-generator/SKILL.md +2 -2
- package/template/.cursor/skills/yss-layered-mvc-scaffold-generator/scripts/generate_scaffold.mjs +8 -5
- package/template/.cursor/skills/yss-layered-mvc-scaffold-generator/scripts/scaffold-generator.test.mjs +17 -2
- package/template/.cursor/skills/yss-mybatis/SKILL.md +34 -58
- package/template/.cursor/skills/yss-mybatis/agents/openai.yaml +2 -2
- package/template/.cursor/skills/yss-mybatis/references/source-index.md +88 -68
- package/template/.cursor/skills/yss-product-lifecycle/SKILL.md +48 -43
- package/template/.cursor/skills/yss-product-lifecycle/references/artifact-dependencies.md +4 -2
- package/template/.cursor/skills/yss-product-lifecycle/references/orchestration-contract.yaml +67 -10
- package/template/.cursor/skills/yss-product-lifecycle/references/orchestration.md +5 -1
- package/template/.cursor/skills/yss-product-lifecycle/references/state-model.md +5 -2
- package/template/.cursor/skills/yss-repository/SKILL.md +28 -70
- package/template/.cursor/skills/yss-repository/agents/openai.yaml +2 -2
- package/template/.cursor/skills/yss-repository/references/profiles/layered-mvc-service.md +19 -1
- package/template/.cursor/skills/yss-repository/references/profiles/mvc-data-analysis-v1.md +19 -1
- package/template/.cursor/skills/yss-repository/references/profiles/target-domain-model.md +21 -1
- package/template/.cursor/skills/yss-repository/tests/profile-routing.test.mjs +59 -0
- package/template/.cursor/skills/yss-skill-source-index-refresh/SKILL.md +8 -5
- package/template/.cursor/skills/yss-skill-source-index-refresh/references/source-location.md +2 -1
- package/template/.cursor/skills/yss-skill-source-index-refresh/scripts/refresh-yss-skill-index.mjs +388 -18
- package/template/.cursor/skills/yss-skill-source-index-refresh/scripts/refresh-yss-skill-index.test.mjs +79 -1
- package/template/.pi/skills/code-review/SKILL.md +4 -0
- package/template/.pi/skills/code-review/agents/openai.yaml +1 -1
- package/template/.pi/skills/code-review/references/yss-review-standards.md +9 -2
- package/template/.pi/skills/yss-ddd-scaffold-generator/SKILL.md +1 -1
- package/template/.pi/skills/yss-ddd-scaffold-generator/scripts/generate_scaffold.mjs +7 -3
- package/template/.pi/skills/yss-ddd-scaffold-generator/scripts/run_scaffold_verification.mjs +1 -1
- package/template/.pi/skills/yss-ddd-scaffold-generator/scripts/scaffold-generator.test.mjs +9 -0
- package/template/.pi/skills/yss-frontend-scaffold-generator/SKILL.md +10 -7
- package/template/.pi/skills/yss-frontend-scaffold-generator/scripts/generate_and_verify_scaffold.mjs +10 -0
- package/template/.pi/skills/yss-frontend-scaffold-generator/scripts/generate_scaffold.mjs +107 -0
- package/template/.pi/skills/yss-frontend-scaffold-generator/scripts/run_scaffold_verification.mjs +41 -0
- package/template/.pi/skills/yss-frontend-scaffold-generator/scripts/scaffold-generator.test.mjs +37 -0
- package/template/.pi/skills/yss-implementation-contract-compiler/SKILL.md +1 -1
- package/template/.pi/skills/yss-implementation-contract-compiler/references/boundaries.md +4 -0
- package/template/.pi/skills/yss-implementation-contract-compiler/references/compiler-contract.yaml +25 -0
- package/template/.pi/skills/yss-layered-mvc-scaffold-generator/SKILL.md +2 -2
- package/template/.pi/skills/yss-layered-mvc-scaffold-generator/scripts/generate_scaffold.mjs +8 -5
- package/template/.pi/skills/yss-layered-mvc-scaffold-generator/scripts/scaffold-generator.test.mjs +17 -2
- package/template/.pi/skills/yss-mybatis/SKILL.md +34 -58
- package/template/.pi/skills/yss-mybatis/agents/openai.yaml +2 -2
- package/template/.pi/skills/yss-mybatis/references/source-index.md +88 -68
- package/template/.pi/skills/yss-product-lifecycle/SKILL.md +48 -43
- package/template/.pi/skills/yss-product-lifecycle/references/artifact-dependencies.md +4 -2
- package/template/.pi/skills/yss-product-lifecycle/references/orchestration-contract.yaml +67 -10
- package/template/.pi/skills/yss-product-lifecycle/references/orchestration.md +5 -1
- package/template/.pi/skills/yss-product-lifecycle/references/state-model.md +5 -2
- package/template/.pi/skills/yss-repository/SKILL.md +28 -70
- package/template/.pi/skills/yss-repository/agents/openai.yaml +2 -2
- package/template/.pi/skills/yss-repository/references/profiles/layered-mvc-service.md +19 -1
- package/template/.pi/skills/yss-repository/references/profiles/mvc-data-analysis-v1.md +19 -1
- package/template/.pi/skills/yss-repository/references/profiles/target-domain-model.md +21 -1
- package/template/.pi/skills/yss-repository/tests/profile-routing.test.mjs +59 -0
- package/template/.pi/skills/yss-skill-source-index-refresh/SKILL.md +8 -5
- package/template/.pi/skills/yss-skill-source-index-refresh/references/source-location.md +2 -1
- package/template/.pi/skills/yss-skill-source-index-refresh/scripts/refresh-yss-skill-index.mjs +388 -18
- package/template/.pi/skills/yss-skill-source-index-refresh/scripts/refresh-yss-skill-index.test.mjs +79 -1
- package/template/.qoder/skills/code-review/SKILL.md +4 -0
- package/template/.qoder/skills/code-review/agents/openai.yaml +1 -1
- package/template/.qoder/skills/code-review/references/yss-review-standards.md +9 -2
- package/template/.qoder/skills/yss-ddd-scaffold-generator/SKILL.md +1 -1
- package/template/.qoder/skills/yss-ddd-scaffold-generator/scripts/generate_scaffold.mjs +7 -3
- package/template/.qoder/skills/yss-ddd-scaffold-generator/scripts/run_scaffold_verification.mjs +1 -1
- package/template/.qoder/skills/yss-ddd-scaffold-generator/scripts/scaffold-generator.test.mjs +9 -0
- package/template/.qoder/skills/yss-frontend-scaffold-generator/SKILL.md +10 -7
- package/template/.qoder/skills/yss-frontend-scaffold-generator/scripts/generate_and_verify_scaffold.mjs +10 -0
- package/template/.qoder/skills/yss-frontend-scaffold-generator/scripts/generate_scaffold.mjs +107 -0
- package/template/.qoder/skills/yss-frontend-scaffold-generator/scripts/run_scaffold_verification.mjs +41 -0
- package/template/.qoder/skills/yss-frontend-scaffold-generator/scripts/scaffold-generator.test.mjs +37 -0
- package/template/.qoder/skills/yss-implementation-contract-compiler/SKILL.md +1 -1
- package/template/.qoder/skills/yss-implementation-contract-compiler/references/boundaries.md +4 -0
- package/template/.qoder/skills/yss-implementation-contract-compiler/references/compiler-contract.yaml +25 -0
- package/template/.qoder/skills/yss-layered-mvc-scaffold-generator/SKILL.md +2 -2
- package/template/.qoder/skills/yss-layered-mvc-scaffold-generator/scripts/generate_scaffold.mjs +8 -5
- package/template/.qoder/skills/yss-layered-mvc-scaffold-generator/scripts/scaffold-generator.test.mjs +17 -2
- package/template/.qoder/skills/yss-mybatis/SKILL.md +34 -58
- package/template/.qoder/skills/yss-mybatis/agents/openai.yaml +2 -2
- package/template/.qoder/skills/yss-mybatis/references/source-index.md +88 -68
- package/template/.qoder/skills/yss-product-lifecycle/SKILL.md +48 -43
- package/template/.qoder/skills/yss-product-lifecycle/references/artifact-dependencies.md +4 -2
- package/template/.qoder/skills/yss-product-lifecycle/references/orchestration-contract.yaml +67 -10
- package/template/.qoder/skills/yss-product-lifecycle/references/orchestration.md +5 -1
- package/template/.qoder/skills/yss-product-lifecycle/references/state-model.md +5 -2
- package/template/.qoder/skills/yss-repository/SKILL.md +28 -70
- package/template/.qoder/skills/yss-repository/agents/openai.yaml +2 -2
- package/template/.qoder/skills/yss-repository/references/profiles/layered-mvc-service.md +19 -1
- package/template/.qoder/skills/yss-repository/references/profiles/mvc-data-analysis-v1.md +19 -1
- package/template/.qoder/skills/yss-repository/references/profiles/target-domain-model.md +21 -1
- package/template/.qoder/skills/yss-repository/tests/profile-routing.test.mjs +59 -0
- package/template/.qoder/skills/yss-skill-source-index-refresh/SKILL.md +8 -5
- package/template/.qoder/skills/yss-skill-source-index-refresh/references/source-location.md +2 -1
- package/template/.qoder/skills/yss-skill-source-index-refresh/scripts/refresh-yss-skill-index.mjs +388 -18
- package/template/.qoder/skills/yss-skill-source-index-refresh/scripts/refresh-yss-skill-index.test.mjs +79 -1
- package/template/.trae/skills/code-review/SKILL.md +4 -0
- package/template/.trae/skills/code-review/agents/openai.yaml +1 -1
- package/template/.trae/skills/code-review/references/yss-review-standards.md +9 -2
- package/template/.trae/skills/yss-ddd-scaffold-generator/SKILL.md +1 -1
- package/template/.trae/skills/yss-ddd-scaffold-generator/scripts/generate_scaffold.mjs +7 -3
- package/template/.trae/skills/yss-ddd-scaffold-generator/scripts/run_scaffold_verification.mjs +1 -1
- package/template/.trae/skills/yss-ddd-scaffold-generator/scripts/scaffold-generator.test.mjs +9 -0
- package/template/.trae/skills/yss-frontend-scaffold-generator/SKILL.md +10 -7
- package/template/.trae/skills/yss-frontend-scaffold-generator/scripts/generate_and_verify_scaffold.mjs +10 -0
- package/template/.trae/skills/yss-frontend-scaffold-generator/scripts/generate_scaffold.mjs +107 -0
- package/template/.trae/skills/yss-frontend-scaffold-generator/scripts/run_scaffold_verification.mjs +41 -0
- package/template/.trae/skills/yss-frontend-scaffold-generator/scripts/scaffold-generator.test.mjs +37 -0
- package/template/.trae/skills/yss-implementation-contract-compiler/SKILL.md +1 -1
- package/template/.trae/skills/yss-implementation-contract-compiler/references/boundaries.md +4 -0
- package/template/.trae/skills/yss-implementation-contract-compiler/references/compiler-contract.yaml +25 -0
- package/template/.trae/skills/yss-layered-mvc-scaffold-generator/SKILL.md +2 -2
- package/template/.trae/skills/yss-layered-mvc-scaffold-generator/scripts/generate_scaffold.mjs +8 -5
- package/template/.trae/skills/yss-layered-mvc-scaffold-generator/scripts/scaffold-generator.test.mjs +17 -2
- package/template/.trae/skills/yss-mybatis/SKILL.md +34 -58
- package/template/.trae/skills/yss-mybatis/agents/openai.yaml +2 -2
- package/template/.trae/skills/yss-mybatis/references/source-index.md +88 -68
- package/template/.trae/skills/yss-product-lifecycle/SKILL.md +48 -43
- package/template/.trae/skills/yss-product-lifecycle/references/artifact-dependencies.md +4 -2
- package/template/.trae/skills/yss-product-lifecycle/references/orchestration-contract.yaml +67 -10
- package/template/.trae/skills/yss-product-lifecycle/references/orchestration.md +5 -1
- package/template/.trae/skills/yss-product-lifecycle/references/state-model.md +5 -2
- package/template/.trae/skills/yss-repository/SKILL.md +28 -70
- package/template/.trae/skills/yss-repository/agents/openai.yaml +2 -2
- package/template/.trae/skills/yss-repository/references/profiles/layered-mvc-service.md +19 -1
- package/template/.trae/skills/yss-repository/references/profiles/mvc-data-analysis-v1.md +19 -1
- package/template/.trae/skills/yss-repository/references/profiles/target-domain-model.md +21 -1
- package/template/.trae/skills/yss-repository/tests/profile-routing.test.mjs +59 -0
- package/template/.trae/skills/yss-skill-source-index-refresh/SKILL.md +8 -5
- package/template/.trae/skills/yss-skill-source-index-refresh/references/source-location.md +2 -1
- package/template/.trae/skills/yss-skill-source-index-refresh/scripts/refresh-yss-skill-index.mjs +388 -18
- package/template/.trae/skills/yss-skill-source-index-refresh/scripts/refresh-yss-skill-index.test.mjs +79 -1
- package/template/docs/agents/digital-human-roles.yaml +2 -0
- package/template/docs/agents/yss-skill-registry.yaml +5 -0
- package/template/docs/process/lifecycle-artifact-map.md +4 -0
- package/template/docs/process/lifecycle-registry-baseline.json +6 -1
- package/template/docs/process/lifecycle-registry.yaml +23 -0
- package/template/docs/process/schemas/implementation-repository-preparation-result.schema.json +38 -0
- package/template/docs/process/schemas/project-scaffold-contract.schema.json +113 -0
- package/template/docs/process/template-verification-profiles.yaml +23 -0
- package/template/docs/templates/implementation-repo-registry-template.md +8 -0
- package/template/docs/templates/review-report-template.md +7 -3
- package/template/scripts/lib/lifecycle-context-query.mjs +137 -0
- package/template/scripts/lib/lifecycle-transition.mjs +109 -3
- package/template/scripts/lib/scenario-checks.mjs +29 -26
- package/template/scripts/lib/skill-registry.mjs +9 -0
- package/template/scripts/query-lifecycle-context +25 -0
- package/template/scripts/verify-business-language-scenarios +0 -7
- package/template/scripts/verify-frontend-scaffold-generator-scenarios +2 -0
- package/template/scripts/verify-lifecycle-context-query-scenarios +68 -0
- package/template/scripts/verify-lifecycle-transition-scenarios +44 -4
- package/template/skills-lock.json +9 -9
- package/template.snapshot.json +4 -4
- package/template/.agents/skills/yss-mybatis/assets/BaseRepository.java +0 -112
- package/template/.agents/skills/yss-mybatis/assets/EntityQueryAspect.java +0 -37
- package/template/.agents/skills/yss-mybatis/assets/MybatisBaseConfiguration.java +0 -18
- package/template/.agents/skills/yss-mybatis/assets/PageQueryEntityConfigration.java +0 -18
- package/template/.agents/skills/yss-mybatis/references/README.md +0 -57
- package/template/.agents/skills/yss-repository/references/infrastructure-layer-guide.md +0 -107
- package/template/.claude/skills/yss-mybatis/assets/BaseRepository.java +0 -112
- package/template/.claude/skills/yss-mybatis/assets/EntityQueryAspect.java +0 -37
- package/template/.claude/skills/yss-mybatis/assets/MybatisBaseConfiguration.java +0 -18
- package/template/.claude/skills/yss-mybatis/assets/PageQueryEntityConfigration.java +0 -18
- package/template/.claude/skills/yss-mybatis/references/README.md +0 -57
- package/template/.claude/skills/yss-repository/references/infrastructure-layer-guide.md +0 -107
- package/template/.codex/skills/yss-mybatis/assets/BaseRepository.java +0 -112
- package/template/.codex/skills/yss-mybatis/assets/EntityQueryAspect.java +0 -37
- package/template/.codex/skills/yss-mybatis/assets/MybatisBaseConfiguration.java +0 -18
- package/template/.codex/skills/yss-mybatis/assets/PageQueryEntityConfigration.java +0 -18
- package/template/.codex/skills/yss-mybatis/references/README.md +0 -57
- package/template/.codex/skills/yss-repository/references/infrastructure-layer-guide.md +0 -107
- package/template/.cursor/skills/yss-mybatis/assets/BaseRepository.java +0 -112
- package/template/.cursor/skills/yss-mybatis/assets/EntityQueryAspect.java +0 -37
- package/template/.cursor/skills/yss-mybatis/assets/MybatisBaseConfiguration.java +0 -18
- package/template/.cursor/skills/yss-mybatis/assets/PageQueryEntityConfigration.java +0 -18
- package/template/.cursor/skills/yss-mybatis/references/README.md +0 -57
- package/template/.cursor/skills/yss-repository/references/infrastructure-layer-guide.md +0 -107
- package/template/.pi/skills/yss-mybatis/assets/BaseRepository.java +0 -112
- package/template/.pi/skills/yss-mybatis/assets/EntityQueryAspect.java +0 -37
- package/template/.pi/skills/yss-mybatis/assets/MybatisBaseConfiguration.java +0 -18
- package/template/.pi/skills/yss-mybatis/assets/PageQueryEntityConfigration.java +0 -18
- package/template/.pi/skills/yss-mybatis/references/README.md +0 -57
- package/template/.pi/skills/yss-repository/references/infrastructure-layer-guide.md +0 -107
- package/template/.qoder/skills/yss-mybatis/assets/BaseRepository.java +0 -112
- package/template/.qoder/skills/yss-mybatis/assets/EntityQueryAspect.java +0 -37
- package/template/.qoder/skills/yss-mybatis/assets/MybatisBaseConfiguration.java +0 -18
- package/template/.qoder/skills/yss-mybatis/assets/PageQueryEntityConfigration.java +0 -18
- package/template/.qoder/skills/yss-mybatis/references/README.md +0 -57
- package/template/.qoder/skills/yss-repository/references/infrastructure-layer-guide.md +0 -107
- package/template/.trae/skills/yss-mybatis/assets/BaseRepository.java +0 -112
- package/template/.trae/skills/yss-mybatis/assets/EntityQueryAspect.java +0 -37
- package/template/.trae/skills/yss-mybatis/assets/MybatisBaseConfiguration.java +0 -18
- package/template/.trae/skills/yss-mybatis/assets/PageQueryEntityConfigration.java +0 -18
- package/template/.trae/skills/yss-mybatis/references/README.md +0 -57
- package/template/.trae/skills/yss-repository/references/infrastructure-layer-guide.md +0 -107
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
# YSS Infrastructure Target Profile 指南
|
|
2
|
-
|
|
3
|
-
本指南只定义 `target-domain-model + mybatis-plus`。历史 `Entity + DTO/VO Gateway` 为 `unsupported`,不存在旧架构 Profile。
|
|
4
|
-
|
|
5
|
-
## 1. 职责
|
|
6
|
-
|
|
7
|
-
- 实现既有 Domain Gateway,负责 Aggregate 持久化;不创建或改写 Gateway interface。
|
|
8
|
-
- 实现 Application Query Port,负责分页、列表和读模型。
|
|
9
|
-
- 定义 PO、MyBatis-Plus Repository/Mapper、XML 和数据源适配。
|
|
10
|
-
- 通过 Spring MapStruct Bean 完成 `PO <-> Domain Model`、`PO -> Application Result`。
|
|
11
|
-
|
|
12
|
-
Infrastructure 不拥有业务事务边界,不向 Application/Web 暴露 PO,也不直接生成 HTTP VO。
|
|
13
|
-
|
|
14
|
-
## 2. 包结构
|
|
15
|
-
|
|
16
|
-
```text
|
|
17
|
-
{base_package}.infrastructure
|
|
18
|
-
├── persistence
|
|
19
|
-
│ ├── po
|
|
20
|
-
│ ├── repository
|
|
21
|
-
│ ├── convertor
|
|
22
|
-
│ └── gateway
|
|
23
|
-
└── query
|
|
24
|
-
├── adapter
|
|
25
|
-
└── convertor
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
新脚手架固定使用 `{base_package}.infrastructure`。已有 `{base_package}.repository` 工程不由 scaffold 改写;需要现代化时单独立项。
|
|
29
|
-
|
|
30
|
-
## 3. Domain Gateway 实现
|
|
31
|
-
|
|
32
|
-
```java
|
|
33
|
-
@Repository
|
|
34
|
-
@RequiredArgsConstructor
|
|
35
|
-
public class QualityTemplateGatewayImpl implements QualityTemplateGateway {
|
|
36
|
-
private final QualityTemplateRepository repository;
|
|
37
|
-
private final QualityTemplatePersistenceConvertor convertor;
|
|
38
|
-
|
|
39
|
-
@Override
|
|
40
|
-
public Optional<QualityTemplate> findById(QualityTemplateId id) {
|
|
41
|
-
return Optional.ofNullable(repository.selectById(id.value()))
|
|
42
|
-
.map(convertor::toDomain);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
@Override
|
|
46
|
-
public void save(QualityTemplate aggregate) {
|
|
47
|
-
repository.insertOrUpdate(convertor.toPO(aggregate));
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
GatewayImpl 不接收 Web Cmd/Query,不返回 VO/PageResult,不声明新的业务事务。
|
|
53
|
-
|
|
54
|
-
## 4. Query Port 实现
|
|
55
|
-
|
|
56
|
-
分页/列表属于 Application Query Port:
|
|
57
|
-
|
|
58
|
-
```java
|
|
59
|
-
@Repository
|
|
60
|
-
@RequiredArgsConstructor
|
|
61
|
-
public class QualityTemplateQueryAdapter implements QualityTemplateQueryPort {
|
|
62
|
-
private final QualityTemplateRepository repository;
|
|
63
|
-
private final QualityTemplateQueryConvertor convertor;
|
|
64
|
-
|
|
65
|
-
@Override
|
|
66
|
-
public PageResult<QualityTemplateResult> page(QualityTemplatePageQuery query) {
|
|
67
|
-
// orderBy/groupBy 必须先映射到批准列白名单,再构造 MyBatis 条件。
|
|
68
|
-
return convertor.toResultPage(repository.selectPage(...));
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
`PageQuery` 可以在 Web/Application/Infrastructure 协作链使用,但不得进入 Domain。`orderBy` / `groupBy` 禁止直接拼接 SQL。
|
|
74
|
-
|
|
75
|
-
## 5. PO 与 Repository
|
|
76
|
-
|
|
77
|
-
- Target Profile 使用 `*PO`;旧式 `*Entity` 布局为 `unsupported`。
|
|
78
|
-
- PO 默认使用最小 Lombok 注解,不无条件使用 `@Data`。
|
|
79
|
-
- 当前实现继承项目既有 `BasePlusRepository<PO>`;普通 MyBatis 为 `unsupported`。
|
|
80
|
-
- Mapper XML 位于项目既有扫描路径;扫描包和 XML 路径必须由集成测试证明。
|
|
81
|
-
|
|
82
|
-
## 6. MapStruct
|
|
83
|
-
|
|
84
|
-
```java
|
|
85
|
-
@Mapper(componentModel = "spring")
|
|
86
|
-
public interface QualityTemplatePersistenceConvertor {
|
|
87
|
-
QualityTemplate toDomain(QualityTemplatePO source);
|
|
88
|
-
QualityTemplatePO toPO(QualityTemplate source);
|
|
89
|
-
}
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
- 禁止 `INSTANCE = Mappers.getMapper(...)`。
|
|
93
|
-
- Convertor 使用构造器注入。
|
|
94
|
-
- 父 POM 必须配置 `mapstruct-processor`、Lombok 和 `lombok-mapstruct-binding`。
|
|
95
|
-
- 验证必须编译生成实现,不能只检查接口文本。
|
|
96
|
-
|
|
97
|
-
## 7. 验证
|
|
98
|
-
|
|
99
|
-
- Domain Gateway:保存后可通过 Gateway seam 重新加载等价 Aggregate。
|
|
100
|
-
- Query Port:分页、total、排序白名单和空结果。
|
|
101
|
-
- Mapper/Repository:实际 MyBatis-Plus/H2 或批准数据库 fixture。
|
|
102
|
-
- Architecture:Infrastructure 可以依赖 Application/Domain;反向依赖必须失败。
|
|
103
|
-
- 使用项目根 `./mvnw test/package` 留证。
|
|
104
|
-
|
|
105
|
-
## 8. 旧架构边界
|
|
106
|
-
|
|
107
|
-
检测到 Repository 直接接收 client Query、返回 VO、Convertor 做 `PO -> VO` 或使用旧式 Entity 布局时,返回 `unsupported`,不得由新 scaffold 自动改写。旧项目继续按原工程维护;现代化改造必须单独立项。
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
package com.yss.cloud.mybatis.support;
|
|
2
|
-
|
|
3
|
-
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
|
4
|
-
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
|
5
|
-
import io.mybatis.mapper.BaseMapper;
|
|
6
|
-
import io.mybatis.mapper.list.ListMapper;
|
|
7
|
-
import io.mybatis.mapper.list.ListProvider;
|
|
8
|
-
import io.mybatis.provider.Caching;
|
|
9
|
-
import com.baomidou.mybatisplus.core.mapper.Mapper;
|
|
10
|
-
import org.apache.ibatis.annotations.*;
|
|
11
|
-
|
|
12
|
-
import java.io.Serializable;
|
|
13
|
-
import java.util.Collection;
|
|
14
|
-
import java.util.List;
|
|
15
|
-
import java.util.Map;
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* @author zhudaoming
|
|
19
|
-
*/
|
|
20
|
-
public interface BaseRepository<T, D extends Serializable> extends Mapper<T>, BaseMapper<T, D>, ListMapper<T> {
|
|
21
|
-
/**s
|
|
22
|
-
/**
|
|
23
|
-
* 删除(根据ID或实体 批量删除)
|
|
24
|
-
*
|
|
25
|
-
* @param idList 主键ID列表或实体列表(不能为 null 以及 empty)
|
|
26
|
-
*/
|
|
27
|
-
int deleteBatchIds(@Param(Constants.COLL) Collection<?> idList);
|
|
28
|
-
/**
|
|
29
|
-
* 查询(根据ID 批量查询)
|
|
30
|
-
*
|
|
31
|
-
* @param idList 主键ID列表(不能为 null 以及 empty)
|
|
32
|
-
*/
|
|
33
|
-
List<T> selectBatchIds(@Param(Constants.COLL) Collection<? extends Serializable> idList);
|
|
34
|
-
/**
|
|
35
|
-
* 查询(根据 columnMap 条件)
|
|
36
|
-
*
|
|
37
|
-
* @param columnMap 表字段 map 对象
|
|
38
|
-
*/
|
|
39
|
-
List<T> selectByMap(@Param(Constants.COLUMN_MAP) Map<String, Object> columnMap);
|
|
40
|
-
/**
|
|
41
|
-
* 根据 Wrapper 条件,查询全部记录
|
|
42
|
-
*
|
|
43
|
-
* @param queryWrapper 实体对象封装操作类(可以为 null)
|
|
44
|
-
*/
|
|
45
|
-
List<Map<String, Object>> selectMaps(@Param(Constants.WRAPPER) Wrapper<T> queryWrapper);
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* 根据 Wrapper 条件,查询全部记录
|
|
49
|
-
* <p>注意: 只返回第一个字段的值</p>
|
|
50
|
-
*
|
|
51
|
-
* @param queryWrapper 实体对象封装操作类(可以为 null)
|
|
52
|
-
*/
|
|
53
|
-
List<Object> selectObjs(@Param(Constants.WRAPPER) Wrapper<T> queryWrapper);
|
|
54
|
-
/**
|
|
55
|
-
* 保存实体,默认主键自增,并且名称为 id
|
|
56
|
-
* <p>
|
|
57
|
-
* 这个方法是个示例,你可以在自己的接口中使用相同的方式覆盖父接口中的配置
|
|
58
|
-
*
|
|
59
|
-
* @param entity 实体类
|
|
60
|
-
* @return 1成功,0失败
|
|
61
|
-
*/
|
|
62
|
-
@Override
|
|
63
|
-
@Lang(Caching.class)
|
|
64
|
-
@Options(useGeneratedKeys = true)
|
|
65
|
-
@InsertProvider(type = EntityProvider.class, method = "insert")
|
|
66
|
-
<S extends T> int insert(S entity);
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* 保存实体中不为空的字段,默认主键自增,并且名称为 id
|
|
70
|
-
* <p>
|
|
71
|
-
* 这个方法是个示例,你可以在自己的接口中使用相同的方式覆盖父接口中的配置
|
|
72
|
-
*
|
|
73
|
-
* @param entity 实体类
|
|
74
|
-
* @return 1成功,0失败
|
|
75
|
-
*/
|
|
76
|
-
@Override
|
|
77
|
-
@Lang(Caching.class)
|
|
78
|
-
@Options(useGeneratedKeys = true)
|
|
79
|
-
@InsertProvider(type = EntityProvider.class, method = "insertSelective")
|
|
80
|
-
<S extends T> int insertSelective(S entity);
|
|
81
|
-
|
|
82
|
-
@Override
|
|
83
|
-
@Lang(Caching.class)
|
|
84
|
-
@Options(useGeneratedKeys = true)
|
|
85
|
-
@InsertProvider(type = ListProvider.class, method = "insertList")
|
|
86
|
-
<S extends T> int insertList(@Param("entityList") List<S> entityList);
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* 批量更新
|
|
90
|
-
*
|
|
91
|
-
* @author dengsd
|
|
92
|
-
* @date 2022/9/27 11:49
|
|
93
|
-
*/
|
|
94
|
-
@Override
|
|
95
|
-
@Lang(Caching.class)
|
|
96
|
-
@Options(useGeneratedKeys = true)
|
|
97
|
-
@UpdateProvider(type = ListProvider.class, method = "updateList")
|
|
98
|
-
<S extends T> int updateList(@Param("entityList") List<S> entityList);
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* 批量更新
|
|
103
|
-
*
|
|
104
|
-
* @author dengsd
|
|
105
|
-
* @date 2022/9/27 11:49
|
|
106
|
-
*/
|
|
107
|
-
@Override
|
|
108
|
-
@Lang(Caching.class)
|
|
109
|
-
@Options(useGeneratedKeys = true)
|
|
110
|
-
@UpdateProvider(type = ListProvider.class, method = "updateListSelective")
|
|
111
|
-
<S extends T> int updateListSelective(@Param("entityList") List<S> entityList);
|
|
112
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
package com.yss.cloud.mybatis.aop;
|
|
2
|
-
|
|
3
|
-
import com.github.pagehelper.Page;
|
|
4
|
-
import com.github.pagehelper.PageHelper;
|
|
5
|
-
import com.yss.cloud.dto.page.PageQuery;
|
|
6
|
-
import lombok.SneakyThrows;
|
|
7
|
-
import org.aspectj.lang.ProceedingJoinPoint;
|
|
8
|
-
import org.aspectj.lang.annotation.Around;
|
|
9
|
-
import org.aspectj.lang.annotation.Aspect;
|
|
10
|
-
|
|
11
|
-
@Aspect
|
|
12
|
-
public class EntityQueryAspect {
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* 字段开启分页的方法
|
|
16
|
-
*
|
|
17
|
-
* @apiNote 1. 包命名需符合规范 com.yss.datamiddle.(项目名).service?.impl.serviceImpl.method <br/> 2. 参数为pageQuery dto的方法
|
|
18
|
-
* @param joinPoint 加入切点
|
|
19
|
-
* @param pageQuery 查询分页对象dtp
|
|
20
|
-
* @return 执行结果
|
|
21
|
-
*/
|
|
22
|
-
@Around("( (execution(public * (@org.springframework.stereotype.Repository *).*(..)) || execution(* com.yss..*.gateway.impl.*.*(..))))&& (args(pageQuery)||args(pageQuery,..))")
|
|
23
|
-
@SneakyThrows
|
|
24
|
-
public Object interceptEntityQueries(ProceedingJoinPoint joinPoint, PageQuery pageQuery) {
|
|
25
|
-
if (pageQuery != null) {
|
|
26
|
-
//分页查询开始
|
|
27
|
-
Page<Object> page = PageHelper.offsetPage(pageQuery.getOffset(), pageQuery.getPageSize());
|
|
28
|
-
// 继续执行目标方法
|
|
29
|
-
Object result = joinPoint.proceed();
|
|
30
|
-
long total = page.getTotal();
|
|
31
|
-
pageQuery.setTempTotalCount(total);
|
|
32
|
-
return result;
|
|
33
|
-
}
|
|
34
|
-
// 不满足条件时直接执行目标方法
|
|
35
|
-
return joinPoint.proceed();
|
|
36
|
-
}
|
|
37
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
package com.yss.cloud.mybatis;
|
|
2
|
-
|
|
3
|
-
import com.yss.cloud.mybatis.config.PageQueryEntityConfigration;
|
|
4
|
-
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
|
5
|
-
import org.springframework.context.annotation.Configuration;
|
|
6
|
-
import org.springframework.context.annotation.Import;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
@Configuration
|
|
10
|
-
@Import({
|
|
11
|
-
PageQueryEntityConfigration.class}
|
|
12
|
-
)
|
|
13
|
-
@EnableConfigurationProperties({PrimaryDataSourceProperties.class,
|
|
14
|
-
MybatisPlusGlobalProperties.class,
|
|
15
|
-
YssMybatisMapperProperties.class})
|
|
16
|
-
public class MybatisBaseConfiguration {
|
|
17
|
-
|
|
18
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
package com.yss.cloud.mybatis.config;
|
|
2
|
-
|
|
3
|
-
import com.yss.cloud.mybatis.aop.EntityQueryAspect;
|
|
4
|
-
import lombok.extern.slf4j.Slf4j;
|
|
5
|
-
import org.springframework.context.annotation.Bean;
|
|
6
|
-
import org.springframework.context.annotation.Configuration;
|
|
7
|
-
import org.springframework.context.annotation.Primary;
|
|
8
|
-
|
|
9
|
-
@Configuration
|
|
10
|
-
@Slf4j
|
|
11
|
-
public class PageQueryEntityConfigration {
|
|
12
|
-
@Primary
|
|
13
|
-
@Bean
|
|
14
|
-
public EntityQueryAspect entityQueryAspect() {
|
|
15
|
-
log.info("【MapperConfiguration】DataSource 获取数据源primaryDataSourceProperties配置");
|
|
16
|
-
return new EntityQueryAspect();
|
|
17
|
-
}
|
|
18
|
-
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
# 参考资料
|
|
2
|
-
|
|
3
|
-
本文档详细介绍了 `yss-component-mybatis-starter` 模块中的核心类和配置类,这些类构成了通用 MyBatis 模式的基础。
|
|
4
|
-
|
|
5
|
-
## 核心类 (Core Classes)
|
|
6
|
-
|
|
7
|
-
### 1. BaseRepository.java
|
|
8
|
-
**位置**: `../assets/BaseRepository.java`
|
|
9
|
-
|
|
10
|
-
`BaseRepository<T, D>` 是通用 MyBatis 模式下的核心 Mapper 接口,所有业务 Repository 都应继承它。
|
|
11
|
-
|
|
12
|
-
**主要特性**:
|
|
13
|
-
- **继承链**: 继承了 `io.mybatis.mapper.BaseMapper` (基础 CRUD), `io.mybatis.mapper.list.ListMapper` (批量操作), 和 `com.baomidou.mybatisplus.core.mapper.Mapper` (兼容性)。
|
|
14
|
-
- **通用方法**:
|
|
15
|
-
- `insert`, `update`, `delete`: 标准的单表操作。
|
|
16
|
-
- `selectBatchIds`, `deleteBatchIds`: 批量操作。
|
|
17
|
-
- `selectByMap`, `selectMaps`, `selectObjs`: 基于 Map 和 Wrapper 的查询。
|
|
18
|
-
- **扩展点**: 允许用户通过继承此接口,获得开箱即用的 CRUD 能力,无需编写 XML。
|
|
19
|
-
|
|
20
|
-
### 2. EntityQueryAspect.java
|
|
21
|
-
**位置**: `../assets/EntityQueryAspect.java`
|
|
22
|
-
|
|
23
|
-
这是一个 AOP 切面,用于实现非侵入式的自动分页功能。
|
|
24
|
-
|
|
25
|
-
**工作原理**:
|
|
26
|
-
- **切点**: 拦截所有 Repository 层 (`@Repository`) 和 Gateway 实现层的方法。
|
|
27
|
-
- **条件**: 方法参数中必须包含 `com.yss.cloud.dto.page.PageQuery` 对象。
|
|
28
|
-
- **逻辑**:
|
|
29
|
-
1. 检查 `PageQuery` 参数是否非空。
|
|
30
|
-
2. 调用 `PageHelper.offsetPage(offset, pageSize)` 开启分页。
|
|
31
|
-
3. 执行目标方法。
|
|
32
|
-
4. 获取分页结果的总记录数 (`page.getTotal()`)。
|
|
33
|
-
5. 将总数回填到 `PageQuery.tempTotalCount` 字段中。
|
|
34
|
-
|
|
35
|
-
### 3. MybatisBaseConfiguration.java
|
|
36
|
-
**位置**: `../assets/MybatisBaseConfiguration.java`
|
|
37
|
-
|
|
38
|
-
MyBatis 基础配置类,负责加载核心组件。
|
|
39
|
-
|
|
40
|
-
**主要功能**:
|
|
41
|
-
- **导入配置**: 导入了 `PageQueryEntityConfigration`,确保分页切面生效。
|
|
42
|
-
- **启用属性**: 启用了 `PrimaryDataSourceProperties`, `MybatisPlusGlobalProperties`, `YssMybatisMapperProperties` 等配置属性类。
|
|
43
|
-
|
|
44
|
-
### 4. PageQueryEntityConfigration.java
|
|
45
|
-
**位置**: `../assets/PageQueryEntityConfigration.java`
|
|
46
|
-
|
|
47
|
-
负责注册分页查询切面。
|
|
48
|
-
|
|
49
|
-
**主要功能**:
|
|
50
|
-
- 定义了 `entityQueryAspect` Bean,使其受 Spring 容器管理,从而激活自动分页拦截功能。
|
|
51
|
-
|
|
52
|
-
## 使用建议
|
|
53
|
-
|
|
54
|
-
当您在开发中使用通用 MyBatis 模式时:
|
|
55
|
-
1. **定义 Repository**: 直接继承 `BaseRepository<Entity, ID>`。
|
|
56
|
-
2. **分页查询**: 在方法参数中添加 `PageQuery`,框架会自动处理分页逻辑。
|
|
57
|
-
3. **批量操作**: 使用 `insertList`, `updateList` 等方法进行高效的数据处理。
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
# YSS Infrastructure Target Profile 指南
|
|
2
|
-
|
|
3
|
-
本指南只定义 `target-domain-model + mybatis-plus`。历史 `Entity + DTO/VO Gateway` 为 `unsupported`,不存在旧架构 Profile。
|
|
4
|
-
|
|
5
|
-
## 1. 职责
|
|
6
|
-
|
|
7
|
-
- 实现既有 Domain Gateway,负责 Aggregate 持久化;不创建或改写 Gateway interface。
|
|
8
|
-
- 实现 Application Query Port,负责分页、列表和读模型。
|
|
9
|
-
- 定义 PO、MyBatis-Plus Repository/Mapper、XML 和数据源适配。
|
|
10
|
-
- 通过 Spring MapStruct Bean 完成 `PO <-> Domain Model`、`PO -> Application Result`。
|
|
11
|
-
|
|
12
|
-
Infrastructure 不拥有业务事务边界,不向 Application/Web 暴露 PO,也不直接生成 HTTP VO。
|
|
13
|
-
|
|
14
|
-
## 2. 包结构
|
|
15
|
-
|
|
16
|
-
```text
|
|
17
|
-
{base_package}.infrastructure
|
|
18
|
-
├── persistence
|
|
19
|
-
│ ├── po
|
|
20
|
-
│ ├── repository
|
|
21
|
-
│ ├── convertor
|
|
22
|
-
│ └── gateway
|
|
23
|
-
└── query
|
|
24
|
-
├── adapter
|
|
25
|
-
└── convertor
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
新脚手架固定使用 `{base_package}.infrastructure`。已有 `{base_package}.repository` 工程不由 scaffold 改写;需要现代化时单独立项。
|
|
29
|
-
|
|
30
|
-
## 3. Domain Gateway 实现
|
|
31
|
-
|
|
32
|
-
```java
|
|
33
|
-
@Repository
|
|
34
|
-
@RequiredArgsConstructor
|
|
35
|
-
public class QualityTemplateGatewayImpl implements QualityTemplateGateway {
|
|
36
|
-
private final QualityTemplateRepository repository;
|
|
37
|
-
private final QualityTemplatePersistenceConvertor convertor;
|
|
38
|
-
|
|
39
|
-
@Override
|
|
40
|
-
public Optional<QualityTemplate> findById(QualityTemplateId id) {
|
|
41
|
-
return Optional.ofNullable(repository.selectById(id.value()))
|
|
42
|
-
.map(convertor::toDomain);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
@Override
|
|
46
|
-
public void save(QualityTemplate aggregate) {
|
|
47
|
-
repository.insertOrUpdate(convertor.toPO(aggregate));
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
GatewayImpl 不接收 Web Cmd/Query,不返回 VO/PageResult,不声明新的业务事务。
|
|
53
|
-
|
|
54
|
-
## 4. Query Port 实现
|
|
55
|
-
|
|
56
|
-
分页/列表属于 Application Query Port:
|
|
57
|
-
|
|
58
|
-
```java
|
|
59
|
-
@Repository
|
|
60
|
-
@RequiredArgsConstructor
|
|
61
|
-
public class QualityTemplateQueryAdapter implements QualityTemplateQueryPort {
|
|
62
|
-
private final QualityTemplateRepository repository;
|
|
63
|
-
private final QualityTemplateQueryConvertor convertor;
|
|
64
|
-
|
|
65
|
-
@Override
|
|
66
|
-
public PageResult<QualityTemplateResult> page(QualityTemplatePageQuery query) {
|
|
67
|
-
// orderBy/groupBy 必须先映射到批准列白名单,再构造 MyBatis 条件。
|
|
68
|
-
return convertor.toResultPage(repository.selectPage(...));
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
`PageQuery` 可以在 Web/Application/Infrastructure 协作链使用,但不得进入 Domain。`orderBy` / `groupBy` 禁止直接拼接 SQL。
|
|
74
|
-
|
|
75
|
-
## 5. PO 与 Repository
|
|
76
|
-
|
|
77
|
-
- Target Profile 使用 `*PO`;旧式 `*Entity` 布局为 `unsupported`。
|
|
78
|
-
- PO 默认使用最小 Lombok 注解,不无条件使用 `@Data`。
|
|
79
|
-
- 当前实现继承项目既有 `BasePlusRepository<PO>`;普通 MyBatis 为 `unsupported`。
|
|
80
|
-
- Mapper XML 位于项目既有扫描路径;扫描包和 XML 路径必须由集成测试证明。
|
|
81
|
-
|
|
82
|
-
## 6. MapStruct
|
|
83
|
-
|
|
84
|
-
```java
|
|
85
|
-
@Mapper(componentModel = "spring")
|
|
86
|
-
public interface QualityTemplatePersistenceConvertor {
|
|
87
|
-
QualityTemplate toDomain(QualityTemplatePO source);
|
|
88
|
-
QualityTemplatePO toPO(QualityTemplate source);
|
|
89
|
-
}
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
- 禁止 `INSTANCE = Mappers.getMapper(...)`。
|
|
93
|
-
- Convertor 使用构造器注入。
|
|
94
|
-
- 父 POM 必须配置 `mapstruct-processor`、Lombok 和 `lombok-mapstruct-binding`。
|
|
95
|
-
- 验证必须编译生成实现,不能只检查接口文本。
|
|
96
|
-
|
|
97
|
-
## 7. 验证
|
|
98
|
-
|
|
99
|
-
- Domain Gateway:保存后可通过 Gateway seam 重新加载等价 Aggregate。
|
|
100
|
-
- Query Port:分页、total、排序白名单和空结果。
|
|
101
|
-
- Mapper/Repository:实际 MyBatis-Plus/H2 或批准数据库 fixture。
|
|
102
|
-
- Architecture:Infrastructure 可以依赖 Application/Domain;反向依赖必须失败。
|
|
103
|
-
- 使用项目根 `./mvnw test/package` 留证。
|
|
104
|
-
|
|
105
|
-
## 8. 旧架构边界
|
|
106
|
-
|
|
107
|
-
检测到 Repository 直接接收 client Query、返回 VO、Convertor 做 `PO -> VO` 或使用旧式 Entity 布局时,返回 `unsupported`,不得由新 scaffold 自动改写。旧项目继续按原工程维护;现代化改造必须单独立项。
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
package com.yss.cloud.mybatis.support;
|
|
2
|
-
|
|
3
|
-
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
|
4
|
-
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
|
5
|
-
import io.mybatis.mapper.BaseMapper;
|
|
6
|
-
import io.mybatis.mapper.list.ListMapper;
|
|
7
|
-
import io.mybatis.mapper.list.ListProvider;
|
|
8
|
-
import io.mybatis.provider.Caching;
|
|
9
|
-
import com.baomidou.mybatisplus.core.mapper.Mapper;
|
|
10
|
-
import org.apache.ibatis.annotations.*;
|
|
11
|
-
|
|
12
|
-
import java.io.Serializable;
|
|
13
|
-
import java.util.Collection;
|
|
14
|
-
import java.util.List;
|
|
15
|
-
import java.util.Map;
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* @author zhudaoming
|
|
19
|
-
*/
|
|
20
|
-
public interface BaseRepository<T, D extends Serializable> extends Mapper<T>, BaseMapper<T, D>, ListMapper<T> {
|
|
21
|
-
/**s
|
|
22
|
-
/**
|
|
23
|
-
* 删除(根据ID或实体 批量删除)
|
|
24
|
-
*
|
|
25
|
-
* @param idList 主键ID列表或实体列表(不能为 null 以及 empty)
|
|
26
|
-
*/
|
|
27
|
-
int deleteBatchIds(@Param(Constants.COLL) Collection<?> idList);
|
|
28
|
-
/**
|
|
29
|
-
* 查询(根据ID 批量查询)
|
|
30
|
-
*
|
|
31
|
-
* @param idList 主键ID列表(不能为 null 以及 empty)
|
|
32
|
-
*/
|
|
33
|
-
List<T> selectBatchIds(@Param(Constants.COLL) Collection<? extends Serializable> idList);
|
|
34
|
-
/**
|
|
35
|
-
* 查询(根据 columnMap 条件)
|
|
36
|
-
*
|
|
37
|
-
* @param columnMap 表字段 map 对象
|
|
38
|
-
*/
|
|
39
|
-
List<T> selectByMap(@Param(Constants.COLUMN_MAP) Map<String, Object> columnMap);
|
|
40
|
-
/**
|
|
41
|
-
* 根据 Wrapper 条件,查询全部记录
|
|
42
|
-
*
|
|
43
|
-
* @param queryWrapper 实体对象封装操作类(可以为 null)
|
|
44
|
-
*/
|
|
45
|
-
List<Map<String, Object>> selectMaps(@Param(Constants.WRAPPER) Wrapper<T> queryWrapper);
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* 根据 Wrapper 条件,查询全部记录
|
|
49
|
-
* <p>注意: 只返回第一个字段的值</p>
|
|
50
|
-
*
|
|
51
|
-
* @param queryWrapper 实体对象封装操作类(可以为 null)
|
|
52
|
-
*/
|
|
53
|
-
List<Object> selectObjs(@Param(Constants.WRAPPER) Wrapper<T> queryWrapper);
|
|
54
|
-
/**
|
|
55
|
-
* 保存实体,默认主键自增,并且名称为 id
|
|
56
|
-
* <p>
|
|
57
|
-
* 这个方法是个示例,你可以在自己的接口中使用相同的方式覆盖父接口中的配置
|
|
58
|
-
*
|
|
59
|
-
* @param entity 实体类
|
|
60
|
-
* @return 1成功,0失败
|
|
61
|
-
*/
|
|
62
|
-
@Override
|
|
63
|
-
@Lang(Caching.class)
|
|
64
|
-
@Options(useGeneratedKeys = true)
|
|
65
|
-
@InsertProvider(type = EntityProvider.class, method = "insert")
|
|
66
|
-
<S extends T> int insert(S entity);
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* 保存实体中不为空的字段,默认主键自增,并且名称为 id
|
|
70
|
-
* <p>
|
|
71
|
-
* 这个方法是个示例,你可以在自己的接口中使用相同的方式覆盖父接口中的配置
|
|
72
|
-
*
|
|
73
|
-
* @param entity 实体类
|
|
74
|
-
* @return 1成功,0失败
|
|
75
|
-
*/
|
|
76
|
-
@Override
|
|
77
|
-
@Lang(Caching.class)
|
|
78
|
-
@Options(useGeneratedKeys = true)
|
|
79
|
-
@InsertProvider(type = EntityProvider.class, method = "insertSelective")
|
|
80
|
-
<S extends T> int insertSelective(S entity);
|
|
81
|
-
|
|
82
|
-
@Override
|
|
83
|
-
@Lang(Caching.class)
|
|
84
|
-
@Options(useGeneratedKeys = true)
|
|
85
|
-
@InsertProvider(type = ListProvider.class, method = "insertList")
|
|
86
|
-
<S extends T> int insertList(@Param("entityList") List<S> entityList);
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* 批量更新
|
|
90
|
-
*
|
|
91
|
-
* @author dengsd
|
|
92
|
-
* @date 2022/9/27 11:49
|
|
93
|
-
*/
|
|
94
|
-
@Override
|
|
95
|
-
@Lang(Caching.class)
|
|
96
|
-
@Options(useGeneratedKeys = true)
|
|
97
|
-
@UpdateProvider(type = ListProvider.class, method = "updateList")
|
|
98
|
-
<S extends T> int updateList(@Param("entityList") List<S> entityList);
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* 批量更新
|
|
103
|
-
*
|
|
104
|
-
* @author dengsd
|
|
105
|
-
* @date 2022/9/27 11:49
|
|
106
|
-
*/
|
|
107
|
-
@Override
|
|
108
|
-
@Lang(Caching.class)
|
|
109
|
-
@Options(useGeneratedKeys = true)
|
|
110
|
-
@UpdateProvider(type = ListProvider.class, method = "updateListSelective")
|
|
111
|
-
<S extends T> int updateListSelective(@Param("entityList") List<S> entityList);
|
|
112
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
package com.yss.cloud.mybatis.aop;
|
|
2
|
-
|
|
3
|
-
import com.github.pagehelper.Page;
|
|
4
|
-
import com.github.pagehelper.PageHelper;
|
|
5
|
-
import com.yss.cloud.dto.page.PageQuery;
|
|
6
|
-
import lombok.SneakyThrows;
|
|
7
|
-
import org.aspectj.lang.ProceedingJoinPoint;
|
|
8
|
-
import org.aspectj.lang.annotation.Around;
|
|
9
|
-
import org.aspectj.lang.annotation.Aspect;
|
|
10
|
-
|
|
11
|
-
@Aspect
|
|
12
|
-
public class EntityQueryAspect {
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* 字段开启分页的方法
|
|
16
|
-
*
|
|
17
|
-
* @apiNote 1. 包命名需符合规范 com.yss.datamiddle.(项目名).service?.impl.serviceImpl.method <br/> 2. 参数为pageQuery dto的方法
|
|
18
|
-
* @param joinPoint 加入切点
|
|
19
|
-
* @param pageQuery 查询分页对象dtp
|
|
20
|
-
* @return 执行结果
|
|
21
|
-
*/
|
|
22
|
-
@Around("( (execution(public * (@org.springframework.stereotype.Repository *).*(..)) || execution(* com.yss..*.gateway.impl.*.*(..))))&& (args(pageQuery)||args(pageQuery,..))")
|
|
23
|
-
@SneakyThrows
|
|
24
|
-
public Object interceptEntityQueries(ProceedingJoinPoint joinPoint, PageQuery pageQuery) {
|
|
25
|
-
if (pageQuery != null) {
|
|
26
|
-
//分页查询开始
|
|
27
|
-
Page<Object> page = PageHelper.offsetPage(pageQuery.getOffset(), pageQuery.getPageSize());
|
|
28
|
-
// 继续执行目标方法
|
|
29
|
-
Object result = joinPoint.proceed();
|
|
30
|
-
long total = page.getTotal();
|
|
31
|
-
pageQuery.setTempTotalCount(total);
|
|
32
|
-
return result;
|
|
33
|
-
}
|
|
34
|
-
// 不满足条件时直接执行目标方法
|
|
35
|
-
return joinPoint.proceed();
|
|
36
|
-
}
|
|
37
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
package com.yss.cloud.mybatis;
|
|
2
|
-
|
|
3
|
-
import com.yss.cloud.mybatis.config.PageQueryEntityConfigration;
|
|
4
|
-
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
|
5
|
-
import org.springframework.context.annotation.Configuration;
|
|
6
|
-
import org.springframework.context.annotation.Import;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
@Configuration
|
|
10
|
-
@Import({
|
|
11
|
-
PageQueryEntityConfigration.class}
|
|
12
|
-
)
|
|
13
|
-
@EnableConfigurationProperties({PrimaryDataSourceProperties.class,
|
|
14
|
-
MybatisPlusGlobalProperties.class,
|
|
15
|
-
YssMybatisMapperProperties.class})
|
|
16
|
-
public class MybatisBaseConfiguration {
|
|
17
|
-
|
|
18
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
package com.yss.cloud.mybatis.config;
|
|
2
|
-
|
|
3
|
-
import com.yss.cloud.mybatis.aop.EntityQueryAspect;
|
|
4
|
-
import lombok.extern.slf4j.Slf4j;
|
|
5
|
-
import org.springframework.context.annotation.Bean;
|
|
6
|
-
import org.springframework.context.annotation.Configuration;
|
|
7
|
-
import org.springframework.context.annotation.Primary;
|
|
8
|
-
|
|
9
|
-
@Configuration
|
|
10
|
-
@Slf4j
|
|
11
|
-
public class PageQueryEntityConfigration {
|
|
12
|
-
@Primary
|
|
13
|
-
@Bean
|
|
14
|
-
public EntityQueryAspect entityQueryAspect() {
|
|
15
|
-
log.info("【MapperConfiguration】DataSource 获取数据源primaryDataSourceProperties配置");
|
|
16
|
-
return new EntityQueryAspect();
|
|
17
|
-
}
|
|
18
|
-
}
|