midway-fatcms 0.0.4 → 0.0.6

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 (126) hide show
  1. package/README.md +635 -352
  2. package/dist/controller/manage/CrudStandardDesignApi.d.ts +0 -2
  3. package/dist/controller/manage/CrudStandardDesignApi.js +11 -85
  4. package/dist/index.d.ts +2 -0
  5. package/dist/index.js +2 -0
  6. package/dist/libs/crud-pro/CrudPro.d.ts +9 -1
  7. package/dist/libs/crud-pro/CrudPro.js +15 -0
  8. package/dist/libs/crud-pro/README.md +809 -0
  9. package/dist/libs/crud-pro/README_FUNC.md +193 -0
  10. package/dist/libs/crud-pro/exceptions.d.ts +2 -0
  11. package/dist/libs/crud-pro/exceptions.js +2 -0
  12. package/dist/libs/crud-pro/interfaces.d.ts +34 -1
  13. package/dist/libs/crud-pro/models/ExecuteContext.d.ts +3 -3
  14. package/dist/libs/crud-pro/models/ExecuteContext.js +2 -0
  15. package/dist/libs/crud-pro/models/RequestModel.d.ts +41 -1
  16. package/dist/libs/crud-pro/models/RequestModel.js +103 -39
  17. package/dist/libs/crud-pro/models/ResModel.d.ts +6 -4
  18. package/dist/libs/crud-pro/models/ServiceHub.d.ts +1 -0
  19. package/dist/libs/crud-pro/models/keys.d.ts +6 -1
  20. package/dist/libs/crud-pro/models/keys.js +5 -0
  21. package/dist/libs/crud-pro/services/CrudProDataTypeConvertService.d.ts +52 -0
  22. package/dist/libs/crud-pro/services/CrudProDataTypeConvertService.js +158 -0
  23. package/dist/libs/crud-pro/services/CrudProExecuteSqlService.js +20 -1
  24. package/dist/libs/crud-pro/services/CrudProFieldValidateService.d.ts +7 -0
  25. package/dist/libs/crud-pro/services/CrudProFieldValidateService.js +32 -0
  26. package/dist/libs/crud-pro/services/CrudProGenSqlService.d.ts +13 -0
  27. package/dist/libs/crud-pro/services/CrudProGenSqlService.js +44 -7
  28. package/dist/libs/crud-pro/services/CrudProOriginToExecuteSql.d.ts +43 -0
  29. package/dist/libs/crud-pro/services/CrudProOriginToExecuteSql.js +132 -1
  30. package/dist/libs/crud-pro/services/CrudProTableMetaService.d.ts +15 -1
  31. package/dist/libs/crud-pro/services/CrudProTableMetaService.js +107 -0
  32. package/dist/libs/crud-pro/services/CurdProServiceHub.d.ts +5 -1
  33. package/dist/libs/crud-pro/services/CurdProServiceHub.js +11 -0
  34. package/dist/libs/crud-pro/utils/DateTimeUtils.d.ts +1 -0
  35. package/dist/libs/crud-pro/utils/DateTimeUtils.js +3 -0
  36. package/dist/libs/crud-pro/utils/MixinUtils.d.ts +32 -0
  37. package/dist/libs/crud-pro/utils/MixinUtils.js +85 -1
  38. package/dist/libs/crud-pro/utils/ValidateUtils.js +1 -1
  39. package/dist/libs/crud-sharding/ROUTING_LOGIC.md +944 -0
  40. package/dist/libs/crud-sharding/ShardingConfig.d.ts +218 -0
  41. package/dist/libs/crud-sharding/ShardingConfig.js +32 -0
  42. package/dist/libs/crud-sharding/ShardingCountCache.d.ts +69 -0
  43. package/dist/libs/crud-sharding/ShardingCountCache.js +160 -0
  44. package/dist/libs/crud-sharding/ShardingCrudPro.d.ts +363 -0
  45. package/dist/libs/crud-sharding/ShardingCrudPro.js +699 -0
  46. package/dist/libs/crud-sharding/ShardingMerger.d.ts +130 -0
  47. package/dist/libs/crud-sharding/ShardingMerger.js +280 -0
  48. package/dist/libs/crud-sharding/ShardingRouter.d.ts +69 -0
  49. package/dist/libs/crud-sharding/ShardingRouter.js +377 -0
  50. package/dist/libs/crud-sharding/ShardingTableCreator.d.ts +146 -0
  51. package/dist/libs/crud-sharding/ShardingTableCreator.js +805 -0
  52. package/dist/libs/crud-sharding/ShardingUtils.d.ts +38 -0
  53. package/dist/libs/crud-sharding/ShardingUtils.js +77 -0
  54. package/dist/libs/crud-sharding/index.d.ts +45 -0
  55. package/dist/libs/crud-sharding/index.js +55 -0
  56. package/dist/models/StandardColumns.d.ts +71 -0
  57. package/dist/models/StandardColumns.js +28 -0
  58. package/dist/service/SysAppService.js +2 -2
  59. package/dist/service/SysConfigService.js +1 -1
  60. package/dist/service/SysDictDataService.js +2 -2
  61. package/dist/service/SysMenuService.js +1 -1
  62. package/dist/service/UserAccountService.d.ts +1 -1
  63. package/dist/service/crudstd/CrudStdService.d.ts +0 -1
  64. package/dist/service/crudstd/CrudStdService.js +0 -27
  65. package/dist/service/curd/CrudProQuick.d.ts +134 -4
  66. package/dist/service/curd/CrudProQuick.js +155 -3
  67. package/dist/service/curd/CurdMixService.d.ts +2 -1
  68. package/dist/service/curd/CurdMixService.js +5 -1
  69. package/dist/service/curd/CurdProService.d.ts +44 -2
  70. package/dist/service/curd/CurdProService.js +53 -1
  71. package/dist/service/curd/README.md +1001 -0
  72. package/dist/service/curd/fixSoftDelete.d.ts +14 -0
  73. package/dist/service/curd/fixSoftDelete.js +29 -11
  74. package/dist/service/flow/FlowConfigService.js +1 -1
  75. package/dist/service/flow/FlowInstanceCrudService.js +1 -1
  76. package/package.json +3 -1
  77. package/src/controller/gateway/AsyncTaskController.ts +1 -1
  78. package/src/controller/manage/CrudStandardDesignApi.ts +16 -100
  79. package/src/index.ts +3 -0
  80. package/src/libs/crud-pro/CrudPro.ts +19 -1
  81. package/src/libs/crud-pro/README.md +809 -0
  82. package/src/libs/crud-pro/README_FUNC.md +193 -0
  83. package/src/libs/crud-pro/exceptions.ts +2 -0
  84. package/src/libs/crud-pro/interfaces.ts +38 -1
  85. package/src/libs/crud-pro/models/ExecuteContext.ts +6 -3
  86. package/src/libs/crud-pro/models/RequestModel.ts +108 -44
  87. package/src/libs/crud-pro/models/ResModel.ts +10 -4
  88. package/src/libs/crud-pro/models/ServiceHub.ts +2 -0
  89. package/src/libs/crud-pro/models/keys.ts +5 -0
  90. package/src/libs/crud-pro/services/CrudProDataTypeConvertService.ts +171 -0
  91. package/src/libs/crud-pro/services/CrudProExecuteSqlService.ts +24 -1
  92. package/src/libs/crud-pro/services/CrudProFieldValidateService.ts +53 -1
  93. package/src/libs/crud-pro/services/CrudProGenSqlService.ts +51 -7
  94. package/src/libs/crud-pro/services/CrudProOriginToExecuteSql.ts +159 -2
  95. package/src/libs/crud-pro/services/CrudProTableMetaService.ts +139 -1
  96. package/src/libs/crud-pro/services/CurdProServiceHub.ts +16 -1
  97. package/src/libs/crud-pro/utils/DateTimeUtils.ts +3 -0
  98. package/src/libs/crud-pro/utils/MixinUtils.ts +97 -1
  99. package/src/libs/crud-pro/utils/ValidateUtils.ts +1 -1
  100. package/src/libs/crud-sharding/ROUTING_LOGIC.md +944 -0
  101. package/src/libs/crud-sharding/ShardingConfig.ts +240 -0
  102. package/src/libs/crud-sharding/ShardingCountCache.ts +200 -0
  103. package/src/libs/crud-sharding/ShardingCrudPro.ts +856 -0
  104. package/src/libs/crud-sharding/ShardingMerger.ts +382 -0
  105. package/src/libs/crud-sharding/ShardingRouter.ts +512 -0
  106. package/src/libs/crud-sharding/ShardingTableCreator.ts +1007 -0
  107. package/src/libs/crud-sharding/ShardingUtils.ts +84 -0
  108. package/src/libs/crud-sharding/index.ts +64 -0
  109. package/src/models/StandardColumns.ts +76 -0
  110. package/src/service/FileCenterService.ts +1 -1
  111. package/src/service/SysAppService.ts +2 -2
  112. package/src/service/SysConfigService.ts +1 -1
  113. package/src/service/SysDictDataService.ts +2 -2
  114. package/src/service/SysMenuService.ts +2 -2
  115. package/src/service/WorkbenchService.ts +1 -1
  116. package/src/service/anyapi/AnyApiService.ts +1 -1
  117. package/src/service/asyncTask/AsyncTaskRunnerService.ts +1 -1
  118. package/src/service/crudstd/CrudStdService.ts +0 -32
  119. package/src/service/curd/CrudProQuick.ts +164 -5
  120. package/src/service/curd/CurdMixService.ts +7 -2
  121. package/src/service/curd/CurdProService.ts +62 -3
  122. package/src/service/curd/README.md +1001 -0
  123. package/src/service/curd/fixCfgModel.ts +1 -2
  124. package/src/service/curd/fixSoftDelete.ts +38 -16
  125. package/src/service/flow/FlowConfigService.ts +1 -1
  126. package/src/service/flow/FlowInstanceCrudService.ts +1 -1
