suggestFeedBack-service.js
960 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/**
* suggestFeedBack model
* @author: gxh<xuhui.ge@yoho.cn>
* @date: 2017/05/25
*/
'use strict';
const api = require('./suggestFeedBack-api');
const helpers = global.yoho.helpers;
const _ = require('lodash');
const suggestFeedBack = () => {
return api.feedBackApi().then((result) => {
let suggestData = [];
if (result && result.code === 200 && _.get(result, 'data.rows')) {
if (_.get(result, 'data.rows')) {
_.forEach(_.get(result, 'data.rows', []), it => {
let item = {
description: it.description,
title: it.title,
id: it.id,
url: helpers.urlFormat(`/3party/questionnaire/${it.id}`, null)
};
suggestData.push(item);
});
}
}
return suggestData;
});
};
module.exports = {
suggestFeedBack
};