박권수

style. unecessary code remove and marking

...@@ -3,8 +3,28 @@ const authCtrl = require('./auth.ctrl'); ...@@ -3,8 +3,28 @@ const authCtrl = require('./auth.ctrl');
3 3
4 const auth = new Router(); 4 const auth = new Router();
5 5
6 +/**
7 + * 회원가입 (email type)
8 + * url : http://localhost:4000/api/auth/register
9 + * request parameter : userId, password, passwordCheck
10 + * return : null
11 + */
6 auth.post('/register', authCtrl.register); 12 auth.post('/register', authCtrl.register);
13 +
14 +/**
15 + * 로그인 (email type)
16 + * url : http://localhost:4000/api/auth/login
17 + * request parameter : userId, password
18 + * return : userId
19 + */
7 auth.post('/login', authCtrl.login); 20 auth.post('/login', authCtrl.login);
21 +
22 +/**
23 + * 로그아웃
24 + * url : http://localhost:4000/api/auth/logout
25 + * request parameter : null
26 + * return : null
27 + */
8 auth.post('/logout', authCtrl.logout); 28 auth.post('/logout', authCtrl.logout);
9 29
10 module.exports = auth; 30 module.exports = auth;
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -162,16 +162,3 @@ exports.setMedicine = async(ctx) => { ...@@ -162,16 +162,3 @@ exports.setMedicine = async(ctx) => {
162 ctx.status = 200; 162 ctx.status = 200;
163 } 163 }
164 164
165 -const dataRequest = () => {
166 - return 'dataRequest'
167 -}
168 -
169 -const getData = async() => {
170 - return 'getData'
171 -}
172 -
173 -const dataProcess = async() => {
174 - return 'dataProcess..'
175 -}
176 -
177 -
......
...@@ -3,9 +3,36 @@ const bottleCtrl = require('./bottle.ctrl'); ...@@ -3,9 +3,36 @@ const bottleCtrl = require('./bottle.ctrl');
3 3
4 const bottle = new Router(); 4 const bottle = new Router();
5 5
6 +/**
7 + * 약병 연결
8 + * request parameter : bottleId, hubId
9 + * url : http://localhost:4000/api/bottle
10 + * return : null
11 + */
6 bottle.post('/', bottleCtrl.bottleConnect); 12 bottle.post('/', bottleCtrl.bottleConnect);
13 +
14 +/**
15 + * 약병 연결 해제
16 + * request parameter : x
17 + * url : http://localhost:4000/api/bottle/:bottleId
18 + * return : null
19 + */
7 bottle.delete('/:bottleId', bottleCtrl.bottleDisconnect); 20 bottle.delete('/:bottleId', bottleCtrl.bottleDisconnect);
21 +
22 +/**
23 + * 약병 정보 확인
24 + * request parameter : x
25 + * url : http://localhost:4000/api/bottle/:bottleId
26 + * return : bottle(json type)
27 + */
8 bottle.get('/:bottleId', bottleCtrl.lookupInfo); 28 bottle.get('/:bottleId', bottleCtrl.lookupInfo);
29 +
30 +/**
31 + * 약병에 약 등록 = 약 검색 후 약 ID(medicineId)와 복용 정보 보고 사용자가 약 복용량(dosage) 입력
32 + * request parameter : medicineId, dosage
33 + * url : http://localhost:4000/api/bottle/:bottleId
34 + * return : bottle(json type)
35 + */
9 bottle.patch('/:bottleId', bottleCtrl.setMedicine); 36 bottle.patch('/:bottleId', bottleCtrl.setMedicine);
10 37
11 module.exports = bottle; 38 module.exports = bottle;
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -3,7 +3,20 @@ const hubCtrl = require('./hub.ctrl'); ...@@ -3,7 +3,20 @@ const hubCtrl = require('./hub.ctrl');
3 3
4 const hub = new Router(); 4 const hub = new Router();
5 5
6 +/**
7 + * 허브 등록
8 + * request parameter : hubId, host, port
9 + * url : http://localhost:4000/api/hub
10 + * return : hub(json type)
11 + */
6 hub.post('/', hubCtrl.hubConnect); 12 hub.post('/', hubCtrl.hubConnect);
13 +
14 +/**
15 + * 허브 등록 해제
16 + * request parameter : x
17 + * url : http://localhost:4000/api/hub/:hubId
18 + * return : null
19 + */
7 hub.delete('/:hubId', hubCtrl.hubDisconnect); 20 hub.delete('/:hubId', hubCtrl.hubDisconnect);
8 21
9 module.exports = hub; 22 module.exports = hub;
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -3,7 +3,20 @@ const medicineCtrl = require('./medicine.ctrl'); ...@@ -3,7 +3,20 @@ const medicineCtrl = require('./medicine.ctrl');
3 3
4 const medicine = new Router(); 4 const medicine = new Router();
5 5
6 +/**
7 + * 약 검색 후 검색 대상 가져오기
8 + * request parameter : name, company, target 중 하나
9 + * url : http://localhost:4000/api/medicine
10 + * return : medicine List(json 타입의 List)
11 + */
6 medicine.post('/', medicineCtrl.medicineSearch); 12 medicine.post('/', medicineCtrl.medicineSearch);
13 +
14 +/**
15 + * 약 검색 후 검색 대상 가져오기
16 + * request parameter : x
17 + * url : http://localhost:4000/api/medicine/:mdedicineId
18 + * return : medicine(json type)
19 + */
7 medicine.get('/:medicineId', medicineCtrl.medicineGet); 20 medicine.get('/:medicineId', medicineCtrl.medicineGet);
8 21
9 module.exports = medicine; 22 module.exports = medicine;
...\ No newline at end of file ...\ No newline at end of file
......