package/README.md CHANGED
@@ -1,407 +1,690 @@
1
1
  # Midway FatCMS
2
2
 
3
- **企业级低代码/零代码开发平台**
4
-
5
- 基于 Midway.js 框架的多租户 SaaS 低代码平台,提供 API 网关、CRUD-Pro 引擎、工作流、文档管理等企业级功能。
6
-
7
- ## 项目简介
8
-
9
- Midway FatCMS 是一个功能完整的企业级低代码开发平台,旨在通过配置化的方式快速构建企业应用系统。系统核心特性包括:
10
-
11
- - **零代码 CRUD 开发**:通过配置自动生成 CRUD 接口
12
- - **动态 API 管理**:支持 SQL 查询、沙箱脚本、自定义代码三种 API 类型
13
- - **API 网关与代理**:反向代理、负载均衡、流量控制
14
- - **多租户架构**:基于域名的租户隔离,支持 SaaS 部署
15
- - **工作流引擎**:灵活的业务流程管理
16
- - **文档管理系统**:支持文档库、版本控制、权限管理
17
- - **文件服务**:OSS 对接、上传下载、预览管理
18
-
19
- ## 核心功能
20
-
21
- ### 1. CRUD-Pro 引擎
22
-
23
- **智能 CRUD 生成引擎**,提供配置化的数据库操作能力:
24
-
25
- - **标准化 CRUD**:基于表配置自动生成增删改查接口
26
- - **复杂查询支持**:分页、排序、筛选、关联查询
27
- - **字段级权限**:支持字段可见性、只读、必填等控制
28
- - **数据验证**:内置 20+ 种验证器(邮箱、手机号、日期等)
29
- - **关联关系**:自动处理一对一、一对多、多对多关系
30
- - **软删除**:支持逻辑删除和物理删除
31
- - **审计日志**:自动记录创建人、修改人、时间戳
32
- - **多数据库支持**:MySQL、PostgreSQL、SQL Server
33
-
34
- **应用场景**:
35
- - 快速搭建后台管理系统
36
- - 数据管理平台
37
- - 报表查询系统
38
- - 业务配置中心
39
-
40
- ### 2. 动态 API 管理(Any API)
41
-
42
- **三种 API 创建方式**,满足不同复杂度需求:
43
-
44
- #### 2.1 SQL 查询 API
45
- - 直接编写 SQL,自动转换为 REST API
46
- - 支持参数化查询、防 SQL 注入
47
- - 适用于复杂报表、数据分析
48
-
49
- #### 2.2 沙箱脚本 API
50
- - 使用 Node.js VM 沙箱执行自定义代码
51
- - 提供安全的运行环境
52
- - 内置工具库(axios、lodash、moment 等)
53
- - 访问数据库、Redis、OSS 等资源
54
-
55
- #### 2.3 自定义代码 API
56
- - 完全自定义的业务逻辑
57
- - 类似 Serverless Function
58
- - 热更新,无需重启服务
59
-
60
- **安全控制**:
61
- - 权限验证(登录、角色、功能点)
62
- - 限流控制(令牌桶算法)
63
- - 服务降级开关
64
- - 超时控制
65
- - IP 黑白名单
66
-
67
- **应用场景**:
68
- - 快速开发业务接口
69
- - 数据聚合 API
70
- - 第三方集成
71
- - 微服务编排
72
-
73
- ### 3. API 网关与代理
74
-
75
- **企业级 API 网关**,提供完整的代理转发能力:
76
-
77
- #### 负载均衡策略
78
- - 轮询(Round Robin)
79
- - 加权轮询(Weighted Round Robin)
80
- - 随机(Random)
81
- - 加权随机(Weighted Random)
82
- - IP Hash(同一 IP 固定路由)
83
- - 用户 Hash(同一用户固定路由)
84
- - 会话 Hash(同一会话固定路由)
85
-
86
- #### 流量控制
87
- - 请求限流
88
- - 超时控制
89
- - 重试机制
90
- - 熔断降级
91
-
92
- #### 安全特性
93
- - 真实 IP 透传
94
- - 用户上下文传递
95
- - Host/Origin 修改
96
- - 请求/响应头控制
97
-
98
- **应用场景**:
99
- - 微服务网关
100
- - 灰度发布
101
- - A/B 测试
102
- - 流量分发
103
- - 服务聚合
104
-
105
- ### 4. 多租户架构
106
-
107
- **工作台(Workbench)系统**,实现完整的多租户隔离:
108
-
109
- #### 租户隔离机制
110
- - **域名识别**:根据请求域名自动识别租户
111
- - **数据隔离**:租户数据完全隔离
112
- - **权限隔离**:用户、角色、权限独立管理
113
- - **资源隔离**:文件、配置、应用独立
114
-
115
- #### 灵活配置
116
- - 支持主域名 + 2 个备用域名
117
- - 通配符域名支持
118
- - 租户模板机制
119
- - 个性化配置
120
-
121
- **应用场景**:
122
- - SaaS 平台
123
- - 多品牌运营
124
- - 集团企业
125
- - 白标产品
126
-
127
- ### 5. 工作流引擎
128
-
129
- **灵活的业务流程管理**:
130
-
131
- - 流程定义与配置
132
- - 流程实例管理
133
- - 任务分配与审批
134
- - 流程状态跟踪
135
- - 流转记录查询
136
-
137
- **应用场景**:
138
- - 审批流程
139
- - 业务流转
140
- - 状态机管理
141
-
142
- ### 6. 文档管理系统
143
-
144
- **企业级文档管理**:
145
-
146
- - **文档库管理**:支持多个文档库
147
- - **目录结构**:树形目录组织
148
- - **版本控制**:文档版本管理
149
- - **访问统计**:PV/UV 统计(IP 去重)
150
- - **权限控制**:文档级权限管理
151
-
152
- **应用场景**:
153
- - API 文档
154
- - 产品文档
155
- - 知识库
156
- - 帮助中心
157
-
158
- ### 7. 文件服务
159
-
160
- **完整的文件管理能力**:
161
-
162
- - **上传下载**:支持单文件、多文件上传
163
- - **存储管理**:OSS 对接(公有桶、私有桶)
164
- - **文件预览**:图片、PDF、Office 文档
165
- - **访问控制**:临时链接、权限验证
166
- - **分类管理**:文件分类、标签
167
-
168
- ### 8. 系统管理
169
-
170
- #### 用户权限管理
171
- - 用户账号管理
172
- - 角色管理
173
- - 功能点管理
174
- - 权限分配
175
-
176
- #### 应用管理
177
- - 应用列表
178
- - 应用页面管理
179
- - 菜单管理
180
- - 低代码模板
181
-
182
- #### 系统配置
183
- - 数据字典
184
- - 系统参数
185
- - 枚举管理
186
- - 定时任务
187
-
188
- #### 监控运维
189
- - 访问统计
190
- - 操作日志
191
- - 系统信息
192
- - 部署管理
193
-
194
- ## 技术架构
195
-
196
- ### 技术栈
197
-
198
- **后端框架**
199
- - Midway.js 3.x(企业级 Node.js 框架)
200
- - Koa(Web 框架)
201
- - TypeScript(类型安全)
202
-
203
- **数据存储**
204
- - MySQL 2(主数据库)
205
- - PostgreSQL 8(可选)
206
- - SQL Server 11(可选)
207
- - Redis(缓存、锁、会话)
208
-
209
- **文件存储**
210
- - 阿里云 OSS
211
- - 兼容 S3 协议的对象存储
212
-
213
- **工具库**
214
- - Lodash(工具函数)
215
- - Moment(日期处理)
216
- - Axios(HTTP 客户端)
217
- - EJS(模板引擎)
218
- - Nodemailer(邮件发送)
219
- - LRU Cache(内存缓存)
220
-
221
- ### 核心中间件
222
-
223
- #### 全局中间件
224
- - **用户会话管理**:登录状态、权限信息
225
- - **多租户隔离**:域名识别、数据隔离
226
- - **事务管理**:自动事务控制
227
- - **日志追踪**:请求级日志
228
- - **响应格式化**:统一响应格式
229
- - **调试信息注入**:开发环境调试
230
- - **真实 IP 获取**:代理环境下获取真实 IP
231
-
232
- #### 权限中间件
233
- - **登录检查**(checkLogin)
234
- - **角色检查**(checkRole)
235
- - **权限检查**(checkPermission)
236
-
237
- #### 安全中间件
238
- - **黑名单拦截**(Forbidden):防止路径遍历、敏感文件访问
239
- - **Redis 分布式锁**(RedisLock):防止并发冲突
240
- - **Redis 缓存**(RedisCache):接口级缓存
241
-
242
- #### 事务中间件
243
- - **自动事务**(Transaction):开启、提交、回滚
244
-
245
- ### 安全特性
246
-
247
- #### 访问控制
248
- - JWT Token 认证
249
- - 会话管理
250
- - 超级管理员机制
251
- - 细粒度权限控制
252
-
253
- #### 攻击防护
254
- - SQL 注入防护
255
- - XSS 防护
256
- - CSRF Token
257
- - 路径遍历防护
258
- - User-Agent 黑名单(扫描工具检测)
259
- - IP 限流
260
-
261
- #### 数据安全
262
- - AES-128-CBC 加密
263
- - 非对称加密支持
264
- - 敏感字段加密存储
265
- - 密码加盐存储
266
-
267
- ## 应用场景
268
-
269
- ### 1. 企业后台系统
270
- - 快速搭建管理后台
271
- - 业务系统配置中心
272
- - 内部工具平台
273
-
274
- ### 2. SaaS 平台
275
- - 多租户应用
276
- - 白标产品
277
- - 行业解决方案
278
-
279
- ### 3. API 平台
280
- - API 管理与网关
281
- - 数据开放平台
282
- - 微服务聚合
283
-
284
- ### 4. 低代码平台
285
- - 业务系统快速开发
286
- - 表单驱动应用
287
- - 数据分析平台
288
-
289
- ### 5. 内容管理系统
290
- - 文档管理
291
- - 知识库
292
- - 内容发布平台
293
-
294
- ## 快速开始
295
-
296
- ### 环境要求
3
+ <p align="center">
4
+ <strong>Enterprise-Grade Low-Code / Zero-Code Development Platform</strong>
5
+ </p>
6
+
7
+ <p align="center">
8
+ Build production-ready enterprise applications in minutes, not months.
9
+ </p>
10
+
11
+ <p align="center">
12
+ <a href="#-quick-start">Quick Start</a> · <a href="#-core-engines">Core Engines</a> · <a href="#-architecture">Architecture</a> · <a href="#-api-reference">API Reference</a>
13
+ </p>
14
+
15
+ ---
16
+
17
+ ## Why Midway FatCMS?
18
+
19
+ Stop writing repetitive CRUD boilerplate. Stop struggling with API versioning. Stop worrying about multi-tenant data isolation.
20
+
21
+ **Midway FatCMS** is a battle-tested, enterprise-grade low-code platform that transforms weeks of development into hours of configuration. Built on top of the robust Midway.js framework, it empowers teams to ship faster without sacrificing security, scalability, or control.
22
+
23
+ ### The Problem We Solve
24
+
25
+ | Traditional Development | With Midway FatCMS |
26
+ |------------------------|-------------------|
27
+ | 2 weeks to build a CRUD module | 15 minutes of configuration |
28
+ | Manual API documentation | Auto-generated, always in sync |
29
+ | Complex multi-tenant logic | Built-in tenant isolation |
30
+ | Hand-coded sharding & pagination | Cross-shard queries out of the box |
31
+ | Reinventing the wheel | Production-ready building blocks |
32
+
33
+ ---
34
+
35
+ ## Core Engines
36
+
37
+ ### CRUD-Pro Engine — Zero-Code Data Operations
38
+
39
+ Transform database tables into fully functional REST APIs with zero code. CRUD-Pro is the heart of Midway FatCMS, providing configuration-driven SQL execution with built-in validation, security, and multi-database support.
40
+
41
+ **Features:**
42
+
43
+ - **Instant CRUD** — Auto-generated Create, Read, Update, Delete endpoints via `sqlSimpleName`
44
+ - **Advanced Querying** Pagination, sorting, filtering, joins, and MongoDB-style query operators
45
+ - **Field-Level Security** Granular control over visibility (`allowCfg`), read-only, and rejected fields (`rejectCfg`)
46
+ - **Built-in Validation** — 20+ validators (email, phone, date, regex, length, range, enum, etc.)
47
+ - **Smart Relations** — Automatic data enrichment via `columnsRelation` (dict, sysConfig, account, workbench, custom)
48
+ - **Soft Delete** — Logical deletion with recovery support (`enableSoftDelete`)
49
+ - **Audit Trail** — Automatic tracking of creators, modifiers, and timestamps (`enableStandardUpdateCfg`)
50
+ - **Data Type Conversion** — Auto-convert JS arrays to PostgreSQL array literals, JSON strings parsed automatically
51
+ - **Multi-Database** — MySQL, PostgreSQL, SQL Server support with dialect-aware SQL generation
52
+ - **Custom SQL** — Template-based SQL with `@@placeholder` syntax for complex queries
53
+ - **Transaction Support** — Built-in transaction management with configurable isolation levels
54
+ - **Configuration Cache** — Database-stored configurations with TTL-based caching
55
+
56
+ **10-Step Execution Pipeline:**
57
+
58
+ ```
59
+ 1. Receive Request (RequestModel)
60
+
61
+ 2. Load Configuration (RequestCfgModel)
62
+
63
+ 3. Field Filtering (filterDataByTableMeta) — Remove non-existent columns based on table schema
64
+
65
+ 4. Data Type Conversion (convertDataTypeByTableMeta) — Auto-convert based on column types (e.g. PG ARRAY)
66
+
67
+ 5. Data Validation (validateByAllow/rejectCfg/validateCfg)
68
+
69
+ 6. Permission Check (validateByAuthCfg)
70
+
71
+ 7. Default Value Setting (updateByCfg)
72
+
73
+ 8. Generate SQL (generateSQLList)
74
+
75
+ 9. Execute SQL (executeSQLList)
76
+
77
+ 10. Return Result (ExecuteContext)
78
+ ```
79
+
80
+ **Quick Example:**
81
+
82
+ ```typescript
83
+ const cfgJson: IRequestCfgModel = {
84
+ method: 'article.list',
85
+ sqlTable: 'article',
86
+ sqlSimpleName: KeysOfSimpleSQL.SIMPLE_QUERY_PAGE,
87
+ };
88
+
89
+ const reqJson: IRequestModel = {
90
+ columns: 'id,title,content,author_id,created_at',
91
+ condition: {
92
+ status: 1,
93
+ category_id: { $in: [1, 2, 3] },
94
+ created_at: { $gte: '2024-01-01' },
95
+ },
96
+ pageNo: 1,
97
+ pageSize: 20,
98
+ orderBy: 'created_at-',
99
+ };
100
+
101
+ const ctx = await crudPro.executeCrudByCfg(reqJson, cfgJson);
102
+ const { rows, total_count } = ctx.getResModelForQueryPage();
103
+ ```
104
+
105
+ > Full CRUD-Pro documentation: [src/libs/crud-pro/README.md](src/libs/crud-pro/README.md) · Built-in Functions: [src/libs/crud-pro/README_FUNC.md](src/libs/crud-pro/README_FUNC.md)
106
+
107
+ ---
108
+
109
+ ### Sharding Engine — Scalable Table Partitioning
110
+
111
+ Built on top of CRUD-Pro, the Sharding Engine provides transparent table partitioning with automatic routing, cross-shard pagination, and smart result merging — zero code changes required.
112
+
113
+ **Sharding Strategies:**
114
+
115
+ | Strategy | Enum | Suffix Example | Best For |
116
+ |----------|------|----------------|----------|
117
+ | By Year | `ShardingType.YEAR` | `_2024`, `_2025` | Annual reports, yearly archives |
118
+ | By Month | `ShardingType.MONTH` | `_202401`, `_202402` | Order systems, log tables |
119
+ | By Day | `ShardingType.DAY` | `_20240101` | High-volume daily logs |
120
+ | By Range | `ShardingType.RANGE` | `_0` ~ `_99` | Numeric ID-based partitioning |
121
+ | By Hash | `ShardingType.HASH` | `_01` ~ `_16` | Even distribution, user-based |
122
+ | Custom | `ShardingType.CUSTOM` | User-defined | Tenant-based, business-specific |
123
+
124
+ **Key Features:**
125
+
126
+ - **Automatic Routing** — Insert/update/delete routed to the correct shard based on data fields
127
+ - **Cross-Shard Pagination** — Transparent `queryPage()` across multiple shards with direct-offset optimization
128
+ - **Smart Batch Insert** — `batchInsert()` auto-groups data by shard, parallel writes across tables
129
+ - **COUNT Query Cache** — LRU + TTL cache for historical shard COUNT queries, real-time for current period
130
+ - **Table Existence Filtering** — Non-existent shards silently skipped in queries, error on insert
131
+ - **Multi-Sort Support** — Primary time-based sort + secondary field sorts within each shard
132
+
133
+ **Quick Example:**
134
+
135
+ ```typescript
136
+ const sharding = curdProService.getShardingCrud('mydb', SqlDbType.mysql, {
137
+ type: ShardingType.MONTH,
138
+ baseTable: 't_order',
139
+ timeColumn: 'created_at',
140
+ autoCreateTable: true,
141
+ countCache: { ttlSeconds: 300, maxSize: 1000 },
142
+ });
143
+
144
+ // Insert — auto-routes to t_order_202403
145
+ await sharding.insert({
146
+ data: { order_id: '001', amount: 100, created_at: '2024-03-15' }
147
+ });
148
+
149
+ // Cross-shard pagination automatic merging
150
+ const page = await sharding.queryPage({
151
+ condition: { status: 'paid' },
152
+ pageNo: 1,
153
+ pageSize: 10,
154
+ orderBy: 'created_at DESC',
155
+ });
156
+ ```
157
+
158
+ > Full Sharding documentation: [src/libs/crud-sharding/ROUTING_LOGIC.md](src/libs/crud-sharding/ROUTING_LOGIC.md)
159
+
160
+ ---
161
+
162
+ ### Any API — Three Ways to Build APIs
163
+
164
+ Whether you need a simple query or complex business logic, we've got you covered.
165
+
166
+ #### 1. SQL Query API
167
+ Write SQL, get REST. It's that simple.
168
+ - Native SQL with automatic parameter binding
169
+ - SQL injection protection built-in
170
+ - Ideal for complex reports and data analytics
171
+
172
+ #### 2. Sandbox Script API
173
+ Safe, sandboxed Node.js execution.
174
+ - Isolated VM environment for secure code execution
175
+ - Pre-loaded utilities (axios, lodash, moment)
176
+ - Direct access to database, Redis, and OSS
177
+
178
+ #### 3. Custom Code API
179
+ Full control when you need it.
180
+ - Serverless-like function deployment
181
+ - Hot-reload without service restart
182
+ - Complete business logic freedom
183
+
184
+ **Enterprise Security:**
185
+ - JWT authentication & role-based access control
186
+ - Token bucket rate limiting
187
+ - Circuit breaker & timeout protection
188
+ - IP whitelist/blacklist
189
+
190
+ ---
191
+
192
+ ### API Gateway & Proxy — Enterprise-Grade Traffic Management
193
+
194
+ A full-featured API gateway that handles the complexity so you don't have to.
195
+
196
+ #### Load Balancing Strategies
197
+ - Round Robin
198
+ - Weighted Round Robin
199
+ - Random & Weighted Random
200
+ - IP Hash (sticky sessions by IP)
201
+ - User Hash (sticky sessions by user)
202
+ - Session Hash (sticky sessions by session)
203
+
204
+ #### Traffic Control
205
+ - Request rate limiting
206
+ - Configurable timeouts
207
+ - Automatic retry mechanisms
208
+ - Circuit breaker & fallback
209
+
210
+ #### Security & Context
211
+ - Real IP forwarding through proxies
212
+ - User context propagation
213
+ - Customizable headers (Host, Origin)
214
+ - Request/response header manipulation
215
+
216
+ ---
217
+
218
+ ### Multi-Tenant Architecture — True SaaS-Ready
219
+
220
+ Deploy once, serve unlimited customers. Complete tenant isolation without the complexity.
221
+
222
+ **Tenant Isolation:**
223
+ - **Domain Recognition** — Automatic tenant detection by domain
224
+ - **Data Separation** — Complete data isolation between tenants
225
+ - **Permission Boundaries** — Independent user, role, and permission management
226
+ - **Resource Isolation** — Files, configurations, and apps are tenant-scoped
227
+
228
+ **Flexible Configuration:**
229
+ - Primary domain + 2 backup domains per tenant
230
+ - Wildcard domain support
231
+ - Tenant templates for rapid onboarding
232
+ - Customizable tenant branding
233
+
234
+ ---
235
+
236
+ ### Workflow Engine — Automate Business Processes
237
+
238
+ Streamline approvals and business flows with a flexible workflow engine.
239
+
240
+ - Visual process definition
241
+ - Process instance tracking
242
+ - Task assignment and approval workflows
243
+ - Real-time status monitoring
244
+ - Historical flow records
245
+
246
+ ---
247
+
248
+ ### Document Management System — Enterprise Knowledge Base
249
+
250
+ A complete document management solution with version control and analytics.
251
+
252
+ - **Document Libraries** — Multiple document repositories
253
+ - **Hierarchical Structure** — Tree-based organization
254
+ - **Version Control** — Full document versioning
255
+ - **Analytics** — PV/UV tracking with IP deduplication
256
+ - **Access Control** — Document-level permissions
257
+
258
+ ---
259
+
260
+ ### File Service — Complete File Management
261
+
262
+ Enterprise file handling with cloud storage integration.
263
+
264
+ - **Upload & Download** — Single and batch file uploads
265
+ - **Cloud Storage** — Alibaba Cloud OSS integration (public & private buckets)
266
+ - **File Preview** — Images, PDFs, Office documents
267
+ - **Access Control** — Time-limited secure URLs
268
+ - **Organization** — Categories and tags
269
+
270
+ ---
271
+
272
+ ### System Management — Everything You Need
273
+
274
+ **User & Permissions:**
275
+ - User account management
276
+ - Role-based access control
277
+ - Feature-level permissions
278
+ - Permission allocation workflows
279
+
280
+ **Application Management:**
281
+ - Application registry
282
+ - Page management
283
+ - Menu configuration
284
+ - Low-code templates
285
+
286
+ **System Configuration:**
287
+ - Data dictionaries
288
+ - System parameters
289
+ - Enumeration management
290
+ - Scheduled tasks
291
+
292
+ **Monitoring & Operations:**
293
+ - Access statistics
294
+ - Operation logs
295
+ - System health info
296
+ - Deployment management
297
+
298
+ ---
299
+
300
+ ## Security First
301
+
302
+ We take security seriously. Built-in protection at every layer:
303
+
304
+ ### Access Control
305
+ - JWT Token authentication
306
+ - Session management with Redis
307
+ - Super admin mechanism
308
+ - Granular permission control (`authType: free | login | byRoleCode | byFuncCode`)
309
+
310
+ ### Attack Prevention
311
+ - SQL injection protection (parameterized queries)
312
+ - XSS protection
313
+ - CSRF token validation
314
+ - Path traversal prevention
315
+ - User-Agent blacklisting (scanner detection)
316
+ - IP-based rate limiting
317
+
318
+ ### Data Protection
319
+ - AES-128-CBC encryption
320
+ - Asymmetric encryption support
321
+ - Sensitive field encryption
322
+ - Salted password hashing
323
+
324
+ ---
325
+
326
+ ## Architecture
327
+
328
+ ### Technology Stack
329
+
330
+ | Layer | Technology |
331
+ |-------|-----------|
332
+ | **Framework** | Midway.js 3.x (Enterprise Node.js) |
333
+ | **Web Server** | Koa |
334
+ | **Language** | TypeScript |
335
+ | **Database** | MySQL / PostgreSQL / SQL Server |
336
+ | **Cache** | Redis |
337
+ | **File Storage** | Alibaba Cloud OSS / S3-compatible |
338
+
339
+ ### Core Middleware
340
+
341
+ **Global Middleware:**
342
+ - User session management
343
+ - Multi-tenant isolation
344
+ - Transaction management
345
+ - Request-level logging
346
+ - Unified response formatting
347
+ - Real IP extraction
348
+
349
+ **Security Middleware:**
350
+ - Login verification (`checkLogin`)
351
+ - Role verification (`checkRole`)
352
+ - Permission verification (`checkPermission`)
353
+ - Path blacklist (`Forbidden`)
354
+ - Distributed locking (`RedisLock`)
355
+ - Response caching (`RedisCache`)
356
+
357
+ ### Project Structure
358
+
359
+ ```
360
+ midway-fatcms/
361
+ ├── src/
362
+ │ ├── config/ # Configuration files
363
+ │ ├── controller/ # Controllers
364
+ │ │ ├── base/ # Base controllers
365
+ │ │ ├── gateway/ # Gateway APIs (CRUD, AnyAPI, Proxy, etc.)
366
+ │ │ ├── manage/ # Management APIs
367
+ │ │ ├── myinfo/ # Personal info & Auth APIs
368
+ │ │ └── render/ # Rendering APIs
369
+ │ ├── filter/ # Exception filters
370
+ │ ├── libs/ # Core libraries
371
+ │ │ ├── crud-pro/ # CRUD-Pro engine (SQL generation, validation, execution)
372
+ │ │ ├── crud-sharding/ # Sharding engine (routing, merging, caching)
373
+ │ │ ├── global-config/ # Global configuration
374
+ │ │ └── utils/ # Shared utilities
375
+ │ ├── middleware/ # Middleware (auth, permission, tx, cache, lock)
376
+ │ ├── models/ # Data models & type definitions
377
+ │ ├── schedule/ # Scheduled tasks
378
+ │ ├── service/ # Business services
379
+ │ │ ├── anyapi/ # Dynamic API (SQL, Sandbox, Custom Code)
380
+ │ │ ├── asyncTask/ # Async task runner
381
+ │ │ ├── base/ # Base services (cache, rate limiter)
382
+ │ │ ├── crudstd/ # Standard CRUD (gateway-level)
383
+ │ │ ├── curd/ # CRUD service layer (context injection, soft delete, relations)
384
+ │ │ ├── flow/ # Workflow engine
385
+ │ │ └── proxyapi/ # Proxy API gateway
386
+ │ └── views/ # View templates
387
+ ├── ddl/ # Database initialization scripts
388
+ ├── scripts/ # Utility scripts
389
+ └── package.json # Project configuration
390
+ ```
391
+
392
+ ### Service Layer Architecture
393
+
394
+ ```
395
+ Business Code
396
+
397
+ ├── CurdMixService (orchestrator: CRUD + relation enrichment)
398
+ │ ├── CurdMixByDictService → relatedType: 'dict'
399
+ │ ├── CurdMixBySysConfigService → relatedType: 'sysCfgEnum'
400
+ │ ├── CurdMixByAccountService → relatedType: 'accountBasic'
401
+ │ ├── CurdMixByWorkbenchService → relatedType: 'workbenchBasic'
402
+ │ └── CurdMixByLinkToCustomService → relatedType: 'linkToCustom'
403
+
404
+ └── CurdProService (core service layer)
405
+ ├── CrudProQuick → Quick CRUD (fluent API)
406
+ ├── ShardingCrudPro → Sharded CRUD
407
+ ├── fixCfgModel() → Standard field auto-fill
408
+ └── fixSoftDelete() → Soft delete handling
409
+ ```
410
+
411
+ > Full service layer documentation: [src/service/curd/README.md](src/service/curd/README.md)
412
+
413
+ ---
414
+
415
+ ## API Reference
416
+
417
+ ### CrudProQuick — Fluent CRUD API
418
+
419
+ The quickest way to perform database operations. All methods automatically inherit context (visitor, transaction, soft delete, standard fields).
420
+
421
+ ```typescript
422
+ const quick = curdProService.getQuickCrud('mydb', SqlDbType.mysql, 't_user');
423
+
424
+ // Query methods
425
+ const users = await quick.getList({ condition: { status: 'active' } });
426
+ const page = await quick.getListPage({ condition: { status: 'active' }, pageNo: 1, pageSize: 20 });
427
+ const user = await quick.getUniqueOne({ condition: { email: 'user@example.com' } });
428
+ const exists = await quick.isExist({ condition: { phone: '13800138000' } });
429
+ const count = await quick.getTotalCount({ condition: { status: 'active' } });
430
+
431
+ // Write methods
432
+ const result = await quick.insertObject({ data: { name: 'Alice', email: 'a@b.com' } });
433
+ const batch = await quick.batchInsert({ data: [{ name: 'A' }, { name: 'B' }] });
434
+ const updated = await quick.updateObject({ condition: { id: 1 }, data: { name: 'Bob' } });
435
+ const deleted = await quick.deleteObject({ condition: { id: 1 } });
436
+ const upserted = await quick.insertOnDuplicate({ data: { id: 1, name: 'A' } }, ['id']);
437
+
438
+ // Raw SQL
439
+ const rows = await quick.executeSQL('SELECT * FROM t_user WHERE status = ?', ['active']);
440
+ ```
441
+
442
+ ### Query Condition Operators
443
+
444
+ MongoDB-style operators for powerful queries:
445
+
446
+ ```typescript
447
+ const condition = {
448
+ status: 1, // Equal
449
+ age: { $gt: 18, $lt: 60 }, // Greater than / Less than
450
+ id: { $in: [1, 2, 3] }, // IN
451
+ code: { $nin: ['a', 'b'] }, // NOT IN
452
+ amount: { $between: [100, 500] }, // BETWEEN
453
+ name: { $like: '张' }, // Prefix match
454
+ title: { $likeInclude: '文章' }, // Contains match
455
+ deleted_at: { $isNull: true }, // IS NULL
456
+ updated_at: { $isNotNull: true }, // IS NOT NULL
457
+ $or: [{ name: { $like: '张' } }, { name: { $like: '李' } }], // OR
458
+ };
459
+ ```
460
+
461
+ ### Sorting Syntax
462
+
463
+ ```typescript
464
+ // Standard SQL format
465
+ orderBy: 'created_at DESC, amount ASC'
466
+
467
+ // Shorthand format (+ ascending, - descending)
468
+ orderBy: 'created_at-, amount+'
469
+
470
+ // Array format (mixed strings & objects)
471
+ orderBy: ['order_id', { fieldName: 'created_at', orderType: 'desc' }, 'amount+']
472
+ ```
473
+
474
+ ### ShardingCrudPro API
475
+
476
+ | Method | Returns | Description |
477
+ |--------|---------|-------------|
478
+ | `insert(reqJson)` | `ExecuteContext` | Insert single record (auto-route) |
479
+ | `batchInsert(reqJson)` | `IShardingSmartBatchInsertResult` | Batch insert (cross-shard, parallel) |
480
+ | `update(reqJson)` | `ExecuteContext` | Update data |
481
+ | `delete(reqJson)` | `ExecuteContext` | Delete data |
482
+ | `insertOrUpdate(reqJson)` | `ExecuteContext` | Insert or update |
483
+ | `insertOnDuplicateUpdate(reqJson)` | `ExecuteContext` | Native upsert |
484
+ | `queryOne(reqJson)` | `any \| null` | Query single record |
485
+ | `query(reqJson)` | `any[]` | List query (auto-merge shards) |
486
+ | `queryPage(reqJson)` | `IShardingPageQueryResult` | Cross-shard pagination |
487
+ | `queryCount(reqJson)` | `number` | Count across shards |
488
+ | `isExist(reqJson)` | `boolean` | Existence check across shards |
489
+
490
+ ### Built-in Functions
491
+
492
+ CrudPro provides 30+ built-in functions for `updateCfg`, `validateCfg`, `executeWhen`, and `validate`:
493
+
494
+ **DateTime:** `getCurrentTimeStampMs`, `getCurrentTimeStampSecond`, `getCurrentTimeString`, `getCurrentDateFormat`, `getYesterdayDateFormat`
495
+
496
+ **Compare:** `eq`, `ne`, `gt`, `gte`, `lt`, `lte`
497
+
498
+ **Utility:** `isNil`, `isNotNil`, `isEmpty`, `isNotEmpty`, `equals`, `equalsIgnoreCase`, `startsWith`, `isValidFieldName`, `selectNotEmpty`, `hasAny`, `parseValueByType`, `sleepMs`, `uuid`, `generateSnowflakeId`
499
+
500
+ **Type Check:** `isBasicType`, `isBoolean`, `isString`, `isInteger`, `isNumber`, `isNumeric`, `isValidName`, `isChinesePhone`, `isEmailStrValid`, `pickNumber`
501
+
502
+ > Full function reference: [src/libs/crud-pro/README_FUNC.md](src/libs/crud-pro/README_FUNC.md)
503
+
504
+ ### Soft Delete
505
+
506
+ When `enableSoftDelete: true`, operations are automatically rewritten:
507
+
508
+ | Operation | Original | With Soft Delete |
509
+ |-----------|----------|-----------------|
510
+ | INSERT | Normal insert | Auto-set `data.deleted_at = 0` |
511
+ | DELETE | Physical DELETE | UPDATE: `deleted_at = timestamp`, `deleted_by = userId` |
512
+ | QUERY | Normal query | Auto-append `condition.deleted_at = 0` |
513
+
514
+ ### Standard Field Auto-Fill
515
+
516
+ When `enableStandardUpdateCfg: true`, standard fields are automatically populated:
517
+
518
+ | Operation | Auto-Filled Fields |
519
+ |-----------|--------------------|
520
+ | INSERT | `created_by`, `created_avatar`, `created_nickname`, `created_account_type` |
521
+ | UPDATE | `modified_by`, `modified_avatar`, `modified_nickname`, `modified_account_type` |
522
+ | DELETE | — (condition auto-includes `created_by` for ownership check) |
523
+
524
+ ### Data Type Auto-Conversion
525
+
526
+ CrudPro automatically converts data types based on table schema before INSERT/UPDATE:
527
+
528
+ **PostgreSQL ARRAY** — JS arrays are automatically converted to PG array literal format:
529
+
530
+ | Input | Converted | Description |
531
+ |-------|-----------|-------------|
532
+ | `["a","b","c"]` | `{"a","b","c"}` | String arrays: double-quoted |
533
+ | `[1,2,3]` | `{1,2,3}` | Number arrays: no quotes |
534
+ | `[true,false]` | `{t,f}` | Boolean arrays: t/f notation |
535
+ | `[1,null,3]` | `{1,NULL,3}` | Null handling |
536
+ | `[]` | `{}` | Empty arrays |
537
+ | `['he"llo']` | `{"he\"llo"}` | Special character escaping |
538
+
539
+ > Only applies to PostgreSQL; MySQL and SQL Server drivers handle type conversion natively.
540
+
541
+ ---
542
+
543
+ ## Quick Start
544
+
545
+ ### Prerequisites
297
546
 
