suggestFeedBack.js
1003 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
40
41
42
43
/**
* 意见反馈 controller
* @return jsonp
* @author: gxh<xuhui.ge@yoho.cn>
* @date: 2017/04/06
*/
'use strict';
const suggestFeedBackModel = require('../models/suggestFeedBack');
const _ = require('lodash');
const getFeedBack = (req, res, next) => {
let feedbackId = req.query.feedback_id || 0;
let questionId = req.query.question_id || 0;
let answer = _.trim(req.query.answer) || '';
let solution = req.query.solution || 0;
if (!_.isEmpty(feedbackId) || !_.isEmpty(questionId) || !_.isEmpty(answer) || !_.isEmpty(solution)) {
suggestFeedBackModel.FeedBackApi(feedbackId, questionId, answer, solution).then((result) => {
return res.jsonp({
code: result.code,
data: result.data,
message: result.message
});
}).catch(next);
} else {
return res.status(403).send({
message: '意见反馈失败'
});
}
};
module.exports = {
getFeedBack
};