From bac4362a0b7726d38a23d38f0d7913f2c2bab262 Mon Sep 17 00:00:00 2001
From: wangzhibo <wangzhibo@shsening.com>
Date: 星期四, 16 七月 2026 16:25:43 +0800
Subject: [PATCH] first init.

---
 README.md |  196 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 194 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md
index 1397244..8bf3bb7 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,196 @@
-## cool-admin-midway
+<p align="center">
+  <a href="https://midwayjs.org/" target="blank"><img src="https://cool-show.oss-cn-shanghai.aliyuncs.com/admin/logo.png" width="200" alt="Midway Logo" /></a>
+</p>
 
-婧愭棤蹇ф棤搴熸牎鍥�-鍚庣
+<p align="center">cool-admin(nodejs鐗�)涓�涓緢閰风殑鍚庡彴鏉冮檺绠$悊绯荤粺锛屽紑婧愬厤璐癸紝Ai缂栫爜銆佹祦绋嬬紪鎺掋�佹ā鍧楀寲銆佹彃浠跺寲銆佹瀬閫熷紑鍙慍RUD锛屾柟渚垮揩閫熸瀯寤鸿凯浠e悗鍙扮鐞嗙郴缁燂紝鏀寔鍘熺敓銆乨ocker銆佹櫘閫氭湇鍔″櫒绛夊绉嶆柟寮忛儴缃�
+鍒� <a href="https://cool-js.com" target="_blank">瀹樼綉</a> 杩涗竴姝ヤ簡瑙c��
+<p align="center">
+    <a href="https://github.com/cool-team-official/cool-admin-midway/blob/master/LICENSE" target="_blank"><img src="https://img.shields.io/badge/license-MIT-green?style=flat-square" alt="GitHub license" />
+    <a href=""><img src="https://img.shields.io/github/package-json/v/cool-team-official/cool-admin-midway?style=flat-square" alt="GitHub tag"></a>
+    <img src="https://img.shields.io/github/last-commit/cool-team-official/cool-admin-midway?style=flat-square" alt="GitHub tag"></a>
+</p>
 
