ai-engineering-init 1.1.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.
Files changed (313) hide show
  1. package/.claude/agents/code-reviewer.md +139 -0
  2. package/.claude/agents/project-manager.md +159 -0
  3. package/.claude/audio/completed.wav +0 -0
  4. package/.claude/commands/add-todo.md +255 -0
  5. package/.claude/commands/check.md +210 -0
  6. package/.claude/commands/crud.md +454 -0
  7. package/.claude/commands/dev.md +503 -0
  8. package/.claude/commands/init-docs.md +681 -0
  9. package/.claude/commands/next.md +251 -0
  10. package/.claude/commands/progress.md +242 -0
  11. package/.claude/commands/start.md +199 -0
  12. package/.claude/commands/sync.md +307 -0
  13. package/.claude/commands/update-status.md +428 -0
  14. package/.claude/docs/Mixin/344/275/277/347/224/250/346/214/207/345/215/227.md +299 -0
  15. package/.claude/docs/README.md +167 -0
  16. package/.claude/docs//345/211/215/347/253/257/345/274/200/345/217/221/346/214/207/345/215/227.md +599 -0
  17. package/.claude/docs//345/220/216/347/253/257/345/274/200/345/217/221/346/214/207/345/215/227.md +726 -0
  18. 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
  19. 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
  20. 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
  21. 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
  22. 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
  23. package/.claude/docs//346/241/206/346/236/266/350/257/264/346/230/216.md +393 -0
  24. package/.claude/docs//350/267/257/347/224/261/351/205/215/347/275/256/346/214/207/345/215/227.md +246 -0
  25. package/.claude/framework-config.json +73 -0
  26. package/.claude/hooks/pre-tool-use.js +117 -0
  27. package/.claude/hooks/skill-forced-eval.js +167 -0
  28. package/.claude/hooks/stop.js +58 -0
  29. package/.claude/settings.json +41 -0
  30. package/.claude/skills/add-skill/SKILL.md +352 -0
  31. package/.claude/skills/api-development/SKILL.md +560 -0
  32. package/.claude/skills/architecture-design/SKILL.md +756 -0
  33. package/.claude/skills/backend-annotations/SKILL.md +674 -0
  34. package/.claude/skills/banana-image/CHANGELOG.md +37 -0
  35. package/.claude/skills/banana-image/README.md +146 -0
  36. package/.claude/skills/banana-image/SKILL.md +164 -0
  37. package/.claude/skills/banana-image/assets/logo.png +0 -0
  38. package/.claude/skills/banana-image/references/advanced-usage.md +189 -0
  39. package/.claude/skills/banana-image/scripts/apply_template.py +125 -0
  40. package/.claude/skills/banana-image/scripts/banana_image_exec.ts +412 -0
  41. package/.claude/skills/banana-image/scripts/batch_prep.py +82 -0
  42. package/.claude/skills/banana-image/scripts/package-lock.json +1437 -0
  43. package/.claude/skills/banana-image/scripts/package.json +18 -0
  44. package/.claude/skills/banana-image/scripts/requirements.txt +10 -0
  45. package/.claude/skills/banana-image/templates/poster.json +22 -0
  46. package/.claude/skills/banana-image/templates/product.json +17 -0
  47. package/.claude/skills/banana-image/templates/social.json +22 -0
  48. package/.claude/skills/banana-image/templates/thumbnail.json +17 -0
  49. package/.claude/skills/brainstorm/SKILL.md +648 -0
  50. package/.claude/skills/bug-detective/SKILL.md +1206 -0
  51. package/.claude/skills/code-patterns/SKILL.md +590 -0
  52. package/.claude/skills/collaborating-with-codex/SKILL.md +174 -0
  53. package/.claude/skills/collaborating-with-codex/scripts/codex_bridge.py +275 -0
  54. package/.claude/skills/collaborating-with-gemini/SKILL.md +194 -0
  55. package/.claude/skills/collaborating-with-gemini/scripts/gemini_bridge.py +275 -0
  56. package/.claude/skills/crud-development/SKILL.md +649 -0
  57. package/.claude/skills/data-permission/SKILL.md +599 -0
  58. package/.claude/skills/database-ops/SKILL.md +407 -0
  59. package/.claude/skills/error-handler/SKILL.md +371 -0
  60. package/.claude/skills/file-oss-management/SKILL.md +863 -0
  61. package/.claude/skills/git-workflow/SKILL.md +375 -0
  62. package/.claude/skills/json-serialization/SKILL.md +357 -0
  63. package/.claude/skills/leniu-api-development/SKILL.md +803 -0
  64. package/.claude/skills/leniu-architecture-design/SKILL.md +598 -0
  65. package/.claude/skills/leniu-backend-annotations/SKILL.md +664 -0
  66. package/.claude/skills/leniu-code-patterns/SKILL.md +365 -0
  67. package/.claude/skills/leniu-crud-development/SKILL.md +1110 -0
  68. package/.claude/skills/leniu-data-permission/SKILL.md +256 -0
  69. package/.claude/skills/leniu-database-ops/SKILL.md +426 -0
  70. package/.claude/skills/leniu-error-handler/SKILL.md +462 -0
  71. package/.claude/skills/leniu-java-amount-handling/SKILL.md +461 -0
  72. package/.claude/skills/leniu-java-code-style/SKILL.md +510 -0
  73. package/.claude/skills/leniu-java-concurrent/SKILL.md +400 -0
  74. package/.claude/skills/leniu-java-entity/SKILL.md +751 -0
  75. package/.claude/skills/leniu-java-export/SKILL.md +560 -0
  76. package/.claude/skills/leniu-java-logging/SKILL.md +832 -0
  77. package/.claude/skills/leniu-java-mq/SKILL.md +338 -0
  78. package/.claude/skills/leniu-java-mybatis/SKILL.md +640 -0
  79. package/.claude/skills/leniu-java-report-query-param/SKILL.md +291 -0
  80. package/.claude/skills/leniu-java-task/SKILL.md +367 -0
  81. package/.claude/skills/leniu-java-total-line/SKILL.md +195 -0
  82. package/.claude/skills/leniu-marketing-price-rule-customizer/SKILL.md +301 -0
  83. package/.claude/skills/leniu-marketing-recharge-rule-customizer/SKILL.md +285 -0
  84. package/.claude/skills/leniu-mealtime/SKILL.md +215 -0
  85. package/.claude/skills/leniu-redis-cache/SKILL.md +316 -0
  86. package/.claude/skills/leniu-security-guard/SKILL.md +520 -0
  87. package/.claude/skills/leniu-utils-toolkit/SKILL.md +380 -0
  88. package/.claude/skills/openspec-apply-change/SKILL.md +156 -0
  89. package/.claude/skills/openspec-archive-change/SKILL.md +114 -0
  90. package/.claude/skills/openspec-bulk-archive-change/SKILL.md +246 -0
  91. package/.claude/skills/openspec-continue-change/SKILL.md +118 -0
  92. package/.claude/skills/openspec-explore/SKILL.md +290 -0
  93. package/.claude/skills/openspec-ff-change/SKILL.md +101 -0
  94. package/.claude/skills/openspec-new-change/SKILL.md +74 -0
  95. package/.claude/skills/openspec-onboard/SKILL.md +529 -0
  96. package/.claude/skills/openspec-sync-specs/SKILL.md +138 -0
  97. package/.claude/skills/openspec-verify-change/SKILL.md +168 -0
  98. package/.claude/skills/performance-doctor/SKILL.md +627 -0
  99. package/.claude/skills/project-navigator/SKILL.md +305 -0
  100. package/.claude/skills/redis-cache/SKILL.md +839 -0
  101. package/.claude/skills/scheduled-jobs/SKILL.md +633 -0
  102. package/.claude/skills/security-guard/SKILL.md +748 -0
  103. package/.claude/skills/sms-mail/SKILL.md +766 -0
  104. package/.claude/skills/social-login/SKILL.md +668 -0
  105. package/.claude/skills/store-pc/SKILL.md +366 -0
  106. package/.claude/skills/task-tracker/SKILL.md +307 -0
  107. package/.claude/skills/tech-decision/SKILL.md +393 -0
  108. package/.claude/skills/tenant-management/SKILL.md +603 -0
  109. package/.claude/skills/test-development/SKILL.md +755 -0
  110. package/.claude/skills/ui-pc/SKILL.md +438 -0
  111. package/.claude/skills/utils-toolkit/SKILL.md +615 -0
  112. package/.claude/skills/websocket-sse/SKILL.md +716 -0
  113. package/.claude/skills/workflow-engine/SKILL.md +676 -0
  114. package/.claude/templates//345/276/205/345/212/236/346/270/205/345/215/225/346/250/241/346/235/277.md +56 -0
  115. package/.claude/templates//351/234/200/346/261/202/346/226/207/346/241/243/346/250/241/346/235/277.md +85 -0
  116. package/.claude/templates//351/241/271/347/233/256/347/212/266/346/200/201/346/250/241/346/235/277.md +43 -0
  117. package/.codex/skills/add-skill/SKILL.md +352 -0
  118. package/.codex/skills/add-todo/SKILL.md +269 -0
  119. package/.codex/skills/api-development/SKILL.md +693 -0
  120. package/.codex/skills/architecture-design/SKILL.md +628 -0
  121. package/.codex/skills/backend-annotations/SKILL.md +664 -0
  122. package/.codex/skills/banana-image/CHANGELOG.md +37 -0
  123. package/.codex/skills/banana-image/README.md +146 -0
  124. package/.codex/skills/banana-image/SKILL.md +164 -0
  125. package/.codex/skills/banana-image/assets/logo.png +0 -0
  126. package/.codex/skills/banana-image/references/advanced-usage.md +189 -0
  127. package/.codex/skills/banana-image/scripts/apply_template.py +125 -0
  128. package/.codex/skills/banana-image/scripts/banana_image_exec.ts +412 -0
  129. package/.codex/skills/banana-image/scripts/batch_prep.py +82 -0
  130. package/.codex/skills/banana-image/scripts/package-lock.json +1437 -0
  131. package/.codex/skills/banana-image/scripts/package.json +18 -0
  132. package/.codex/skills/banana-image/scripts/requirements.txt +10 -0
  133. package/.codex/skills/banana-image/templates/poster.json +22 -0
  134. package/.codex/skills/banana-image/templates/product.json +17 -0
  135. package/.codex/skills/banana-image/templates/social.json +22 -0
  136. package/.codex/skills/banana-image/templates/thumbnail.json +17 -0
  137. package/.codex/skills/brainstorm/SKILL.md +648 -0
  138. package/.codex/skills/bug-detective/SKILL.md +1206 -0
  139. package/.codex/skills/check/SKILL.md +367 -0
  140. package/.codex/skills/code-patterns/SKILL.md +442 -0
  141. package/.codex/skills/collaborating-with-codex/SKILL.md +174 -0
  142. package/.codex/skills/collaborating-with-codex/scripts/codex_bridge.py +275 -0
  143. package/.codex/skills/collaborating-with-gemini/SKILL.md +194 -0
  144. package/.codex/skills/collaborating-with-gemini/scripts/gemini_bridge.py +275 -0
  145. package/.codex/skills/crud/SKILL.md +265 -0
  146. package/.codex/skills/crud-development/SKILL.md +637 -0
  147. package/.codex/skills/data-permission/SKILL.md +591 -0
  148. package/.codex/skills/database-ops/SKILL.md +553 -0
  149. package/.codex/skills/dev/SKILL.md +187 -0
  150. package/.codex/skills/error-handler/SKILL.md +361 -0
  151. package/.codex/skills/file-oss-management/SKILL.md +863 -0
  152. package/.codex/skills/git-workflow/SKILL.md +375 -0
  153. package/.codex/skills/init-docs/SKILL.md +194 -0
  154. package/.codex/skills/json-serialization/SKILL.md +357 -0
  155. package/.codex/skills/leniu-api-development/SKILL.md +803 -0
  156. package/.codex/skills/leniu-architecture-design/SKILL.md +594 -0
  157. package/.codex/skills/leniu-backend-annotations/SKILL.md +662 -0
  158. package/.codex/skills/leniu-code-patterns/SKILL.md +365 -0
  159. package/.codex/skills/leniu-crud-development/SKILL.md +1110 -0
  160. package/.codex/skills/leniu-data-permission/SKILL.md +256 -0
  161. package/.codex/skills/leniu-database-ops/SKILL.md +426 -0
  162. package/.codex/skills/leniu-error-handler/SKILL.md +462 -0
  163. package/.codex/skills/leniu-java-amount-handling/SKILL.md +461 -0
  164. package/.codex/skills/leniu-java-code-style/SKILL.md +510 -0
  165. package/.codex/skills/leniu-java-concurrent/SKILL.md +400 -0
  166. package/.codex/skills/leniu-java-entity/SKILL.md +751 -0
  167. package/.codex/skills/leniu-java-export/SKILL.md +560 -0
  168. package/.codex/skills/leniu-java-logging/SKILL.md +832 -0
  169. package/.codex/skills/leniu-java-mq/SKILL.md +338 -0
  170. package/.codex/skills/leniu-java-mybatis/SKILL.md +640 -0
  171. package/.codex/skills/leniu-java-report-query-param/SKILL.md +291 -0
  172. package/.codex/skills/leniu-java-task/SKILL.md +367 -0
  173. package/.codex/skills/leniu-java-total-line/SKILL.md +195 -0
  174. package/.codex/skills/leniu-marketing-price-rule-customizer/SKILL.md +301 -0
  175. package/.codex/skills/leniu-marketing-recharge-rule-customizer/SKILL.md +285 -0
  176. package/.codex/skills/leniu-mealtime/SKILL.md +215 -0
  177. package/.codex/skills/leniu-redis-cache/SKILL.md +316 -0
  178. package/.codex/skills/leniu-security-guard/SKILL.md +520 -0
  179. package/.codex/skills/leniu-utils-toolkit/SKILL.md +378 -0
  180. package/.codex/skills/next/SKILL.md +137 -0
  181. package/.codex/skills/openspec-apply-change/SKILL.md +156 -0
  182. package/.codex/skills/openspec-archive-change/SKILL.md +114 -0
  183. package/.codex/skills/openspec-bulk-archive-change/SKILL.md +246 -0
  184. package/.codex/skills/openspec-continue-change/SKILL.md +118 -0
  185. package/.codex/skills/openspec-explore/SKILL.md +290 -0
  186. package/.codex/skills/openspec-ff-change/SKILL.md +101 -0
  187. package/.codex/skills/openspec-new-change/SKILL.md +74 -0
  188. package/.codex/skills/openspec-onboard/SKILL.md +529 -0
  189. package/.codex/skills/openspec-sync-specs/SKILL.md +138 -0
  190. package/.codex/skills/openspec-verify-change/SKILL.md +168 -0
  191. package/.codex/skills/performance-doctor/SKILL.md +627 -0
  192. package/.codex/skills/progress/SKILL.md +193 -0
  193. package/.codex/skills/project-navigator/SKILL.md +286 -0
  194. package/.codex/skills/redis-cache/SKILL.md +829 -0
  195. package/.codex/skills/scheduled-jobs/SKILL.md +633 -0
  196. package/.codex/skills/security-guard/SKILL.md +739 -0
  197. package/.codex/skills/sms-mail/SKILL.md +766 -0
  198. package/.codex/skills/social-login/SKILL.md +668 -0
  199. package/.codex/skills/start/SKILL.md +154 -0
  200. package/.codex/skills/store-pc/SKILL.md +491 -0
  201. package/.codex/skills/sync/SKILL.md +149 -0
  202. package/.codex/skills/task-tracker/SKILL.md +307 -0
  203. package/.codex/skills/tech-decision/SKILL.md +393 -0
  204. package/.codex/skills/tenant-management/SKILL.md +603 -0
  205. package/.codex/skills/test-development/SKILL.md +755 -0
  206. package/.codex/skills/ui-pc/SKILL.md +475 -0
  207. package/.codex/skills/update-status/SKILL.md +159 -0
  208. package/.codex/skills/utils-toolkit/SKILL.md +593 -0
  209. package/.codex/skills/websocket-sse/SKILL.md +716 -0
  210. package/.codex/skills/workflow-engine/SKILL.md +676 -0
  211. package/.cursor/agents/code-reviewer.md +139 -0
  212. package/.cursor/agents/project-manager.md +159 -0
  213. package/.cursor/commands/opsx-apply.md +152 -0
  214. package/.cursor/commands/opsx-archive.md +157 -0
  215. package/.cursor/commands/opsx-bulk-archive.md +242 -0
  216. package/.cursor/commands/opsx-continue.md +114 -0
  217. package/.cursor/commands/opsx-explore.md +174 -0
  218. package/.cursor/commands/opsx-ff.md +94 -0
  219. package/.cursor/commands/opsx-new.md +69 -0
  220. package/.cursor/commands/opsx-onboard.md +525 -0
  221. package/.cursor/commands/opsx-sync.md +134 -0
  222. package/.cursor/commands/opsx-verify.md +164 -0
  223. package/.cursor/mcp.json +22 -0
  224. package/.cursor/skills/add-skill/SKILL.md +352 -0
  225. package/.cursor/skills/api-development/SKILL.md +560 -0
  226. package/.cursor/skills/architecture-design/SKILL.md +756 -0
  227. package/.cursor/skills/backend-annotations/SKILL.md +674 -0
  228. package/.cursor/skills/banana-image/CHANGELOG.md +37 -0
  229. package/.cursor/skills/banana-image/README.md +146 -0
  230. package/.cursor/skills/banana-image/SKILL.md +164 -0
  231. package/.cursor/skills/banana-image/assets/logo.png +0 -0
  232. package/.cursor/skills/banana-image/references/advanced-usage.md +189 -0
  233. package/.cursor/skills/banana-image/scripts/apply_template.py +125 -0
  234. package/.cursor/skills/banana-image/scripts/banana_image_exec.ts +412 -0
  235. package/.cursor/skills/banana-image/scripts/batch_prep.py +82 -0
  236. package/.cursor/skills/banana-image/scripts/package-lock.json +1437 -0
  237. package/.cursor/skills/banana-image/scripts/package.json +18 -0
  238. package/.cursor/skills/banana-image/scripts/requirements.txt +10 -0
  239. package/.cursor/skills/banana-image/templates/poster.json +22 -0
  240. package/.cursor/skills/banana-image/templates/product.json +17 -0
  241. package/.cursor/skills/banana-image/templates/social.json +22 -0
  242. package/.cursor/skills/banana-image/templates/thumbnail.json +17 -0
  243. package/.cursor/skills/brainstorm/SKILL.md +648 -0
  244. package/.cursor/skills/bug-detective/SKILL.md +1206 -0
  245. package/.cursor/skills/code-patterns/SKILL.md +590 -0
  246. package/.cursor/skills/collaborating-with-codex/SKILL.md +174 -0
  247. package/.cursor/skills/collaborating-with-codex/scripts/codex_bridge.py +275 -0
  248. package/.cursor/skills/collaborating-with-gemini/SKILL.md +194 -0
  249. package/.cursor/skills/collaborating-with-gemini/scripts/gemini_bridge.py +275 -0
  250. package/.cursor/skills/crud-development/SKILL.md +649 -0
  251. package/.cursor/skills/data-permission/SKILL.md +599 -0
  252. package/.cursor/skills/database-ops/SKILL.md +407 -0
  253. package/.cursor/skills/error-handler/SKILL.md +371 -0
  254. package/.cursor/skills/file-oss-management/SKILL.md +863 -0
  255. package/.cursor/skills/git-workflow/SKILL.md +375 -0
  256. package/.cursor/skills/json-serialization/SKILL.md +357 -0
  257. package/.cursor/skills/leniu-api-development/SKILL.md +803 -0
  258. package/.cursor/skills/leniu-architecture-design/SKILL.md +598 -0
  259. package/.cursor/skills/leniu-backend-annotations/SKILL.md +664 -0
  260. package/.cursor/skills/leniu-code-patterns/SKILL.md +365 -0
  261. package/.cursor/skills/leniu-crud-development/SKILL.md +1110 -0
  262. package/.cursor/skills/leniu-data-permission/SKILL.md +256 -0
  263. package/.cursor/skills/leniu-database-ops/SKILL.md +426 -0
  264. package/.cursor/skills/leniu-error-handler/SKILL.md +462 -0
  265. package/.cursor/skills/leniu-java-amount-handling/SKILL.md +461 -0
  266. package/.cursor/skills/leniu-java-code-style/SKILL.md +510 -0
  267. package/.cursor/skills/leniu-java-concurrent/SKILL.md +400 -0
  268. package/.cursor/skills/leniu-java-entity/SKILL.md +751 -0
  269. package/.cursor/skills/leniu-java-export/SKILL.md +560 -0
  270. package/.cursor/skills/leniu-java-logging/SKILL.md +832 -0
  271. package/.cursor/skills/leniu-java-mq/SKILL.md +338 -0
  272. package/.cursor/skills/leniu-java-mybatis/SKILL.md +640 -0
  273. package/.cursor/skills/leniu-java-report-query-param/SKILL.md +291 -0
  274. package/.cursor/skills/leniu-java-task/SKILL.md +367 -0
  275. package/.cursor/skills/leniu-java-total-line/SKILL.md +195 -0
  276. package/.cursor/skills/leniu-marketing-price-rule-customizer/SKILL.md +301 -0
  277. package/.cursor/skills/leniu-marketing-recharge-rule-customizer/SKILL.md +285 -0
  278. package/.cursor/skills/leniu-mealtime/SKILL.md +215 -0
  279. package/.cursor/skills/leniu-redis-cache/SKILL.md +316 -0
  280. package/.cursor/skills/leniu-security-guard/SKILL.md +520 -0
  281. package/.cursor/skills/leniu-utils-toolkit/SKILL.md +380 -0
  282. package/.cursor/skills/openspec-apply-change/SKILL.md +156 -0
  283. package/.cursor/skills/openspec-archive-change/SKILL.md +114 -0
  284. package/.cursor/skills/openspec-bulk-archive-change/SKILL.md +246 -0
  285. package/.cursor/skills/openspec-continue-change/SKILL.md +118 -0
  286. package/.cursor/skills/openspec-explore/SKILL.md +290 -0
  287. package/.cursor/skills/openspec-ff-change/SKILL.md +101 -0
  288. package/.cursor/skills/openspec-new-change/SKILL.md +74 -0
  289. package/.cursor/skills/openspec-onboard/SKILL.md +529 -0
  290. package/.cursor/skills/openspec-sync-specs/SKILL.md +138 -0
  291. package/.cursor/skills/openspec-verify-change/SKILL.md +168 -0
  292. package/.cursor/skills/performance-doctor/SKILL.md +627 -0
  293. package/.cursor/skills/project-navigator/SKILL.md +305 -0
  294. package/.cursor/skills/redis-cache/SKILL.md +839 -0
  295. package/.cursor/skills/scheduled-jobs/SKILL.md +633 -0
  296. package/.cursor/skills/security-guard/SKILL.md +748 -0
  297. package/.cursor/skills/sms-mail/SKILL.md +766 -0
  298. package/.cursor/skills/social-login/SKILL.md +668 -0
  299. package/.cursor/skills/store-pc/SKILL.md +366 -0
  300. package/.cursor/skills/task-tracker/SKILL.md +307 -0
  301. package/.cursor/skills/tech-decision/SKILL.md +393 -0
  302. package/.cursor/skills/tenant-management/SKILL.md +603 -0
  303. package/.cursor/skills/test-development/SKILL.md +755 -0
  304. package/.cursor/skills/ui-pc/SKILL.md +438 -0
  305. package/.cursor/skills/utils-toolkit/SKILL.md +615 -0
  306. package/.cursor/skills/websocket-sse/SKILL.md +716 -0
  307. package/.cursor/skills/workflow-engine/SKILL.md +676 -0
  308. package/AGENTS.md +669 -0
  309. package/CLAUDE.md +205 -0
  310. package/README.md +205 -0
  311. package/bin/index.js +179 -0
  312. package/init.sh +178 -0
  313. package/package.json +27 -0