298
547
  - Node.js >= 10
299
548
  - MySQL >= 5.7 / PostgreSQL >= 8 / SQL Server >= 11
300
549
  - Redis >= 3.0
301
550
 
302
- ### 安装依赖
551
+ ### Installation
303
552
 
304
553
  ```bash
554
+ # Clone the repository
555
+ git clone <repository-url>
556
+ cd midway-fatcms
557
+
558
+ # Install dependencies
305
559
  npm install
306
560
  ```
307
561
 
308
- ### 配置
562
+ ### Configuration
309
563
 
310
- 1. 配置数据库连接(`src/config/config.default.ts`)
311
- 2. 配置 Redis 连接
312
- 3. 配置 OSS(可选)
313
- 4. 配置工作台信息
564
+ 1. Configure database connection in `src/config/config.default.ts`
565
+ 2. Set up Redis connection
566
+ 3. Configure OSS (optional)
567
+ 4. Configure workbench information
314
568
 
315
- ### 数据库初始化
569
+ ### Database Setup
316
570
 
317
571
  ```sql
318
- -- 执行初始化 SQL
572
+ -- Run initialization SQL
319
573
  source ddl/2025-12-20.sql
320
574
  ```
321
575
 
322
- ### 启动服务
576
+ ### Start Development
323
577
 
