Commit f5e9178b by 孙亚楠

Merge branch 'esign-admin' of gitlab.gongsibao.com:jiangyong/zhichan into esign-admin

parents 03797396 8858f94f
......@@ -51,6 +51,24 @@ class ProductCtl extends CtlBase {
return system.getResultFail(500, err.message)
}
}
async apiList (pobj) {
try {
let res = await this.prodSve.apiList(pobj)
return res
} catch (error) {
return system.getResultFail(500, err.message)
}
}
async apiMap (pobj) {
try {
let res = await this.prodSve.apiMap(pobj)
return res
} catch (error) {
return system.getResultFail(500, err.message)
}
}
}
module.exports = ProductCtl;
\ No newline at end of file
......@@ -45,6 +45,22 @@ class ProductService extends ServiceBase {
throw error
}
}
async apiList (params) {
try {
return await this.callms("engine_product", "apiList", params)
} catch (error) {
throw error
}
}
async apiMap (params) {
try {
return await this.callms("engine_product", "apiMap", params)
} catch (error) {
throw error
}
}
}
module.exports = ProductService;
\ No newline at end of file
......@@ -7,6 +7,8 @@
3. [根据 id 数组查询](#getByIds)
4. [获取组合产品子产品列表](#getItems)
5. [添加/更新产品](#createOrUpdate)
6. [获取api (list格式)](#apiList)
7. [获取api (object格式)](#apiMap)
## **<a name="getPage"> 产品分页查询 </a>**
......@@ -24,14 +26,14 @@
| -------- | -------- | ------ | -------------------- |
| page | number | 可选 | 页数 默认 1 |
| limit | number | 可选 | 每页条数 默认 10 |
| types | list | 可选 | 所选类别 默认 [0, 1] |
| types | list | 可选 | 所选类别 默认 [1, 2] |
| keywords | string | 可选 | 关键字 |
#### 参数示例
```javascript
{
"types": [0],
"types": [1],
"keywords": "s",
"page": 1,
"limit": 1
......@@ -51,8 +53,9 @@
"id":7,
"source_id":10001, // 产品来源 id
"product_name":"ssda", // 产品名称
"product_type":0, // 产品类型
"product_type":1, // 产品类型
"product_desc":"0", // 产品描述
"product_property": 0,
"price":0, // 产品价格
"cost":0,
"created_at":"2020-06-29T11:31:35.000Z",
......@@ -79,7 +82,7 @@
| 参数名 | 参数类型 | 必选项 | 备注 |
| ------ | -------- | ------ | -------------------- |
| types | list | 可选 | 所选类别 默认 [0, 1] |
| types | list | 可选 | 所选类别 默认 [1, 2] |
#### 参数示例
......@@ -100,6 +103,7 @@
"id":6,
"product_type":2,
"product_name":"asdf",
"product_property": 0,
"price":0,
"ids":[
1,
......@@ -109,6 +113,7 @@
"id":11,
"product_type":2,
"product_name":"testa",
"product_property": 0,
"price":1,
"ids":[
8,
......@@ -119,6 +124,7 @@
"id":13,
"product_type":2,
"product_name":"testb",
"product_property": 0,
"price":1,
"ids":[
8,
......@@ -129,6 +135,7 @@
"id":1,
"product_type":1,
"product_name":"ss",
"product_property": 0,
"price":0,
"productitems":[
],
......@@ -139,6 +146,7 @@
"id":7,
"product_type":1,
"product_name":"ssda",
"product_property": 0,
"price":0,
"ids":[
]
......@@ -147,6 +155,7 @@
"id":8,
"product_type":1,
"product_name":"test",
"product_property": 0,
"price":1,
"ids":[
]
......@@ -155,6 +164,7 @@
"id":9,
"product_type":1,
"product_name":"test",
"product_property": 0,
"price":1,
"ids":[
]
......@@ -163,6 +173,7 @@
"id":10,
"product_type":1,
"product_name":"test",
"product_property": 0,
"price":1,
"ids":[
]
......@@ -171,6 +182,7 @@
"id":12,
"product_type":1,
"product_name":"testa",
"product_property": 0,
"price":1,
"ids":[
]
......@@ -216,7 +228,8 @@
"id":6,
"source_id":10001,
"product_name":"asdf", // 产品名称
"product_type":1, // 产品类型
"product_type":2, // 产品类型
"product_property": 0,
"product_desc":"0", // 产品描述
"price":0, // 产品价格
"cost":0,
......@@ -229,7 +242,8 @@
"id":7,
"source_id":10001,
"product_name":"ssda",
"product_type":0,
"product_type":1,
"product_property": 0,
"product_desc":"0",
"price":0,
"cost":0,
......@@ -278,8 +292,9 @@
"id":1,
"source_id":10001,
"product_name":"ss", // 产品名称
"product_type":0, // 产品类型
"product_type":1, // 产品类型
"product_desc":"0", // 产品描述
"product_property": 0,
"price":0, // 产品价格
"cost":0,
"created_at":"2020-06-28T17:37:28.000Z",
......@@ -291,7 +306,8 @@
"id":7,
"source_id":10001,
"product_name":"ssda",
"product_type":0,
"product_type":1,
"product_property": 0,
"product_desc":"0",
"price":0,
"cost":0,
......@@ -322,11 +338,11 @@
| id | number | 可选 | 更新产品的主键 如果没有则为创建 |
| source_id | number | 可选 | 产品来源 id 默认 10001 |
| product_name | string | 必选 | 产品名称 |
| product_type | number | 必选 | 产品类型 0: 单产品 1: 组合产品 |
| product_type | number | 必选 | 产品类型 1: 单产品 2: 组合产品 |
| price | number | 可选 | 默认 0 |
| cost | number | 可选 | 默认 0 |
| api | string | 可选 | |
| items | list | 限定必选 | 子产品 id 列表 <br> 如果 product_type 为 1 则必有此项 <br> 如果为 0 则必没有此项 |
| items | list | 限定必选 | 子产品 id 列表 <br> 如果 product_type 为 2 则必有此项 <br> 如果为 1 则必没有此项 |
#### 参数示例
......@@ -334,7 +350,8 @@
{
"source_id": 10001,
"product_name": "testa",
"product_type": 1,
"product_type": 2,
"product_property": 0,
"product_desc": "testa",
"price": 1,
"cost": 0,
......@@ -354,3 +371,81 @@
"requestid":"e6f7a5e50e404296ad47c92f43a54de4"
}
```
## **<a name="apiList"> 获取api </a>**
[返回到目录](#menu)
#### HTTP 请求方式 `POST`
#### 接口地址 `/web/product/productCtl/apiList`
#### 返回结果
```javascript
{
"status":0,
"msg":"success",
"data":[
{
"key":"nameTwo_1",
"name":"姓名二要素-e签宝"
},
{
"key":"sign_1",
"name":"手动签-e签宝"
},
{
"key":"autoSign_1",
"name":"静默签-e签宝"
},
{
"key":"bankThree_2",
"name":"银行卡三要素-兰铂旺"
},
{
"key":"bankFour_2",
"name":"银行卡四要素-兰铂旺"
}],
"requestid":"d8dbbd33f0294f9e8b3fbfac51165f57"
}
```
## **<a name="apiMap"> 获取api </a>**
[返回到目录](#menu)
#### HTTP 请求方式 `POST`
#### 接口地址 `/web/product/productCtl/apiMap`
#### 返回结果
```javascript
{
"status":0,
"msg":"success",
"data":{
"nameTwo_1":{
"key":"nameTwo_1",
"name":"姓名二要素-e签宝"
},
"sign_1":{
"key":"sign_1",
"name":"手动签-e签宝"
},
"autoSign_1":{
"key":"autoSign_1",
"name":"静默签-e签宝"
},
"bankThree_2":{
"key":"bankThree_2",
"name":"银行卡三要素-兰铂旺"
},
"bankFour_2":{
"key":"bankFour_2",
"name":"银行卡四要素-兰铂旺"
}
},
"requestid":"08483f755eeb48928e7eb201252b8476"
}
```
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment