Toggle navigation
Toggle navigation
This project
Loading...
Sign in
zuzitsu
/
UR_Village
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
Suyeon Jung
2020-12-07 19:24:55 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
70810ab9d933973e1726fe00d21dc9ef956b2761
70810ab9
1 parent
da1d8824
Change api from songclub to movietheater : culture result
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
18 deletions
routes/category.js
views/results/culture.ejs
routes/category.js
View file @
70810ab
...
...
@@ -404,26 +404,26 @@ router.get('/safe', function(req, res) {
});
router
.
get
(
'/culture'
,
function
(
req
,
res
)
{
//
노래방
let
sing_url
=
'https://openapi.gg.go.kr/Songclub
'
;
//
영화관
let
movie_url
=
'https://openapi.gg.go.kr/MovieTheater
'
;
let
qs
=
`?Type=json&KEY=
${
GYEONGI_API_KEY
}
&SIGUN_CD=
${
SIGUN_CODE
}
`
;
request
({
url
:
sing
_url
+
qs
,
url
:
movie
_url
+
qs
,
method
:
'GET'
},
function
(
err
,
response
,
body
)
{
if
(
!
err
&&
res
.
statusCode
==
200
)
{
let
sing
_result
=
JSON
.
parse
(
body
);
console
.
log
(
sing
_result
);
let
sing
s
=
[];
for
(
let
i
=
0
;
i
<
sing_result
.
Songclub
[
1
].
row
.
length
;
i
++
)
{
sing
=
sing_result
.
Songclub
[
1
].
row
[
i
];
let
movie
_result
=
JSON
.
parse
(
body
);
console
.
log
(
movie
_result
);
let
movie
s
=
[];
for
(
let
i
=
0
;
i
<
movie_result
.
MovieTheater
[
1
].
row
.
length
;
i
++
)
{
movie
=
movie_result
.
MovieTheater
[
1
].
row
[
i
];
// 폐업인 지점 제외
if
(
!
sing
[
'BSN_STATE_NM'
].
includes
(
'폐업'
)
&&
userArea
(
sing
,
'REFINE_LOTNO_ADDR'
,
user_dong
))
{
console
.
log
(
'
sing'
,
sing
);
sings
.
push
(
sing
);
if
(
!
movie
[
'BSN_STATE_NM'
].
includes
(
'폐업'
)
&&
userArea
(
movie
,
'REFINE_LOTNO_ADDR'
,
user_dong
))
{
console
.
log
(
'
movie'
,
movie
);
movies
.
push
(
movie
);
}
}
res
.
render
(
'result'
,
{
category
:
'culture'
,
sings
:
sing
s
,
userLocation
:
userLocation
});
res
.
render
(
'result'
,
{
category
:
'culture'
,
movies
:
movie
s
,
userLocation
:
userLocation
});
}
});
});
...
...
views/results/culture.ejs
View file @
70810ab
<h1>
🎤 노래방
현황</h1>
<h1>
🎬 영화관
현황</h1>
<table class="table">
<thead>
<th>사업장명</th>
<th>도로명주소</th>
</thead>
<tbody>
<%for (var i =0; i <
sing
s.length; i++){%>
<%for (var i =0; i <
movie
s.length; i++){%>
<tr>
<td>
<%=
sing
s[i].BIZPLC_NM%>
<%=
movie
s[i].BIZPLC_NM%>
</td>
<td>
<%=
sing
s[i].REFINE_ROADNM_ADDR%>
<%=
movie
s[i].REFINE_ROADNM_ADDR%>
</td>
</tr>
<%}%>
...
...
@@ -19,6 +19,6 @@
</table>
<h3>총
노래방
개수 :
<%=
sing
s.length%>
<h3>총
영화관
개수 :
<%=
movie
s.length%>
</h3>
\ No newline at end of file
...
...
Please
register
or
login
to post a comment