Fakultas Ilmu Komputer UI
Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ppl-fasilkom-ui
2020
PPL-C
DTB-Layanan Fasilitas Publik Penyandang Disabilitas
PoiPoLeGan-PPLapanganTembak-DTB Layanan Fasilitas Publik Penyandang Disabilitas-BE
Commits
493a2ed8
Commit
493a2ed8
authored
May 05, 2020
by
Usman Sidiq
Browse files
Merge branch 'coldfix' into 'staging'
Coldfix Registrasi See merge request
!55
parents
3cb4d9b0
46b7d1ab
Pipeline
#45369
passed with stages
in 82 minutes and 29 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
493a2ed8
...
...
@@ -63,7 +63,7 @@ It will return a json with key:
*
`phone_number`
: Your phone number
### 4. To register a location:
Make
`POST`
request to API endpoint
`/informasi-
lok
as
i
/lokasi/add/`
with the following key:
Make
`POST`
request to API endpoint
`/informasi-
fasilit
as/lokasi/add/`
with the following key:
*
`name`
: location name
*
`altitude`
: location altitude, a float.
*
`longitude`
: location longitude, a float.
...
...
@@ -72,7 +72,7 @@ Make `POST` request to API endpoint `/informasi-lokasi/lokasi/add/` with the fol
*
`image`
: string of sourc image
`.jpg`
### 5. To view a location list:
Make
`GET`
request to API endpoint
`/informasi-
lok
as
i
/lokasi/list/`
.
<br>
Make
`GET`
request to API endpoint
`/informasi-
fasilit
as/lokasi/list/`
.
<br>
It will return a json list of locations with key:
*
`id`
: id of location
*
`name`
: location name
...
...
@@ -83,7 +83,7 @@ It will return a json list of locations with key:
*
`image`
: string of sourc image
`.jpg`
### 6. To view a location details:
Make
`GET`
request to API endpoint
`/informasi-
lok
as
i
/lokasi/detail/*nama_lokasi*/`
.
<br>
Make
`GET`
request to API endpoint
`/informasi-
fasilit
as/lokasi/detail/*nama_lokasi*/`
.
<br>
It will return a json with key:
*
`name`
: location name
*
`altitude`
: location altitude, a float.
...
...
@@ -93,7 +93,7 @@ It will return a json with key:
*
`image`
: string of source image
`.jpg`
### 7. To register a facility:
Make
`POST`
request to API endpoint
`/informasi-
lok
as
i
/lokasi/add-fasilitas/*nama-lokasi*/`
with the following key:
Make
`POST`
request to API endpoint
`/informasi-
fasilit
as/lokasi/add-fasilitas/*nama-lokasi*/`
with the following key:
*
`tag`
: Fasility Tag
*
The options are :
*
KURSI_RODA = 'KR'
...
...
@@ -121,7 +121,7 @@ Make `POST` request to API endpoint `/informasi-lokasi/lokasi/add-fasilitas/*nam
<b>
Add this to your request header.
`Authorization`
with value
`token *your_token_from_request*`
</b>
### 8. To see a facility list from a location:
Make
`GET`
request to API endpoint
`/informasi-
lok
as
i
/lokasi/list-fasilitas/*nama-lokasi*/`
.
<br>
Make
`GET`
request to API endpoint
`/informasi-
fasilit
as/lokasi/list-fasilitas/*nama-lokasi*/`
.
<br>
It will return a json with the following key:
*
`id`
: id of the facility
*
`nama_lokasi`
: location name of the facility
...
...
@@ -137,7 +137,7 @@ It will return a json with the following key:
*
`is_verified`
: Verified status
### 9. To see a facility details:
Make
`GET`
request to API endpoint
`/informasi-
lok
as
i
/lokasi/detail-fasilitas/*nama-lokasi*/*id-fasilitas*/`
.
<br>
Make
`GET`
request to API endpoint
`/informasi-
fasilit
as/lokasi/detail-fasilitas/*nama-lokasi*/*id-fasilitas*/`
.
<br>
It will return a json with the following key:
*
`nama_lokasi`
: location name of the facility
*
`deskripsi`
: the description
...
...
@@ -152,7 +152,7 @@ It will return a json with the following key:
*
`is_verified`
: Verified status
### 10. To update a facility details:
Make
`PUT`
request to API endpoint
`/informasi-
lok
as
i
/lokasi/update-fasilitas/*nama-lokasi*/*id-fasilitas*/`
.
<br>
Make
`PUT`
request to API endpoint
`/informasi-
fasilit
as/lokasi/update-fasilitas/*nama-lokasi*/*id-fasilitas*/`
.
<br>
It requires a request with the following key:
*
`deskripsi`
: the description
*
`rating`
: rating of the facility. Default is 3
...
...
@@ -164,14 +164,14 @@ It requires a request with the following key:
of the facility could update the facility
</b>
### 11. To update a location phone_number:
Make
`PUT`
request to API endpoint
`/informasi-
lok
as
i
/lokasi/update-lokasi/*nama-lokasi*/`
.
<br>
Make
`PUT`
request to API endpoint
`/informasi-
fasilit
as/lokasi/update-lokasi/*nama-lokasi*/`
.
<br>
It requires a request with the following key:
*
`no_telp`
: the description
<b>
Make sure you have token it your request header.
</b>
<b>
Add this to your request header.
`Authorization`
with value
`token *your_token_from_request*`
</b>
### 12. To like / dislike a facility:
Make
`PUT`
request to API endpoint
`/informasi-
lok
as
i
/lokasi/like-facility/*nama-lokasi*/*operation*/`
.
<br>
Make
`PUT`
request to API endpoint
`/informasi-
fasilit
as/lokasi/like-facility/*nama-lokasi*/*operation*/`
.
<br>
Replace the
`operation`
with:
*
`like`
: if you want to like the facility
*
`dislike`
: if you want to dislike the facility
...
...
new_rest_api/views.py
View file @
493a2ed8
...
...
@@ -89,9 +89,8 @@ def register_user(request):
return
JsonResponse
({
'response'
:
missing_key_message
(
str
(
e
))},
status
=
status
.
INTERNAL_SERVER_ERROR
)
except
IntegrityError
as
e
:
return
JsonResponse
({
'response'
:
'User is already exist'
},
status
=
status
.
INTERNAL_SERVER_ERROR
)
except
MethodNotAllowed
:
return
JsonResponse
({
'response'
:
request_error_message
(
"post"
)},
status
=
status
.
METHOD_NOT_ALLOWED
)
@
api_view
([
'GET'
])
@
authentication_classes
([])
@
permission_classes
([])
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment