Toggle navigation
Toggle navigation
This project
Loading...
Sign in
김대선
/
Recruitment_Information_chatbot
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
김대선
2021-05-31 22:14:04 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
261dcfaa8117059a57205d3f223e64efaeb1c3e8
261dcfaa
1 parent
e54df28f
공고명, 회사명, Tag를 통한 데이터 조회 기능 구현
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
6 deletions
app.js
functions/dataFunctions.js
functions/findFunction.js
app.js
View file @
261dcfa
const
express
=
require
(
'express'
)
const
schedule
=
require
(
'node-schedule'
)
const
data
Functions
=
require
(
'./functions/dataFunctions'
)
const
data
=
require
(
'./functions/dataFunctions'
)
const
find
=
require
(
'./functions/findFunction'
)
const
app
=
express
();
// 0초 0분 0시 아무날 아무달 아무년
const
saveData
=
schedule
.
scheduleJob
(
'55 45 20 * * *'
,
data
Functions
.
save
)
const
saveData
=
schedule
.
scheduleJob
(
'55 45 20 * * *'
,
data
.
save
)
const
server
=
app
.
listen
(
3000
,()
=>
{
const
host
=
server
.
address
().
address
...
...
@@ -19,6 +19,6 @@ const server = app.listen(3000,()=>{
app
.
get
(
'/'
,
async
(
req
,
res
)
=>
{
data
=
await
dataFunctions
.
read
(
)
res
.
send
(
data
)
console
.
log
(
find
.
byCompanyName
(
'naver'
)[
0
],
find
.
byTags
(
'백엔드'
)[
0
],
find
.
byTitle
(
'백엔드'
)[
0
]
)
res
.
send
(
'helloworld'
)
})
\ No newline at end of file
...
...
functions/dataFunctions.js
View file @
261dcfa
const
fs
=
require
(
'fs'
)
const
functions
=
require
(
'./function'
)
const
read
=
async
()
=>
{
const
read
=
()
=>
{
const
data
=
[]
let
title
=
""
let
tags
=
[]
...
...
functions/findFunction.js
0 → 100644
View file @
261dcfa
const
data
=
require
(
'./dataFunctions'
)
const
byCompanyName
=
function
(
companyName
){
return
data
.
read
().
filter
(
data
=>
data
.
companyName
.
includes
(
companyName
))
}
const
byTags
=
function
(
tag
){
return
data
.
read
().
filter
(
data
=>
data
.
tags
.
join
().
includes
(
tag
))
}
const
byTitle
=
function
(
title
){
return
data
.
read
().
filter
(
data
=>
data
.
title
.
includes
(
title
))
}
module
.
exports
=
{
byCompanyName
:
byCompanyName
,
byTags
:
byTags
,
byTitle
:
byTitle
}
\ No newline at end of file
Please
register
or
login
to post a comment