ai-engineering-init 1.3.4 → 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 +2 -0
- package/.claude/settings.json +3 -3
- package/.claude/skills/add-skill/SKILL.md +79 -32
- 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 -365
- package/.claude/skills/leniu-report-customization/references/table-fields.md +93 -0
- package/.claude/skills/leniu-report-standard-customization/SKILL.md +111 -334
- 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 +79 -32
- 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 -365
- package/.codex/skills/leniu-report-customization/references/table-fields.md +93 -0
- package/.codex/skills/leniu-report-standard-customization/SKILL.md +111 -334
- 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/skills/add-skill/SKILL.md +79 -32
- 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 -365
- package/.cursor/skills/leniu-report-customization/references/table-fields.md +93 -0
- package/.cursor/skills/leniu-report-standard-customization/SKILL.md +111 -334
- 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/package.json +1 -1
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# OSS 数据库实体类定义
|
|
2
|
+
|
|
3
|
+
## SysOss 实体
|
|
4
|
+
|
|
5
|
+
```java
|
|
6
|
+
@Data
|
|
7
|
+
@EqualsAndHashCode(callSuper = true)
|
|
8
|
+
@TableName("sys_oss")
|
|
9
|
+
public class SysOss extends TenantEntity {
|
|
10
|
+
|
|
11
|
+
@TableId(value = "oss_id")
|
|
12
|
+
private Long ossId;
|
|
13
|
+
|
|
14
|
+
private String fileName; // OSS对象键
|
|
15
|
+
private String originalName; // 原始文件名
|
|
16
|
+
private String fileSuffix; // 后缀名(如 .jpg)
|
|
17
|
+
private String url; // URL地址
|
|
18
|
+
private String ext1; // 扩展字段(JSON)
|
|
19
|
+
private String service; // 服务商标识
|
|
20
|
+
|
|
21
|
+
// 继承自 TenantEntity: tenantId, createTime, createBy, updateTime, updateBy, delFlag
|
|
22
|
+
}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## SysOssVo 视图对象
|
|
26
|
+
|
|
27
|
+
```java
|
|
28
|
+
@Data
|
|
29
|
+
@AutoMapper(target = SysOss.class)
|
|
30
|
+
public class SysOssVo implements Serializable {
|
|
31
|
+
|
|
32
|
+
private Long ossId;
|
|
33
|
+
private String fileName;
|
|
34
|
+
private String originalName;
|
|
35
|
+
private String fileSuffix;
|
|
36
|
+
private String url;
|
|
37
|
+
private String ext1;
|
|
38
|
+
private Date createTime;
|
|
39
|
+
private Long createBy;
|
|
40
|
+
|
|
41
|
+
@Translation(type = TransConstant.USER_ID_TO_NAME, mapper = "createBy")
|
|
42
|
+
private String createByName; // 上传人名称(自动翻译)
|
|
43
|
+
|
|
44
|
+
private String service;
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## SysOssBo 业务对象
|
|
49
|
+
|
|
50
|
+
```java
|
|
51
|
+
@Data
|
|
52
|
+
@EqualsAndHashCode(callSuper = true)
|
|
53
|
+
@AutoMapper(target = SysOss.class, reverseConvertGenerate = false)
|
|
54
|
+
public class SysOssBo extends BaseEntity {
|
|
55
|
+
|
|
56
|
+
private Long ossId;
|
|
57
|
+
private String fileName;
|
|
58
|
+
private String originalName;
|
|
59
|
+
private String fileSuffix;
|
|
60
|
+
private String url;
|
|
61
|
+
private String ext1;
|
|
62
|
+
private String service;
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## SysOssExt 扩展信息对象
|
|
67
|
+
|
|
68
|
+
> 以 JSON 字符串形式存储在 ext1 字段中
|
|
69
|
+
|
|
70
|
+
```java
|
|
71
|
+
@Data
|
|
72
|
+
public class SysOssExt implements Serializable {
|
|
73
|
+
|
|
74
|
+
private String bizType; // 业务类型(avatar、report等)
|
|
75
|
+
private Long fileSize; // 文件大小(字节)
|
|
76
|
+
private String contentType; // MIME类型
|
|
77
|
+
private String source; // 来源标识
|
|
78
|
+
private String uploadIp; // 上传IP
|
|
79
|
+
private String remark; // 备注
|
|
80
|
+
private List<String> tags; // 标签
|
|
81
|
+
private String refId; // 绑定业务ID
|
|
82
|
+
private String refType; // 绑定业务类型
|
|
83
|
+
private Boolean isTemp; // 是否临时文件
|
|
84
|
+
private String md5; // 文件MD5值
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## OssProperties 配置类
|
|
89
|
+
|
|
90
|
+
```java
|
|
91
|
+
@Data
|
|
92
|
+
public class OssProperties {
|
|
93
|
+
|
|
94
|
+
private String tenantId;
|
|
95
|
+
private String endpoint; // 访问站点
|
|
96
|
+
private String domain; // 自定义域名
|
|
97
|
+
private String prefix; // 文件前缀
|
|
98
|
+
private String accessKey;
|
|
99
|
+
private String secretKey;
|
|
100
|
+
private String bucketName;
|
|
101
|
+
private String region;
|
|
102
|
+
private String isHttps; // Y/N
|
|
103
|
+
private String accessPolicy; // 0-private, 1-public, 2-custom
|
|
104
|
+
}
|
|
105
|
+
```
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# SysOssServiceImpl 完整实现
|
|
2
|
+
|
|
3
|
+
> 位置:`ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysOssServiceImpl.java`
|
|
4
|
+
|
|
5
|
+
## 文件上传
|
|
6
|
+
|
|
7
|
+
```java
|
|
8
|
+
@RequiredArgsConstructor
|
|
9
|
+
@Service
|
|
10
|
+
public class SysOssServiceImpl implements ISysOssService {
|
|
11
|
+
|
|
12
|
+
private final SysOssMapper baseMapper;
|
|
13
|
+
|
|
14
|
+
@Override
|
|
15
|
+
public SysOssVo upload(MultipartFile file) {
|
|
16
|
+
if (ObjectUtil.isNull(file) || file.isEmpty()) {
|
|
17
|
+
throw new ServiceException("上传文件不能为空");
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
String originalfileName = file.getOriginalFilename();
|
|
21
|
+
String suffix = StringUtils.substring(originalfileName,
|
|
22
|
+
originalfileName.lastIndexOf("."),
|
|
23
|
+
originalfileName.length());
|
|
24
|
+
|
|
25
|
+
OssClient storage = OssFactory.instance();
|
|
26
|
+
|
|
27
|
+
UploadResult uploadResult;
|
|
28
|
+
try {
|
|
29
|
+
uploadResult = storage.uploadSuffix(file.getBytes(), suffix, file.getContentType());
|
|
30
|
+
} catch (IOException e) {
|
|
31
|
+
throw new ServiceException(e.getMessage());
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
SysOssExt ext1 = new SysOssExt();
|
|
35
|
+
ext1.setFileSize(file.getSize());
|
|
36
|
+
ext1.setContentType(file.getContentType());
|
|
37
|
+
|
|
38
|
+
return buildResultEntity(originalfileName, suffix,
|
|
39
|
+
storage.getConfigKey(), uploadResult, ext1);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
private SysOssVo buildResultEntity(String originalfileName, String suffix,
|
|
43
|
+
String configKey, UploadResult uploadResult, SysOssExt ext1) {
|
|
44
|
+
|
|
45
|
+
SysOss oss = new SysOss();
|
|
46
|
+
oss.setUrl(uploadResult.getUrl());
|
|
47
|
+
oss.setFileSuffix(suffix);
|
|
48
|
+
oss.setFileName(uploadResult.getFilename()); // 小写 'n'
|
|
49
|
+
oss.setOriginalName(originalfileName);
|
|
50
|
+
oss.setService(configKey);
|
|
51
|
+
oss.setExt1(JsonUtils.toJsonString(ext1));
|
|
52
|
+
|
|
53
|
+
baseMapper.insert(oss);
|
|
54
|
+
SysOssVo sysOssVo = MapstructUtils.convert(oss, SysOssVo.class);
|
|
55
|
+
return this.matchingUrl(sysOssVo);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## 文件下载
|
|
61
|
+
|
|
62
|
+
```java
|
|
63
|
+
@Override
|
|
64
|
+
public void download(Long ossId, HttpServletResponse response) throws IOException {
|
|
65
|
+
SysOssVo sysOss = SpringUtils.getAopProxy(this).getById(ossId);
|
|
66
|
+
if (ObjectUtil.isNull(sysOss)) {
|
|
67
|
+
throw new ServiceException("文件数据不存在!");
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
FileUtils.setAttachmentResponseHeader(response, sysOss.getOriginalName());
|
|
71
|
+
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE + "; charset=UTF-8");
|
|
72
|
+
|
|
73
|
+
OssClient storage = OssFactory.instance(sysOss.getService());
|
|
74
|
+
storage.download(sysOss.getFileName(),
|
|
75
|
+
response.getOutputStream(),
|
|
76
|
+
response::setContentLengthLong);
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## 文件删除
|
|
81
|
+
|
|
82
|
+
```java
|
|
83
|
+
@Override
|
|
84
|
+
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
|
85
|
+
List<SysOss> list = baseMapper.selectByIds(ids);
|
|
86
|
+
for (SysOss sysOss : list) {
|
|
87
|
+
OssClient storage = OssFactory.instance(sysOss.getService());
|
|
88
|
+
storage.delete(sysOss.getUrl());
|
|
89
|
+
}
|
|
90
|
+
return baseMapper.deleteByIds(ids) > 0;
|
|
91
|
+
}
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## 私有桶预签名URL
|
|
95
|
+
|
|
96
|
+
```java
|
|
97
|
+
private SysOssVo matchingUrl(SysOssVo oss) {
|
|
98
|
+
OssClient storage = OssFactory.instance(oss.getService());
|
|
99
|
+
if (AccessPolicyType.PRIVATE == storage.getAccessPolicy()) {
|
|
100
|
+
oss.setUrl(storage.createPresignedGetUrl(oss.getFileName(), Duration.ofSeconds(120)));
|
|
101
|
+
}
|
|
102
|
+
return oss;
|
|
103
|
+
}
|
|
104
|
+
```
|
|
@@ -75,11 +75,23 @@ git commit -m "feat(system): 新增xxx功能"
|
|
|
75
75
|
### 不要提交的文件
|
|
76
76
|
|
|
77
77
|
```bash
|
|
78
|
-
# ❌
|
|
78
|
+
# ❌ 团队项目配置文件(绝对不提交,包含数据库/中间件/环境信息)
|
|
79
|
+
core-base/src/main/resources/bootstrap.yml
|
|
80
|
+
core-base/src/main/resources/bootstrap-dev.yml
|
|
81
|
+
core-base/src/main/resources/ConfigSource.properties
|
|
82
|
+
core-base/src/main/resources/license.dat
|
|
83
|
+
core-base/src/main/resources/logback-spring.xml
|
|
84
|
+
core-base/src/main/resources/message_*.properties
|
|
85
|
+
|
|
86
|
+
# ❌ 通用配置文件(绝对不提交)
|
|
79
87
|
ruoyi-admin/src/main/resources/application.yml
|
|
80
88
|
ruoyi-admin/src/main/resources/application-*.yml
|
|
81
89
|
ruoyi-common/**/resources/*.yml
|
|
82
90
|
|
|
91
|
+
# ❌ 测试/迁移基础设施文件(包含本地数据源配置,不提交)
|
|
92
|
+
**/WebMvcTestConfig.java
|
|
93
|
+
**/DataSourceMigration.java
|
|
94
|
+
|
|
83
95
|
# ❌ IDE 配置
|
|
84
96
|
.idea/
|
|
85
97
|
.vscode/
|
|
@@ -335,14 +347,15 @@ git log --author="作者名"
|
|
|
335
347
|
|
|
336
348
|
1. **不要强制推送到主分支**
|
|
337
349
|
```bash
|
|
338
|
-
# ❌
|
|
339
|
-
git push --force origin
|
|
350
|
+
# ❌ 禁止(团队主分支为 master)
|
|
351
|
+
git push --force origin master
|
|
352
|
+
git push --force origin main
|
|
340
353
|
```
|
|
341
354
|
|
|
342
355
|
2. **不要在主分支直接开发**
|
|
343
356
|
```bash
|
|
344
|
-
# ❌
|
|
345
|
-
git checkout
|
|
357
|
+
# ❌ 禁止(团队主分支为 master,不在此分支直接提交)
|
|
358
|
+
git checkout master
|
|
346
359
|
# 直接修改代码...
|
|
347
360
|
```
|
|
348
361
|
|
|
@@ -352,8 +365,17 @@ git log --author="作者名"
|
|
|
352
365
|
application.yml
|
|
353
366
|
application-dev.yml
|
|
354
367
|
application-prod.yml
|
|
368
|
+
bootstrap.yml
|
|
369
|
+
bootstrap-dev.yml
|
|
370
|
+
ConfigSource.properties
|
|
371
|
+
license.dat
|
|
372
|
+
logback-spring.xml
|
|
373
|
+
message_*.properties
|
|
355
374
|
credentials.json
|
|
356
375
|
password.txt
|
|
376
|
+
# ❌ 禁止提交(包含本地数据源/测试环境配置)
|
|
377
|
+
WebMvcTestConfig.java
|
|
378
|
+
DataSourceMigration.java
|
|
357
379
|
```
|
|
358
380
|
|
|
359
381
|
4. **不要自动 push(除非用户明确要求)**
|