+## 鐗规��
+
+Ai 鏃朵唬锛屽緢澶氳�佹棫鐨勬鏋跺凡缁忔棤娉曟弧瓒崇幇浠e寲鐨勫紑鍙戦渶姹傦紝Cool-Admin 寮�鍙戜簡涓�绯诲垪鐨勫姛鑳斤紝璁╁紑鍙戝彉寰楁洿绠�鍗曘�佹洿蹇�熴�佹洿楂樻晥銆�
+
+- **Ai 缂栫爜**锛氶�氳繃寰皟澶фā鍨嬪涔犳鏋剁壒鏈夊啓娉曪紝瀹炵幇绠�鍗曞姛鑳戒粠 Api 鎺ュ彛鍒板墠绔〉闈㈢殑涓�閿敓鎴怺璇︽儏](https://node.cool-admin.com/src/guide/ai.html)
+- **娴佺▼缂栨帓**锛氶�氳繃鎷栨嫿缂栨帓鏂瑰紡锛屽嵆鍙疄鐜扮被浼煎儚鏅鸿兘瀹㈡湇杩欐牱鐨勫姛鑳絒璇︽儏](https://node.cool-admin.com/src/guide/flow.html)
+- **澶氱鎴�**锛氭敮鎸佸绉熸埛锛岄噰鐢ㄥ叏灞�鍔ㄦ�佹敞鍏ユ煡璇㈡潯浠禰璇︽儏](https://node.cool-admin.com/src/guide/core/tenant.html)
+- **澶氳瑷�**锛氬熀浜庡ぇ妯″瀷鑷姩缈昏瘧锛屾棤闇�鏇存敼鍘熸湁浠g爜[璇︽儏](https://node.cool-admin.com/src/guide/core/i18n.html)
+- **鍘熺敓鎵撳寘**锛氭墦鍖呮垚 exe 绛夊畨瑁呭寘锛屾墦鍖呭畬鍙互鐩存帴杩愯鍦� windows銆乵ac銆乴inux 绛夋搷浣滅郴缁熶笂[璇︽儏](https://node.cool-admin.com/src/guide/core/pkg.html)
+- **妯″潡鍖�**锛氫唬鐮佹槸妯″潡鍖栫殑锛屾竻鏅版槑浜嗭紝鏂逛究缁存姢
+- **鎻掍欢鍖�**锛氭彃浠跺寲鐨勮璁★紝鍙互閫氳繃瀹夎鎻掍欢鐨勬柟寮忔墿灞曞锛氭敮浠樸�佺煭淇°�侀偖浠剁瓑鍔熻兘
+- ......
+
+![](https://cool-show.oss-cn-shanghai.aliyuncs.com/admin/flow.png)
+
+## 鎶�鏈爤
+
+- 鍚庣锛�**`node.js` `typescript`**
+- 鍓嶇锛�**`vue.js` `element-plus` `jsx` `pinia` `vue-router`**
+- 鏁版嵁搴擄細**`mysql` `postgresql` `sqlite`**
+
+濡傛灉浣犳槸鍓嶇锛屽悗绔殑杩欎簺鎶�鏈�夊瀷瀵逛綘鏄壒鍒弸濂界殑锛屽墠绔紑鍙戣�呭彲浠ヨ緝蹇�熷湴涓婃墜銆�
+濡傛灉浣犳槸鍚庣锛孴ypescript 鐨勮娉曞張璺� java銆乸hp 绛夌壒鍒被浼硷紝涓�鍒囩湅璧锋潵涔熸槸閭d箞寰楃啛鎮夈��
+
+濡傛灉浣犳兂浣跨敤 java 鐗堟湰鍚庣锛岃绉绘[cool-admin-java](https://cool-js.com/admin/java/introduce.html)
+
+#### 瀹樼綉
+
+[https://cool-js.com](https://cool-js.com)
+
+## 瑙嗛鏁欑▼
+
+[瀹樻柟 B 绔欒棰戞暀绋媇(https://www.bilibili.com/video/BV1j1421R7aB)
+
+<!-- 鍦ㄦ娆℃坊鍔犱娇鐢ㄦ枃妗� -->
+
+## 婕旂ず
+
+[AI 鏋侀�熺紪鐮乚(https://node.cool-admin.com/src/guide/ai.html)
+
+[https://show.cool-admin.com](https://show.cool-admin.com)
+
+- 璐︽埛锛歛dmin
+- 瀵嗙爜锛�123456
+
+<img src="https://cool-show.oss-cn-shanghai.aliyuncs.com/admin/home-mini.png" alt="Admin Home"></a>
+
+#### 椤圭洰鍓嶇
+
+[https://github.com/cool-team-official/cool-admin-vue](https://github.com/cool-team-official/cool-admin-vue)
+
+鎴�
+
+[https://gitee.com/cool-team-official/cool-admin-vue](https://gitee.com/cool-team-official/cool-admin-vue)
+
+鎴�
+
+[https://gitcode.com/cool_team/cool-admin-vue](https://gitcode.com/cool_team/cool-admin-vue)
+
+## 寰俊缇�
+
+<img width="260" src="https://cool-show.oss-cn-shanghai.aliyuncs.com/admin/wechat.jpeg?v=1" alt="Admin Wechat"></a>
+
+## 杩愯
+
+#### 淇敼鏁版嵁搴撻厤缃紝閰嶇疆鏂囦欢浣嶄簬`src/config/config.local.ts`
+
+浠� Mysql 涓轰緥锛屽叾浠栨暟鎹簱璇峰弬鑰僛鏁版嵁搴撻厤缃枃妗(https://cool-js.com/admin/node/quick.html#%E6%95%B0%E6%8D%AE%E5%BA%93%E9%85%8D%E7%BD%AE)
+
+Mysql(`>=5.7鐗堟湰`)锛屽缓璁� 8.0锛宯ode 鐗堟湰(`>=18.x`)锛岄娆″惎鍔ㄤ細鑷姩鍒濆鍖栧苟瀵煎叆鏁版嵁
+
+```ts
+// mysql锛岄┍鍔ㄥ凡缁忓唴缃紝鏃犻渶瀹夎
+typeorm: {
+    dataSource: {
+      default: {
+        type: 'mysql',
+        host: '127.0.0.1',
+        port: 3306,
+        username: 'root',
+        password: '123456',
+        database: 'cool',
+        // 鑷姩寤鸿〃 娉ㄦ剰锛氱嚎涓婇儴缃茬殑鏃跺�欎笉瑕佷娇鐢紝鏈夊彲鑳藉鑷存暟鎹涪澶�
+        synchronize: true,
+        // 鎵撳嵃鏃ュ織
+        logging: false,
+        // 瀛楃闆�
+        charset: 'utf8mb4',
+        // 鏄惁寮�鍚紦瀛�
+        cache: true,
+        // 瀹炰綋璺緞
+        entities: ['**/modules/*/entity'],
+      },
+    },
+  },
+```
+
+#### 瀹夎渚濊禆骞惰繍琛�
+
+```bash
+$ npm i
+$ npm run dev
+```
+
+鍚姩瀹屾垚璁块棶锛歔http://localhost:8001/](http://localhost:8001)
+
+娉細 `npm i`濡傛灉瀹夎澶辫触鍙互灏濊瘯浣跨敤鍒囨崲鎮ㄧ殑闀滃儚婧愶紝鎺ㄨ崘浣跨敤[pnpm](https://pnpm.io/)瀹夎
+
+## CURD(蹇�熷鍒犳敼鏌�)
+
+澶ч儴鍒嗙殑鍚庡彴绠$悊绯荤粺锛屾垨鑰� API 鏈嶅姟閮芥槸瀵规暟鎹繘琛岀鐞嗭紝鎵�浠ュ彲浠ョ湅鍒板ぇ閲忕殑 CRUD 鍦烘櫙(澧炲垹鏀规煡)锛宑ool-admin 瀵规杩涜浜嗗ぇ閲忓湴灏佽锛岃杩欏潡鐨勭紪鐮侀噺鍙樺緱鏋佸叾鍦板皯銆�
+
+#### 鏂板缓涓�涓暟鎹〃
+
+`src/modules/demo/entity/goods.ts`锛岄」鐩惎鍔ㄦ暟鎹簱浼氳嚜鍔ㄥ垱寤鸿琛紝鏃犻渶鎵嬪姩鍒涘缓
+
+```ts
+import { BaseEntity } from '../../base/entity/base';
+import { Column, Entity, Index } from 'typeorm';
+
+/**
+ * 鍟嗗搧
+ */
+@Entity('demo_app_goods')
+export class DemoAppGoodsEntity extends BaseEntity {
+  @Column({ comment: '鏍囬' })
+  title: string;
+
+  @Column({ comment: '鍥剧墖' })
+  pic: string;
+
+  @Column({ comment: '浠锋牸', type: 'decimal', precision: 5, scale: 2 })
+  price: number;
+}
+```
+
+#### 缂栧啓 api 鎺ュ彛
+
+`src/modules/demo/controller/app/goods.ts`锛屽揩閫熺紪鍐� 6 涓� api 鎺ュ彛
+
+```ts
+import { CoolController, BaseController } from '@cool-midway/core';
+import { DemoAppGoodsEntity } from '../../entity/goods';
+
+/**
+ * 鍟嗗搧
+ */
+@CoolController({
+  api: ['add', 'delete', 'update', 'info', 'list', 'page'],
+  entity: DemoAppGoodsEntity,
+})
+export class DemoAppGoodsController extends BaseController {
+  /**
+   * 鍏朵粬鎺ュ彛
+   */
+  @Get('/other')
+  async other() {
+    return this.ok('hello, cool-admin!!!');
+  }
+}
+```
+
+杩欐牱鎴戜滑灏卞畬鎴愪簡 6 涓帴鍙g殑缂栧啓锛屽搴旂殑鎺ュ彛濡備笅锛�
+
+- `POST /app/demo/goods/add` 鏂板
+- `POST /app/demo/goods/delete` 鍒犻櫎
+- `POST /app/demo/goods/update` 鏇存柊
+- `GET /app/demo/goods/info` 鍗曚釜淇℃伅
+- `POST /app/demo/goods/list` 鍒楄〃淇℃伅
+- `POST /app/demo/goods/page` 鍒嗛〉鏌ヨ(鍖呭惈妯$硦鏌ヨ銆佸瓧娈靛叏鍖归厤绛�)
+
+### 閮ㄧ讲
+
+[閮ㄧ讲鏁欑▼](https://node.cool-admin.com/src/guide/deploy.html)
+
+### 鍐呯疆鎸囦护
+
+- 浣跨敤 `npm run lint` 鏉ュ仛浠g爜椋庢牸妫�鏌ャ��
+
+[midway]: https://midwayjs.org
+
+### 浣庝环鏈嶅姟鍣�
+
+[闃块噷浜戙�佽吘璁簯銆佸崕涓轰簯浣庝环浜戞湇鍔″櫒锛屼笉闄愭柊鑰乚(https://cool-js.com/service/cloud)

--
Gitblit v1.9.1