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-10-20 12:22:45 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
49b57a02536990aa99619b5c4eec5f09009278d4
49b57a02
1 parent
4d17191c
feat. 사용성 개선 및 db 수정
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
0 deletions
server/src/api/bottle/bottle.ctrl.js
server/src/api/doctor/doctor.ctrl.js
server/src/api/hub/hub.ctrl.js
web/src/views/main/doctor/DoctorMenuContainer.tsx
server/src/api/bottle/bottle.ctrl.js
View file @
49b57a0
...
...
@@ -103,6 +103,7 @@ exports.bottleDisconnect = async(ctx) => {
const
topic
=
'bottle/'
+
bottleId
+
'/bts'
;
Mqtt
.
mqttUnsubscribe
(
client
,
topic
);
await
BottleMedicine
.
updateMany
({
bottleId
},
{
useYn
:
'N'
});
await
Bottle
.
deleteOne
({
bottleId
});
ctx
.
status
=
204
;
...
...
server/src/api/doctor/doctor.ctrl.js
View file @
49b57a0
...
...
@@ -358,6 +358,7 @@ exports.writeReqBottleFeedback = async ctx => {
ctx
.
status
=
200
;
};
/**
...
...
@@ -451,6 +452,15 @@ exports.registerNewPatient = async ctx => {
await
patientInfo
.
updateInfo
(
'환자 등록 요청'
);
await
patientInfo
.
save
();
const
profile
=
await
Profile
.
findByUserId
(
patientId
);
const
{
deviceToken
}
=
profile
;
sendPushMessage
({
deviceToken
,
title
:
'새로운 의사 등록 요청이 왔습니다.'
,
body
:
'어플리케이션을 실행해 확인하세요.'
,
});
ctx
.
status
=
200
;
};
...
...
server/src/api/hub/hub.ctrl.js
View file @
49b57a0
...
...
@@ -5,6 +5,7 @@ const User = require('../../models/user');
const
Mqtt
=
require
(
'../../util/MqttModule'
);
const
DataProcess
=
require
(
'../../util/DataProcess'
);
const
jwt
=
require
(
'jsonwebtoken'
);
const
BottleMedicine
=
require
(
'../../models/bottleMedicine'
);
//허브 연결
exports
.
hubConnect
=
async
(
ctx
)
=>
{
...
...
@@ -81,6 +82,11 @@ exports.hubDisconnect = async(ctx) => {
const
hosting
=
await
hub
.
getHubHost
();
Mqtt
.
mqttOff
(
hosting
);
const
bottleList
=
await
Bottle
.
find
({
hubId
});
await
Promise
.
all
(
bottleList
.
map
(
async
bottle
=>
{
await
BottleMedicine
.
updateMany
({
bottleId
:
bottle
.
bottleId
},
{
useYn
:
'N'
});
}));
await
Bottle
.
deleteMany
({
hubId
});
await
Hub
.
deleteOne
({
hubId
});
...
...
web/src/views/main/doctor/DoctorMenuContainer.tsx
View file @
49b57a0
...
...
@@ -197,6 +197,7 @@ const DoctorMenuContainer = (props : DoctorMenuProps) => {
});
if(result.statusText === 'OK') {
Alert.onSuccess('환자에게 담당의 등록 요청을 전송했습니다.', () => null);
setNewPatientRegisterModal(false);
} else {
Alert.onError('환자에게 담당의 등록 요청을 실패했습니다.', () => null);
}
...
...
Please
register
or
login
to post a comment