Showing
4 changed files
with
3 additions
and
39 deletions
1 | const { marketMultiSearch } = require("../search/marketSearch"); | 1 | const { marketMultiSearch } = require("../search/marketSearch"); |
2 | const setCarouselMessage = require("../message/setCarouselMessage"); | 2 | const setCarouselMessage = require("../message/setCarouselMessage"); |
3 | + | ||
3 | // Database APIs | 4 | // Database APIs |
4 | const db = require("../../apis/database"); | 5 | const db = require("../../apis/database"); |
5 | -// API List | ||
6 | -// database.addKeyword = async function(keyword, userId) | ||
7 | -// database.deleteKeyword = async function(userId, keyword) | ||
8 | -// database.getKeywordsByUserId = async function(userId) | ||
9 | -// database.getUsersByKeyword = async function(keyword) | ||
10 | -// database.getAllUsers = async function() | ||
11 | -// database.getAllKeywords = async function() | ||
12 | 6 | ||
13 | const multiCheckMamul = (client) => { | 7 | const multiCheckMamul = (client) => { |
14 | db.getAllKeywords().then((keywords) => { | 8 | db.getAllKeywords().then((keywords) => { | ... | ... |
1 | // Line chatbot + Message generate functions | 1 | // Line chatbot + Message generate functions |
2 | const line = require("@line/bot-sdk"); | 2 | const line = require("@line/bot-sdk"); |
3 | -// const setFlexMessage = require("./message/setFlexMessage"); | ||
4 | const setCarouselMessage = require("./message/setCarouselMessage"); | 3 | const setCarouselMessage = require("./message/setCarouselMessage"); |
5 | -// const setKeywordsFlexMessage = require("./message/setKeywordsFlexMessage"); | ||
6 | 4 | ||
7 | // Market Search | 5 | // Market Search |
8 | -// const { daangnSingleSearch } = require("./search/daangnSearch"); | ||
9 | -// const { daangnMultiSearch } = require("./search/daangnSearch"); | ||
10 | -// const { joongnaSingleSearch } = require("./search/joongnaSearch"); | ||
11 | -// const { joongnaMultiSearch } = require("./search/joongnaSearch"); | ||
12 | -// const { bunjangSingleSearch } = require("./search/bunjangSearch"); | ||
13 | -// const { bunjangMultiSearch } = require("./search/bunjangSearch"); | ||
14 | const { marketMultiSearch } = require("./search/marketSearch"); | 6 | const { marketMultiSearch } = require("./search/marketSearch"); |
15 | 7 | ||
16 | -// File search - Will be deleted (Unused) | 8 | +// File search |
17 | const fs = require("fs"); | 9 | const fs = require("fs"); |
18 | 10 | ||
19 | // Cron for Mamul Notification | 11 | // Cron for Mamul Notification |
... | @@ -24,13 +16,6 @@ const job = schedule.scheduleJob("0 */1 * * *", () => { | ... | @@ -24,13 +16,6 @@ const job = schedule.scheduleJob("0 */1 * * *", () => { |
24 | 16 | ||
25 | // Database APIs | 17 | // Database APIs |
26 | const db = require("../apis/database"); | 18 | const db = require("../apis/database"); |
27 | -// API List | ||
28 | -// database.addKeyword = async function(keyword, userId) | ||
29 | -// database.deleteKeyword = async function(userId, keyword) | ||
30 | -// database.getKeywordsByUserId = async function(userId) | ||
31 | -// database.getUsersByKeyword = async function(keyword) | ||
32 | -// database.getAllUsers = async function() | ||
33 | -// database.getAllKeywords = async function() | ||
34 | 19 | ||
35 | // Import credentials for Line chatbot | 20 | // Import credentials for Line chatbot |
36 | require("dotenv").config({ path: __dirname + "/../config/.env" }); | 21 | require("dotenv").config({ path: __dirname + "/../config/.env" }); | ... | ... |
... | @@ -3,21 +3,7 @@ const setFlexMessage = require("./setFlexMessage"); | ... | @@ -3,21 +3,7 @@ const setFlexMessage = require("./setFlexMessage"); |
3 | function setCarouselMessage(mamuls, keyword) { | 3 | function setCarouselMessage(mamuls, keyword) { |
4 | let flexMessages = []; | 4 | let flexMessages = []; |
5 | let flexMessage = {}; | 5 | let flexMessage = {}; |
6 | - if ( | 6 | + if (mamuls[0] == undefined) { |
7 | - mamuls[0] == undefined | ||
8 | - // && | ||
9 | - // mamuls[1] == undefined && | ||
10 | - // mamuls[2] == undefined && | ||
11 | - // mamuls[3] == undefined && | ||
12 | - // mamuls[4] == undefined && | ||
13 | - // mamuls[5] == undefined && | ||
14 | - // mamuls[6] == undefined && | ||
15 | - // mamuls[7] == undefined && | ||
16 | - // mamuls[8] == undefined && | ||
17 | - // mamuls[9] == undefined && | ||
18 | - // mamuls[10] == undefined && | ||
19 | - // mamuls[11] == undefined | ||
20 | - ) { | ||
21 | let nonMamulMessage = { | 7 | let nonMamulMessage = { |
22 | type: "flex", | 8 | type: "flex", |
23 | altText: `${keyword} 매물은 아직 없어요!`, | 9 | altText: `${keyword} 매물은 아직 없어요!`, | ... | ... |
1 | const { daangnMultiSearch } = require("./daangnSearch"); | 1 | const { daangnMultiSearch } = require("./daangnSearch"); |
2 | const { bunjangMultiSearch } = require("./bunjangSearch"); | 2 | const { bunjangMultiSearch } = require("./bunjangSearch"); |
3 | const { joongnaMultiSearch } = require("./joongnaSearch"); | 3 | const { joongnaMultiSearch } = require("./joongnaSearch"); |
4 | -const setCarouselMessage = require("../message/setCarouselMessage"); | ||
5 | 4 | ||
6 | const marketMultiSearch = (keyword) => { | 5 | const marketMultiSearch = (keyword) => { |
7 | const result = []; | 6 | const result = []; | ... | ... |
-
Please register or login to post a comment