ai-engineering-init 1.14.1 → 1.14.3
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/commands/release.md +109 -0
- package/.claude/hooks/skill-forced-eval.js +1 -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/leniu-crud-development/SKILL.md +26 -7
- package/.claude/skills/leniu-java-mybatis/SKILL.md +25 -16
- package/.claude/skills/leniu-report-scenario/SKILL.md +508 -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/report-tables.md +162 -0
- package/.codex/skills/leniu-crud-development/SKILL.md +26 -7
- package/.codex/skills/leniu-java-mybatis/SKILL.md +25 -16
- package/.codex/skills/leniu-report-scenario/SKILL.md +508 -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/report-tables.md +162 -0
- package/.cursor/hooks/cursor-skill-eval.js +4 -29
- package/.cursor/rules/skill-activation.mdc +1 -7
- package/.cursor/skills/leniu-crud-development/SKILL.md +26 -7
- package/.cursor/skills/leniu-java-mybatis/SKILL.md +25 -16
- package/.cursor/skills/leniu-report-scenario/SKILL.md +508 -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/report-tables.md +162 -0
- package/bin/index.js +1 -1
- package/package.json +1 -1
|
@@ -87,10 +87,6 @@ const skillMap = [
|
|
|
87
87
|
name: 'leniu-java-concurrent',
|
|
88
88
|
keywords: ['leniu-并发', 'leniu-CompletableFuture', 'leniu-线程池', 'leniu-分布式锁']
|
|
89
89
|
},
|
|
90
|
-
{
|
|
91
|
-
name: 'leniu-java-export',
|
|
92
|
-
keywords: ['leniu-导出', 'leniu-Export', 'leniu-Excel导出', 'leniu-异步导出', 'leniu-@ExcelProperty']
|
|
93
|
-
},
|
|
94
90
|
{
|
|
95
91
|
name: 'leniu-java-logging',
|
|
96
92
|
keywords: ['leniu-日志', 'leniu-@Slf4j', 'leniu-log.info', 'leniu-log.error']
|
|
@@ -104,16 +100,10 @@ const skillMap = [
|
|
|
104
100
|
keywords: ['leniu-定时任务', 'leniu-XXL-Job', 'leniu-@XxlJob', 'leniu-TenantLoader']
|
|
105
101
|
},
|
|
106
102
|
{
|
|
107
|
-
name: 'leniu-
|
|
108
|
-
keywords: ['
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
name: 'leniu-java-amount-handling',
|
|
112
|
-
keywords: ['leniu-金额', 'leniu-分转元', 'leniu-元转分', 'leniu-Long金额', 'amountFen', 'amountYuan']
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
name: 'leniu-java-report-query-param',
|
|
116
|
-
keywords: ['leniu-报表查询', 'leniu-Param类', 'leniu-分页参数', 'leniu-时间范围', 'ReportBaseParam']
|
|
103
|
+
name: 'leniu-report-scenario',
|
|
104
|
+
keywords: ['报表', '报表开发', '报表查询', '报表导出', '合计行', 'totalLine', '汇总报表', '定制报表',
|
|
105
|
+
'report_order_info', '金额处理', '分转元', '餐次', 'mealtime', 'ReportBaseTotalVO',
|
|
106
|
+
'CustomNumberConverter', 'ExcelProperty', 'ReportOrderConsumeService', 'ReportBaseParam']
|
|
117
107
|
},
|
|
118
108
|
{
|
|
119
109
|
name: 'leniu-error-handler',
|
|
@@ -158,10 +148,6 @@ const skillMap = [
|
|
|
158
148
|
name: 'leniu-marketing-recharge-rule-customizer',
|
|
159
149
|
keywords: ['营销充值', '充值规则', 'recharge规则', '满赠规则']
|
|
160
150
|
},
|
|
161
|
-
{
|
|
162
|
-
name: 'leniu-mealtime',
|
|
163
|
-
keywords: ['餐次', '早餐', '午餐', '下午茶', '晚餐', '夜宵', 'mealtimeTypes']
|
|
164
|
-
},
|
|
165
151
|
{
|
|
166
152
|
name: 'leniu-customization-location',
|
|
167
153
|
keywords: ['定制开发', '定制代码位置', 'Dz前缀', 'leniu-yunshitang', 'dz_表名', '定制仓库',
|
|
@@ -367,17 +353,6 @@ const skillMap = [
|
|
|
367
353
|
keywords: ['leniu-头脑风暴', '云食堂方案', '云食堂设计', '云食堂功能规划', 'leniu-方案设计',
|
|
368
354
|
'云食堂怎么设计', '云食堂可行性']
|
|
369
355
|
},
|
|
370
|
-
{
|
|
371
|
-
name: 'leniu-report-customization',
|
|
372
|
-
keywords: ['定制报表', 'report_order_info', 'report_order_detail', 'report_account_flow',
|
|
373
|
-
'退款汇总', '消费金额统计', '订单报表', '流水报表', '汇总报表']
|
|
374
|
-
},
|
|
375
|
-
{
|
|
376
|
-
name: 'leniu-report-standard-customization',
|
|
377
|
-
keywords: ['标准版报表', 'core-report', 'report_refund', 'report_refund_detail',
|
|
378
|
-
'经营分析', '营业额分析', '用户活跃度', '菜品排行', '操作员统计', '账户日结',
|
|
379
|
-
'ReportOrderConsumeService', 'ReportAccountConsumeService']
|
|
380
|
-
},
|
|
381
356
|
{
|
|
382
357
|
name: 'mysql-debug',
|
|
383
358
|
keywords: ['mysql查询', '查数据库', '查表', '执行SQL', '数据库排查', '验证数据',
|
|
@@ -17,13 +17,10 @@ alwaysApply: true
|
|
|
17
17
|
| leniu-Entity/leniu-VO/leniu-DTO/@TableName/@TableField | `.cursor/skills/leniu-java-entity/SKILL.md` |
|
|
18
18
|
| leniu-MyBatis/leniu-Mapper/LambdaQueryWrapper/leniu-XML | `.cursor/skills/leniu-java-mybatis/SKILL.md` |
|
|
19
19
|
| leniu-并发/CompletableFuture/leniu-线程池 | `.cursor/skills/leniu-java-concurrent/SKILL.md` |
|
|
20
|
-
| leniu-导出/leniu-Excel导出/leniu-@ExcelProperty | `.cursor/skills/leniu-java-export/SKILL.md` |
|
|
21
20
|
| leniu-日志/@Slf4j/leniu-log.info | `.cursor/skills/leniu-java-logging/SKILL.md` |
|
|
22
21
|
| leniu-消息队列/leniu-MQ/MqUtil/@MqConsumer | `.cursor/skills/leniu-java-mq/SKILL.md` |
|
|
23
22
|
| leniu-定时任务/leniu-XXL-Job/@XxlJob | `.cursor/skills/leniu-java-task/SKILL.md` |
|
|
24
|
-
|
|
|
25
|
-
| leniu-金额/leniu-分转元/leniu-元转分/amountFen | `.cursor/skills/leniu-java-amount-handling/SKILL.md` |
|
|
26
|
-
| leniu-报表查询/ReportBaseParam/leniu-分页参数 | `.cursor/skills/leniu-java-report-query-param/SKILL.md` |
|
|
23
|
+
| 报表/报表开发/报表查询/报表导出/合计行/totalLine/金额处理/分转元/餐次/mealtime/ReportBaseTotalVO/CustomNumberConverter | `.cursor/skills/leniu-report-scenario/SKILL.md` |
|
|
27
24
|
| leniu-异常/LeException/leniu-全局异常/leniu-I18n | `.cursor/skills/leniu-error-handler/SKILL.md` |
|
|
28
25
|
| leniu-注解/@RequiresAuthentication/@Validated | `.cursor/skills/leniu-backend-annotations/SKILL.md` |
|
|
29
26
|
| leniu-工具类/leniu-BeanUtil/leniu-StrUtil/LeBeanUtil | `.cursor/skills/leniu-utils-toolkit/SKILL.md` |
|
|
@@ -34,9 +31,6 @@ alwaysApply: true
|
|
|
34
31
|
| leniu-规范/leniu-禁止/leniu-命名/leniu-代码风格 | `.cursor/skills/leniu-code-patterns/SKILL.md` |
|
|
35
32
|
| 营销计费/计费规则/RulePriceHandler | `.cursor/skills/leniu-marketing-price-rule-customizer/SKILL.md` |
|
|
36
33
|
| 营销充值/充值规则/RuleRechargeHandler/满赠规则 | `.cursor/skills/leniu-marketing-recharge-rule-customizer/SKILL.md` |
|
|
37
|
-
| 餐次/早餐/午餐/下午茶/晚餐/夜宵/mealtimeTypes | `.cursor/skills/leniu-mealtime/SKILL.md` |
|
|
38
|
-
| 定制报表/汇总报表/report_order_info/v5.29报表/batchConsume/consumeType | `.cursor/skills/leniu-report-customization/SKILL.md` |
|
|
39
|
-
| 标准版报表/core-report/report_refund/经营分析/fix重算/账户日结/菜品排行 | `.cursor/skills/leniu-report-standard-customization/SKILL.md` |
|
|
40
34
|
|
|
41
35
|
### OpenSpec 工作流技能
|
|
42
36
|
|
|
@@ -39,6 +39,7 @@ description: |
|
|
|
39
39
|
| 架构 | Controller -> Business -> Service -> Mapper(四层) |
|
|
40
40
|
| 无 DAO 层 | Service 直接注入 Mapper |
|
|
41
41
|
| 对象转换 | `BeanUtil.copyProperties()` (Hutool) |
|
|
42
|
+
| Service 模式 | **两种并存**:简单 CRUD 继承 `ServiceImpl`;业务聚合直接 `@Service` |
|
|
42
43
|
| Entity 基类 | 无基类,自定义审计字段 |
|
|
43
44
|
| 请求封装 | `LeRequest<T>` |
|
|
44
45
|
| 响应封装 | `Page<T>` / `LeResponse<T>` / `void` |
|
|
@@ -110,19 +111,38 @@ private LocalDateTime uptime;
|
|
|
110
111
|
private Integer delFlag; // 1=删除, 2=正常
|
|
111
112
|
```
|
|
112
113
|
|
|
113
|
-
### Service
|
|
114
|
+
### Service 两种模式
|
|
114
115
|
|
|
116
|
+
项目中存在两种 Service 模式,根据业务复杂度选择:
|
|
117
|
+
|
|
118
|
+
**模式 A:简单 CRUD Service**(适用于单表操作,利用 MyBatis-Plus 内置方法)
|
|
115
119
|
```java
|
|
120
|
+
// 接口
|
|
121
|
+
public interface XxxService extends IService<XxxEntity> { }
|
|
122
|
+
|
|
123
|
+
// 实现
|
|
116
124
|
@Slf4j
|
|
117
125
|
@Service
|
|
118
|
-
public class XxxServiceImpl implements XxxService {
|
|
119
|
-
|
|
120
|
-
|
|
126
|
+
public class XxxServiceImpl extends ServiceImpl<XxxMapper, XxxEntity> implements XxxService {
|
|
127
|
+
// 继承 ServiceImpl 获得 save/updateById/removeById/page 等内置方法
|
|
128
|
+
// 通过 this.baseMapper 访问 Mapper(父类提供)
|
|
129
|
+
}
|
|
130
|
+
```
|
|
121
131
|
|
|
122
|
-
|
|
132
|
+
**模式 B:业务聚合 Service**(适用于跨表操作、复杂业务编排)
|
|
133
|
+
```java
|
|
134
|
+
@Slf4j
|
|
135
|
+
@Service
|
|
136
|
+
public class XxxService {
|
|
137
|
+
@Autowired
|
|
138
|
+
private XxxMapper xxxMapper; // 直接注入 Mapper,无 DAO 层
|
|
139
|
+
@Autowired
|
|
140
|
+
private YyyMapper yyyMapper; // 可注入多个 Mapper
|
|
123
141
|
}
|
|
124
142
|
```
|
|
125
143
|
|
|
144
|
+
**选择建议**:新建简单单表 CRUD 用模式 A;涉及多表联查、报表、业务编排用模式 B。
|
|
145
|
+
|
|
126
146
|
### Controller 请求封装
|
|
127
147
|
|
|
128
148
|
```java
|
|
@@ -366,7 +386,6 @@ private String createBy; // -> crby
|
|
|
366
386
|
entity.setDelFlag(0); // -> setDelFlag(2) 表示正常
|
|
367
387
|
throw new ServiceException("..."); // -> throw new LeException("...")
|
|
368
388
|
MapstructUtils.convert(src, Dst.class); // -> BeanUtil.copyProperties(src, Dst.class)
|
|
369
|
-
extends ServiceImpl<XxxMapper, Xxx> // -> implements XxxService(不继承)
|
|
370
389
|
@Resource private XxxDao xxxDao; // -> @Resource private XxxMapper xxxMapper
|
|
371
390
|
// XML 放 resources/mapper/ // -> 与 Java 同目录
|
|
372
391
|
return null; // -> return Collections.emptyList()
|
|
@@ -377,7 +396,7 @@ return null; // -> return Collections.emptyList()
|
|
|
377
396
|
## 生成前检查清单
|
|
378
397
|
|
|
379
398
|
- [ ] 包名 `net.xnzn.core.*`
|
|
380
|
-
- [ ] Service
|
|
399
|
+
- [ ] Service 模式选择:简单 CRUD 用模式 A(继承 ServiceImpl);业务聚合用模式 B(直接 @Service)
|
|
381
400
|
- [ ] Service 直接注入 Mapper(无 DAO)
|
|
382
401
|
- [ ] 审计字段 crby/crtime/upby/uptime
|
|
383
402
|
- [ ] delFlag: 1=删除, 2=正常
|
|
@@ -22,7 +22,7 @@ description: |
|
|
|
22
22
|
| XML 位置 | **与 Mapper 接口同目录**(非 `resources/mapper/`) |
|
|
23
23
|
| 分页 | PageHelper → `PageMethod.startPage(PageDTO)` → `PageVO.of(list)` |
|
|
24
24
|
| 逻辑删除 | **1=删除,2=正常**(与 RuoYi 相反) |
|
|
25
|
-
| Service |
|
|
25
|
+
| Service | **两种模式并存**:简单 CRUD 继承 `ServiceImpl`(`this.baseMapper`);业务聚合直接 `@Service`(`@Autowired XxxMapper xxxMapper`) |
|
|
26
26
|
| 循环依赖 | 跨模块依赖用 `@Autowired @Lazy` |
|
|
27
27
|
|
|
28
28
|
## Mapper 接口模板
|
|
@@ -147,28 +147,36 @@ List<XxxEntity> list = mapper.selectList(
|
|
|
147
147
|
|
|
148
148
|
## Service 注入规范
|
|
149
149
|
|
|
150
|
+
项目中 Service 有两种模式,Mapper 字段名也不统一——参考周围已有代码的风格即可。
|
|
151
|
+
|
|
152
|
+
**模式 A:继承 ServiceImpl(简单 CRUD)**
|
|
153
|
+
```java
|
|
154
|
+
@Service
|
|
155
|
+
public class XxxServiceImpl extends ServiceImpl<XxxMapper, XxxEntity> implements XxxService {
|
|
156
|
+
// 通过 this.baseMapper 访问 Mapper(父类自动注入)
|
|
157
|
+
public boolean exists(String macOrderId) {
|
|
158
|
+
return this.baseMapper.existsOne(
|
|
159
|
+
Wrappers.lambdaQuery(XxxEntity.class)
|
|
160
|
+
.eq(XxxEntity::getMacOrderId, macOrderId)
|
|
161
|
+
.eq(XxxEntity::getDelFlag, 2)
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
**模式 B:直接 @Service(业务聚合)**
|
|
150
168
|
```java
|
|
151
169
|
@Slf4j
|
|
152
170
|
@Service
|
|
153
|
-
@Validated
|
|
154
171
|
public class XxxService {
|
|
155
|
-
|
|
156
172
|
@Autowired
|
|
157
|
-
private XxxMapper
|
|
173
|
+
private XxxMapper xxxMapper; // 字段名跟随 Mapper 类名
|
|
158
174
|
|
|
159
175
|
@Autowired @Lazy
|
|
160
|
-
private
|
|
176
|
+
private YyyService yyyService; // 跨模块用 @Lazy
|
|
161
177
|
|
|
162
178
|
public XxxEntity getOne(Long id) {
|
|
163
|
-
return
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
public boolean exists(String macOrderId) {
|
|
167
|
-
return baseMapper.existsOne(
|
|
168
|
-
Wrappers.lambdaQuery(XxxEntity.class)
|
|
169
|
-
.eq(XxxEntity::getMacOrderId, macOrderId)
|
|
170
|
-
.eq(XxxEntity::getDelFlag, 2)
|
|
171
|
-
);
|
|
179
|
+
return xxxMapper.selectById(id);
|
|
172
180
|
}
|
|
173
181
|
}
|
|
174
182
|
```
|
|
@@ -250,8 +258,9 @@ wrapper.eq(XxxEntity::getDelFlag, 0);
|
|
|
250
258
|
// ❌ MapstructUtils(用 BeanUtil.copyProperties)
|
|
251
259
|
MapstructUtils.convert(source, Target.class);
|
|
252
260
|
|
|
253
|
-
// ❌ Service
|
|
254
|
-
|
|
261
|
+
// ❌ 业务聚合 Service 不要继承 IService / ServiceImpl(简单 CRUD Service 可以继承)
|
|
262
|
+
// 错误:在报表/业务编排 Service 中继承 ServiceImpl
|
|
263
|
+
// 正确:简单单表 CRUD 可以继承 ServiceImpl,复杂业务直接 @Service
|
|
255
264
|
```
|
|
256
265
|
|
|
257
266
|
## XML 文件位置
|