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-14 20:26:05 +0900
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
e17b93fad26ba96281b2942dcac071f7a5df8d0f
e17b93fa
2 parents
e43fceda
8619f4bc
fix. merge conflict
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
15 deletions
server/src/util/Batch.js
server/src/util/Batch.js
View file @
e17b93f
...
...
@@ -7,17 +7,17 @@
* 2) Dosage에 따라, Push Notification 발송
*/
const
cron
=
require
(
'node-cron'
);
const
cron
=
require
(
'node-cron'
);
const
Profile
=
require
(
'../models/profile'
);
const
User
=
require
(
'../models/user'
);
const
Hub
=
require
(
'../models/hub'
);
const
Bottle
=
require
(
'../models/bottle'
);
const
BottleMedicine
=
require
(
'../models/bottleMedicine'
);
const
Profile
=
require
(
'../models/profile'
);
const
User
=
require
(
'../models/user'
);
const
Hub
=
require
(
'../models/hub'
);
const
Bottle
=
require
(
'../models/bottle'
);
const
BottleMedicine
=
require
(
'../models/bottleMedicine'
);
//매년 1월 1일 00시 00분에 1살씩 추가
exports
.
CheckNewYear
=
()
=>
{
//매년 1월 1일 00시 00분에 1살씩 추가
exports
.
CheckNewYear
=
()
=>
{
cron
.
schedule
(
'0 0 0 1 1 *'
,
async
()
=>
{
const
profileList
=
await
Profile
.
find
();
profileList
.
forEach
(
async
profile
=>
{
...
...
@@ -28,11 +28,11 @@ exports.CheckNewYear = () => {
},
{
timezone
:
'Asia/Tokyo'
,
});
};
};
//dosage에 따라, Push Notification을 발송한다.
//아침 8시, 점심 12시, 저녁 6시에 한번씩 발송
exports
.
PushNotifyByDosage
=
async
()
=>
{
//dosage에 따라, Push Notification을 발송한다.
//아침 8시, 점심 12시, 저녁 6시에 한번씩 발송
exports
.
PushNotifyByDosage
=
async
()
=>
{
//매일 아침 8시 : 복용량 상관 없이 보냄
cron
.
schedule
(
'0 0 8 * * *'
,
async
()
=>
{
...
...
@@ -93,9 +93,12 @@ exports.PushNotifyByDosage = async() => {
timezone
:
'Asia/Tokyo'
,
});
};
};
const
PushNotify
=
async
(
deviceToken
)
=>
{
const
PushNotify
=
async
(
deviceToken
)
=>
{
//toDo : deviceToken을 받아서 push notification을 발송하는 함수
if
(
deviceToken
)
{
console
.
log
(
deviceToken
);
};
}
};
...
...
Please
register
or
login
to post a comment