Toggle navigation
Toggle navigation
This project
Loading...
Sign in
ncov
/
back
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
lintry
2020-01-30 14:03:41 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
e4d993a18b4064d55a72cb1e719b8975b747c6a4
e4d993a1
1 parent
e0ff7e50
调整接口参数配置
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
5 deletions
server/cron/crawler.js
server/init/config.js
server/cron/crawler.js
View file @
e4d993a
...
...
@@ -2,14 +2,16 @@
* run
* Created by lintry on 2020/1/28.
*/
const
_
=
require
(
'lodash'
);
const
config
=
global
.
config
;
const
dbo
=
global
.
sequelize
;
const
DataImporter
=
require
(
'../service/data_importer'
);
const
data_importer
=
new
DataImporter
(
dbo
);
const
NCOV_URL
=
config
.
NCOV
.
API_URL
;
const
NCOV_URL
=
config
.
NCOV_API
.
area
.
url
;
const
NCOV_PARAM
=
config
.
NCOV_API
.
area
.
param
;
const
Result
=
require
(
'kml-express-stage-lib'
).
Result
;
module
.
exports
=
async
(
cfg
)
=>
{
await
data_importer
.
import_url
(
NCOV_URL
,
{
latest
:
0
}
)
return
Result
.
Ok
(
`Fetched from
${
NCOV_URL
}
`
);
await
data_importer
.
import_url
(
NCOV_URL
,
_
.
merge
({
latest
:
0
},
NCOV_PARAM
)
)
return
Result
.
Ok
(
`Fetched from
${
NCOV_URL
}
`
,
NCOV_PARAM
);
};
...
...
server/init/config.js
View file @
e4d993a
...
...
@@ -209,8 +209,13 @@ const configure = function () {
},
// 获取数据的api地址
NCOV
:
{
API_URL
:
'https://lab.isaaclin.cn/nCoV/api/area'
NCOV_API
:
{
area
:
{
url
:
'https://lab.isaaclin.cn/nCoV/api/area'
,
param
:
{
latest
:
1
}
}
}
};
...
...
Please
register
or
login
to post a comment