Toggle navigation
Toggle navigation
This project
Loading...
Sign in
김재웅
/
TFT
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
hellowhales
2021-11-30 02:16:28 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
abbd29250f6e488dfbb10cdc9a2d1dc66bdaa4b3
abbd2925
1 parent
39dae057
APIhandelr Alpha version
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
8 deletions
APIhandler.js
models/Festival.js
server.js
APIhandler.js
View file @
abbd292
let
request
=
require
(
'request'
);
let
options
=
{
'method'
:
'GET'
,
'url'
:
'http://api.visitkorea.or.kr/openapi/service/rest/KorService/areaBasedList?ServiceKey=
2lFkvQJYgzOOhwUKiUt8aZVNpd1PpBOf%2FfMNW17cl25DE0GUEDddeR9iGnuSUpggjUoIUgamfhcvnKQ3eH1dA
w%3D%3D&contentTypeId=15&areaCode=&sigunguCode=&cat1=&cat2=&cat3=&listYN=Y&MobileOS=ETC&MobileApp=TourAPI3.0_Guide&arrange=C&numOfRows=12&pageNo=1&_type=json'
,
'url'
:
'http://api.visitkorea.or.kr/openapi/service/rest/KorService/areaBasedList?ServiceKey=
3zrQDvoNwUV9Se%2BHZv8DjCCNWRGJisQ7jjHP6LsbJqoRQ2cJpQKrHUGC4uslgXSVO9Dzb06BSC3kp9BunvIPS
w%3D%3D&contentTypeId=15&areaCode=&sigunguCode=&cat1=&cat2=&cat3=&listYN=Y&MobileOS=ETC&MobileApp=TourAPI3.0_Guide&arrange=C&numOfRows=12&pageNo=1&_type=json'
,
'headers'
:
{
}
};
...
...
@@ -18,7 +18,7 @@ for(i in info['response']['body']['items']['item']){
'public'
:
{
'method'
:
'GET'
,
'url'
:
'http://api.visitkorea.or.kr/openapi/service/rest/KorService/detailCommon?'
+
'ServiceKey='
+
'
2lFkvQJYgzOOhwUKiUt8aZVNpd1PpBOf%2FfMNW17cl25DE0GUEDddeR9iGnuSUpggjUoIUgamfhcvnKQ3eH1dA
w%3D%3D'
+
'ServiceKey='
+
'
3zrQDvoNwUV9Se%2BHZv8DjCCNWRGJisQ7jjHP6LsbJqoRQ2cJpQKrHUGC4uslgXSVO9Dzb06BSC3kp9BunvIPS
w%3D%3D'
+
'&contentTypeId='
+
'15'
+
'&contentId='
+
+
contentId
[
i
]
+
'&MobileOS=ETC&MobileApp=TourAPI3.0_Guide&defaultYN=Y&firstImageYN=Y&areacodeYN=Y&catcodeYN=Y&addrinfoYN=Y&mapinfoYN=Y&overviewYN=Y&transGuideYN=Y&_type=json'
,
...
...
@@ -27,7 +27,7 @@ for(i in info['response']['body']['items']['item']){
'detail'
:
{
'method'
:
'GET'
,
'url'
:
'http://api.visitkorea.or.kr/openapi/service/rest/KorService/detailIntro?'
+
'ServiceKey='
+
'
2lFkvQJYgzOOhwUKiUt8aZVNpd1PpBOf%2FfMNW17cl25DE0GUEDddeR9iGnuSUpggjUoIUgamfhcvnKQ3eH1dA
w%3D%3D'
+
'ServiceKey='
+
'
3zrQDvoNwUV9Se%2BHZv8DjCCNWRGJisQ7jjHP6LsbJqoRQ2cJpQKrHUGC4uslgXSVO9Dzb06BSC3kp9BunvIPS
w%3D%3D'
+
'&contentTypeId='
+
'15'
+
'&contentId='
+
contentId
[
i
]
+
'&MobileOS=ETC&MobileApp=TourAPI3.0_Guide&introYN=Y&_type=json'
,
...
...
@@ -36,7 +36,7 @@ for(i in info['response']['body']['items']['item']){
'weather'
:
{
'method'
:
'GET'
,
'url'
:
'http://apis.data.go.kr/1360000/VilageFcstInfoService_2.0/getVilageFcst?'
+
'serviceKey='
+
'
2lFkvQJYgzOOhwUKiUt8aZVNpd1PpBOf%2FfMNW17cl25DE0GUEDddeR9iGnuSUpggjUoIUgamfhcvnKQ3eH1dA
w%3D%3D'
+
'serviceKey='
+
'
3zrQDvoNwUV9Se%2BHZv8DjCCNWRGJisQ7jjHP6LsbJqoRQ2cJpQKrHUGC4uslgXSVO9Dzb06BSC3kp9BunvIPS
w%3D%3D'
+
'&pageNo='
+
'1'
+
'&numOfRows='
+
'50'
+
'&dataType='
+
'JSON'
...
...
models/Festival.js
View file @
abbd292
...
...
@@ -6,12 +6,25 @@ const festivalSchema = new Schema({
addr
:
String
,
tel
:
String
,
mapx
:
Number
,
mapy
:
Number
mapy
:
Number
,
eventstartdate
:
String
,
eventenddate
:
String
,
overview
:
String
,
firstimage
:
String
,
homepage
:
String
,
district
:
String
,
city
:
String
,
temparature
:
Number
,
weathers
:
String
// weather : {
// date1: { weather : String, temp : Number},
// date2: { weather : String, temp : Number},
// date3: { weather : String, temp : Number},
// }
},
{
timestamps
:
true
}
);
versionKey
:
false
});
module
.
exports
=
mongoose
.
model
(
'Festival'
,
festivalSchema
);
...
...
server.js
View file @
abbd292
This diff is collapsed. Click to expand it.
Please
register
or
login
to post a comment