Showing
1 changed file
with
11 additions
and
9 deletions
... | @@ -27,7 +27,7 @@ exports.dialogflowFirebaseFulfillment = functions.https.onRequest((request, resp | ... | @@ -27,7 +27,7 @@ exports.dialogflowFirebaseFulfillment = functions.https.onRequest((request, resp |
27 | 취침시간 입력 예시 : 취침 22:30 또는 기상 22시30분 \n`); | 27 | 취침시간 입력 예시 : 취침 22:30 또는 기상 22시30분 \n`); |
28 | } | 28 | } |
29 | 29 | ||
30 | - //기상시간 입력 및 추천 cycle 반환 | 30 | + //기상시간 입력의 경우 |
31 | function mytime1(agent) { | 31 | function mytime1(agent) { |
32 | const hour = agent.parameters['number-integer']; | 32 | const hour = agent.parameters['number-integer']; |
33 | const min = agent.parameters['number-integer1']; | 33 | const min = agent.parameters['number-integer1']; |
... | @@ -97,6 +97,8 @@ exports.dialogflowFirebaseFulfillment = functions.https.onRequest((request, resp | ... | @@ -97,6 +97,8 @@ exports.dialogflowFirebaseFulfillment = functions.https.onRequest((request, resp |
97 | } | 97 | } |
98 | } | 98 | } |
99 | 99 | ||
100 | + | ||
101 | +//취침시간 입력의 경우 | ||
100 | function mytime2(agent) { | 102 | function mytime2(agent) { |
101 | const hour = agent.parameters['number-integer']; | 103 | const hour = agent.parameters['number-integer']; |
102 | const min = agent.parameters['number-integer1']; | 104 | const min = agent.parameters['number-integer1']; |
... | @@ -126,9 +128,9 @@ function mytime2(agent) { | ... | @@ -126,9 +128,9 @@ function mytime2(agent) { |
126 | if(myhour4>=24){myhour4=myhour4-24;} | 128 | if(myhour4>=24){myhour4=myhour4-24;} |
127 | 129 | ||
128 | if(mymin1>=60){mymin1=mymin1-60;} | 130 | if(mymin1>=60){mymin1=mymin1-60;} |
129 | - if(mymin2>=60){mymin1=mymin2-60;} | 131 | + if(mymin2>=60){mymin2=mymin2-60;} |
130 | - if(mymin3>=60){mymin1=mymin3-60;} | 132 | + if(mymin3>=60){mymin3=mymin3-60;} |
131 | - if(mymin4>=60){mymin1=mymin4-60;} | 133 | + if(mymin4>=60){mymin4=mymin4-60;} |
132 | 134 | ||
133 | }else if(min+30>60){ | 135 | }else if(min+30>60){ |
134 | myhour1 = Number(hour)+2; | 136 | myhour1 = Number(hour)+2; |
... | @@ -151,9 +153,9 @@ function mytime2(agent) { | ... | @@ -151,9 +153,9 @@ function mytime2(agent) { |
151 | if(myhour4>=24){myhour4=myhour4-24;} | 153 | if(myhour4>=24){myhour4=myhour4-24;} |
152 | 154 | ||
153 | if(mymin1>=60){mymin1=mymin1-60;} | 155 | if(mymin1>=60){mymin1=mymin1-60;} |
154 | - if(mymin2>=60){mymin1=mymin2-60;} | 156 | + if(mymin2>=60){mymin2=mymin2-60;} |
155 | - if(mymin3>=60){mymin1=mymin3-60;} | 157 | + if(mymin3>=60){mymin3=mymin3-60;} |
156 | - if(mymin4>=60){mymin1=mymin4-60;} | 158 | + if(mymin4>=60){mymin4=mymin4-60;} |
157 | } | 159 | } |
158 | 160 | ||
159 | if(gothour && gotmin && sethour && setmin) { | 161 | if(gothour && gotmin && sethour && setmin) { |
... | @@ -171,7 +173,7 @@ function mytime2(agent) { | ... | @@ -171,7 +173,7 @@ function mytime2(agent) { |
171 | let intentMap = new Map(); | 173 | let intentMap = new Map(); |
172 | intentMap.set('Default Welcome Intent', fallback); | 174 | intentMap.set('Default Welcome Intent', fallback); |
173 | intentMap.set('Default Fallback Intent', fallback); | 175 | intentMap.set('Default Fallback Intent', fallback); |
174 | - intentMap.set('time1',mytime1);//기상시간 기준 | 176 | + intentMap.set('time1',mytime1);//기상시간 입력기준 |
175 | - intentMap.set('time2',mytime2);//취침시간 기준 | 177 | + intentMap.set('time2',mytime2);//취침시간 입력기준 |
176 | agent.handleRequest(intentMap); | 178 | agent.handleRequest(intentMap); |
177 | }); | 179 | }); | ... | ... |
-
Please register or login to post a comment