ming_node 2.2.5 → 2.4.0

Sign up to get free protection for your applications and to get access to all the features.
package/README.md CHANGED
@@ -10,7 +10,7 @@
10
10
  ```
11
11
  # cdn
12
12
 
13
- https://unpkg.com/ming_node/MemoryBaseRpcApi.js
13
+ https://unpkg.com/ming_node/index.js
14
14
 
15
15
 
16
16
  # ming_node最小环境
@@ -190,6 +190,16 @@ async function main(){
190
190
 
191
191
  ```
192
192
 
193
+ # Rpc风格,服务插件
194
+ [ming_node api插件.yuque](https://www.yuque.com/docs/share/f4444345-ea5b-4f3d-b0c7-ab267e901e81)
195
+ ```js
196
+ var M=require("ming_node");
197
+ const Api= require("ming_node/plugins/BaseRpcApi/MemoryBaseRpcApi");
198
+ let api = new Api({tableName:"ming",generateTime:true})
199
+ var app=M.server();
200
+ app.listen(8888);
201
+ app.use(api);
202
+ ```
193
203
 
194
204
  # 基于ming_node 的 ming_api_mock
195
205
 
@@ -0,0 +1,24 @@
1
+ var M=require("../index");
2
+ Db= M.getMySql({
3
+ database: "lj_node"
4
+ })
5
+ const BaseMapper=require("../module/BaseMapper");
6
+ //mi_api 是表名
7
+ file_chat_msgMapper = new BaseMapper("file_chat_msg");
8
+ async function main(){
9
+
10
+ r=await file_chat_msgMapper.selectList({});
11
+ await BaseMapper.appendListName({
12
+ tableName:"vip_basic",
13
+ list:r,
14
+ list_idkey:"create_user",
15
+ list_namekey:"create_user_name",
16
+ db_idkey:"unionid",
17
+ db_namekey:"name"
18
+ })
19
+ console.log(r);
20
+ }
21
+
22
+ main().then(d=>{
23
+ process.exit()
24
+ })
@@ -0,0 +1,10 @@
1
+ var M=require("../index");
2
+
3
+ CollectionUtils= require("../utils/common/CollectionUtils")
4
+
5
+ r1= CollectionUtils.u([[{name:"zs"}],[{name:"zws"}]],"name")
6
+ r2= CollectionUtils.n([[{name:"zs"}],[{name:"zs"}]],"name")
7
+ console.log(r1)
8
+ console.log(r2)
9
+
10
+ console.log(MIO)
@@ -17,3 +17,6 @@ var app=M.server();
17
17
  app.listen(8888);
18
18
 
19
19
  app.use(mongoDbBaseRestApi);
20
+
21
+
22
+ console.log(M._globle_plugin)
@@ -0,0 +1,10 @@
1
+ var M=require("ming_node");
2
+
3
+ var app=M.server();
4
+ app.listen(8888);
5
+
6
+ app.installPlugin("http://localhost:4444/OssWebApi.js",{
7
+ name:"我是插件构造方法参数"
8
+ },{
9
+ name:"我是插件构造方法附加参数"
10
+ });