# <center><i class="fa fa-edit"></i> Smart Dispenser API Beta Testing Items 9-13 </center> ###### tags: `Internship` :::info **Goal:** Test the newly written API for the Smart Dispenser with Postman. Specifically, whether items 9~13 produce a normal response with the examples not produced in the HackMD page. - [x] 9. 各類期間取水次數/取水量 數據&百分比 - [x] 10. 學生: 各類總人數, 各類取水人數, 各類取水人數百分比 - [x] 11. 統計:學生: 各類學生每人每日取水量分布 - [x] 12. 學生: 各類別期間每日三種水(冷水 溫水 熱水)的取水量與取水百分比 - [x] 13. 學生: 各類別各學生在某一天期間取水量CDF **Resources:** [Xinxing Trig API Document](https://hackmd.io/@RenJhang/rkDFsbBr5) [Smart Dispenser Project](https://hackmd.io/@RayCheng/HJk_YpRou) [新興國中開始畫圖數據觀察](https://hackmd.io/@RenJhang/SJpi2dsy9) ::: --- :::spoiler **Expand Catalog** [TOC] ::: --- ## Configuration: 確認API程式是否在運行 ![](https://i.imgur.com/440rGWt.png) --- ## 9. 各類期間取水次數/取水量 數據&百分比 ### Post ``` http://140.118.122.115:15034/statistic/all/classes/waterIntakeAndPercent ``` ### Key | key | value(choose 1) | remark | | --------------- | --------------------------------- | ------------------------------------------------- | | "IdentityLimit" | "Student"<br>"Faculty"<br>"False" | 只看學生<br>只看教職員<br>都看 | | "StudentScale" | "Class"<br>"Grade"<br>"All" | 以班級為單位<br>以年級為單位<br>以全校學生為單位 | | "StudentGender" | "True"<br>"False" | "True": 要再分性別<br>"False": 沒有要再分性別 | | "IllegalScale" | "All"<br>"Detail" | 統一顯示為非法輸入<br>區分學號/工號形式的非法輸入 | ### Postman Trials :::success **Trial 1** Body: raw - JSON ``` { "start":"2021-11-30", "end":"2021-11-30", "IdentityLimit":"Student", "StudentScale":"Grade", "StudentGender":"True", "IllegalScale":"All" } ``` ![](https://i.imgur.com/GTsHG8g.png) ::: :::success Trial 2 - Body: raw - JSON ``` { "start":"2021-11-30", "end":"2021-11-30", "IdentityLimit":"Student", "StudentScale":"All", "StudentGender":"False", "IllegalScale":"All" } ``` ![](https://i.imgur.com/IJOBH6i.png) ::: :::success Trial 3 - Body: raw - JSON ``` { "start":"2021-11-30", "end":"2021-11-30", "IdentityLimit":"False", "StudentScale":"All", "StudentGender":"False", "IllegalScale":"Detail" } ``` ![](https://i.imgur.com/QwKIp9P.png) ::: :::danger Trial 4 - Body: raw - JSON ``` { "start":"2021-11-30", "end":"2021-11-30", "IdentityLimit":"Faculty", "StudentScale":"Class", "StudentGender":"True", "IllegalScale":"All" } ``` ![](https://i.imgur.com/RE0MBor.png) ::: :::danger Trial 5 - Body: raw - JSON ``` { "start":"2021-11-30", "end":"2021-11-30", "IdentityLimit":"Faculty", "StudentScale":"Class", "StudentGender":"False", "IllegalScale":"All" } ``` ![](https://i.imgur.com/jDuuTuR.png) ::: :::danger Trial 6 - Body: raw - JSON ``` { "start":"2021-11-30", "end":"2021-11-30", "IdentityLimit":"Faculty", "StudentScale":"Grade", "StudentGender":"True", "IllegalScale":"All" } ``` ![](https://i.imgur.com/1LwyeUM.png) ::: :::danger Trial 7 - Body: raw - JSON ``` { "start":"2021-11-30", "end":"2021-11-30", "IdentityLimit":"Faculty", "StudentScale":"Grade", "StudentGender":"False", "IllegalScale":"All" } ``` ![](https://i.imgur.com/ujn0AvQ.png) ::: :::danger Trial 8 - Body: raw - JSON ``` { "start":"2021-11-30", "end":"2021-11-30", "IdentityLimit":"Faculty", "StudentScale":"All", "StudentGender":"True", "IllegalScale":"All" } ``` ![](https://i.imgur.com/0upECht.png) ::: :::danger Trial 9 - Body: raw - JSON ``` { "start":"2021-11-30", "end":"2021-11-30", "IdentityLimit":"Faculty", "StudentScale":"All", "StudentGender":"False", "IllegalScale":"All" } ``` ![](https://i.imgur.com/P2bv49N.png) ::: ### 總結 :::info 所有包含`“IdentityLimit”:“Faculty”`都有`overload`或`error` (詳情請看 Trial 4~9) ::: --- ## 10. 學生: 各類總人數, 各類取水人數, 各類取水人數百分比 ### Post ``` http://140.118.122.115:15034/statistic/student/classes/waterIntakePeopleNumAndPercent ``` ### Key | key | value(choose 1) | remark | | -------- | -------- | -------- | | "StudentScale" | "Class"<br>"Grade"<br>"All" | 以班級為單位<br>以年級為單位<br>以全校學生為單位 | | "StudentGender" | "True"<br>"False" | "True": 要再分性別<br>"False": 沒有要再分性別 | ### Postman Trials :::success Trial 1 - Body: raw - JSON ``` { "start":"2021-11-30", "end":"2021-11-30", "StudentScale":"Grade", "StudentGender":"True" } ``` ![](https://i.imgur.com/R77RdZV.png) ::: :::success Trial 2 - Body: raw - JSON ``` { "start":"2021-11-30", "end":"2021-11-30", "StudentScale":"All", "StudentGender":"True" } ``` ![](https://i.imgur.com/Ud0YfLe.png) ::: :::success Trial 3 - Body: raw - JSON ``` { "start":"2021-11-30", "end":"2021-11-30", "StudentScale":"Class", "StudentGender":"False" } ``` ![](https://i.imgur.com/l7gu9g7.png) ::: :::success Trial 4 - Body: raw - JSON ``` { "start":"2021-11-30", "end":"2021-11-30", "StudentScale":"Grade", "StudentGender":"False" } ``` ![](https://i.imgur.com/DGU6mRQ.png) ::: :::success Trial 5 - Body: raw - JSON ``` { "start":"2021-11-30", "end":"2021-11-30", "StudentScale":"All", "StudentGender":"False" } ``` ![](https://i.imgur.com/CYAhxKg.png) ::: ### 總結 :::info cleared, all normal responses ::: --- ## 11. 統計:學生: 各類學生每人每日取水量分布 ### Post ``` http://140.118.122.115:15034/statistic/student/classes/eachClassMemberAccumulatedTakeWaterDistribution ``` ### Key | key | value(choose 1) | remark | | --------------- | --------------------------- | ------------------------------------------------ | | "StudentScale" | "Class"<br>"Grade"<br>"All" | 以班級為單位<br>以年級為單位<br>以全校學生為單位 | | "StudentGender" | "True"<br>"False" | "True": 要再分性別<br>"False": 沒有要再分性別 | ### Postman Trials :::success Trial 1 - Body: raw - JSON ``` { "start":"2021-11-30", "end":"2021-11-30", "StudentScale":"Class", "StudentGender":"False" } ``` ![](https://i.imgur.com/UxXrmKd.png) ::: :::danger Trial 2 - Body: raw - JSON ``` { "start":"2021-11-30", "end":"2021-11-30", "StudentScale":"Grade", "StudentGender":"True" } ``` ![](https://i.imgur.com/wMslTMz.png) ::: :::success Trial 3 - Body: raw - JSON ``` { "start":"2021-11-30", "end":"2021-11-30", "StudentScale":"Grade", "StudentGender":"False" } ``` ![](https://i.imgur.com/umLdlrC.png) ::: :::success Trial 4 - Body: raw - JSON ``` { "start":"2021-11-30", "end":"2021-11-30", "StudentScale":"All", "StudentGender":"True" } ``` ![](https://i.imgur.com/24QEjwF.png) ::: :::success Trial 5 - Body: raw - JSON ``` { "start":"2021-11-30", "end":"2021-11-30", "StudentScale":"All", "StudentGender":"False" } ``` ![](https://i.imgur.com/kwUdIYh.png) ::: ### 總結 :::info `"StudentScale":"Grade", "StudentGender":"True"` 有`overload`或`error` (詳情請看 Trial 2) ::: --- ## 12. 學生: 各類別期間每日三種水(冷水 溫水 熱水)的取水量與取水百分比 ### Post ``` http://140.118.122.115:15034/statistic/student/classes/eachClassEachDayThreeKindWaterVolumeAndPercent ``` ### Key | key | value(choose 1) | remark | | --------------- | --------------------------- | ------------------------------------------------ | | "StudentScale" | "Class"<br>"Grade"<br>"All" | 以班級為單位<br>以年級為單位<br>以全校學生為單位 | | "StudentGender" | "True"<br>"False" | "True": 要再分性別<br>"False": 沒有要再分性別 | ### Postman Trials :::success Trial 1 - Body: raw - JSON ``` { "start":"2021-11-30", "end":"2021-11-30", "StudentScale":"Class", "StudentGender":"False" } ``` ![](https://i.imgur.com/wkwFVoD.png) ::: :::success Trial 2 - Body: raw - JSON ``` { "start":"2021-11-30", "end":"2021-11-30", "StudentScale":"Grade", "StudentGender":"True" } ``` ![](https://i.imgur.com/eLO8DOR.png) ::: :::success Trial 3 - Body: raw - JSON ``` { "start":"2021-11-30", "end":"2021-11-30", "StudentScale":"Grade", "StudentGender":"False" } ``` ![](https://i.imgur.com/Cw2iFjj.png) ::: :::success Trial 4 - Body: raw - JSON ``` { "start":"2021-11-30", "end":"2021-11-30", "StudentScale":"All", "StudentGender":"True" } ``` ![](https://i.imgur.com/UICMzok.png) ::: :::success Trial 5 - Body: raw - JSON ``` { "start":"2021-11-30", "end":"2021-11-30", "StudentScale":"All", "StudentGender":"False" } ``` ![](https://i.imgur.com/hfzK9ws.png) ::: ### 總結 :::info cleared, all normal responses ::: --- ## 13. 學生: 各類別各學生在某一天期間取水量CDF ### Post ``` http://140.118.122.115:15034/statistic/student/classes/eachClassEachStudentTakeWaterCDF ``` ### Key | key | value(choose 1) | remark | | --------------- | --------------------------- | ------------------------------------------------ | | "StudentScale" | "Class"<br>"Grade"<br>"All" | 以班級為單位<br>以年級為單位<br>以全校學生為單位 | | "StudentGender" | "True"<br>"False" | "True": 要再分性別<br>"False": 沒有要再分性別 | ### Postman Trials :::success Trial 1 - Body: raw - JSON ``` { "specific_date":"2021-11-30", "StudentScale":"Class", "StudentGender":"False" } ``` ![](https://i.imgur.com/njmlutP.png) ::: :::danger Trial 2 - Body: raw - JSON ``` { "specific_date":"2021-11-30", "StudentScale":"Grade", "StudentGender":"True" } ``` ![](https://i.imgur.com/P71V6zc.png) ::: :::success Trial 3 - Body: raw - JSON ``` { "specific_date":"2021-11-30", "StudentScale":"Grade", "StudentGender":"False" } ``` ![](https://i.imgur.com/smPm5nt.png) ::: :::success Trial 4 - Body: raw - JSON ``` { "specific_date":"2021-11-30", "StudentScale":"All", "StudentGender":"True" } ``` ![](https://i.imgur.com/oDy1CLJ.png) ::: :::success Trial 5 - Body: raw - JSON ``` { "specific_date":"2021-11-30", "StudentScale":"All", "StudentGender":"False" } ``` ![](https://i.imgur.com/LryyCZp.png) ::: ### 總結 :::info `"StudentScale":"Grade", "StudentGender":"True"` 有`overload`或`error` (詳情請看 Trial 2) :::