Commit a6a24e4a by 钟占达

zyd

parent 3ec7eec8
......@@ -41,14 +41,14 @@ class Templateconfig extends APIBase {
opResult = await this.imginfoSve.getImgList(pobj.actionBody);
break;
case "createImginfo": // 添加图片
opResult = await this.imginfoSve.create(pobj.actionBody);
opResult = await this.imginfoSve.createImginfo(pobj.actionBody);
break;
case "getTemplateList": // 获取模板列表
opResult = await this.templateinfoSve.findAndCountAll(pobj.actionBody);
opResult = await this.templateinfoSve.getTemplateList(pobj.actionBody);
// opResult = await this.templateinfoSve.findByCompanyId(pobj.actionBody);
break;
case "getFormList": // 获取表单列表
opResult = await this.forminfoSve.findByCompanyId(pobj.actionBody);
opResult = await this.forminfoSve.getFormList(pobj.actionBody);
break;
default:
opResult = system.getResult(null, "action_type参数错误");
......
......@@ -53,6 +53,10 @@ class ForminfoService extends ServiceBase {
return null;
}
async getFormList (pobj) {
let res = await this.dao.findAndCountAll(pobj);
return system.getResult(res);
}
}
module.exports = ForminfoService;
\ No newline at end of file
......@@ -5,8 +5,17 @@ class ImginfoService extends ServiceBase {
constructor() {
super("configmag", ServiceBase.getDaoName(ImginfoService));
}
async getImgList(obj){
var res = await this.dao.findAndCountAll(obj);
async getImgList (pobj) {
let res = await this.dao.findAndCountAll(pobj);
return system.getResultSuccess(res);
}
async createImginfo (pobj) {
let code = await this.getBusUid("img");
pobj.imginfo.code = code;
if (pobj.imginfo.company_id === undefined) {
pobj.imginfo.company_id = 10;
}
let res = await this.dao.create(pobj.imginfo);
return system.getResultSuccess(res);
}
async create(pobj){
......
......@@ -339,9 +339,9 @@
"actionType": "createImginfo",
"actionBody": {
"imginfo": {
"url": "https://gsb-zc.oss-cn-beijing.aliyuncs.com//zc_1137159702950007820201011182078huluwa.jpg",
"name": "444",
"size": "200K"
"name": "hahah",
"pic_url": "https://gsb-zc.oss-cn-beijing.aliyuncs.com//zc_1137159702950007820201011182078huluwa.jpg",
"pic_size": "200K"
}
}
}
......@@ -351,14 +351,19 @@
#### 返回结果
```javascript
{
"version": 0,
"id": 55,
"name": "444",
"pic_url": "https://gsb-zc.oss-cn-beijing.aliyuncs.com//zc_1137159702950007820201011182078huluwa.jpg",
"code": "IMG202008101624l5Vd5",
"company_id": 10,
"updated_at": "2020-08-10T08:24:49.672Z",
"created_at": "2020-08-10T08:24:49.672Z"
"status": 0,
"msg": "success",
"data": {
"version": 0,
"id": 93,
"name": "hahah",
"pic_url": "https://gsb-zc.oss-cn-beijing.aliyuncs.com//zc_1137159702950007820201011182078huluwa.jpg",
"code": "IMG202008111110GcI0b",
"company_id": 10,
"updated_at": "2020-08-11T03:10:38.999Z",
"created_at": "2020-08-11T03:10:38.999Z"
},
"requestId": "d8507fcc2bb14c49b8a5f3a3fa62f0fc"
}
```
......@@ -377,9 +382,6 @@
"pageInfo":{
"pageNo":1,
"pageSize":10
},
"where": {
"company_id": 10
}
}
}
......@@ -393,13 +395,45 @@
"msg": "操作成功",
"data": {
"results": {
"count": 3,
"count": 5,
"rows": [
{
"id": 5,
"code": "FM202008111118aCRMw4",
"name": "3",
"form_items": "手机号、单选按钮",
"form_describe": "4",
"notes": null,
"user_id": null,
"user_name": "jytest6",
"company_id": 10,
"record_num": null,
"created_at": "2020-08-11T03:18:59.000Z",
"updated_at": "2020-08-11T03:20:08.000Z",
"deleted_at": null,
"version": 0
},
{
"id": 4,
"code": "FM202008111117FRpd3P",
"name": "2",
"form_items": null,
"form_describe": "2",
"notes": null,
"user_id": 1,
"user_name": "jytest6",
"company_id": 11,
"record_num": null,
"created_at": "2020-08-11T03:17:42.000Z",
"updated_at": "2020-08-11T03:17:42.000Z",
"deleted_at": null,
"version": 0
},
{
"id": 1,
"code": "00001",
"name": "1",
"form_items": "手机号",
"form_items": "单选按钮、手机号",
"form_describe": "1",
"notes": "test",
"user_id": 1,
......@@ -407,7 +441,7 @@
"company_id": 10,
"record_num": 2,
"created_at": "2020-08-07T15:59:56.000Z",
"updated_at": "2020-08-10T05:43:03.000Z",
"updated_at": "2020-08-11T03:10:50.000Z",
"deleted_at": null,
"version": null
},
......@@ -431,7 +465,7 @@
"id": 2,
"code": null,
"name": "sssssss",
"form_items": null,
"form_items": "手机号",
"form_describe": "ss",
"notes": "tset2",
"user_id": null,
......@@ -439,7 +473,7 @@
"company_id": 10,
"record_num": 3,
"created_at": "2020-08-07T10:42:27.000Z",
"updated_at": "2020-08-07T10:42:27.000Z",
"updated_at": "2020-08-11T03:10:13.000Z",
"deleted_at": null,
"version": 0
}
......@@ -448,7 +482,6 @@
"aggresult": {}
},
"bizmsg": "empty",
"requestId": "a36fdfff4c2b4ae98b462c54b3cf588d"
"requestId": "7029b432952a4463ae99b0f560e0eefb"
}
```
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