ai-engineering-init 1.3.3 → 1.4.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/hooks/skill-forced-eval.js +4 -1
- package/.claude/settings.json +3 -3
- package/.claude/skills/add-skill/SKILL.md +252 -116
- package/.claude/skills/api-development/SKILL.md +83 -377
- package/.claude/skills/architecture-design/SKILL.md +138 -632
- package/.claude/skills/backend-annotations/SKILL.md +134 -506
- package/.claude/skills/banana-image/SKILL.md +10 -3
- package/.claude/skills/brainstorm/SKILL.md +103 -535
- package/.claude/skills/bug-detective/SKILL.md +147 -1097
- package/.claude/skills/bug-detective/references/error-patterns.md +242 -0
- package/.claude/skills/code-patterns/SKILL.md +116 -426
- package/.claude/skills/code-patterns/references/leniu-code-patterns.md +87 -0
- package/.claude/skills/crud-development/SKILL.md +64 -304
- package/.claude/skills/data-permission/SKILL.md +105 -412
- package/.claude/skills/data-permission/references/custom-data-scope.md +90 -0
- package/.claude/skills/file-oss-management/SKILL.md +106 -714
- 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/leniu-api-development/SKILL.md +142 -626
- package/.claude/skills/leniu-api-development/references/real-examples.md +273 -0
- package/.claude/skills/leniu-architecture-design/SKILL.md +176 -391
- package/.claude/skills/leniu-backend-annotations/SKILL.md +132 -519
- package/.claude/skills/leniu-brainstorm/SKILL.md +132 -541
- package/.claude/skills/leniu-brainstorm/references/business-scenarios.md +162 -0
- package/.claude/skills/leniu-crud-development/SKILL.md +232 -938
- 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 +70 -0
- package/.claude/skills/leniu-java-entity/SKILL.md +76 -590
- package/.claude/skills/leniu-java-entity/references/templates.md +237 -0
- package/.claude/skills/leniu-java-export/SKILL.md +94 -379
- package/.claude/skills/leniu-java-logging/SKILL.md +106 -709
- 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-mybatis/SKILL.md +73 -446
- package/.claude/skills/leniu-java-mybatis/references/report-mapper.md +88 -0
- package/.claude/skills/leniu-report-customization/SKILL.md +111 -325
- package/.claude/skills/leniu-report-customization/references/table-fields.md +93 -0
- package/.claude/skills/leniu-report-standard-customization/SKILL.md +328 -0
- package/.claude/skills/leniu-report-standard-customization/references/analysis-module.md +64 -0
- package/.claude/skills/leniu-report-standard-customization/references/table-fields.md +113 -0
- package/.claude/skills/leniu-security-guard/SKILL.md +133 -347
- package/.claude/skills/mysql-debug/SKILL.md +364 -0
- package/.claude/skills/openspec-apply-change/SKILL.md +10 -1
- package/.claude/skills/openspec-archive-change/SKILL.md +9 -1
- package/.claude/skills/openspec-bulk-archive-change/SKILL.md +9 -1
- package/.claude/skills/openspec-continue-change/SKILL.md +9 -1
- package/.claude/skills/openspec-explore/SKILL.md +10 -1
- package/.claude/skills/openspec-ff-change/SKILL.md +9 -1
- package/.claude/skills/openspec-new-change/SKILL.md +9 -1
- package/.claude/skills/openspec-onboard/SKILL.md +15 -130
- package/.claude/skills/openspec-sync-specs/SKILL.md +9 -1
- package/.claude/skills/openspec-verify-change/SKILL.md +9 -1
- package/.claude/skills/performance-doctor/SKILL.md +110 -434
- package/.claude/skills/redis-cache/SKILL.md +89 -595
- package/.claude/skills/redis-cache/references/listeners.md +23 -0
- package/.claude/skills/scheduled-jobs/SKILL.md +88 -407
- package/.claude/skills/security-guard/SKILL.md +137 -532
- 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 +116 -574
- 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 +112 -514
- package/.claude/skills/social-login/references/provider-configs.md +118 -0
- package/.claude/skills/tenant-management/SKILL.md +129 -444
- package/.claude/skills/tenant-management/references/tenant-scenarios.md +91 -0
- package/.claude/skills/test-development/SKILL.md +86 -540
- package/.claude/skills/test-development/references/parameterized-examples.md +119 -0
- package/.claude/skills/utils-toolkit/SKILL.md +52 -305
- package/.claude/skills/utils-toolkit/references/redis-utils-api.md +56 -0
- package/.claude/skills/websocket-sse/SKILL.md +105 -550
- package/.claude/skills/workflow-engine/SKILL.md +147 -502
- package/.codex/skills/add-skill/SKILL.md +252 -116
- package/.codex/skills/api-development/SKILL.md +172 -599
- package/.codex/skills/architecture-design/SKILL.md +138 -504
- package/.codex/skills/backend-annotations/SKILL.md +134 -496
- package/.codex/skills/banana-image/SKILL.md +10 -3
- package/.codex/skills/brainstorm/SKILL.md +103 -535
- package/.codex/skills/bug-detective/SKILL.md +147 -1097
- package/.codex/skills/bug-detective/references/error-patterns.md +242 -0
- package/.codex/skills/code-patterns/SKILL.md +120 -282
- package/.codex/skills/code-patterns/references/leniu-code-patterns.md +87 -0
- package/.codex/skills/crud-development/SKILL.md +64 -292
- package/.codex/skills/data-permission/SKILL.md +108 -407
- package/.codex/skills/data-permission/references/custom-data-scope.md +90 -0
- package/.codex/skills/database-ops/SKILL.md +8 -154
- package/.codex/skills/error-handler/SKILL.md +10 -0
- package/.codex/skills/file-oss-management/SKILL.md +106 -714
- 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/git-workflow/SKILL.md +27 -5
- package/.codex/skills/leniu-api-development/SKILL.md +142 -626
- package/.codex/skills/leniu-api-development/references/real-examples.md +273 -0
- package/.codex/skills/leniu-architecture-design/SKILL.md +176 -391
- package/.codex/skills/leniu-backend-annotations/SKILL.md +132 -519
- package/.codex/skills/leniu-brainstorm/SKILL.md +132 -541
- package/.codex/skills/leniu-brainstorm/references/business-scenarios.md +162 -0
- package/.codex/skills/leniu-crud-development/SKILL.md +232 -938
- 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 +70 -0
- package/.codex/skills/leniu-java-code-style/SKILL.md +510 -0
- package/.codex/skills/leniu-java-entity/SKILL.md +76 -590
- package/.codex/skills/leniu-java-entity/references/templates.md +237 -0
- package/.codex/skills/leniu-java-export/SKILL.md +94 -379
- package/.codex/skills/leniu-java-logging/SKILL.md +106 -709
- 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-mybatis/SKILL.md +73 -446
- package/.codex/skills/leniu-java-mybatis/references/report-mapper.md +88 -0
- package/.codex/skills/leniu-report-customization/SKILL.md +111 -325
- package/.codex/skills/leniu-report-customization/references/table-fields.md +93 -0
- package/.codex/skills/leniu-report-standard-customization/SKILL.md +328 -0
- package/.codex/skills/leniu-report-standard-customization/references/analysis-module.md +64 -0
- package/.codex/skills/leniu-report-standard-customization/references/table-fields.md +113 -0
- package/.codex/skills/leniu-security-guard/SKILL.md +133 -347
- package/.codex/skills/mysql-debug/SKILL.md +364 -0
- package/.codex/skills/openspec-apply-change/SKILL.md +10 -1
- package/.codex/skills/openspec-archive-change/SKILL.md +9 -1
- package/.codex/skills/openspec-bulk-archive-change/SKILL.md +9 -1
- package/.codex/skills/openspec-continue-change/SKILL.md +9 -1
- package/.codex/skills/openspec-explore/SKILL.md +10 -1
- package/.codex/skills/openspec-ff-change/SKILL.md +9 -1
- package/.codex/skills/openspec-new-change/SKILL.md +9 -1
- package/.codex/skills/openspec-onboard/SKILL.md +15 -130
- package/.codex/skills/openspec-sync-specs/SKILL.md +9 -1
- package/.codex/skills/openspec-verify-change/SKILL.md +9 -1
- package/.codex/skills/performance-doctor/SKILL.md +110 -434
- package/.codex/skills/project-navigator/SKILL.md +20 -1
- package/.codex/skills/redis-cache/SKILL.md +93 -589
- package/.codex/skills/redis-cache/references/listeners.md +23 -0
- package/.codex/skills/scheduled-jobs/SKILL.md +88 -407
- package/.codex/skills/security-guard/SKILL.md +141 -527
- 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/sms-mail/SKILL.md +116 -574
- 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 +112 -514
- package/.codex/skills/social-login/references/provider-configs.md +118 -0
- package/.codex/skills/store-pc/SKILL.md +258 -383
- package/.codex/skills/tenant-management/SKILL.md +129 -444
- package/.codex/skills/tenant-management/references/tenant-scenarios.md +91 -0
- package/.codex/skills/test-development/SKILL.md +86 -540
- package/.codex/skills/test-development/references/parameterized-examples.md +119 -0
- package/.codex/skills/ui-pc/SKILL.md +350 -387
- package/.codex/skills/utils-toolkit/SKILL.md +52 -283
- package/.codex/skills/utils-toolkit/references/redis-utils-api.md +56 -0
- package/.codex/skills/websocket-sse/SKILL.md +105 -550
- package/.codex/skills/workflow-engine/SKILL.md +147 -502
- package/.cursor/hooks.json +3 -3
- package/.cursor/rules/skill-activation.mdc +2 -0
- package/.cursor/skills/add-skill/SKILL.md +252 -116
- package/.cursor/skills/api-development/SKILL.md +83 -377
- package/.cursor/skills/architecture-design/SKILL.md +138 -632
- package/.cursor/skills/backend-annotations/SKILL.md +134 -506
- package/.cursor/skills/banana-image/SKILL.md +10 -3
- package/.cursor/skills/brainstorm/SKILL.md +103 -535
- package/.cursor/skills/bug-detective/SKILL.md +147 -1097
- package/.cursor/skills/bug-detective/references/error-patterns.md +242 -0
- package/.cursor/skills/code-patterns/SKILL.md +116 -426
- package/.cursor/skills/code-patterns/references/leniu-code-patterns.md +87 -0
- package/.cursor/skills/crud-development/SKILL.md +64 -304
- package/.cursor/skills/data-permission/SKILL.md +105 -412
- package/.cursor/skills/data-permission/references/custom-data-scope.md +90 -0
- package/.cursor/skills/file-oss-management/SKILL.md +106 -714
- 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/git-workflow/SKILL.md +27 -5
- package/.cursor/skills/leniu-api-development/SKILL.md +142 -626
- package/.cursor/skills/leniu-api-development/references/real-examples.md +273 -0
- package/.cursor/skills/leniu-architecture-design/SKILL.md +176 -391
- package/.cursor/skills/leniu-backend-annotations/SKILL.md +132 -519
- package/.cursor/skills/leniu-brainstorm/SKILL.md +132 -541
- package/.cursor/skills/leniu-brainstorm/references/business-scenarios.md +162 -0
- package/.cursor/skills/leniu-crud-development/SKILL.md +232 -938
- 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 +70 -0
- package/.cursor/skills/leniu-java-code-style/SKILL.md +510 -0
- package/.cursor/skills/leniu-java-entity/SKILL.md +76 -590
- package/.cursor/skills/leniu-java-entity/references/templates.md +237 -0
- package/.cursor/skills/leniu-java-export/SKILL.md +94 -379
- package/.cursor/skills/leniu-java-logging/SKILL.md +106 -709
- 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-mybatis/SKILL.md +73 -446
- package/.cursor/skills/leniu-java-mybatis/references/report-mapper.md +88 -0
- package/.cursor/skills/leniu-report-customization/SKILL.md +111 -325
- package/.cursor/skills/leniu-report-customization/references/table-fields.md +93 -0
- package/.cursor/skills/leniu-report-standard-customization/SKILL.md +328 -0
- package/.cursor/skills/leniu-report-standard-customization/references/analysis-module.md +64 -0
- package/.cursor/skills/leniu-report-standard-customization/references/table-fields.md +113 -0
- package/.cursor/skills/leniu-security-guard/SKILL.md +133 -347
- package/.cursor/skills/mysql-debug/SKILL.md +364 -0
- package/.cursor/skills/openspec-apply-change/SKILL.md +10 -1
- package/.cursor/skills/openspec-archive-change/SKILL.md +9 -1
- package/.cursor/skills/openspec-bulk-archive-change/SKILL.md +9 -1
- package/.cursor/skills/openspec-continue-change/SKILL.md +9 -1
- package/.cursor/skills/openspec-explore/SKILL.md +10 -1
- package/.cursor/skills/openspec-ff-change/SKILL.md +9 -1
- package/.cursor/skills/openspec-new-change/SKILL.md +9 -1
- package/.cursor/skills/openspec-onboard/SKILL.md +15 -130
- package/.cursor/skills/openspec-sync-specs/SKILL.md +9 -1
- package/.cursor/skills/openspec-verify-change/SKILL.md +9 -1
- package/.cursor/skills/performance-doctor/SKILL.md +110 -434
- package/.cursor/skills/redis-cache/SKILL.md +89 -595
- package/.cursor/skills/redis-cache/references/listeners.md +23 -0
- package/.cursor/skills/scheduled-jobs/SKILL.md +88 -407
- package/.cursor/skills/security-guard/SKILL.md +137 -532
- 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/sms-mail/SKILL.md +116 -574
- 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 +112 -514
- package/.cursor/skills/social-login/references/provider-configs.md +118 -0
- package/.cursor/skills/tenant-management/SKILL.md +129 -444
- package/.cursor/skills/tenant-management/references/tenant-scenarios.md +91 -0
- package/.cursor/skills/test-development/SKILL.md +86 -540
- package/.cursor/skills/test-development/references/parameterized-examples.md +119 -0
- package/.cursor/skills/utils-toolkit/SKILL.md +52 -305
- package/.cursor/skills/utils-toolkit/references/redis-utils-api.md +56 -0
- package/.cursor/skills/websocket-sse/SKILL.md +105 -550
- package/.cursor/skills/workflow-engine/SKILL.md +147 -502
- package/AGENTS.md +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
# Entity/VO/DTO 完整模板参考
|
|
2
|
+
|
|
3
|
+
## 生产代码参考:OrderInfo Model
|
|
4
|
+
|
|
5
|
+
```java
|
|
6
|
+
import com.baomidou.mybatisplus.annotation.*;
|
|
7
|
+
import io.swagger.annotations.ApiModel;
|
|
8
|
+
import io.swagger.annotations.ApiModelProperty;
|
|
9
|
+
import lombok.Data;
|
|
10
|
+
import lombok.experimental.Accessors;
|
|
11
|
+
|
|
12
|
+
import java.math.BigDecimal;
|
|
13
|
+
import java.time.LocalDateTime;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* 关键特征:
|
|
17
|
+
* 1. 无基类、无 Serializable
|
|
18
|
+
* 2. @TableName 不带 autoResultMap(报表 Mapper 无 BaseMapper)
|
|
19
|
+
* 3. 包含静态工厂方法 newDefaultInstance()
|
|
20
|
+
* 4. 包含领域业务方法(计算/重置等)
|
|
21
|
+
*/
|
|
22
|
+
@Data
|
|
23
|
+
@Accessors(chain = true)
|
|
24
|
+
@ApiModel(value = "订单信息")
|
|
25
|
+
@TableName("order_info")
|
|
26
|
+
public class OrderInfo {
|
|
27
|
+
|
|
28
|
+
@TableId
|
|
29
|
+
@ApiModelProperty(value = "订单ID")
|
|
30
|
+
private Long id;
|
|
31
|
+
|
|
32
|
+
@ApiModelProperty(value = "食堂ID")
|
|
33
|
+
private Long canteenId;
|
|
34
|
+
|
|
35
|
+
@ApiModelProperty(value = "用户ID")
|
|
36
|
+
private Long userId;
|
|
37
|
+
|
|
38
|
+
@ApiModelProperty(value = "应付金额(分)")
|
|
39
|
+
private BigDecimal payableAmount;
|
|
40
|
+
|
|
41
|
+
@ApiModelProperty(value = "实付金额(分)")
|
|
42
|
+
private BigDecimal realAmount;
|
|
43
|
+
|
|
44
|
+
@ApiModelProperty(value = "优惠金额(分)")
|
|
45
|
+
private BigDecimal discountsAmount;
|
|
46
|
+
|
|
47
|
+
@ApiModelProperty(value = "订单状态")
|
|
48
|
+
private Integer status;
|
|
49
|
+
|
|
50
|
+
@ApiModelProperty(value = "删除标识(1-删除,2-正常)")
|
|
51
|
+
private Integer delFlag;
|
|
52
|
+
|
|
53
|
+
@TableField(fill = FieldFill.INSERT)
|
|
54
|
+
@ApiModelProperty(value = "创建人")
|
|
55
|
+
private String crby;
|
|
56
|
+
|
|
57
|
+
@TableField(fill = FieldFill.INSERT)
|
|
58
|
+
@ApiModelProperty(value = "创建时间")
|
|
59
|
+
private LocalDateTime crtime;
|
|
60
|
+
|
|
61
|
+
@TableField(fill = FieldFill.INSERT_UPDATE)
|
|
62
|
+
@ApiModelProperty(value = "更新人")
|
|
63
|
+
private String upby;
|
|
64
|
+
|
|
65
|
+
@TableField(fill = FieldFill.INSERT_UPDATE)
|
|
66
|
+
@ApiModelProperty(value = "更新时间")
|
|
67
|
+
private LocalDateTime uptime;
|
|
68
|
+
|
|
69
|
+
public static OrderInfo newDefaultInstance() {
|
|
70
|
+
OrderInfo orderInfo = new OrderInfo();
|
|
71
|
+
orderInfo.setDelFlag(2);
|
|
72
|
+
orderInfo.setPayableAmount(BigDecimal.ZERO);
|
|
73
|
+
orderInfo.setRealAmount(BigDecimal.ZERO);
|
|
74
|
+
orderInfo.setDiscountsAmount(BigDecimal.ZERO);
|
|
75
|
+
return orderInfo;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
public BigDecimal calcNeedPayAmount() {
|
|
79
|
+
return payableAmount.subtract(discountsAmount);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
public void resetAmountsZero() {
|
|
83
|
+
this.payableAmount = BigDecimal.ZERO;
|
|
84
|
+
this.realAmount = BigDecimal.ZERO;
|
|
85
|
+
this.discountsAmount = BigDecimal.ZERO;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Excel 导出 VO
|
|
91
|
+
|
|
92
|
+
```java
|
|
93
|
+
import com.alibaba.excel.annotation.ExcelProperty;
|
|
94
|
+
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
|
95
|
+
import io.swagger.annotations.ApiModel;
|
|
96
|
+
import io.swagger.annotations.ApiModelProperty;
|
|
97
|
+
import lombok.Data;
|
|
98
|
+
import lombok.experimental.Accessors;
|
|
99
|
+
import net.xnzn.core.common.export.converter.CustomNumberConverter;
|
|
100
|
+
|
|
101
|
+
import java.math.BigDecimal;
|
|
102
|
+
import java.time.LocalDateTime;
|
|
103
|
+
|
|
104
|
+
@Data
|
|
105
|
+
@Accessors(chain = true)
|
|
106
|
+
@ApiModel("订单信息")
|
|
107
|
+
public class OrderExportVO {
|
|
108
|
+
|
|
109
|
+
@ExcelProperty(value = "订单ID", order = 1)
|
|
110
|
+
@ColumnWidth(15)
|
|
111
|
+
@ApiModelProperty("订单ID")
|
|
112
|
+
private Long orderId;
|
|
113
|
+
|
|
114
|
+
@ExcelProperty(value = "用户ID", order = 2)
|
|
115
|
+
@ColumnWidth(15)
|
|
116
|
+
@ApiModelProperty("用户ID")
|
|
117
|
+
private Long userId;
|
|
118
|
+
|
|
119
|
+
@ExcelProperty(value = "订单金额(元)", order = 3, converter = CustomNumberConverter.class)
|
|
120
|
+
@ColumnWidth(15)
|
|
121
|
+
@ApiModelProperty("订单金额(元)")
|
|
122
|
+
private BigDecimal orderAmount;
|
|
123
|
+
|
|
124
|
+
@ExcelProperty(value = "创建时间", order = 4)
|
|
125
|
+
@ColumnWidth(20)
|
|
126
|
+
@ApiModelProperty("创建时间")
|
|
127
|
+
private LocalDateTime crtime;
|
|
128
|
+
}
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## 报表 Param
|
|
132
|
+
|
|
133
|
+
```java
|
|
134
|
+
import com.alibaba.excel.annotation.ExcelIgnore;
|
|
135
|
+
import io.swagger.annotations.ApiModel;
|
|
136
|
+
import io.swagger.annotations.ApiModelProperty;
|
|
137
|
+
import lombok.Data;
|
|
138
|
+
|
|
139
|
+
import java.io.Serializable;
|
|
140
|
+
import java.time.LocalDate;
|
|
141
|
+
import java.util.List;
|
|
142
|
+
|
|
143
|
+
@Data
|
|
144
|
+
@ApiModel("订单报表查询参数")
|
|
145
|
+
public class OrderReportParam implements Serializable {
|
|
146
|
+
|
|
147
|
+
@ExcelIgnore
|
|
148
|
+
@ApiModelProperty(value = "分页参数", required = true)
|
|
149
|
+
private PageDTO page;
|
|
150
|
+
|
|
151
|
+
@ExcelIgnore
|
|
152
|
+
@ApiModelProperty("关键字")
|
|
153
|
+
private String keyword;
|
|
154
|
+
|
|
155
|
+
@ApiModelProperty("开始日期")
|
|
156
|
+
private LocalDate startDate;
|
|
157
|
+
|
|
158
|
+
@ApiModelProperty("结束日期")
|
|
159
|
+
private LocalDate endDate;
|
|
160
|
+
|
|
161
|
+
@ApiModelProperty("食堂ID列表")
|
|
162
|
+
private List<Long> canteenIds;
|
|
163
|
+
|
|
164
|
+
@ApiModelProperty("状态")
|
|
165
|
+
private Integer status;
|
|
166
|
+
}
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
## 含国际化的枚举
|
|
170
|
+
|
|
171
|
+
```java
|
|
172
|
+
import lombok.AllArgsConstructor;
|
|
173
|
+
import lombok.Getter;
|
|
174
|
+
import net.xnzn.core.common.i18n.I18n;
|
|
175
|
+
|
|
176
|
+
@Getter
|
|
177
|
+
@AllArgsConstructor
|
|
178
|
+
public enum OrderStatusEnum {
|
|
179
|
+
|
|
180
|
+
CREATED(1, "{order.status.created}"),
|
|
181
|
+
PAID(2, "{order.status.paid}"),
|
|
182
|
+
COMPLETED(3, "{order.status.completed}"),
|
|
183
|
+
CANCELLED(4, "{order.status.cancelled}");
|
|
184
|
+
|
|
185
|
+
private final Integer key;
|
|
186
|
+
private final String desc;
|
|
187
|
+
|
|
188
|
+
public String getDesc() {
|
|
189
|
+
return I18n.getMessage(desc);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
public static OrderStatusEnum getByKey(Integer key) {
|
|
193
|
+
if (key == null) return null;
|
|
194
|
+
for (OrderStatusEnum e : values()) {
|
|
195
|
+
if (e.getKey().equals(key)) return e;
|
|
196
|
+
}
|
|
197
|
+
return null;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
public static String getDescByKey(Integer key) {
|
|
201
|
+
OrderStatusEnum e = getByKey(key);
|
|
202
|
+
return e != null ? e.getDesc() : "";
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
## 常用注解速查
|
|
208
|
+
|
|
209
|
+
### MyBatis-Plus
|
|
210
|
+
|
|
211
|
+
| 注解 | 示例 |
|
|
212
|
+
|------|------|
|
|
213
|
+
| `@TableName` | `@TableName("order_table")` 或 `@TableName(value = "x", autoResultMap = true)` |
|
|
214
|
+
| `@TableId` | `@TableId private Long id;` |
|
|
215
|
+
| `@TableField(fill = FieldFill.INSERT)` | 插入时填充(crby, crtime) |
|
|
216
|
+
| `@TableField(fill = FieldFill.INSERT_UPDATE)` | 插入+更新填充(upby, uptime) |
|
|
217
|
+
| `@TableField(exist = false)` | 非数据库字段 |
|
|
218
|
+
|
|
219
|
+
### Jakarta Validation
|
|
220
|
+
|
|
221
|
+
| 注解 | 示例 |
|
|
222
|
+
|------|------|
|
|
223
|
+
| `@NotNull` | `@NotNull(message = "不能为空")` |
|
|
224
|
+
| `@NotBlank` | `@NotBlank(message = "名称不能为空")` |
|
|
225
|
+
| `@NotEmpty` | `@NotEmpty(message = "列表不能为空")` |
|
|
226
|
+
| `@Size` | `@Size(min = 1, max = 100)` |
|
|
227
|
+
| `@DecimalMin` | `@DecimalMin(value = "0.01")` |
|
|
228
|
+
| `@Pattern` | `@Pattern(regexp = "^1[3-9]\\d{9}$")` |
|
|
229
|
+
|
|
230
|
+
### EasyExcel
|
|
231
|
+
|
|
232
|
+
| 注解 | 示例 |
|
|
233
|
+
|------|------|
|
|
234
|
+
| `@ExcelProperty(value = "列名", order = 1)` | 列名和顺序 |
|
|
235
|
+
| `@ColumnWidth(15)` | 列宽 |
|
|
236
|
+
| `@ExcelIgnore` | 忽略导出 |
|
|
237
|
+
| `converter = CustomNumberConverter.class` | 金额转换器 |
|