Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2021-1-capstone-design1
/
RIT_Project1
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
1
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
박권수
2021-09-16 20:46:54 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
677ab067c030584a29c3f94f4864f3dd2b12d66c
677ab067
1 parent
9bbb3b4e
feat. search hospital -> page, totalpage
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletions
server/src/api/auth/auth.ctrl.js
server/src/api/auth/auth.ctrl.js
View file @
677ab06
...
...
@@ -73,16 +73,19 @@ exports.searchHospital = async ctx => {
page
,
}
=
ctx
.
query
;
const
pageSlice
=
5
;
const
url
=
'http://apis.data.go.kr/B551182/hospInfoService1/getHospBasisList1'
;
let
queryParams
=
'?'
+
encodeURIComponent
(
'ServiceKey'
)
+
'='
+
process
.
env
.
SERVICE_KEY
;
queryParams
+=
'&'
+
encodeURIComponent
(
'pageNo'
)
+
'='
+
encodeURIComponent
(
page
);
queryParams
+=
'&'
+
encodeURIComponent
(
'numOfRows'
)
+
'='
+
encodeURIComponent
(
10
);
queryParams
+=
'&'
+
encodeURIComponent
(
'numOfRows'
)
+
'='
+
encodeURIComponent
(
pageSlice
);
queryParams
+=
'&'
+
encodeURIComponent
(
'yadmNm'
)
+
'='
+
encodeURIComponent
(
hospitalNm
);
const
result
=
await
axios
.
get
(
url
+
queryParams
);
ctx
.
status
=
200
;
ctx
.
body
=
{
totalPage
:
Math
.
ceil
(
result
.
data
.
response
.
body
.
totalCount
/
pageSlice
),
hospitalList
:
result
.
data
.
response
.
body
.
items
.
item
,
};
};
...
...
Please
register
or
login
to post a comment