@@ -0,0 +1,751 @@
1
+ ---
2
+ name: leniu-java-entity
3
+ description: |
4
+ leniu-tengyun-core 项目 Entity、VO、DTO、Param 等数据类规范。当创建实体类、视图对象、数据传输对象时使用此 skill。
5
+
6
+ 触发场景:
7
+ - 创建 Entity 实体类(@TableName、@TableField 注解)
8
+ - 创建 VO 视图对象(接口返回数据)
9
+ - 创建 DTO/Param 数据传输对象
10
+ - 配置时间格式化和参数校验
11
+ - 使用 Jakarta Validation 注解
12
+
13
+ 触发词:Entity、VO、DTO、Param、实体类、@TableName、@TableField、@JsonFormat、字段映射、数据对象、@NotNull、@NotBlank、jakarta.validation
14
+ ---
15
+
16
+ # leniu-tengyun-core Entity/VO/DTO 规范
17
+
18
+ ## 项目特征
19
+
20
+ | 特征 | 说明 |
21
+ |------|------|
22
+ | **包名前缀** | `net.xnzn.core.*` |
23
+ | **JDK 版本** | 21 |
24
+ | **Validation** | `jakarta.validation.*` |
25
+ | **工具库** | Hutool (CollUtil, ObjectUtil, BeanUtil) |
26
+ | **日期类型** | `LocalDateTime` / `LocalDate` |
27
+ | **金额类型** | `Long`(分)/ `BigDecimal`(元) |
28
+ | **审计字段** | crby、crtime、upby、uptime |
29
+ | **逻辑删除** | 1=删除,2=正常 |
30
+
31
+ ## Model 类(生产代码参考)
32
+
33
+ `OrderInfo` 是订单模块的核心 Model,体现了 leniu 项目的真实代码风格:
34
+
35
+ ```java
36
+ import com.baomidou.mybatisplus.annotation.*;
37
+ import io.swagger.annotations.ApiModel;
38
+ import io.swagger.annotations.ApiModelProperty;
39
+ import lombok.Data;
40
+ import lombok.experimental.Accessors;
41
+
42
+ import java.math.BigDecimal;
43
+ import java.time.LocalDateTime;
44
+
45
+ /**
46
+ * 关键特征:
47
+ * 1. 无基类(不继承任何 Entity 基类)
48
+ * 2. 无 Serializable
49
+ * 3. @TableName 不带 autoResultMap(报表 Mapper 无 BaseMapper)
50
+ * 4. BigDecimal 存储分为单位的金额
51
+ * 5. 包含静态工厂方法 newDefaultInstance()
52
+ * 6. 包含领域业务方法(计算/重置等)
53
+ */
54
+ @Data
55
+ @Accessors(chain = true)
56
+ @ApiModel(value = "订单信息")
57
+ @TableName("order_info")
58
+ public class OrderInfo {
59
+
60
+ @TableId
61
+ @ApiModelProperty(value = "订单ID")
62
+ private Long id;
63
+
64
+ @ApiModelProperty(value = "食堂ID")
65
+ private Long canteenId;
66
+
67
+ @ApiModelProperty(value = "用户ID")
68
+ private Long userId;
69
+
70
+ @ApiModelProperty(value = "应付金额(分)")
71
+ private BigDecimal payableAmount;
72
+
73
+ @ApiModelProperty(value = "实付金额(分)")
74
+ private BigDecimal realAmount;
75
+
76
+ @ApiModelProperty(value = "优惠金额(分)")
77
+ private BigDecimal discountsAmount;
78
+
79
+ @ApiModelProperty(value = "订单状态")
80
+ private Integer status;
81
+
82
+ @ApiModelProperty(value = "删除标识(1-删除,2-正常)")
83
+ private Integer delFlag;
84
+
85
+ // 审计字段(INSERT 自动填充)
86
+ @TableField(fill = FieldFill.INSERT)
87
+ @ApiModelProperty(value = "创建人")
88
+ private String crby;
89
+
90
+ @TableField(fill = FieldFill.INSERT)
91
+ @ApiModelProperty(value = "创建时间")
92
+ private LocalDateTime crtime;
93
+
94
+ // 审计字段(INSERT + UPDATE 自动填充)
95
+ @TableField(fill = FieldFill.INSERT_UPDATE)
96
+ @ApiModelProperty(value = "更新人")
97
+ private String upby;
98
+
99
+ @TableField(fill = FieldFill.INSERT_UPDATE)
100
+ @ApiModelProperty(value = "更新时间")
101
+ private LocalDateTime uptime;
102
+
103
+ // ===== 静态工厂方法 =====
104
+
105
+ /**
106
+ * 创建默认实例(预设默认值)
107
+ */
108
+ public static OrderInfo newDefaultInstance() {
109
+ OrderInfo orderInfo = new OrderInfo();
110
+ orderInfo.setDelFlag(2); // 2=正常
111
+ orderInfo.setPayableAmount(BigDecimal.ZERO);
112
+ orderInfo.setRealAmount(BigDecimal.ZERO);
113
+ orderInfo.setDiscountsAmount(BigDecimal.ZERO);
114
+ return orderInfo;
115
+ }
116
+
117
+ // ===== 领域业务方法 =====
118
+
119
+ /**
120
+ * 计算需付金额 = 应付 - 优惠
121
+ */
122
+ public BigDecimal calcNeedPayAmount() {
123
+ return payableAmount.subtract(discountsAmount);
124
+ }
125
+
126
+ /**
127
+ * 重置所有金额为零
128
+ */
129
+ public void resetAmountsZero() {
130
+ this.payableAmount = BigDecimal.ZERO;
131
+ this.realAmount = BigDecimal.ZERO;
132
+ this.discountsAmount = BigDecimal.ZERO;
133
+ }
134
+ }
135
+ ```
136
+
137
+ **设计要点**:
138
+ - 无基类,所有字段直接定义在类中
139
+ - 无 `implements Serializable`
140
+ - `@TableName("order_info")` 不带 `autoResultMap = true`(报表 Mapper 是 XML,无需 TypeHandler)
141
+ - 静态工厂方法 `newDefaultInstance()` 预设业务默认值
142
+ - 领域业务方法直接放在 Model 类中(非 Service),体现贫血/充血混合模式
143
+
144
+ ## Entity 实体类模板
145
+
146
+ ### 基础 Entity
147
+
148
+ ```java
149
+ import com.baomidou.mybatisplus.annotation.*;
150
+ import io.swagger.annotations.ApiModel;
151
+ import io.swagger.annotations.ApiModelProperty;
152
+ import lombok.Data;
153
+
154
+ import java.time.LocalDateTime;
155
+
156
+ @Data
157
+ @TableName(value = "table_name", autoResultMap = true)
158
+ public class XxxEntity {
159
+
160
+ @TableId
161
+ @ApiModelProperty(value = "主键ID")
162
+ private Long id;
163
+
164
+ @ApiModelProperty(value = "删除标识(1-删除,2-正常)")
165
+ private Integer delFlag;
166
+
167
+ @ApiModelProperty(value = "创建人")
168
+ private String crby;
169
+
170
+ @ApiModelProperty(value = "创建时间")
171
+ private LocalDateTime crtime;
172
+
173
+ @ApiModelProperty(value = "更新人")
174
+ private String upby;
175
+
176
+ @ApiModelProperty(value = "更新时间")
177
+ private LocalDateTime uptime;
178
+ }
179
+ ```
180
+
181
+ ### 自动填充字段 Entity
182
+
183
+ ```java
184
+ import com.baomidou.mybatisplus.annotation.*;
185
+ import io.swagger.annotations.ApiModel;
186
+ import io.swagger.annotations.ApiModelProperty;
187
+ import lombok.Data;
188
+
189
+ import java.time.LocalDateTime;
190
+
191
+ @Data
192
+ @TableName(value = "table_name", autoResultMap = true)
193
+ public class XxxEntity {
194
+
195
+ @TableId
196
+ private Long id;
197
+
198
+ // 插入时自动填充
199
+ @TableField(fill = FieldFill.INSERT)
200
+ @ApiModelProperty(value = "创建人")
201
+ private String crby;
202
+
203
+ @TableField(fill = FieldFill.INSERT)
204
+ @ApiModelProperty(value = "创建时间")
205
+ private LocalDateTime crtime;
206
+
207
+ // 插入或更新时自动填充
208
+ @TableField(fill = FieldFill.INSERT_UPDATE)
209
+ @ApiModelProperty(value = "更新人")
210
+ private String upby;
211
+
212
+ @TableField(fill = FieldFill.INSERT_UPDATE)
213
+ @ApiModelProperty(value = "更新时间")
214
+ private LocalDateTime uptime;
215
+
216
+ @ApiModelProperty(value = "删除标识(1-删除,2-正常)")
217
+ private Integer delFlag;
218
+ }
219
+ ```
220
+
221
+ ### 包含业务字段的 Entity
222
+
223
+ ```java
224
+ import com.baomidou.mybatisplus.annotation.*;
225
+ import io.swagger.annotations.ApiModel;
226
+ import io.swagger.annotations.ApiModelProperty;
227
+ import lombok.Data;
228
+
229
+ import java.math.BigDecimal;
230
+ import java.time.LocalDateTime;
231
+
232
+ @Data
233
+ @TableName(value = "order_table", autoResultMap = true)
234
+ public class OrderEntity {
235
+
236
+ @TableId
237
+ @ApiModelProperty(value = "订单ID")
238
+ private Long orderId;
239
+
240
+ @ApiModelProperty(value = "用户ID")
241
+ private Long userId;
242
+
243
+ @ApiModelProperty(value = "订单金额(分)")
244
+ private Long orderAmount;
245
+
246
+ @ApiModelProperty(value = "订单状态")
247
+ private Integer status;
248
+
249
+ @ApiModelProperty(value = "删除标识(1-删除,2-正常)")
250
+ private Integer delFlag;
251
+
252
+ @TableField(fill = FieldFill.INSERT)
253
+ @ApiModelProperty(value = "创建人")
254
+ private String crby;
255
+
256
+ @TableField(fill = FieldFill.INSERT)
257
+ @ApiModelProperty(value = "创建时间")
258
+ private LocalDateTime crtime;
259
+
260
+ @TableField(fill = FieldFill.INSERT_UPDATE)
261
+ @ApiModelProperty(value = "更新人")
262
+ private String upby;
263
+
264
+ @TableField(fill = FieldFill.INSERT_UPDATE)
265
+ @ApiModelProperty(value = "更新时间")
266
+ private LocalDateTime uptime;
267
+ }
268
+ ```
269
+
270
+ ## VO 类模板
271
+
272
+ ### 基础 VO
273
+
274
+ ```java
275
+ import io.swagger.annotations.ApiModel;
276
+ import io.swagger.annotations.ApiModelProperty;
277
+ import lombok.Data;
278
+ import lombok.experimental.Accessors;
279
+
280
+ @Data
281
+ @Accessors(chain = true)
282
+ @ApiModel("订单信息")
283
+ public class OrderVO {
284
+
285
+ @ApiModelProperty("订单ID")
286
+ private Long orderId;
287
+
288
+ @ApiModelProperty("用户ID")
289
+ private Long userId;
290
+
291
+ @ApiModelProperty("订单金额(元)")
292
+ private BigDecimal orderAmount;
293
+
294
+ @ApiModelProperty("订单状态")
295
+ private Integer status;
296
+
297
+ @ApiModelProperty("创建时间")
298
+ private LocalDateTime crtime;
299
+ }
300
+ ```
301
+
302
+ ### 包含参数校验的 VO
303
+
304
+ ```java
305
+ import io.swagger.annotations.ApiModel;
306
+ import io.swagger.annotations.ApiModelProperty;
307
+ import jakarta.validation.constraints.*;
308
+ import lombok.Data;
309
+ import lombok.experimental.Accessors;
310
+
311
+ import java.time.LocalDateTime;
312
+
313
+ @Data
314
+ @Accessors(chain = true)
315
+ @ApiModel("订单信息")
316
+ public class OrderVO {
317
+
318
+ @ApiModelProperty("订单ID")
319
+ private Long orderId;
320
+
321
+ @ApiModelProperty("用户ID")
322
+ @NotNull(message = "用户ID不能为空")
323
+ private Long userId;
324
+
325
+ @ApiModelProperty("订单金额(元)")
326
+ @NotNull(message = "订单金额不能为空")
327
+ @DecimalMin(value = "0.01", message = "订单金额必须大于0")
328
+ private BigDecimal orderAmount;
329
+
330
+ @ApiModelProperty("订单状态")
331
+ private Integer status;
332
+
333
+ @ApiModelProperty("创建时间")
334
+ private LocalDateTime crtime;
335
+ }
336
+ ```
337
+
338
+ ### Excel 导出 VO
339
+
340
+ ```java
341
+ import com.alibaba.excel.annotation.ExcelProperty;
342
+ import com.alibaba.excel.annotation.write.style.ColumnWidth;
343
+ import io.swagger.annotations.ApiModel;
344
+ import io.swagger.annotations.ApiModelProperty;
345
+ import lombok.Data;
346
+ import lombok.experimental.Accessors;
347
+ import net.xnzn.core.common.export.converter.CustomNumberConverter;
348
+
349
+ import java.math.BigDecimal;
350
+ import java.time.LocalDateTime;
351
+
352
+ @Data
353
+ @Accessors(chain = true)
354
+ @ApiModel("订单信息")
355
+ public class OrderExportVO {
356
+
357
+ @ExcelProperty(value = "订单ID", order = 1)
358
+ @ColumnWidth(15)
359
+ @ApiModelProperty("订单ID")
360
+ private Long orderId;
361
+
362
+ @ExcelProperty(value = "用户ID", order = 2)
363
+ @ColumnWidth(15)
364
+ @ApiModelProperty("用户ID")
365
+ private Long userId;
366
+
367
+ @ExcelProperty(value = "订单金额(元)", order = 3, converter = CustomNumberConverter.class)
368
+ @ColumnWidth(15)
369
+ @ApiModelProperty("订单金额(元)")
370
+ private BigDecimal orderAmount;
371
+
372
+ @ExcelProperty(value = "创建时间", order = 4)
373
+ @ColumnWidth(20)
374
+ @ApiModelProperty("创建时间")
375
+ private LocalDateTime crtime;
376
+ }
377
+ ```
378
+
379
+ ## DTO 类模板
380
+
381
+ ### 基础 DTO
382
+
383
+ ```java
384
+ import io.swagger.annotations.ApiModel;
385
+ import io.swagger.annotations.ApiModelProperty;
386
+ import lombok.Data;
387
+
388
+ @Data
389
+ @ApiModel("订单数据传输对象")
390
+ public class OrderDTO {
391
+
392
+ @ApiModelProperty("订单ID")
393
+ private Long orderId;
394
+
395
+ @ApiModelProperty("用户ID")
396
+ private Long userId;
397
+
398
+ @ApiModelProperty("订单状态")
399
+ private Integer status;
400
+ }
401
+ ```
402
+
403
+ ## Param 类模板
404
+
405
+ ### 基础 Param
406
+
407
+ ```java
408
+ import io.swagger.annotations.ApiModel;
409
+ import io.swagger.annotations.ApiModelProperty;
410
+ import lombok.Data;
411
+ import net.xnzn.core.common.page.PageDTO;
412
+
413
+ import java.io.Serializable;
414
+
415
+ @Data
416
+ @ApiModel("查询参数")
417
+ public class OrderQueryParam implements Serializable {
418
+
419
+ @ApiModelProperty(value = "分页参数", required = true)
420
+ @NotNull(message = "分页参数不能为空")
421
+ private PageDTO page;
422
+
423
+ @ApiModelProperty("关键字")
424
+ private String keyword;
425
+
426
+ @ApiModelProperty("状态")
427
+ private Integer status;
428
+ }
429
+ ```
430
+
431
+ ### 完整 Param(包含时间范围)
432
+
433
+ ```java
434
+ import io.swagger.annotations.ApiModel;
435
+ import io.swagger.annotations.ApiModelProperty;
436
+ import jakarta.validation.constraints.NotNull;
437
+ import lombok.Data;
438
+ import net.xnzn.core.common.page.PageDTO;
439
+
440
+ import java.io.Serializable;
441
+ import java.time.LocalDate;
442
+
443
+ @Data
444
+ @ApiModel("订单查询参数")
445
+ public class OrderQueryParam implements Serializable {
446
+
447
+ @ApiModelProperty(value = "分页参数", required = true)
448
+ @NotNull(message = "分页参数不能为空")
449
+ private PageDTO page;
450
+
451
+ @ApiModelProperty("关键字")
452
+ private String keyword;
453
+
454
+ @ApiModelProperty("状态")
455
+ private Integer status;
456
+
457
+ @ApiModelProperty("开始日期")
458
+ private LocalDate startDate;
459
+
460
+ @ApiModelProperty("结束日期")
461
+ private LocalDate endDate;
462
+ }
463
+ ```
464
+
465
+ ### 报表 Param
466
+
467
+ ```java
468
+ import com.alibaba.excel.annotation.ExcelIgnore;
469
+ import io.swagger.annotations.ApiModel;
470
+ import io.swagger.annotations.ApiModelProperty;
471
+ import lombok.Data;
472
+ import lombok.EqualsAndHashCode;
473
+
474
+ import java.io.Serializable;
475
+ import java.time.LocalDate;
476
+ import java.util.List;
477
+
478
+ @Data
479
+ @EqualsAndHashCode(callSuper = true)
480
+ @ApiModel("订单报表查询参数")
481
+ public class OrderReportParam implements Serializable {
482
+
483
+ @ExcelIgnore
484
+ @ApiModelProperty(value = "分页参数", required = true)
485
+ private PageDTO page;
486
+
487
+ @ExcelIgnore
488
+ @ApiModelProperty("关键字")
489
+ private String keyword;
490
+
491
+ @ApiModelProperty("开始日期")
492
+ private LocalDate startDate;
493
+
494
+ @ApiModelProperty("结束日期")
495
+ private LocalDate endDate;
496
+
497
+ @ApiModelProperty("食堂ID列表")
498
+ private List<Long> canteenIds;
499
+
500
+ @ApiModelProperty("状态")
501
+ private Integer status;
502
+ }
503
+ ```
504
+
505
+ ## 枚举类模板
506
+
507
+ ### 基础枚举
508
+
509
+ ```java
510
+ import lombok.AllArgsConstructor;
511
+ import lombok.Getter;
512
+
513
+ @Getter
514
+ @AllArgsConstructor
515
+ public enum OrderStatusEnum {
516
+
517
+ CREATED(1, "已创建"),
518
+ PAID(2, "已支付"),
519
+ COMPLETED(3, "已完成"),
520
+ CANCELLED(4, "已取消");
521
+
522
+ private final Integer key;
523
+ private final String desc;
524
+
525
+ public static OrderStatusEnum getByKey(Integer key) {
526
+ if (key == null) {
527
+ return null;
528
+ }
529
+ for (OrderStatusEnum status : values()) {
530
+ if (status.getKey().equals(key)) {
531
+ return status;
532
+ }
533
+ }
534
+ return null;
535
+ }
536
+
537
+ public static String getDescByKey(Integer key) {
538
+ OrderStatusEnum status = getByKey(key);
539
+ return status != null ? status.getDesc() : "";
540
+ }
541
+ }
542
+ ```
543
+
544
+ ### 含国际化的枚举
545
+
546
+ ```java
547
+ import lombok.AllArgsConstructor;
548
+ import lombok.Getter;
549
+ import net.xnzn.core.common.i18n.I18n;
550
+
551
+ @Getter
552
+ @AllArgsConstructor
553
+ public enum OrderStatusEnum {
554
+
555
+ CREATED(1, "{order.status.created}"),
556
+ PAID(2, "{order.status.paid}"),
557
+ COMPLETED(3, "{order.status.completed}"),
558
+ CANCELLED(4, "{order.status.cancelled}");
559
+
560
+ private final Integer key;
561
+ private final String desc;
562
+
563
+ public String getDesc() {
564
+ return I18n.getMessage(desc);
565
+ }
566
+
567
+ public static OrderStatusEnum getByKey(Integer key) {
568
+ if (key == null) {
569
+ return null;
570
+ }
571
+ for (OrderStatusEnum status : values()) {
572
+ if (status.getKey().equals(key)) {
573
+ return status;
574
+ }
575
+ }
576
+ return null;
577
+ }
578
+
579
+ public static String getDescByKey(Integer key) {
580
+ OrderStatusEnum status = getByKey(key);
581
+ return status != null ? status.getDesc() : "";
582
+ }
583
+ }
584
+ ```
585
+
586
+ ## 常用注解
587
+
588
+ ### MyBatis-Plus 注解
589
+
590
+ | 注解 | 用途 | 示例 |
591
+ |------|------|------|
592
+ | `@TableName` | 表名映射 | `@TableName("order_table")` |
593
+ | `@TableId` | 主键标识 | `@TableId private Long id;` |
594
+ | `@TableField` | 字段映射 | `@TableField("user_name")` |
595
+ | `@TableField(fill = FieldFill.INSERT)` | 插入时填充 | `@TableField(fill = FieldFill.INSERT) private String crby;` |
596
+ | `@TableField(fill = FieldFill.INSERT_UPDATE)` | 插入或更新时填充 | `@TableField(fill = FieldFill.INSERT_UPDATE) private LocalDateTime uptime;` |
597
+ | `@TableField(exist = false)` | 非数据库字段 | `@TableField(exist = false) private String tempField;` |
598
+
599
+ ### Jakarta Validation 注解
600
+
601
+ **重要**:项目使用 JDK 21,必须使用 `jakarta.validation.constraints.*` 包
602
+
603
+ ```java
604
+ import jakarta.validation.constraints.*;
605
+ ```
606
+
607
+ | 注解 | 用途 | 示例 |
608
+ |------|------|------|
609
+ | `@NotNull` | 不能为null | `@NotNull(message = "用户ID不能为空")` |
610
+ | `@NotBlank` | 字符串不能为空 | `@NotBlank(message = "名称不能为空")` |
611
+ | `@NotEmpty` | 集合不能为空 | `@NotEmpty(message = "列表不能为空")` |
612
+ | `@Size` | 大小范围 | `@Size(min = 1, max = 100, message = "长度1-100")` |
613
+ | `@Min` | 最小值 | `@Min(value = 0, message = "金额不能为负数")` |
614
+ | `@Max` | 最大值 | `@Max(value = 1000, message = "数量不能超过1000")` |
615
+ | `@DecimalMin` | 小数最小值 | `@DecimalMin(value = "0.01", message = "金额必须大于0.01")` |
616
+ | `@DecimalMax` | 小数最大值 | `@DecimalMax(value = "999999.99", message = "金额不能超过999999.99")` |
617
+ | `@Email` | 邮箱格式 | `@Email(message = "邮箱格式不正确")` |
618
+ | `@Pattern` | 正则匹配 | `@Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确")` |
619
+
620
+ ### Swagger 注解
621
+
622
+ | 注解 | 用途 | 示例 |
623
+ |------|------|------|
624
+ | `@ApiModel` | 类描述 | `@ApiModel("订单信息")` |
625
+ | `@ApiModelProperty` | 字段描述 | `@ApiModelProperty("订单ID")` |
626
+ | `@ApiModelProperty(value = "...", required = true)` | 必填字段 | `@ApiModelProperty(value = "用户ID", required = true)` |
627
+
628
+ ### Lombok 注解
629
+
630
+ | 注解 | 用途 | 示例 |
631
+ |------|------|------|
632
+ | `@Data` | getter/setter | `@Data public class Xxx {}` |
633
+ | `@Slf4j` | 日志 | `@Slf4j public class Xxx {}` |
634
+ | `@Builder` | 建造者模式 | `@Builder public class Xxx {}` |
635
+ | `@AllArgsConstructor` | 全参构造 | `@AllArgsConstructor public class Xxx {}` |
636
+ | `@NoArgsConstructor` | 无参构造 | `@NoArgsConstructor public class Xxx {}` |
637
+ | `@Accessors(chain = true)` | 链式调用 | `@Accessors(chain = true) public class Xxx {}` |
638
+ | `@Getter` | getter方法 | `@Getter public enum XxxEnum {}` |
639
+
640
+ ### EasyExcel 注解
641
+
642
+ ```java
643
+ import com.alibaba.excel.annotation.ExcelProperty;
644
+ import com.alibaba.excel.annotation.write.style.ColumnWidth;
645
+ import com.alibaba.excel.annotation.write.style.ContentRowHeight;
646
+ import com.alibaba.excel.annotation.ExcelIgnore;
647
+ ```
648
+
649
+ | 注解 | 用途 | 示例 |
650
+ |------|------|------|
651
+ | `@ExcelProperty` | Excel列名 | `@ExcelProperty(value = "订单ID", order = 1)` |
652
+ | `@ColumnWidth` | 列宽 | `@ColumnWidth(15)` |
653
+ | `@ContentRowHeight` | 行高 | `@ContentRowHeight(20)` |
654
+ | `@ExcelIgnore` | 忽略导出 | `@ExcelIgnore private String tempField;` |
655
+
656
+ ### JSON 格式化注解
657
+
658
+ ```java
659
+ import com.fasterxml.jackson.annotation.JsonFormat;
660
+ import org.springframework.format.annotation.DateTimeFormat;
661
+ ```
662
+
663
+ ```java
664
+ @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
665
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
666
+ private LocalDateTime createTime;
667
+
668
+ @DateTimeFormat(pattern = "yyyy-MM-dd")
669
+ @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
670
+ private LocalDate date;
671
+ ```
672
+
673
+ ## 常用工具类
674
+
675
+ ### Hutool 工具类
676
+
677
+ ```java
678
+ import cn.hutool.core.collection.CollUtil;
679
+ import cn.hutool.core.util.ObjectUtil;
680
+ import cn.hutool.core.util.StrUtil;
681
+ import cn.hutool.core.bean.BeanUtil;
682
+
683
+ // 集合判空
684
+ if (CollUtil.isEmpty(list)) { }
685
+ if (CollUtil.isNotEmpty(list)) { }
686
+
687
+ // 对象判空
688
+ if (ObjectUtil.isNull(obj)) { }
689
+ if (ObjectUtil.isNotNull(obj)) { }
690
+
691
+ // 字符串判空
692
+ if (StrUtil.isBlank(str)) { }
693
+ if (StrUtil.isNotBlank(str)) { }
694
+
695
+ // 对象拷贝
696
+ Target target = BeanUtil.copyProperties(source, Target.class);
697
+ List<Target> targets = BeanUtil.copyToList(sources, Target.class);
698
+ ```
699
+
700
+ ## 常见错误
701
+
702
+ ### 错误1:使用 RuoYi 的 TenantEntity
703
+
704
+ ```java
705
+ // ❌ 错误:使用 RuoYi 的基类
706
+ import org.dromara.common.mybatis.core.domain.TenantEntity;
707
+
708
+ // ✅ 正确:leniu 项目使用自定义 Entity
709
+ @Data
710
+ @TableName("table_name")
711
+ public class XxxEntity {
712
+ @TableId
713
+ private Long id;
714
+ }
715
+ ```
716
+
717
+ ### 错误2:使用 javax.validation
718
+
719
+ ```java
720
+ // ❌ 错误:使用 javax.validation(JDK 21 应该用 jakarta)
721
+ import javax.validation.constraints.NotNull;
722
+
723
+ // ✅ 正确:使用 jakarta.validation
724
+ import jakarta.validation.constraints.NotNull;
725
+ ```
726
+
727
+ ### 错误3:使用 MapstructUtils
728
+
729
+ ```java
730
+ // ❌ 错误:使用 RuoYi 的工具类
731
+ import org.dromara.common.core.utils.MapstructUtils;
732
+ Target target = MapstructUtils.convert(source, Target.class);
733
+
734
+ // ✅ 正确:leniu 使用 Hutool
735
+ import cn.hutool.core.bean.BeanUtil;
736
+ Target target = BeanUtil.copyProperties(source, Target.class);
737
+ ```
738
+
739
+ ### 错误4:delFlag 判断错误
740
+
741
+ ```java
742
+ // ❌ 错误:使用 RuoYi 的值
743
+ wrapper.eq(XxxEntity::getDelFlag, 0);
744
+
745
+ // ✅ 正确:leniu 使用 2 表示正常
746
+ wrapper.eq(XxxEntity::getDelFlag, 2);
747
+ ```
748
+
749
+ ## 参考文档
750
+
751
+ 详见:[leniu-tengyun-core 源码](/Users/xujiajun/Developer/gongsi_proj/core/leniu-tengyun-core)