Webservice sederhana untuk keperluan pembelajaran pemrograman webservice di ITB STIKOM Bali, MK Perancangan Web dan Pemrograman Web.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

240 rivejä
7.1 KiB

3 vuotta sitten
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Web Service</title>
  6. <style>
  7. body {
  8. margin: 0;
  9. padding: 0;
  10. }
  11. p {
  12. font-family: sans-serif;
  13. }
  14. h1, h2, h3, h4, h5, h6 {
  15. font-family: serif;
  16. }
  17. h2:hover {
  18. text-decoration: underline;
  19. }
  20. h3, h4 {
  21. margin-bottom: 5px;
  22. }
  23. #container {
  24. margin: auto;
  25. width: 700px;
  26. }
  27. .kode {
  28. font-family: monospace;
  29. font-size: larger;
  30. padding: 0px 5px;
  31. background-color: #eee;
  32. }
  33. .kode-box {
  34. font-family: monospace;
  35. font-size: larger;
  36. padding: 10px;
  37. background-color: #eee;
  38. border: 1px dotted #999;
  39. }
  40. .keterangan {
  41. background-color: #ccc;
  42. border: 1px solid #999;
  43. padding: 10px 20px;
  44. list-style: none;
  45. }
  46. ul.keterangan li {
  47. margin: 5px 0px;
  48. }
  49. .keterangan .parameter {
  50. display: inline-block;
  51. width: 150px;
  52. }
  53. .keterangan .nilai {
  54. font-family: monospace;
  55. font-size: large;
  56. }
  57. </style>
  58. </head>
  59. <body>
  60. <div id="container">
  61. <h1>Dokumentasi Web Service</h1>
  62. <div id="umum" class="bagian">
  63. <h2>Konstruksi Umum</h2>
  64. <p>
  65. Semua request service dilakukan melalui <br><span class="kode">{BASE_URL}</span> :
  66. <span class="kode">http://mangusada.bakpasir.web.id/</span><br>Method yang digunakan
  67. adalah <span class="kode">GET</span> atau <span class="kode">POST</span> tergantung
  68. jenis request.
  69. </p>
  70. <p>
  71. Response service adalah data dalam format JSON, berupa JSON object dengan property pertama
  72. adalah <span class="kode">status</span>. Property <span class="kode">status</span>
  73. menunjukkan status berhasil atau tidaknya request mendapatkan data. Jika berhasil
  74. mendapatkan data, maka <span class="kode">status</span> akan bernilai <span class="kode">1</span>
  75. diikuti dengan property <span class="kode">data</span> yang berisi data hasil request.
  76. Namun jika gagal, maka <span class="kode">status</span> akan bernilai <span class="kode">0</span>.
  77. </p>
  78. <h4>Response berhasil</h4>
  79. <div class="kode-box">
  80. {"status":1, "data": ... }
  81. </div>
  82. <h4>Response gagal</h4>
  83. <div class="kode-box">
  84. {"status":0}
  85. </div>
  86. </div>
  87. <div id="dokter" class="bagian">
  88. <h2>Informasi Daftar Dokter</h2>
  89. <ul class="keterangan">
  90. <li>
  91. <span class="parameter">Method</span>:
  92. <span class="nilai">GET</span>
  93. </li>
  94. <li>
  95. <span class="parameter">URL</span>:
  96. <span class="nilai">{BASE_URL}/dokter/{id_poliklinik}</span>
  97. </li>
  98. <li>
  99. <span class="parameter">Content-Type</span>:
  100. <span class="nilai">application/json</span>
  101. </li>
  102. </ul>
  103. <h4>Contoh:</h4>
  104. <div class="kode-box">
  105. http://mangusada.bakpasir.web.id/dokter/2
  106. </div>
  107. <h4>Hasil:</h4>
  108. <div class="kode-box">
  109. {"status":1, "data":[{"id":"5", "nama":"dr. Budiman", ... }, ... ]}
  110. </div>
  111. </div>
  112. <div id="jadwal" class="bagian">
  113. <h2>Informasi Jadwal Dokter</h2>
  114. <ul class="keterangan">
  115. <li>
  116. <span class="parameter">Method</span>:
  117. <span class="nilai">GET</span>
  118. </li>
  119. <li>
  120. <span class="parameter">URL</span>:
  121. <span class="nilai">{BASE_URL}/jadwal/{id_dokter}</span>
  122. </li>
  123. <li>
  124. <span class="parameter">Content-Type</span>:
  125. <span class="nilai">application/json</span>
  126. </li>
  127. </ul>
  128. <h4>Contoh:</h4>
  129. <div class="kode-box">
  130. http://mangusada.bakpasir.web.id/jadwal/5
  131. </div>
  132. <h4>Hasil:</h4>
  133. <div class="kode-box">
  134. {"status":1, "data":[{"id":"6", "id_dokter":"5", "hari":"2", "mulai":"17:00:00", ... }, ... ]}
  135. </div>
  136. </div>
  137. <div id="jaminan" class="bagian">
  138. <h2>Informasi Daftar Jaminan</h2>
  139. <ul class="keterangan">
  140. <li>
  141. <span class="parameter">Method</span>:
  142. <span class="nilai">GET</span>
  143. </li>
  144. <li>
  145. <span class="parameter">URL</span>:
  146. <span class="nilai">{BASE_URL}/jaminan</span>
  147. </li>
  148. <li>
  149. <span class="parameter">Content-Type</span>:
  150. <span class="nilai">application/json</span>
  151. </li>
  152. </ul>
  153. <h4>Contoh:</h4>
  154. <div class="kode-box">
  155. http://mangusada.bakpasir.web.id/jaminan
  156. </div>
  157. <h4>Hasil:</h4>
  158. <div class="kode-box">
  159. {"status":1, "data":[{"id":"4", "nama":"BPJS", ... }, ... ]}
  160. </div>
  161. </div>
  162. <div id="pasien" class="bagian">
  163. <h2>Informasi Data Pasien</h2>
  164. <ul class="keterangan">
  165. <li>
  166. <span class="parameter">Method</span>:
  167. <span class="nilai">GET</span>
  168. </li>
  169. <li>
  170. <span class="parameter">URL</span>:
  171. <span class="nilai">{BASE_URL}/pasien/{no_rekam_medis}</span>
  172. </li>
  173. <li>
  174. <span class="parameter">Content-Type</span>:
  175. <span class="nilai">application/json</span>
  176. </li>
  177. </ul>
  178. <h4>Contoh:</h4>
  179. <div class="kode-box">
  180. http://mangusada.bakpasir.web.id/pasien/510303200000023
  181. </div>
  182. <h4>Hasil:</h4>
  183. <div class="kode-box">
  184. {"status":1, "data":{"id":"7", "rm":"510303200000023", "nik":"5102044311820002", "nama":"Ni Nyoman Mariawati", ... }}
  185. </div>
  186. </div>
  187. <div id="poliklinik" class="bagian">
  188. <h2>Informasi Daftar Poliklinik</h2>
  189. <h3>Semua Poliklinik</h3>
  190. <ul class="keterangan">
  191. <li>
  192. <span class="parameter">Method</span>:
  193. <span class="nilai">GET</span>
  194. </li>
  195. <li>
  196. <span class="parameter">URL</span>:
  197. <span class="nilai">{BASE_URL}/poliklinik</span>
  198. </li>
  199. <li>
  200. <span class="parameter">Content-Type</span>:
  201. <span class="nilai">application/json</span>
  202. </li>
  203. </ul>
  204. <h4>Contoh:</h4>
  205. <div class="kode-box">
  206. http://mangusada.bakpasir.web.id/poliklinik
  207. </div>
  208. <h4>Hasil:</h4>
  209. <div class="kode-box">
  210. {"status":1, "data":[{"id":"4", "nama":"Klinik Anak", "type":"2"}, ... ]}
  211. </div>
  212. <h3>Poliklinik Menurut Type</h3>
  213. <ul class="keterangan">
  214. <li>
  215. <span class="parameter">Method</span>:
  216. <span class="nilai">GET</span>
  217. </li>
  218. <li>
  219. <span class="parameter">URL</span>:
  220. <span class="nilai">{BASE_URL}/poliklinik/{type}</span>
  221. </li>
  222. <li>
  223. <span class="parameter">Content-Type</span>:
  224. <span class="nilai">application/json</span>
  225. </li>
  226. </ul>
  227. <h4>Contoh:</h4>
  228. <div class="kode-box">
  229. http://mangusada.bakpasir.web.id/poliklinik/2
  230. </div>
  231. <h4>Hasil:</h4>
  232. <div class="kode-box">
  233. {"status":1, "data":[{"id":"4", "nama":"Klinik Anak", "type":"2"}, ... ]}
  234. </div>
  235. </div>
  236. <div id="pendaftaran">
  237. <h2>Melakukan Pendaftaran</h2>
  238. </div>
  239. </div>
  240. </body>
  241. </html>