Commit a6a24e4a by 钟占达

zyd

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