김서영

add cliConnection.js/ request client data and send analyzeData

1 +const textAnalytic = require("./textAnalystic");
2 +const search = require("./search");
3 +const machineRead = require("./machineRead");
4 +
5 +/**
6 + * @param req - request
7 + * @param req.body.data - client에서 보내는 데이터 req.body.data.text에 검색할 문장을 담아야 합니다
8 + * @description client와 데이터를 받아 통신하는 함수입니다
9 + */
10 +const cliConnection = async (req, res) => {
11 + let clientData = {},
12 + analyzeData = {},
13 +
14 + clientData = req.body.data;
15 + //clientData = req.body.data;
16 +
17 + analyzeData = await textAnalytic(clientData);
18 +
19 + analyzeData.searchResults = searchData;
20 + res.send({ return_code: 0, return_data: analyzeData });
21 + res.status(200);
22 +};
23 +
24 +module.exports = cliConnection;