leniu-dev 2.0.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/.claude/agents/auto-test-generator.md +315 -0
- package/.claude/agents/bug-analyzer.md +103 -0
- package/.claude/agents/code-reviewer.md +122 -0
- package/.claude/agents/code-scanner.md +145 -0
- package/.claude/agents/image-reader.md +154 -0
- package/.claude/agents/loki-runner.md +80 -0
- package/.claude/agents/mysql-runner.md +81 -0
- package/.claude/agents/project-manager.md +159 -0
- package/.claude/agents/requirements-analyzer.md +175 -0
- package/.claude/agents/task-fetcher.md +75 -0
- package/.claude/audio/completed.wav +0 -0
- package/.claude/commands/add-todo.md +255 -0
- package/.claude/commands/auto-test.md +252 -0
- package/.claude/commands/check.md +210 -0
- package/.claude/commands/crud.md +454 -0
- package/.claude/commands/dev.md +532 -0
- package/.claude/commands/init-config.md +154 -0
- package/.claude/commands/init-docs.md +681 -0
- package/.claude/commands/next.md +281 -0
- package/.claude/commands/opsx-apply.md +147 -0
- package/.claude/commands/opsx-archive.md +105 -0
- package/.claude/commands/opsx-bulk-archive.md +237 -0
- package/.claude/commands/opsx-continue.md +109 -0
- package/.claude/commands/opsx-explore.md +281 -0
- package/.claude/commands/opsx-ff.md +92 -0
- package/.claude/commands/opsx-new.md +65 -0
- package/.claude/commands/opsx-onboard.md +397 -0
- package/.claude/commands/opsx-sync.md +129 -0
- package/.claude/commands/opsx-verify.md +159 -0
- package/.claude/commands/progress.md +264 -0
- package/.claude/commands/release.md +109 -0
- package/.claude/commands/start.md +199 -0
- package/.claude/commands/sync.md +307 -0
- package/.claude/commands/update-status.md +428 -0
- package/.claude/docs/Mixin/344/275/277/347/224/250/346/214/207/345/215/227.md +299 -0
- package/.claude/docs/README.md +167 -0
- package/.claude/docs//345/211/215/347/253/257/345/274/200/345/217/221/346/214/207/345/215/227.md +599 -0
- package/.claude/docs//345/220/216/347/253/257/345/274/200/345/217/221/346/214/207/345/215/227.md +726 -0
- package/.claude/docs//345/267/245/344/275/234/346/265/201/345/274/200/345/217/221/346/214/207/345/215/227.md +714 -0
- package/.claude/docs//345/267/245/345/205/267/347/261/273/344/275/277/347/224/250/346/214/207/345/215/227.md +463 -0
- package/.claude/docs//346/225/260/346/215/256/345/272/223/350/256/276/350/256/241/350/247/204/350/214/203.md +390 -0
- package/.claude/docs//346/226/260/345/212/237/350/203/275/345/274/200/345/217/221/346/265/201/347/250/213/350/247/204/350/214/203.md +688 -0
- package/.claude/docs//346/226/260/351/241/271/347/233/256/345/274/200/345/217/221/346/265/201/347/250/213.md +365 -0
- package/.claude/docs//346/241/206/346/236/266/350/257/264/346/230/216.md +393 -0
- package/.claude/docs//350/267/257/347/224/261/351/205/215/347/275/256/346/214/207/345/215/227.md +246 -0
- package/.claude/framework-config.json +73 -0
- package/.claude/hooks/lib/notify.js +310 -0
- package/.claude/hooks/pre-tool-use.js +117 -0
- package/.claude/hooks/skill-forced-eval.js +161 -0
- package/.claude/hooks/stop.js +55 -0
- package/.claude/notify-config.json +9 -0
- package/.claude/settings.json +57 -0
- package/.claude/skills/add-skill/SKILL.md +488 -0
- package/.claude/skills/analyze-requirements/SKILL.md +112 -0
- package/.claude/skills/api-development/SKILL.md +315 -0
- package/.claude/skills/architecture-design/SKILL.md +152 -0
- package/.claude/skills/auto-test/SKILL.md +625 -0
- package/.claude/skills/auto-test/references/api-conventions.md +260 -0
- package/.claude/skills/backend-annotations/SKILL.md +248 -0
- package/.claude/skills/banana-image/CHANGELOG.md +37 -0
- package/.claude/skills/banana-image/README.md +146 -0
- package/.claude/skills/banana-image/SKILL.md +171 -0
- package/.claude/skills/banana-image/assets/logo.png +0 -0
- package/.claude/skills/banana-image/references/advanced-usage.md +189 -0
- package/.claude/skills/banana-image/scripts/apply_template.py +125 -0
- package/.claude/skills/banana-image/scripts/banana_image_exec.ts +412 -0
- package/.claude/skills/banana-image/scripts/batch_prep.py +82 -0
- package/.claude/skills/banana-image/scripts/package-lock.json +1437 -0
- package/.claude/skills/banana-image/scripts/package.json +18 -0
- package/.claude/skills/banana-image/scripts/requirements.txt +10 -0
- package/.claude/skills/banana-image/templates/poster.json +22 -0
- package/.claude/skills/banana-image/templates/product.json +17 -0
- package/.claude/skills/banana-image/templates/social.json +22 -0
- package/.claude/skills/banana-image/templates/thumbnail.json +17 -0
- package/.claude/skills/brainstorm/SKILL.md +216 -0
- package/.claude/skills/bug-detective/SKILL.md +295 -0
- package/.claude/skills/bug-detective/references/error-patterns.md +242 -0
- package/.claude/skills/chrome-cdp/SKILL.md +81 -0
- package/.claude/skills/chrome-cdp/scripts/cdp.mjs +838 -0
- package/.claude/skills/chrome-cdp/scripts/run-cdp.sh +7 -0
- package/.claude/skills/code-patterns/SKILL.md +163 -0
- package/.claude/skills/code-patterns/references/leniu-code-patterns.md +87 -0
- package/.claude/skills/codex-code-review/SKILL.md +327 -0
- package/.claude/skills/collaborating-with-codex/SKILL.md +180 -0
- package/.claude/skills/collaborating-with-codex/scripts/codex_bridge.py +275 -0
- package/.claude/skills/collaborating-with-gemini/SKILL.md +194 -0
- package/.claude/skills/collaborating-with-gemini/scripts/gemini_bridge.py +275 -0
- package/.claude/skills/crud-development/SKILL.md +328 -0
- package/.claude/skills/data-permission/SKILL.md +221 -0
- package/.claude/skills/data-permission/references/custom-data-scope.md +90 -0
- package/.claude/skills/database-ops/SKILL.md +210 -0
- package/.claude/skills/error-handler/SKILL.md +310 -0
- package/.claude/skills/file-oss-management/SKILL.md +260 -0
- package/.claude/skills/file-oss-management/references/entities.md +105 -0
- package/.claude/skills/file-oss-management/references/service-impl.md +104 -0
- package/.claude/skills/fix-bug/SKILL.md +269 -0
- package/.claude/skills/git-workflow/SKILL.md +179 -0
- package/.claude/skills/jenkins-deploy/SKILL.md +134 -0
- package/.claude/skills/jenkins-deploy/assets/env_param.template.json +51 -0
- package/.claude/skills/jenkins-deploy/assets/jk_build.py +400 -0
- package/.claude/skills/json-serialization/SKILL.md +341 -0
- package/.claude/skills/lanhu-design/SKILL.md +99 -0
- package/.claude/skills/leniu-api-development/SKILL.md +319 -0
- package/.claude/skills/leniu-api-development/references/real-examples.md +273 -0
- package/.claude/skills/leniu-architecture-design/SKILL.md +383 -0
- package/.claude/skills/leniu-backend-annotations/SKILL.md +277 -0
- package/.claude/skills/leniu-brainstorm/SKILL.md +242 -0
- package/.claude/skills/leniu-brainstorm/references/business-scenarios.md +162 -0
- package/.claude/skills/leniu-code-patterns/SKILL.md +411 -0
- package/.claude/skills/leniu-crud-development/SKILL.md +404 -0
- package/.claude/skills/leniu-crud-development/references/templates.md +597 -0
- package/.claude/skills/leniu-customization-location/SKILL.md +410 -0
- package/.claude/skills/leniu-data-permission/SKILL.md +341 -0
- package/.claude/skills/leniu-database-ops/SKILL.md +426 -0
- package/.claude/skills/leniu-error-handler/SKILL.md +462 -0
- package/.claude/skills/leniu-java-concurrent/SKILL.md +400 -0
- package/.claude/skills/leniu-java-entity/SKILL.md +237 -0
- package/.claude/skills/leniu-java-entity/references/templates.md +237 -0
- package/.claude/skills/leniu-java-logging/SKILL.md +229 -0
- package/.claude/skills/leniu-java-logging/references/data-mask.md +46 -0
- package/.claude/skills/leniu-java-logging/references/logging-scenarios.md +113 -0
- package/.claude/skills/leniu-java-mq/SKILL.md +338 -0
- package/.claude/skills/leniu-java-mybatis/SKILL.md +267 -0
- package/.claude/skills/leniu-java-mybatis/references/report-mapper.md +88 -0
- package/.claude/skills/leniu-java-task/SKILL.md +367 -0
- package/.claude/skills/leniu-marketing-scenario/SKILL.md +448 -0
- package/.claude/skills/leniu-marketing-scenario/references/pay-meal-rules.md +197 -0
- package/.claude/skills/leniu-marketing-scenario/references/price-rules.md +286 -0
- package/.claude/skills/leniu-marketing-scenario/references/recharge-rules.md +188 -0
- package/.claude/skills/leniu-redis-cache/SKILL.md +331 -0
- package/.claude/skills/leniu-report-scenario/SKILL.md +508 -0
- package/.claude/skills/leniu-report-scenario/references/amount-handling.md +448 -0
- package/.claude/skills/leniu-report-scenario/references/analysis-module.md +64 -0
- package/.claude/skills/leniu-report-scenario/references/customization-table-fields.md +93 -0
- package/.claude/skills/leniu-report-scenario/references/customization.md +356 -0
- package/.claude/skills/leniu-report-scenario/references/data-permission.md +182 -0
- package/.claude/skills/leniu-report-scenario/references/export.md +553 -0
- package/.claude/skills/leniu-report-scenario/references/mealtime.md +197 -0
- package/.claude/skills/leniu-report-scenario/references/query-param.md +274 -0
- package/.claude/skills/leniu-report-scenario/references/report-tables.md +162 -0
- package/.claude/skills/leniu-report-scenario/references/standard-customization.md +112 -0
- package/.claude/skills/leniu-report-scenario/references/standard-table-fields.md +113 -0
- package/.claude/skills/leniu-report-scenario/references/total-line.md +179 -0
- package/.claude/skills/leniu-security-guard/SKILL.md +306 -0
- package/.claude/skills/leniu-utils-toolkit/SKILL.md +380 -0
- package/.claude/skills/loki-log-query/SKILL.md +430 -0
- package/.claude/skills/mysql-debug/SKILL.md +406 -0
- package/.claude/skills/performance-doctor/SKILL.md +297 -0
- package/.claude/skills/project-navigator/SKILL.md +211 -0
- package/.claude/skills/redis-cache/SKILL.md +282 -0
- package/.claude/skills/redis-cache/references/listeners.md +23 -0
- package/.claude/skills/scheduled-jobs/SKILL.md +277 -0
- package/.claude/skills/security-guard/SKILL.md +245 -0
- package/.claude/skills/security-guard/references/encrypt-config.md +103 -0
- package/.claude/skills/security-guard/references/sensitive-strategies.md +42 -0
- package/.claude/skills/sms-mail/SKILL.md +346 -0
- package/.claude/skills/sms-mail/references/mail-config.md +88 -0
- package/.claude/skills/sms-mail/references/sms-config.md +74 -0
- package/.claude/skills/social-login/SKILL.md +328 -0
- package/.claude/skills/social-login/references/provider-configs.md +118 -0
- package/.claude/skills/store-pc/SKILL.md +366 -0
- package/.claude/skills/sync-back-merge/SKILL.md +66 -0
- package/.claude/skills/task-tracker/SKILL.md +307 -0
- package/.claude/skills/tech-decision/SKILL.md +393 -0
- package/.claude/skills/tenant-management/SKILL.md +272 -0
- package/.claude/skills/tenant-management/references/tenant-scenarios.md +91 -0
- package/.claude/skills/test-development/SKILL.md +301 -0
- package/.claude/skills/test-development/references/parameterized-examples.md +119 -0
- package/.claude/skills/ui-pc/SKILL.md +438 -0
- package/.claude/skills/utils-toolkit/SKILL.md +354 -0
- package/.claude/skills/utils-toolkit/references/redis-utils-api.md +56 -0
- package/.claude/skills/websocket-sse/SKILL.md +350 -0
- package/.claude/skills/workflow-engine/SKILL.md +249 -0
- package/.claude/skills/yunxiao-task-management/SKILL.md +401 -0
- package/.claude/skills/yunxiao-task-management/templates//346/217/220/346/265/213/345/215/225/346/250/241/346/235/277.html +17 -0
- package/.claude/templates/env-config.md +27 -0
- package/.claude/templates//345/276/205/345/212/236/346/270/205/345/215/225/346/250/241/346/235/277.md +56 -0
- package/.claude/templates//351/234/200/346/261/202/346/226/207/346/241/243/346/250/241/346/235/277.md +85 -0
- package/.claude/templates//351/241/271/347/233/256/347/212/266/346/200/201/346/250/241/346/235/277.md +43 -0
- package/.codex/skills/add-skill/SKILL.md +488 -0
- package/.codex/skills/add-todo/SKILL.md +269 -0
- package/.codex/skills/analyze-requirements/SKILL.md +112 -0
- package/.codex/skills/api-development/SKILL.md +315 -0
- package/.codex/skills/architecture-design/SKILL.md +152 -0
- package/.codex/skills/auto-test/SKILL.md +453 -0
- package/.codex/skills/auto-test/references/api-conventions.md +260 -0
- package/.codex/skills/backend-annotations/SKILL.md +248 -0
- package/.codex/skills/banana-image/CHANGELOG.md +37 -0
- package/.codex/skills/banana-image/README.md +146 -0
- package/.codex/skills/banana-image/SKILL.md +171 -0
- package/.codex/skills/banana-image/assets/logo.png +0 -0
- package/.codex/skills/banana-image/references/advanced-usage.md +189 -0
- package/.codex/skills/banana-image/scripts/apply_template.py +125 -0
- package/.codex/skills/banana-image/scripts/banana_image_exec.ts +412 -0
- package/.codex/skills/banana-image/scripts/batch_prep.py +82 -0
- package/.codex/skills/banana-image/scripts/package-lock.json +1437 -0
- package/.codex/skills/banana-image/scripts/package.json +18 -0
- package/.codex/skills/banana-image/scripts/requirements.txt +10 -0
- package/.codex/skills/banana-image/templates/poster.json +22 -0
- package/.codex/skills/banana-image/templates/product.json +17 -0
- package/.codex/skills/banana-image/templates/social.json +22 -0
- package/.codex/skills/banana-image/templates/thumbnail.json +17 -0
- package/.codex/skills/brainstorm/SKILL.md +216 -0
- package/.codex/skills/bug-detective/SKILL.md +295 -0
- package/.codex/skills/bug-detective/references/error-patterns.md +242 -0
- package/.codex/skills/check/SKILL.md +367 -0
- package/.codex/skills/code-patterns/SKILL.md +163 -0
- package/.codex/skills/code-patterns/references/leniu-code-patterns.md +87 -0
- package/.codex/skills/collaborating-with-codex/SKILL.md +180 -0
- package/.codex/skills/collaborating-with-codex/scripts/codex_bridge.py +275 -0
- package/.codex/skills/collaborating-with-gemini/SKILL.md +194 -0
- package/.codex/skills/collaborating-with-gemini/scripts/gemini_bridge.py +275 -0
- package/.codex/skills/crud/SKILL.md +265 -0
- package/.codex/skills/crud-development/SKILL.md +328 -0
- package/.codex/skills/data-permission/SKILL.md +221 -0
- package/.codex/skills/data-permission/references/custom-data-scope.md +90 -0
- package/.codex/skills/database-ops/SKILL.md +210 -0
- package/.codex/skills/dev/SKILL.md +187 -0
- package/.codex/skills/error-handler/SKILL.md +310 -0
- package/.codex/skills/file-oss-management/SKILL.md +260 -0
- package/.codex/skills/file-oss-management/references/entities.md +105 -0
- package/.codex/skills/file-oss-management/references/service-impl.md +104 -0
- package/.codex/skills/fix-bug/SKILL.md +269 -0
- package/.codex/skills/git-workflow/SKILL.md +179 -0
- package/.codex/skills/init-docs/SKILL.md +194 -0
- package/.codex/skills/jenkins-deploy/SKILL.md +134 -0
- package/.codex/skills/json-serialization/SKILL.md +341 -0
- package/.codex/skills/lanhu-design/SKILL.md +99 -0
- package/.codex/skills/leniu-api-development/SKILL.md +319 -0
- package/.codex/skills/leniu-api-development/references/real-examples.md +273 -0
- package/.codex/skills/leniu-architecture-design/SKILL.md +383 -0
- package/.codex/skills/leniu-backend-annotations/SKILL.md +277 -0
- package/.codex/skills/leniu-brainstorm/SKILL.md +242 -0
- package/.codex/skills/leniu-brainstorm/references/business-scenarios.md +162 -0
- package/.codex/skills/leniu-code-patterns/SKILL.md +411 -0
- package/.codex/skills/leniu-crud-development/SKILL.md +404 -0
- package/.codex/skills/leniu-crud-development/references/templates.md +597 -0
- package/.codex/skills/leniu-customization-location/SKILL.md +410 -0
- package/.codex/skills/leniu-data-permission/SKILL.md +341 -0
- package/.codex/skills/leniu-database-ops/SKILL.md +426 -0
- package/.codex/skills/leniu-error-handler/SKILL.md +462 -0
- package/.codex/skills/leniu-java-amount-handling/SKILL.md +461 -0
- package/.codex/skills/leniu-java-code-style/SKILL.md +510 -0
- package/.codex/skills/leniu-java-concurrent/SKILL.md +400 -0
- package/.codex/skills/leniu-java-entity/SKILL.md +237 -0
- package/.codex/skills/leniu-java-entity/references/templates.md +237 -0
- package/.codex/skills/leniu-java-logging/SKILL.md +229 -0
- package/.codex/skills/leniu-java-logging/references/data-mask.md +46 -0
- package/.codex/skills/leniu-java-logging/references/logging-scenarios.md +113 -0
- package/.codex/skills/leniu-java-mq/SKILL.md +338 -0
- package/.codex/skills/leniu-java-mybatis/SKILL.md +267 -0
- package/.codex/skills/leniu-java-mybatis/references/report-mapper.md +88 -0
- package/.codex/skills/leniu-java-task/SKILL.md +367 -0
- package/.codex/skills/leniu-marketing-scenario/SKILL.md +448 -0
- package/.codex/skills/leniu-marketing-scenario/references/pay-meal-rules.md +197 -0
- package/.codex/skills/leniu-marketing-scenario/references/price-rules.md +286 -0
- package/.codex/skills/leniu-marketing-scenario/references/recharge-rules.md +188 -0
- package/.codex/skills/leniu-redis-cache/SKILL.md +331 -0
- package/.codex/skills/leniu-report-scenario/SKILL.md +508 -0
- package/.codex/skills/leniu-report-scenario/references/amount-handling.md +448 -0
- package/.codex/skills/leniu-report-scenario/references/analysis-module.md +64 -0
- package/.codex/skills/leniu-report-scenario/references/customization-table-fields.md +93 -0
- package/.codex/skills/leniu-report-scenario/references/customization.md +356 -0
- package/.codex/skills/leniu-report-scenario/references/data-permission.md +182 -0
- package/.codex/skills/leniu-report-scenario/references/export.md +553 -0
- package/.codex/skills/leniu-report-scenario/references/mealtime.md +197 -0
- package/.codex/skills/leniu-report-scenario/references/query-param.md +274 -0
- package/.codex/skills/leniu-report-scenario/references/report-tables.md +162 -0
- package/.codex/skills/leniu-report-scenario/references/standard-customization.md +112 -0
- package/.codex/skills/leniu-report-scenario/references/standard-table-fields.md +113 -0
- package/.codex/skills/leniu-report-scenario/references/total-line.md +179 -0
- package/.codex/skills/leniu-security-guard/SKILL.md +306 -0
- package/.codex/skills/leniu-utils-toolkit/SKILL.md +380 -0
- package/.codex/skills/loki-log-query/SKILL.md +430 -0
- package/.codex/skills/loki-log-query/environments.json +45 -0
- package/.codex/skills/mysql-debug/SKILL.md +406 -0
- package/.codex/skills/next/SKILL.md +137 -0
- package/.codex/skills/openspec-apply-change/SKILL.md +165 -0
- package/.codex/skills/openspec-archive-change/SKILL.md +122 -0
- package/.codex/skills/openspec-bulk-archive-change/SKILL.md +254 -0
- package/.codex/skills/openspec-continue-change/SKILL.md +126 -0
- package/.codex/skills/openspec-explore/SKILL.md +299 -0
- package/.codex/skills/openspec-ff-change/SKILL.md +109 -0
- package/.codex/skills/openspec-new-change/SKILL.md +82 -0
- package/.codex/skills/openspec-onboard/SKILL.md +414 -0
- package/.codex/skills/openspec-sync-specs/SKILL.md +146 -0
- package/.codex/skills/openspec-verify-change/SKILL.md +176 -0
- package/.codex/skills/performance-doctor/SKILL.md +297 -0
- package/.codex/skills/progress/SKILL.md +193 -0
- package/.codex/skills/project-navigator/SKILL.md +211 -0
- package/.codex/skills/redis-cache/SKILL.md +282 -0
- package/.codex/skills/redis-cache/references/listeners.md +23 -0
- package/.codex/skills/scheduled-jobs/SKILL.md +277 -0
- package/.codex/skills/security-guard/SKILL.md +245 -0
- package/.codex/skills/security-guard/references/encrypt-config.md +103 -0
- package/.codex/skills/security-guard/references/sensitive-strategies.md +42 -0
- package/.codex/skills/skill-creator/LICENSE.txt +202 -0
- package/.codex/skills/skill-creator/SKILL.md +479 -0
- package/.codex/skills/skill-creator/agents/analyzer.md +274 -0
- package/.codex/skills/skill-creator/agents/comparator.md +202 -0
- package/.codex/skills/skill-creator/agents/grader.md +223 -0
- package/.codex/skills/skill-creator/assets/eval_review.html +146 -0
- package/.codex/skills/skill-creator/eval-viewer/generate_review.py +471 -0
- package/.codex/skills/skill-creator/eval-viewer/viewer.html +1325 -0
- package/.codex/skills/skill-creator/references/schemas.md +430 -0
- package/.codex/skills/skill-creator/scripts/__init__.py +0 -0
- package/.codex/skills/skill-creator/scripts/aggregate_benchmark.py +401 -0
- package/.codex/skills/skill-creator/scripts/generate_report.py +326 -0
- package/.codex/skills/skill-creator/scripts/improve_description.py +248 -0
- package/.codex/skills/skill-creator/scripts/package_skill.py +136 -0
- package/.codex/skills/skill-creator/scripts/quick_validate.py +103 -0
- package/.codex/skills/skill-creator/scripts/run_eval.py +310 -0
- package/.codex/skills/skill-creator/scripts/run_loop.py +332 -0
- package/.codex/skills/skill-creator/scripts/utils.py +47 -0
- package/.codex/skills/sms-mail/SKILL.md +346 -0
- package/.codex/skills/sms-mail/references/mail-config.md +88 -0
- package/.codex/skills/sms-mail/references/sms-config.md +74 -0
- package/.codex/skills/social-login/SKILL.md +328 -0
- package/.codex/skills/social-login/references/provider-configs.md +118 -0
- package/.codex/skills/start/SKILL.md +154 -0
- package/.codex/skills/store-pc/SKILL.md +366 -0
- package/.codex/skills/sync/SKILL.md +149 -0
- package/.codex/skills/sync-back-merge/SKILL.md +66 -0
- package/.codex/skills/task-tracker/SKILL.md +307 -0
- package/.codex/skills/tech-decision/SKILL.md +393 -0
- package/.codex/skills/tenant-management/SKILL.md +272 -0
- package/.codex/skills/tenant-management/references/tenant-scenarios.md +91 -0
- package/.codex/skills/test-development/SKILL.md +301 -0
- package/.codex/skills/test-development/references/parameterized-examples.md +119 -0
- package/.codex/skills/ui-pc/SKILL.md +438 -0
- package/.codex/skills/update-status/SKILL.md +159 -0
- package/.codex/skills/utils-toolkit/SKILL.md +354 -0
- package/.codex/skills/utils-toolkit/references/redis-utils-api.md +56 -0
- package/.codex/skills/websocket-sse/SKILL.md +350 -0
- package/.codex/skills/workflow-engine/SKILL.md +249 -0
- package/.codex/skills/yunxiao-task-management/SKILL.md +401 -0
- package/.codex/skills/yunxiao-task-management/templates//346/217/220/346/265/213/345/215/225/346/250/241/346/235/277.html +17 -0
- package/.cursor/agents/bug-analyzer.md +102 -0
- package/.cursor/agents/code-reviewer.md +122 -0
- package/.cursor/agents/code-scanner.md +145 -0
- package/.cursor/agents/image-reader.md +154 -0
- package/.cursor/agents/loki-runner.md +80 -0
- package/.cursor/agents/mysql-runner.md +81 -0
- package/.cursor/agents/project-manager.md +159 -0
- package/.cursor/agents/requirements-analyzer.md +141 -0
- package/.cursor/agents/task-fetcher.md +75 -0
- package/.cursor/audio/completed.wav +0 -0
- package/.cursor/commands/opsx-apply.md +152 -0
- package/.cursor/commands/opsx-archive.md +157 -0
- package/.cursor/commands/opsx-bulk-archive.md +242 -0
- package/.cursor/commands/opsx-continue.md +114 -0
- package/.cursor/commands/opsx-explore.md +174 -0
- package/.cursor/commands/opsx-ff.md +94 -0
- package/.cursor/commands/opsx-new.md +69 -0
- package/.cursor/commands/opsx-onboard.md +525 -0
- package/.cursor/commands/opsx-sync.md +134 -0
- package/.cursor/commands/opsx-verify.md +164 -0
- package/.cursor/hooks/cursor-pre-tool-use.js +122 -0
- package/.cursor/hooks/cursor-skill-eval.js +466 -0
- package/.cursor/hooks/lib/notify.js +310 -0
- package/.cursor/hooks/stop.js +55 -0
- package/.cursor/hooks.json +23 -0
- package/.cursor/mcp.json +22 -0
- package/.cursor/rules/skill-activation.mdc +99 -0
- package/.cursor/skills/add-skill/SKILL.md +488 -0
- package/.cursor/skills/analyze-requirements/SKILL.md +112 -0
- package/.cursor/skills/api-development/SKILL.md +315 -0
- package/.cursor/skills/architecture-design/SKILL.md +152 -0
- package/.cursor/skills/auto-test/SKILL.md +453 -0
- package/.cursor/skills/auto-test/references/api-conventions.md +260 -0
- package/.cursor/skills/backend-annotations/SKILL.md +248 -0
- package/.cursor/skills/banana-image/CHANGELOG.md +37 -0
- package/.cursor/skills/banana-image/README.md +146 -0
- package/.cursor/skills/banana-image/SKILL.md +171 -0
- package/.cursor/skills/banana-image/assets/logo.png +0 -0
- package/.cursor/skills/banana-image/references/advanced-usage.md +189 -0
- package/.cursor/skills/banana-image/scripts/apply_template.py +125 -0
- package/.cursor/skills/banana-image/scripts/banana_image_exec.ts +412 -0
- package/.cursor/skills/banana-image/scripts/batch_prep.py +82 -0
- package/.cursor/skills/banana-image/scripts/package-lock.json +1437 -0
- package/.cursor/skills/banana-image/scripts/package.json +18 -0
- package/.cursor/skills/banana-image/scripts/requirements.txt +10 -0
- package/.cursor/skills/banana-image/templates/poster.json +22 -0
- package/.cursor/skills/banana-image/templates/product.json +17 -0
- package/.cursor/skills/banana-image/templates/social.json +22 -0
- package/.cursor/skills/banana-image/templates/thumbnail.json +17 -0
- package/.cursor/skills/brainstorm/SKILL.md +216 -0
- package/.cursor/skills/bug-detective/SKILL.md +295 -0
- package/.cursor/skills/bug-detective/references/error-patterns.md +242 -0
- package/.cursor/skills/code-patterns/SKILL.md +163 -0
- package/.cursor/skills/code-patterns/references/leniu-code-patterns.md +87 -0
- package/.cursor/skills/collaborating-with-codex/SKILL.md +180 -0
- package/.cursor/skills/collaborating-with-codex/scripts/codex_bridge.py +275 -0
- package/.cursor/skills/collaborating-with-gemini/SKILL.md +194 -0
- package/.cursor/skills/collaborating-with-gemini/scripts/gemini_bridge.py +275 -0
- package/.cursor/skills/crud-development/SKILL.md +328 -0
- package/.cursor/skills/data-permission/SKILL.md +221 -0
- package/.cursor/skills/data-permission/references/custom-data-scope.md +90 -0
- package/.cursor/skills/database-ops/SKILL.md +210 -0
- package/.cursor/skills/error-handler/SKILL.md +310 -0
- package/.cursor/skills/file-oss-management/SKILL.md +260 -0
- package/.cursor/skills/file-oss-management/references/entities.md +105 -0
- package/.cursor/skills/file-oss-management/references/service-impl.md +104 -0
- package/.cursor/skills/fix-bug/SKILL.md +269 -0
- package/.cursor/skills/git-workflow/SKILL.md +179 -0
- package/.cursor/skills/jenkins-deploy/SKILL.md +134 -0
- package/.cursor/skills/json-serialization/SKILL.md +341 -0
- package/.cursor/skills/lanhu-design/SKILL.md +99 -0
- package/.cursor/skills/leniu-api-development/SKILL.md +319 -0
- package/.cursor/skills/leniu-api-development/references/real-examples.md +273 -0
- package/.cursor/skills/leniu-architecture-design/SKILL.md +383 -0
- package/.cursor/skills/leniu-backend-annotations/SKILL.md +277 -0
- package/.cursor/skills/leniu-brainstorm/SKILL.md +242 -0
- package/.cursor/skills/leniu-brainstorm/references/business-scenarios.md +162 -0
- package/.cursor/skills/leniu-code-patterns/SKILL.md +411 -0
- package/.cursor/skills/leniu-crud-development/SKILL.md +404 -0
- package/.cursor/skills/leniu-crud-development/references/templates.md +597 -0
- package/.cursor/skills/leniu-customization-location/SKILL.md +410 -0
- package/.cursor/skills/leniu-data-permission/SKILL.md +341 -0
- package/.cursor/skills/leniu-database-ops/SKILL.md +426 -0
- package/.cursor/skills/leniu-error-handler/SKILL.md +462 -0
- package/.cursor/skills/leniu-java-amount-handling/SKILL.md +461 -0
- package/.cursor/skills/leniu-java-code-style/SKILL.md +510 -0
- package/.cursor/skills/leniu-java-concurrent/SKILL.md +400 -0
- package/.cursor/skills/leniu-java-entity/SKILL.md +237 -0
- package/.cursor/skills/leniu-java-entity/references/templates.md +237 -0
- package/.cursor/skills/leniu-java-logging/SKILL.md +229 -0
- package/.cursor/skills/leniu-java-logging/references/data-mask.md +46 -0
- package/.cursor/skills/leniu-java-logging/references/logging-scenarios.md +113 -0
- package/.cursor/skills/leniu-java-mq/SKILL.md +338 -0
- package/.cursor/skills/leniu-java-mybatis/SKILL.md +267 -0
- package/.cursor/skills/leniu-java-mybatis/references/report-mapper.md +88 -0
- package/.cursor/skills/leniu-java-task/SKILL.md +367 -0
- package/.cursor/skills/leniu-marketing-scenario/SKILL.md +448 -0
- package/.cursor/skills/leniu-marketing-scenario/references/pay-meal-rules.md +197 -0
- package/.cursor/skills/leniu-marketing-scenario/references/price-rules.md +286 -0
- package/.cursor/skills/leniu-marketing-scenario/references/recharge-rules.md +188 -0
- package/.cursor/skills/leniu-redis-cache/SKILL.md +331 -0
- package/.cursor/skills/leniu-report-scenario/SKILL.md +508 -0
- package/.cursor/skills/leniu-report-scenario/references/amount-handling.md +448 -0
- package/.cursor/skills/leniu-report-scenario/references/analysis-module.md +64 -0
- package/.cursor/skills/leniu-report-scenario/references/customization-table-fields.md +93 -0
- package/.cursor/skills/leniu-report-scenario/references/customization.md +356 -0
- package/.cursor/skills/leniu-report-scenario/references/data-permission.md +182 -0
- package/.cursor/skills/leniu-report-scenario/references/export.md +553 -0
- package/.cursor/skills/leniu-report-scenario/references/mealtime.md +197 -0
- package/.cursor/skills/leniu-report-scenario/references/query-param.md +274 -0
- package/.cursor/skills/leniu-report-scenario/references/report-tables.md +162 -0
- package/.cursor/skills/leniu-report-scenario/references/standard-customization.md +112 -0
- package/.cursor/skills/leniu-report-scenario/references/standard-table-fields.md +113 -0
- package/.cursor/skills/leniu-report-scenario/references/total-line.md +179 -0
- package/.cursor/skills/leniu-security-guard/SKILL.md +306 -0
- package/.cursor/skills/leniu-utils-toolkit/SKILL.md +380 -0
- package/.cursor/skills/loki-log-query/SKILL.md +430 -0
- package/.cursor/skills/loki-log-query/environments.json +45 -0
- package/.cursor/skills/mysql-debug/SKILL.md +406 -0
- package/.cursor/skills/openspec-apply-change/SKILL.md +165 -0
- package/.cursor/skills/openspec-archive-change/SKILL.md +122 -0
- package/.cursor/skills/openspec-bulk-archive-change/SKILL.md +254 -0
- package/.cursor/skills/openspec-continue-change/SKILL.md +126 -0
- package/.cursor/skills/openspec-explore/SKILL.md +299 -0
- package/.cursor/skills/openspec-ff-change/SKILL.md +109 -0
- package/.cursor/skills/openspec-new-change/SKILL.md +82 -0
- package/.cursor/skills/openspec-onboard/SKILL.md +414 -0
- package/.cursor/skills/openspec-sync-specs/SKILL.md +146 -0
- package/.cursor/skills/openspec-verify-change/SKILL.md +176 -0
- package/.cursor/skills/performance-doctor/SKILL.md +297 -0
- package/.cursor/skills/project-navigator/SKILL.md +211 -0
- package/.cursor/skills/redis-cache/SKILL.md +282 -0
- package/.cursor/skills/redis-cache/references/listeners.md +23 -0
- package/.cursor/skills/scheduled-jobs/SKILL.md +277 -0
- package/.cursor/skills/security-guard/SKILL.md +245 -0
- package/.cursor/skills/security-guard/references/encrypt-config.md +103 -0
- package/.cursor/skills/security-guard/references/sensitive-strategies.md +42 -0
- package/.cursor/skills/skill-creator/LICENSE.txt +202 -0
- package/.cursor/skills/skill-creator/SKILL.md +479 -0
- package/.cursor/skills/skill-creator/agents/analyzer.md +274 -0
- package/.cursor/skills/skill-creator/agents/comparator.md +202 -0
- package/.cursor/skills/skill-creator/agents/grader.md +223 -0
- package/.cursor/skills/skill-creator/assets/eval_review.html +146 -0
- package/.cursor/skills/skill-creator/eval-viewer/generate_review.py +471 -0
- package/.cursor/skills/skill-creator/eval-viewer/viewer.html +1325 -0
- package/.cursor/skills/skill-creator/references/schemas.md +430 -0
- package/.cursor/skills/skill-creator/scripts/__init__.py +0 -0
- package/.cursor/skills/skill-creator/scripts/aggregate_benchmark.py +401 -0
- package/.cursor/skills/skill-creator/scripts/generate_report.py +326 -0
- package/.cursor/skills/skill-creator/scripts/improve_description.py +248 -0
- package/.cursor/skills/skill-creator/scripts/package_skill.py +136 -0
- package/.cursor/skills/skill-creator/scripts/quick_validate.py +103 -0
- package/.cursor/skills/skill-creator/scripts/run_eval.py +310 -0
- package/.cursor/skills/skill-creator/scripts/run_loop.py +332 -0
- package/.cursor/skills/skill-creator/scripts/utils.py +47 -0
- package/.cursor/skills/sms-mail/SKILL.md +346 -0
- package/.cursor/skills/sms-mail/references/mail-config.md +88 -0
- package/.cursor/skills/sms-mail/references/sms-config.md +74 -0
- package/.cursor/skills/social-login/SKILL.md +328 -0
- package/.cursor/skills/social-login/references/provider-configs.md +118 -0
- package/.cursor/skills/store-pc/SKILL.md +366 -0
- package/.cursor/skills/sync-back-merge/SKILL.md +66 -0
- package/.cursor/skills/task-tracker/SKILL.md +307 -0
- package/.cursor/skills/tech-decision/SKILL.md +393 -0
- package/.cursor/skills/tenant-management/SKILL.md +272 -0
- package/.cursor/skills/tenant-management/references/tenant-scenarios.md +91 -0
- package/.cursor/skills/test-development/SKILL.md +301 -0
- package/.cursor/skills/test-development/references/parameterized-examples.md +119 -0
- package/.cursor/skills/ui-pc/SKILL.md +438 -0
- package/.cursor/skills/utils-toolkit/SKILL.md +354 -0
- package/.cursor/skills/utils-toolkit/references/redis-utils-api.md +56 -0
- package/.cursor/skills/websocket-sse/SKILL.md +350 -0
- package/.cursor/skills/workflow-engine/SKILL.md +249 -0
- package/.cursor/skills/yunxiao-task-management/SKILL.md +401 -0
- package/.cursor/skills/yunxiao-task-management/templates//346/217/220/346/265/213/345/215/225/346/250/241/346/235/277.html +17 -0
- package/.cursor/templates/env-config.md +27 -0
- package/AGENTS.md +275 -0
- package/CLAUDE.md +285 -0
- package/README.md +104 -0
- package/bin/index.js +3069 -0
- package/init.sh +178 -0
- package/package.json +40 -0
- package/scripts/build-skills.js +180 -0
- package/src/platform-map.json +100 -0
- package/src/skills/add-skill/SKILL.md +488 -0
- package/src/skills/add-todo/SKILL.md +269 -0
- package/src/skills/analyze-requirements/SKILL.md +112 -0
- package/src/skills/api-development/SKILL.md +315 -0
- package/src/skills/architecture-design/SKILL.md +152 -0
- package/src/skills/backend-annotations/SKILL.md +248 -0
- package/src/skills/banana-image/CHANGELOG.md +37 -0
- package/src/skills/banana-image/README.md +146 -0
- package/src/skills/banana-image/SKILL.md +171 -0
- package/src/skills/banana-image/assets/logo.png +0 -0
- package/src/skills/banana-image/references/advanced-usage.md +189 -0
- package/src/skills/banana-image/scripts/apply_template.py +125 -0
- package/src/skills/banana-image/scripts/banana_image_exec.ts +412 -0
- package/src/skills/banana-image/scripts/batch_prep.py +82 -0
- package/src/skills/banana-image/scripts/package-lock.json +1437 -0
- package/src/skills/banana-image/scripts/package.json +18 -0
- package/src/skills/banana-image/scripts/requirements.txt +10 -0
- package/src/skills/banana-image/templates/poster.json +22 -0
- package/src/skills/banana-image/templates/product.json +17 -0
- package/src/skills/banana-image/templates/social.json +22 -0
- package/src/skills/banana-image/templates/thumbnail.json +17 -0
- package/src/skills/brainstorm/SKILL.md +216 -0
- package/src/skills/bug-detective/SKILL.md +295 -0
- package/src/skills/bug-detective/references/error-patterns.md +242 -0
- package/src/skills/check/SKILL.md +367 -0
- package/src/skills/code-patterns/SKILL.md +163 -0
- package/src/skills/code-patterns/references/leniu-code-patterns.md +87 -0
- package/src/skills/codex-code-review/SKILL.md +327 -0
- package/src/skills/collaborating-with-codex/SKILL.md +180 -0
- package/src/skills/collaborating-with-codex/scripts/codex_bridge.py +275 -0
- package/src/skills/collaborating-with-gemini/SKILL.md +194 -0
- package/src/skills/collaborating-with-gemini/scripts/gemini_bridge.py +275 -0
- package/src/skills/crud/SKILL.md +265 -0
- package/src/skills/crud-development/SKILL.md +328 -0
- package/src/skills/data-permission/SKILL.md +221 -0
- package/src/skills/data-permission/references/custom-data-scope.md +90 -0
- package/src/skills/database-ops/SKILL.md +210 -0
- package/src/skills/dev/SKILL.md +187 -0
- package/src/skills/error-handler/SKILL.md +310 -0
- package/src/skills/file-oss-management/SKILL.md +260 -0
- package/src/skills/file-oss-management/references/entities.md +105 -0
- package/src/skills/file-oss-management/references/service-impl.md +104 -0
- package/src/skills/fix-bug/SKILL.md +269 -0
- package/src/skills/git-workflow/SKILL.md +179 -0
- package/src/skills/init-docs/SKILL.md +194 -0
- package/src/skills/json-serialization/SKILL.md +341 -0
- package/src/skills/leniu-api-development/SKILL.md +319 -0
- package/src/skills/leniu-api-development/references/real-examples.md +273 -0
- package/src/skills/leniu-architecture-design/SKILL.md +383 -0
- package/src/skills/leniu-backend-annotations/SKILL.md +277 -0
- package/src/skills/leniu-brainstorm/SKILL.md +242 -0
- package/src/skills/leniu-brainstorm/references/business-scenarios.md +162 -0
- package/src/skills/leniu-code-patterns/SKILL.md +411 -0
- package/src/skills/leniu-crud-development/SKILL.md +404 -0
- package/src/skills/leniu-crud-development/references/templates.md +597 -0
- package/src/skills/leniu-customization-location/SKILL.md +410 -0
- package/src/skills/leniu-data-permission/SKILL.md +341 -0
- package/src/skills/leniu-database-ops/SKILL.md +426 -0
- package/src/skills/leniu-error-handler/SKILL.md +462 -0
- package/src/skills/leniu-java-amount-handling/SKILL.md +461 -0
- package/src/skills/leniu-java-code-style/SKILL.md +510 -0
- package/src/skills/leniu-java-concurrent/SKILL.md +400 -0
- package/src/skills/leniu-java-entity/SKILL.md +237 -0
- package/src/skills/leniu-java-entity/references/templates.md +237 -0
- package/src/skills/leniu-java-export/SKILL.md +570 -0
- package/src/skills/leniu-java-logging/SKILL.md +229 -0
- package/src/skills/leniu-java-logging/references/data-mask.md +46 -0
- package/src/skills/leniu-java-logging/references/logging-scenarios.md +113 -0
- package/src/skills/leniu-java-mq/SKILL.md +338 -0
- package/src/skills/leniu-java-mybatis/SKILL.md +267 -0
- package/src/skills/leniu-java-mybatis/references/report-mapper.md +88 -0
- package/src/skills/leniu-java-report-query-param/SKILL.md +291 -0
- package/src/skills/leniu-java-task/SKILL.md +367 -0
- package/src/skills/leniu-java-total-line/SKILL.md +196 -0
- package/src/skills/leniu-marketing-price-rule-customizer/SKILL.md +301 -0
- package/src/skills/leniu-marketing-recharge-rule-customizer/SKILL.md +285 -0
- package/src/skills/leniu-mealtime/SKILL.md +215 -0
- package/src/skills/leniu-redis-cache/SKILL.md +331 -0
- package/src/skills/leniu-report-customization/SKILL.md +415 -0
- package/src/skills/leniu-report-customization/references/table-fields.md +93 -0
- package/src/skills/leniu-report-standard-customization/SKILL.md +391 -0
- package/src/skills/leniu-report-standard-customization/references/analysis-module.md +64 -0
- package/src/skills/leniu-report-standard-customization/references/table-fields.md +113 -0
- package/src/skills/leniu-security-guard/SKILL.md +306 -0
- package/src/skills/leniu-utils-toolkit/SKILL.md +380 -0
- package/src/skills/loki-log-query/SKILL.md +400 -0
- package/src/skills/loki-log-query/environments.json +45 -0
- package/src/skills/mysql-debug/SKILL.md +400 -0
- package/src/skills/next/SKILL.md +137 -0
- package/src/skills/openspec-apply-change/SKILL.md +165 -0
- package/src/skills/openspec-archive-change/SKILL.md +122 -0
- package/src/skills/openspec-bulk-archive-change/SKILL.md +254 -0
- package/src/skills/openspec-continue-change/SKILL.md +126 -0
- package/src/skills/openspec-explore/SKILL.md +299 -0
- package/src/skills/openspec-ff-change/SKILL.md +109 -0
- package/src/skills/openspec-new-change/SKILL.md +82 -0
- package/src/skills/openspec-onboard/SKILL.md +414 -0
- package/src/skills/openspec-sync-specs/SKILL.md +146 -0
- package/src/skills/openspec-verify-change/SKILL.md +176 -0
- package/src/skills/performance-doctor/SKILL.md +297 -0
- package/src/skills/progress/SKILL.md +193 -0
- package/src/skills/project-navigator/SKILL.md +211 -0
- package/src/skills/redis-cache/SKILL.md +282 -0
- package/src/skills/redis-cache/references/listeners.md +23 -0
- package/src/skills/scheduled-jobs/SKILL.md +277 -0
- package/src/skills/security-guard/SKILL.md +245 -0
- package/src/skills/security-guard/references/encrypt-config.md +103 -0
- package/src/skills/security-guard/references/sensitive-strategies.md +42 -0
- package/src/skills/skill-creator/LICENSE.txt +202 -0
- package/src/skills/skill-creator/SKILL.md +479 -0
- package/src/skills/skill-creator/agents/analyzer.md +274 -0
- package/src/skills/skill-creator/agents/comparator.md +202 -0
- package/src/skills/skill-creator/agents/grader.md +223 -0
- package/src/skills/skill-creator/assets/eval_review.html +146 -0
- package/src/skills/skill-creator/eval-viewer/generate_review.py +471 -0
- package/src/skills/skill-creator/eval-viewer/viewer.html +1325 -0
- package/src/skills/skill-creator/references/schemas.md +430 -0
- package/src/skills/skill-creator/scripts/__init__.py +0 -0
- package/src/skills/skill-creator/scripts/aggregate_benchmark.py +401 -0
- package/src/skills/skill-creator/scripts/generate_report.py +326 -0
- package/src/skills/skill-creator/scripts/improve_description.py +248 -0
- package/src/skills/skill-creator/scripts/package_skill.py +136 -0
- package/src/skills/skill-creator/scripts/quick_validate.py +103 -0
- package/src/skills/skill-creator/scripts/run_eval.py +310 -0
- package/src/skills/skill-creator/scripts/run_loop.py +332 -0
- package/src/skills/skill-creator/scripts/utils.py +47 -0
- package/src/skills/sms-mail/SKILL.md +346 -0
- package/src/skills/sms-mail/references/mail-config.md +88 -0
- package/src/skills/sms-mail/references/sms-config.md +74 -0
- package/src/skills/social-login/SKILL.md +328 -0
- package/src/skills/social-login/references/provider-configs.md +118 -0
- package/src/skills/start/SKILL.md +154 -0
- package/src/skills/store-pc/SKILL.md +366 -0
- package/src/skills/sync/SKILL.md +149 -0
- package/src/skills/sync-back-merge/SKILL.md +66 -0
- package/src/skills/task-tracker/SKILL.md +307 -0
- package/src/skills/tech-decision/SKILL.md +393 -0
- package/src/skills/tenant-management/SKILL.md +272 -0
- package/src/skills/tenant-management/references/tenant-scenarios.md +91 -0
- package/src/skills/test-development/SKILL.md +301 -0
- package/src/skills/test-development/references/parameterized-examples.md +119 -0
- package/src/skills/ui-pc/SKILL.md +438 -0
- package/src/skills/update-status/SKILL.md +159 -0
- package/src/skills/utils-toolkit/SKILL.md +354 -0
- package/src/skills/utils-toolkit/references/redis-utils-api.md +56 -0
- package/src/skills/websocket-sse/SKILL.md +350 -0
- package/src/skills/workflow-engine/SKILL.md +249 -0
- package/src/skills/yunxiao-task-management/SKILL.md +401 -0
- package/src/skills/yunxiao-task-management/templates//346/217/220/346/265/213/345/215/225/346/250/241/346/235/277.html +17 -0
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: leniu-java-total-line
|
|
3
|
+
description: |
|
|
4
|
+
leniu-tengyun-core / leniu-yunshitang 项目合计行查询规范。当实现报表分页查询需要合计行功能时使用此skill。
|
|
5
|
+
|
|
6
|
+
触发场景:
|
|
7
|
+
- 实现报表分页查询合计行(Service层合计查询)
|
|
8
|
+
- 编写Mapper XML合计SQL(只返回数值字段)
|
|
9
|
+
- Controller层合计行数据组装
|
|
10
|
+
- 合计查询开关控制
|
|
11
|
+
|
|
12
|
+
适用项目:
|
|
13
|
+
- leniu-tengyun-core:/Users/xujiajun/Developer/gongsi_proj/leniu-api/leniu-tengyun-core
|
|
14
|
+
- leniu-yunshitang:/Users/xujiajun/Developer/gongsi_proj/leniu-api/leniu-tengyun/leniu-yunshitang
|
|
15
|
+
|
|
16
|
+
触发词:合计行、totalLine、报表合计、SUM合计、ReportBaseTotalVO、合计查询
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
# leniu-tengyun-core 合计行(Total Line)规范
|
|
20
|
+
|
|
21
|
+
## 项目特征
|
|
22
|
+
|
|
23
|
+
| 特征 | 说明 |
|
|
24
|
+
|------|------|
|
|
25
|
+
| **包名前缀** | `net.xnzn.core.*` |
|
|
26
|
+
| **JDK 版本** | 21 |
|
|
27
|
+
| **双库切换** | 默认商户库,`Executors.doInSystem()` 切换系统库 |
|
|
28
|
+
| **分页工具** | `PageMethod.startPage()` |
|
|
29
|
+
| **结果封装** | `ReportBaseTotalVO<T>` |
|
|
30
|
+
| **分页封装** | `PageVO.of()` |
|
|
31
|
+
|
|
32
|
+
## 核心原则
|
|
33
|
+
|
|
34
|
+
**合计行SQL只返回需要合计的数值字段**,不返回非数值字段(如日期、名称、ID等)。
|
|
35
|
+
|
|
36
|
+
## Service层实现
|
|
37
|
+
|
|
38
|
+
### 带合计行的分页查询
|
|
39
|
+
|
|
40
|
+
```java
|
|
41
|
+
import net.xnzn.core.common.page.PageMethod;
|
|
42
|
+
import net.xnzn.core.common.page.PageVO;
|
|
43
|
+
import net.xnzn.core.common.vo.ReportBaseTotalVO;
|
|
44
|
+
import cn.hutool.core.collection.CollUtil;
|
|
45
|
+
|
|
46
|
+
// ⚠️ 系统默认在商户库执行,业务查询无需 Executors.readInSystem()
|
|
47
|
+
// Executors.readInSystem() 仅用于需要访问系统库的场景(如全局配置、商户管理)
|
|
48
|
+
|
|
49
|
+
public ReportBaseTotalVO<XxxVO> pageWithTotal(XxxPageParam param) {
|
|
50
|
+
ReportBaseTotalVO<XxxVO> result = new ReportBaseTotalVO<>();
|
|
51
|
+
|
|
52
|
+
// 1. 导出时不查询合计行(避免不必要的性能开销)
|
|
53
|
+
if (CollUtil.isEmpty(param.getExportCols())) {
|
|
54
|
+
XxxVO totalLine = mapper.getSummaryTotal(param);
|
|
55
|
+
result.setTotalLine(totalLine);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// 2. 开启分页
|
|
59
|
+
PageMethod.startPage(param.getPage());
|
|
60
|
+
|
|
61
|
+
// 3. 查询数据
|
|
62
|
+
List<XxxVO> list = mapper.getSummaryList(param);
|
|
63
|
+
|
|
64
|
+
// 4. 封装分页结果
|
|
65
|
+
result.setResultPage(PageVO.of(list));
|
|
66
|
+
return result;
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### 单独的合计行查询方法
|
|
71
|
+
|
|
72
|
+
```java
|
|
73
|
+
public XxxVO getSummaryTotal(XxxPageParam param) {
|
|
74
|
+
// 默认在商户库执行,无需 Executors 包装
|
|
75
|
+
return mapper.getSummaryTotal(param);
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Mapper XML规范
|
|
80
|
+
|
|
81
|
+
### 错误示例:返回非数值字段
|
|
82
|
+
|
|
83
|
+
```xml
|
|
84
|
+
<!-- ❌ 不要这样做 -->
|
|
85
|
+
<select id="getSummaryTotal" resultType="XxxVO">
|
|
86
|
+
SELECT
|
|
87
|
+
'合计' AS dateMonth, <!-- ❌ 不要返回字符串 -->
|
|
88
|
+
NULL AS schoolId, <!-- ❌ 不要返回ID -->
|
|
89
|
+
NULL AS schoolName, <!-- ❌ 不要返回名称 -->
|
|
90
|
+
SUM(staffCount) AS staffCount,
|
|
91
|
+
SUM(amount) AS amount
|
|
92
|
+
FROM xxx_table
|
|
93
|
+
</select>
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### 正确示例:只返回数值字段
|
|
97
|
+
|
|
98
|
+
```xml
|
|
99
|
+
<!-- ✅ 正确做法 -->
|
|
100
|
+
<select id="getSummaryTotal" resultType="XxxVO">
|
|
101
|
+
SELECT
|
|
102
|
+
SUM(staff_count) AS staffCount,
|
|
103
|
+
SUM(basic_salary) AS basicSalary,
|
|
104
|
+
SUM(overtime_salary) AS overtimeSalary,
|
|
105
|
+
SUM(personal_actual_amount) AS personalActualAmount,
|
|
106
|
+
CASE
|
|
107
|
+
WHEN SUM(staff_count) = 0 THEN 0
|
|
108
|
+
ELSE SUM(avg_salary) / COUNT(DISTINCT tenant_id)
|
|
109
|
+
END AS avgSalary
|
|
110
|
+
FROM xxx_table
|
|
111
|
+
<where>
|
|
112
|
+
del_flag = 2
|
|
113
|
+
<if test="startDate != null">
|
|
114
|
+
AND crtime >= #{startDate}
|
|
115
|
+
</if>
|
|
116
|
+
<if test="endDate != null">
|
|
117
|
+
AND crtime <= #{endDate}
|
|
118
|
+
</if>
|
|
119
|
+
</where>
|
|
120
|
+
</select>
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## 常见合计字段类型
|
|
124
|
+
|
|
125
|
+
| 字段类型 | 示例 | 合计方式 |
|
|
126
|
+
|---------|------|---------|
|
|
127
|
+
| 数量 | `staff_count`, `order_count` | `SUM()` |
|
|
128
|
+
| 金额 | `amount`, `salary` | `SUM()` |
|
|
129
|
+
| 百分比 | `discount_rate` | `AVG()` 或 `SUM() / COUNT()` |
|
|
130
|
+
| 计数 | `COUNT(DISTINCT id)` | 直接使用 |
|
|
131
|
+
|
|
132
|
+
## 特殊处理:平均值
|
|
133
|
+
|
|
134
|
+
```xml
|
|
135
|
+
<!-- 简单平均值 -->
|
|
136
|
+
SELECT AVG(amount) AS avgAmount
|
|
137
|
+
|
|
138
|
+
<!-- 加权平均值 -->
|
|
139
|
+
SELECT
|
|
140
|
+
CASE
|
|
141
|
+
WHEN SUM(count) = 0 THEN 0
|
|
142
|
+
ELSE SUM(amount * count) / SUM(count)
|
|
143
|
+
END AS weightedAvgAmount
|
|
144
|
+
|
|
145
|
+
<!-- 按维度平均 -->
|
|
146
|
+
SELECT
|
|
147
|
+
CASE
|
|
148
|
+
WHEN COUNT(DISTINCT tenant_id) = 0 THEN 0
|
|
149
|
+
ELSE SUM(total_amount) / COUNT(DISTINCT tenant_id)
|
|
150
|
+
END AS avgByTenant
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
## Controller层实现
|
|
154
|
+
|
|
155
|
+
```java
|
|
156
|
+
@PostMapping("/page")
|
|
157
|
+
@ApiOperation("分页查询(带合计)")
|
|
158
|
+
@RequiresAuthentication
|
|
159
|
+
public ReportBaseTotalVO<XxxVO> page(@RequestBody LeRequest<XxxParam> request) {
|
|
160
|
+
XxxParam param = request.getContent();
|
|
161
|
+
return xxxService.pageWithTotal(param);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
@GetMapping("/total")
|
|
165
|
+
@ApiOperation("单独查询合计行")
|
|
166
|
+
@RequiresAuthentication
|
|
167
|
+
public XxxVO getTotal(XxxParam param) {
|
|
168
|
+
return xxxService.getSummaryTotal(param);
|
|
169
|
+
}
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
## 导出时合计行处理
|
|
173
|
+
|
|
174
|
+
```java
|
|
175
|
+
public void exportExcel(XxxParam param, HttpServletResponse response) {
|
|
176
|
+
// 导出时需要查询合计行
|
|
177
|
+
XxxVO totalLine = mapper.getSummaryTotal(param);
|
|
178
|
+
|
|
179
|
+
// 分页查询所有数据(不分页)
|
|
180
|
+
param.getPage().setSize(Integer.MAX_VALUE);
|
|
181
|
+
List<XxxVO> list = mapper.getSummaryList(param);
|
|
182
|
+
|
|
183
|
+
// 将合计行添加到列表末尾
|
|
184
|
+
list.add(totalLine);
|
|
185
|
+
|
|
186
|
+
// 导出
|
|
187
|
+
exportService.export(list, response);
|
|
188
|
+
}
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
## 注意事项
|
|
192
|
+
|
|
193
|
+
- 合计SQL只返回数值字段,不返回字符串、ID、名称等
|
|
194
|
+
- 业务查询默认在商户库执行,无需 `Executors` 包装;仅访问系统库数据时才使用 `Executors.doInSystem()`
|
|
195
|
+
- 导出时通过 `exportCols` 判断是否需要合计行
|
|
196
|
+
- 金额字段类型与 Entity 保持一致:订单模块用 `BigDecimal`,钱包模块用 `Long`(详见 leniu-java-amount-handling)
|
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: leniu-marketing-price-rule-customizer
|
|
3
|
+
description: |
|
|
4
|
+
leniu-tengyun-core 项目营销计费(price)规则定制指南。当需要定制营销计费规则时使用,支持新增规则类型、重写规则逻辑、扩展 DTO 字段。
|
|
5
|
+
|
|
6
|
+
触发场景:
|
|
7
|
+
- 新增营销计费规则类型(折扣、满减、限额、补贴等)
|
|
8
|
+
- 重写现有计费规则逻辑(@Primary 模式)
|
|
9
|
+
- 扩展规则 DTO 字段(向后兼容)
|
|
10
|
+
- 定制规则计算行为(handle 方法实现)
|
|
11
|
+
- 注册规则枚举(RulePriceEnum)
|
|
12
|
+
|
|
13
|
+
适用项目:
|
|
14
|
+
- leniu-tengyun-core:/Users/xujiajun/Developer/gongsi_proj/leniu-api/leniu-tengyun-core
|
|
15
|
+
- leniu-yunshitang:/Users/xujiajun/Developer/gongsi_proj/leniu-api/leniu-tengyun/leniu-yunshitang
|
|
16
|
+
|
|
17
|
+
触发词:营销计费、计价规则、RulePriceHandler、RulePriceEnum、折扣规则、满减规则、限额规则、补贴规则
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
# leniu-tengyun-core 营销计费规则定制
|
|
21
|
+
|
|
22
|
+
## 概述
|
|
23
|
+
|
|
24
|
+
leniu-tengyun-core 项目的营销计费(price)规则功能采用扩展点设计,支持灵活的规则定制。
|
|
25
|
+
|
|
26
|
+
营销计费规则是营销系统的核心组件,负责计算订单的优惠金额、限制消费行为、提供补贴等功能。
|
|
27
|
+
|
|
28
|
+
## 何时使用此 Skill
|
|
29
|
+
|
|
30
|
+
- 需要新增一个计价规则类型
|
|
31
|
+
- 需要修改现有规则的计算逻辑
|
|
32
|
+
- 需要为规则添加新的配置字段
|
|
33
|
+
- 需要针对特定项目定制规则行为
|
|
34
|
+
- 参考现有规则实现新的定制需求
|
|
35
|
+
|
|
36
|
+
## 规则定制工作流
|
|
37
|
+
|
|
38
|
+
### 步骤1:确定定制模式
|
|
39
|
+
|
|
40
|
+
根据需求选择合适的定制模式:
|
|
41
|
+
|
|
42
|
+
**模式A:新增规则**
|
|
43
|
+
- 适用场景:创建全新的规则类型
|
|
44
|
+
- 需要创建:DTO、扩展接口、默认实现
|
|
45
|
+
|
|
46
|
+
**模式B:重写规则(@Primary)**
|
|
47
|
+
- 适用场景:完全替换现有规则行为
|
|
48
|
+
- 需要创建:定制实现类(使用@Primary注解)
|
|
49
|
+
- 可选:扩展DTO字段
|
|
50
|
+
|
|
51
|
+
**模式C:重写规则(Ordered)**
|
|
52
|
+
- 适用场景:多个实现共存
|
|
53
|
+
- 需要创建:定制实现类(实现Ordered接口)
|
|
54
|
+
|
|
55
|
+
### 步骤2:理解规则结构
|
|
56
|
+
|
|
57
|
+
了解:
|
|
58
|
+
- 规则接口层次(RulePriceHandler → Extension → Implementation)
|
|
59
|
+
- 规则DTO结构
|
|
60
|
+
- 规则计算入参(RulePriceResultOrderDTO、MarketRuleVO、orderResults)
|
|
61
|
+
- 规则计算流程
|
|
62
|
+
- 常用工具类(MarketUtil、MarketRuleRangeService)
|
|
63
|
+
|
|
64
|
+
### 步骤3:参考实际案例
|
|
65
|
+
|
|
66
|
+
查看实际案例,了解如何实现具体的定制需求:
|
|
67
|
+
- **案例1**:支持自定义场景类型选择(@Primary + DTO扩展)
|
|
68
|
+
- **案例2**:移除订单类型过滤(直接修改)
|
|
69
|
+
|
|
70
|
+
### 步骤4:实现规则定制
|
|
71
|
+
|
|
72
|
+
#### 新增规则的实现步骤
|
|
73
|
+
|
|
74
|
+
1. **创建规则DTO**
|
|
75
|
+
- 位置:`net.xnzn.core.marketing.v2.rule.price.handler.[ruletype].dto`
|
|
76
|
+
- 包含规则配置字段
|
|
77
|
+
- 实现 `toString()` 方法返回可读描述
|
|
78
|
+
|
|
79
|
+
2. **创建扩展接口**
|
|
80
|
+
- 位置:`net.xnzn.core.marketing.v2.rule.price.handler.[ruletype].extension`
|
|
81
|
+
- 继承 `RulePriceHandler`
|
|
82
|
+
- 实现 `getRuleType()` 和 `checkRuleInfo()` 方法
|
|
83
|
+
|
|
84
|
+
3. **创建默认实现**
|
|
85
|
+
- 位置:`net.xnzn.core.marketing.v2.rule.price.handler.[ruletype].extension.impl`
|
|
86
|
+
- 实现扩展接口
|
|
87
|
+
- 添加 `@Service` 注解
|
|
88
|
+
- 实现 `handle()` 方法
|
|
89
|
+
|
|
90
|
+
4. **注册规则枚举**
|
|
91
|
+
- 在 `RulePriceEnum` 中添加新的规则类型
|
|
92
|
+
|
|
93
|
+
#### 重写规则的实现步骤(@Primary模式)
|
|
94
|
+
|
|
95
|
+
1. **(可选)扩展DTO字段**
|
|
96
|
+
- 在定制项目中覆盖核心DTO类
|
|
97
|
+
- 添加新字段并保持向后兼容
|
|
98
|
+
|
|
99
|
+
2. **创建定制实现**
|
|
100
|
+
- 位置:定制项目包(如 `net.xnzn.yunshitang.marketing.handler`)
|
|
101
|
+
- 继承默认实现类(可选,用于复用逻辑)
|
|
102
|
+
- 实现扩展接口
|
|
103
|
+
- 添加 `@Service` 和 `@Primary` 注解
|
|
104
|
+
- 重写 `handle()` 方法
|
|
105
|
+
|
|
106
|
+
3. **实现定制逻辑**
|
|
107
|
+
- 解析规则配置(包含新字段)
|
|
108
|
+
- 实现自定义计算逻辑
|
|
109
|
+
- 更新订单优惠金额或抛出限制异常
|
|
110
|
+
|
|
111
|
+
### 步骤5:测试规则
|
|
112
|
+
|
|
113
|
+
1. 测试向后兼容性(新字段为null的场景)
|
|
114
|
+
2. 测试新功能(新字段有值的场景)
|
|
115
|
+
3. 测试边界条件
|
|
116
|
+
4. 测试与其他规则的组合使用
|
|
117
|
+
|
|
118
|
+
## 代码模板
|
|
119
|
+
|
|
120
|
+
### 新增规则模板
|
|
121
|
+
|
|
122
|
+
```java
|
|
123
|
+
// 1. DTO
|
|
124
|
+
@Data
|
|
125
|
+
@ApiModel("计价规则详情-[规则名称]")
|
|
126
|
+
public class [RuleType]DTO {
|
|
127
|
+
@ApiModelProperty("[字段说明]")
|
|
128
|
+
private [Type] fieldName;
|
|
129
|
+
|
|
130
|
+
@Override
|
|
131
|
+
public String toString() {
|
|
132
|
+
return "字段:" + fieldName;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// 2. 扩展接口
|
|
137
|
+
public interface [RuleType]HandlerExtension extends RulePriceHandler {
|
|
138
|
+
@Override
|
|
139
|
+
default Integer getRuleType() {
|
|
140
|
+
return RulePriceEnum.[RULE_TYPE_ENUM].getKey();
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
@Override
|
|
144
|
+
default String checkRuleInfo(String ruleInfo) {
|
|
145
|
+
[RuleType]DTO rule = JSON.parseObject(ruleInfo, [RuleType]DTO.class);
|
|
146
|
+
return rule.toString();
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// 3. 默认实现
|
|
151
|
+
@Slf4j
|
|
152
|
+
@Service
|
|
153
|
+
public class Default[RuleType]HandlerImpl implements [RuleType]HandlerExtension {
|
|
154
|
+
|
|
155
|
+
@Autowired
|
|
156
|
+
private MarketRuleRangeService rangeService;
|
|
157
|
+
|
|
158
|
+
@Override
|
|
159
|
+
public void handle(RulePriceResultOrderDTO order, MarketRuleVO rule,
|
|
160
|
+
List<RulePriceResultOrderDTO> orderResults) {
|
|
161
|
+
// 1. 解析规则配置
|
|
162
|
+
[RuleType]DTO ruleInfo = JSON.parseObject(rule.getRuleInfo(), [RuleType]DTO.class);
|
|
163
|
+
|
|
164
|
+
// 2. 查询规则适用范围
|
|
165
|
+
List<MarketRuleRange> rangeList = rangeService.listRuleRangeLatest(rule.getRuleId());
|
|
166
|
+
|
|
167
|
+
// 3. 实现规则计算逻辑
|
|
168
|
+
// ...
|
|
169
|
+
|
|
170
|
+
// 4. 更新订单优惠金额或抛出异常
|
|
171
|
+
order.setDiscountsAmount(order.getDiscountsAmount().add(discountAmount));
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
### 重写规则模板(@Primary)
|
|
177
|
+
|
|
178
|
+
```java
|
|
179
|
+
@Slf4j
|
|
180
|
+
@Service
|
|
181
|
+
@Primary // 标记为主要实现
|
|
182
|
+
public class Custom[RuleType]HandlerImpl extends Default[RuleType]HandlerImpl
|
|
183
|
+
implements [RuleType]HandlerExtension {
|
|
184
|
+
|
|
185
|
+
@Autowired
|
|
186
|
+
private MarketRuleRangeService rangeService;
|
|
187
|
+
|
|
188
|
+
@Override
|
|
189
|
+
public void handle(RulePriceResultOrderDTO order, MarketRuleVO rule,
|
|
190
|
+
List<RulePriceResultOrderDTO> orderResults) {
|
|
191
|
+
// 解析规则配置(可能包含扩展字段)
|
|
192
|
+
[RuleType]DTO ruleInfo = JSON.parseObject(rule.getRuleInfo(), [RuleType]DTO.class);
|
|
193
|
+
|
|
194
|
+
// 实现定制逻辑
|
|
195
|
+
// 可以调用父类方法:super.handle(order, rule, orderResults);
|
|
196
|
+
// 或完全自定义实现
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
## 常见规则类型
|
|
202
|
+
|
|
203
|
+
### 优惠类规则
|
|
204
|
+
- 折扣规则:`PriceDiscountHandlerExtension`
|
|
205
|
+
- 菜品折扣:`PriceDishDiscountHandlerExtension`
|
|
206
|
+
- 商品折扣:`PriceGoodsDiscountHandlerExtension`
|
|
207
|
+
- 满减规则:`PriceReductionFixedHandlerExtension`
|
|
208
|
+
|
|
209
|
+
### 限制类规则
|
|
210
|
+
- 限额-单次金额:`PriceLimitMaxAmountHandlerExtension`
|
|
211
|
+
- 限额-累计次数:`PriceLimitMaxCountHandlerExtension`
|
|
212
|
+
- 限额-累计金额:`PriceLimitSumAmountHandlerExtension`
|
|
213
|
+
|
|
214
|
+
### 补贴类规则
|
|
215
|
+
- 固定补贴:`PriceSubsidyFixedHandlerExtension`
|
|
216
|
+
- 累计赠送:`PriceSumGiveHandlerExtension`
|
|
217
|
+
|
|
218
|
+
## 最佳实践
|
|
219
|
+
|
|
220
|
+
### 包名规范
|
|
221
|
+
- 覆盖核心类:使用核心工程的包名(`net.xnzn.core.marketing.v2.rule.price.handler.[ruletype]`)
|
|
222
|
+
- 定制实现:使用项目特定包名(如 `net.xnzn.yunshitang.marketing.handler`)
|
|
223
|
+
|
|
224
|
+
### 类名规范
|
|
225
|
+
- 扩展接口:`[RuleType]HandlerExtension`
|
|
226
|
+
- 默认实现:`Default[RuleType]HandlerImpl`
|
|
227
|
+
- 定制实现:`Custom[RuleType]HandlerImpl` 或描述性名称
|
|
228
|
+
|
|
229
|
+
### 注解使用
|
|
230
|
+
- 所有实现类必须添加 `@Service` 注解
|
|
231
|
+
- 重写规则使用 `@Primary` 注解(推荐)
|
|
232
|
+
- 日志记录使用 `@Slf4j` 注解
|
|
233
|
+
|
|
234
|
+
### 向后兼容
|
|
235
|
+
- 扩展DTO字段时,新字段应支持null值
|
|
236
|
+
- 新字段为null时应保持原有行为
|
|
237
|
+
- 在toString方法中包含所有字段
|
|
238
|
+
|
|
239
|
+
## 快速开始示例
|
|
240
|
+
|
|
241
|
+
假设需要为限额累计金额规则(`PriceLimitSumAmountHandlerExtension`)添加场景类型选择功能:
|
|
242
|
+
|
|
243
|
+
1. **扩展DTO**:在 `PriceLimitSumAmountDTO` 中添加 `sceneTypes` 字段
|
|
244
|
+
2. **创建定制实现**:创建 `CrossScenePriceLimitSumAmountHandlerImpl`,位于 `net.xnzn.yunshitang.marketing.handler`,使用 `@Primary` 注解
|
|
245
|
+
3. **实现逻辑**:在 `handle()` 方法中使用 `sceneTypes` 字段过滤订单
|
|
246
|
+
4. **向后兼容**:`sceneTypes` 为null时查询所有场景
|
|
247
|
+
|
|
248
|
+
```java
|
|
249
|
+
// 1. 扩展DTO(在核心工程包名下覆盖)
|
|
250
|
+
// 位置:net.xnzn.core.marketing.v2.rule.price.handler.limitsum.dto.PriceLimitSumAmountDTO
|
|
251
|
+
@Data
|
|
252
|
+
@ApiModel("限额-累计金额规则详情")
|
|
253
|
+
public class PriceLimitSumAmountDTO {
|
|
254
|
+
@ApiModelProperty("累计金额限额(分)")
|
|
255
|
+
private BigDecimal limitAmount;
|
|
256
|
+
|
|
257
|
+
// 扩展字段:场景类型列表,null时表示所有场景
|
|
258
|
+
@ApiModelProperty("适用场景类型(null=所有)")
|
|
259
|
+
private List<Integer> sceneTypes;
|
|
260
|
+
|
|
261
|
+
@Override
|
|
262
|
+
public String toString() {
|
|
263
|
+
return "limitAmount=" + limitAmount + ", sceneTypes=" + sceneTypes;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
// 2. 定制实现(在yunshitang项目包下)
|
|
268
|
+
// 位置:net.xnzn.yunshitang.marketing.handler
|
|
269
|
+
@Slf4j
|
|
270
|
+
@Service
|
|
271
|
+
@Primary
|
|
272
|
+
public class CrossScenePriceLimitSumAmountHandlerImpl
|
|
273
|
+
implements PriceLimitSumAmountHandlerExtension {
|
|
274
|
+
|
|
275
|
+
@Autowired
|
|
276
|
+
private MarketRuleRangeService rangeService;
|
|
277
|
+
|
|
278
|
+
@Override
|
|
279
|
+
public void handle(RulePriceResultOrderDTO order, MarketRuleVO rule,
|
|
280
|
+
List<RulePriceResultOrderDTO> orderResults) {
|
|
281
|
+
PriceLimitSumAmountDTO ruleInfo = JSON.parseObject(
|
|
282
|
+
rule.getRuleInfo(), PriceLimitSumAmountDTO.class);
|
|
283
|
+
|
|
284
|
+
// 场景过滤(向后兼容:null时不过滤)
|
|
285
|
+
if (CollUtil.isNotEmpty(ruleInfo.getSceneTypes())
|
|
286
|
+
&& !ruleInfo.getSceneTypes().contains(order.getSceneType())) {
|
|
287
|
+
return; // 不在适用场景内,跳过
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
// 原有累计金额限额逻辑...
|
|
291
|
+
BigDecimal sumAmount = calcSumAmount(order, orderResults);
|
|
292
|
+
if (sumAmount.compareTo(ruleInfo.getLimitAmount()) >= 0) {
|
|
293
|
+
throw new LeException("已超出累计消费限额");
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
## 参考文档
|
|
300
|
+
|
|
301
|
+
详见:[leniu-tengyun-core 源码](/Users/xujiajun/Developer/gongsi_proj/core/leniu-tengyun-core)
|