suggestFeedBack.js
947 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
44
/**
* 意见反馈 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 (!feedbackId || !questionId || !answer || !solution) {
suggestFeedBackModel.feedBackApi(feedbackId, questionId, answer, solution).then((result) => {
return res.jsonp({
code: 200,
data: result.data,
message: 'success'
});
}).catch(next);
} else {
return res.status(403).send({
message: '意见反馈失败'
});
}
};
module.exports = {
getFeedBack
};