Toggle navigation
Toggle navigation
This project
Loading...
Sign in
윤동주
/
LINEBOT
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
최한솔
2019-12-05 03:20:39 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
e40712e552744ef1e57a5e0935d7f3a8ce1460e2
e40712e5
1 parent
7deafe23
all code modify3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
9 deletions
dialogflowFulfillment/firebase/functions/index.js
dialogflowFulfillment/firebase/functions/index.js
View file @
e40712e
...
...
@@ -27,7 +27,7 @@ exports.dialogflowFirebaseFulfillment = functions.https.onRequest((request, resp
취침시간 입력 예시 : 취침 22:30 또는 기상 22시30분 \n`
);
}
//기상시간 입력
및 추천 cycle 반환
//기상시간 입력
의 경우
function
mytime1
(
agent
)
{
const
hour
=
agent
.
parameters
[
'number-integer'
];
const
min
=
agent
.
parameters
[
'number-integer1'
];
...
...
@@ -97,6 +97,8 @@ exports.dialogflowFirebaseFulfillment = functions.https.onRequest((request, resp
}
}
//취침시간 입력의 경우
function
mytime2
(
agent
)
{
const
hour
=
agent
.
parameters
[
'number-integer'
];
const
min
=
agent
.
parameters
[
'number-integer1'
];
...
...
@@ -126,9 +128,9 @@ function mytime2(agent) {
if
(
myhour4
>=
24
){
myhour4
=
myhour4
-
24
;}
if
(
mymin1
>=
60
){
mymin1
=
mymin1
-
60
;}
if
(
mymin2
>=
60
){
mymin
1
=
mymin2
-
60
;}
if
(
mymin3
>=
60
){
mymin
1
=
mymin3
-
60
;}
if
(
mymin4
>=
60
){
mymin
1
=
mymin4
-
60
;}
if
(
mymin2
>=
60
){
mymin
2
=
mymin2
-
60
;}
if
(
mymin3
>=
60
){
mymin
3
=
mymin3
-
60
;}
if
(
mymin4
>=
60
){
mymin
4
=
mymin4
-
60
;}
}
else
if
(
min
+
30
>
60
){
myhour1
=
Number
(
hour
)
+
2
;
...
...
@@ -151,9 +153,9 @@ function mytime2(agent) {
if
(
myhour4
>=
24
){
myhour4
=
myhour4
-
24
;}
if
(
mymin1
>=
60
){
mymin1
=
mymin1
-
60
;}
if
(
mymin2
>=
60
){
mymin
1
=
mymin2
-
60
;}
if
(
mymin3
>=
60
){
mymin
1
=
mymin3
-
60
;}
if
(
mymin4
>=
60
){
mymin
1
=
mymin4
-
60
;}
if
(
mymin2
>=
60
){
mymin
2
=
mymin2
-
60
;}
if
(
mymin3
>=
60
){
mymin
3
=
mymin3
-
60
;}
if
(
mymin4
>=
60
){
mymin
4
=
mymin4
-
60
;}
}
if
(
gothour
&&
gotmin
&&
sethour
&&
setmin
)
{
...
...
@@ -171,7 +173,7 @@ function mytime2(agent) {
let
intentMap
=
new
Map
();
intentMap
.
set
(
'Default Welcome Intent'
,
fallback
);
intentMap
.
set
(
'Default Fallback Intent'
,
fallback
);
intentMap
.
set
(
'time1'
,
mytime1
);
//기상시간 기준
intentMap
.
set
(
'time2'
,
mytime2
);
//취침시간 기준
intentMap
.
set
(
'time1'
,
mytime1
);
//기상시간
입력
기준
intentMap
.
set
(
'time2'
,
mytime2
);
//취침시간
입력
기준
agent
.
handleRequest
(
intentMap
);
});
...
...
Please
register
or
login
to post a comment