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 +11 -1
- package/beforeTest/BaseMapperTest1.js +24 -0
- package/beforeTest/CollectUtilsTest.js +10 -0
- package/beforeTest/MongoDbBaseRestApiTest.js +3 -0
- package/beforeTest/installPluginTest.js +10 -0
- package/index.js +154 -125
- package/module/BaseMapper.js +56 -2
- package/package.json +1 -1
- package/plugins/BaseGraphqlApi/getGraphqlSchema.js +99 -27
- package/plugins/BaseGraphqlApi/index.js +8 -3
- package/plugins/BaseRpcApi/ApiCloudBaseRpcApi.js +3 -2
- package/utils/common/CollectionUtils.js +111 -0
- package/utils/common/DateUtils.js +36 -0
package/README.md
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
```
|
11
11
|
# cdn
|
12
12
|
|
13
|
-
https://unpkg.com/ming_node/
|
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)
|