324
578
  ```bash
325
- # 开发模式
579
+ # Development mode with hot reload
326
580
  npm run dev
327
581
 
328
- # 生产构建
582
+ # Build for production
329
583
  npm run build
330
584
 
331
- # 生产运行
585
+ # Start production server
332
586
  npm start
333
587
  ```
334
588
 
335
- ### 代码检查
589
+ ### Code Quality
336
590
 
337
591
  ```bash
338
- # 检查代码规范
592
+ # Check code style
339
593
  npm run lint
340
594
 
341
- # 自动修复
595
+ # Auto-fix issues
342
596
  npm run lint:fix
343
597
  ```
344
598
 
345
- ### 测试
599
+ ### Testing
346
600
 
347
601
  ```bash
348
- # 运行测试
602
+ # Run tests
349
603
  npm test
350
604
 
351
- # 测试覆盖率
605
+ # Generate coverage report
352
606
  npm run cov
353
607
  ```
354
608
 
355
- ## 工具接口
609
+ ---
610
+
611
+ ## Use Cases
612
+
613
+ ### Enterprise Back-Office Systems
614
+ - Rapid admin dashboard creation
615
+ - Business system configuration hubs
616
+ - Internal tool platforms
617
+
618
+ ### SaaS Platforms
619
+ - Multi-tenant applications
620
+ - White-label products
621
+ - Industry-specific solutions
356
622
 
357
- ### 加密工具
623
+ ### API Platforms
624
+ - API management & gateways
625
+ - Data open platforms
626
+ - Microservice aggregation
627
+
628
+ ### High-Volume Data Systems
629
+ - Sharded order management (millions of records per month)
630
+ - Time-series log storage with auto-routing
631
+ - Real-time analytics across partitioned tables
632
+
633
+ ### Low-Code Development
634
+ - Rapid business system development
635
+ - Form-driven applications
636
+ - Data analysis platforms
637
+
638
+ ### Content Management
639
+ - Document repositories
640
+ - Knowledge bases
641
+ - Content publishing platforms
642
+
643
+ ---
644
+
645
+ ## Utility Endpoints
646
+
647
+ ### Encryption Helper
358
648
 
359
649
  ```
360
650
  http://127.0.0.1:7002/ns/api/helpers/cryptoAes128CBC?input=123
361
651
  ```
362
652
 
363
- ## 项目结构
653
+ ---
364
654
 
365
- ```
366
- midway-fatcms/
367
- ├── src/
368
- │ ├── config/ # 配置文件
369
- │ ├── controller/ # 控制器
370
- │ │ ├── base/ # 基础控制器
371
- │ │ ├── gateway/ # 网关接口
372
- │ │ ├── manage/ # 管理接口
373
- │ │ ├── myinfo/ # 个人信息
374
- │ │ └── render/ # 渲染接口
375
- │ ├── filter/ # 异常过滤器
376
- │ ├── libs/ # 核心库
377
- │ │ ├── crud-pro/ # CRUD-Pro 引擎
378
- │ │ ├── global-config/ # 全局配置
379
- │ │ └── utils/ # 工具函数
380
- │ ├── middleware/ # 中间件
381
- │ ├── models/ # 数据模型
382
- │ ├── schedule/ # 定时任务
383
- │ ├── service/ # 业务服务
384
- │ │ ├── anyapi/ # 动态 API
385
- │ │ ├── asyncTask/ # 异步任务
386
- │ │ ├── base/ # 基础服务
387
- │ │ ├── crudstd/ # CRUD 标准
388
- │ │ ├── curd/ # CRUD 服务
389
- │ │ ├── flow/ # 工作流
390
- │ │ └── proxyapi/ # 代理 API
391
- │ └── views/ # 视图模板
392
- ├── ddl/ # 数据库脚本
393
- ├── scripts/ # 脚本工具
394
- └── package.json # 项目配置
395
- ```
655
+ ## Documentation Index
656
+
657
+ | Document | Description |
658
+ |----------|-------------|
659
+ | [CRUD-Pro Guide](src/libs/crud-pro/README.md) | Configuration-driven CRUD operations, validation, permissions |
660
+ | [Built-in Functions](src/libs/crud-pro/README_FUNC.md) | 30+ functions: date, compare, utility, type check |
661
+ | [Service Layer Guide](src/service/curd/README.md) | Context injection, soft delete, quick CRUD, sharding, relations |
662
+ | [Sharding Routing Logic](src/libs/crud-sharding/ROUTING_LOGIC.md) | Shard strategies, cross-shard pagination, COUNT cache |
663
+
664
+ ---
665
+
666
+ ## Version
667
+
668
+ Current Version: `0.0.1-beta.82`
669
+
670
+ ---
671
+
672
+ ## License
673
+
674
+ MIT License Use it freely, contribute often.
396
675
 
397
- ## 版本
676
+ ---
398
677
 
399
- 当前版本:`0.0.1-beta.82`
678
+ ## Contributing
400
679
 
401
- ## 许可证
680
+ We welcome contributions! Whether it's bug reports, feature requests, or pull requests, your input helps make Midway FatCMS better for everyone.
402
681
 
403
- MIT License
682
+ ---
404
683
 
405
- ## 作者
684
+ <p align="center">
685
+ <strong>Built with care by the Enterprise Low-Code Development Team</strong>
686
+ </p>
406
687
 
407
- 企业级低代码开发团队
688
+ <p align="center">
689
+ Ready to ship faster? Let's build something amazing together.
690
+ </p>