-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #342 from COS301-SE-2024/feat/backend/migrating-im…
…age-storage-to-azureblobs Feat/backend/migrating image storage to azureblobs
- Loading branch information
Showing
22 changed files
with
553 additions
and
907 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,9 +28,11 @@ The API also allows you to retrieve information about these resources. | |
- [Get Notification Settings](#GetNotificationSettings) | ||
- [Upload Profile Image](#UploadProfileImage) | ||
- [Download Profile Image](#DownloadProfileImage) | ||
- [Delete Profile Image](#DeleteProfileImage) | ||
- [Image ID](#ImageID) | ||
- [Upload Image](#UploadImage) | ||
- [Upload Room Image](#UploadRoomImage) | ||
- [Delete Room Image](#DeleteRoomImage) | ||
- [Add Room](#AddRoom) | ||
- [Available slots](#AvailableSlots) | ||
|
||
|
@@ -738,7 +740,7 @@ This endpoint is used to upload a profile image for a user in the Occupi system. | |
|
||
`POST` | ||
|
||
- **Request Form Data** | ||
- **Send request as Form-Data NOT JSON body or url parameters** | ||
|
||
- **Content** | ||
|
||
|
@@ -800,6 +802,44 @@ or | |
|
||
- **Content:** `{ "status": 500, "message": "Internal server error", "error": {"code":"INTERNAL_SERVER_ERROR","details":null,"message":"Internal server error"} }` | ||
|
||
### DeleteProfileImage | ||
|
||
This endpoint is used to delete a profile image for a user in the Occupi system. | ||
|
||
- **URL** | ||
|
||
`/api/delete-profile-image` | ||
|
||
- **Method** | ||
|
||
`DELETE` | ||
|
||
- **Request JSON Data** | ||
|
||
- **Content** | ||
|
||
```json copy | ||
"email": "[email protected]" // optional if you are logged in | ||
``` | ||
|
||
or | ||
|
||
``` | ||
/api/[email protected] | ||
``` | ||
|
||
**Success Response** | ||
|
||
- **Code:** 200 | ||
|
||
- **Content:** `{ "status": 200, "message": "Successfully deleted image!", "data": null }` | ||
|
||
**Error Response** | ||
|
||
- **Code:** 500 | ||
|
||
- **Content:** `{ "status": 500, "message": "Internal server error", "error": {"code":"INTERNAL_SERVER_ERROR","details":null,"message":"Internal server error"} }` | ||
|
||
### Image ID | ||
|
||
This endpoint is used to get the image in the Occupi system given an image ID as a url parameter. | ||
|
@@ -828,8 +868,6 @@ or | |
|
||
**the id is the id of the image which you will get when you get a room and is required for all requests on this endpoint** | ||
|
||
**note that the higher quality, the longer it will take to download** | ||
|
||
**Success Response** | ||
|
||
- **Code:** 200 | ||
|
@@ -842,13 +880,13 @@ or | |
|
||
- **Content:** `{ "status": 500, "message": "Internal server error", "error": {"code":"INTERNAL_SERVER_ERROR","details":null,"message":"Internal server error"} }` | ||
|
||
### Upload Image | ||
### Upload Room Image | ||
|
||
This endpoint is used to upload an image in the Occupi system. Only Admins can upload images. | ||
This endpoint is used to upload an image for a room in the Occupi system. Only Admins can upload images. | ||
|
||
- **URL** | ||
|
||
`/api/upload-image` | ||
`/api/upload-room-image` | ||
|
||
- **Method** | ||
|
||
|
@@ -860,6 +898,7 @@ This endpoint is used to upload an image in the Occupi system. Only Admins can u | |
|
||
```copy | ||
"image": image_data, // required | ||
"roomId": "RM000" // required | ||
``` | ||
|
||
**Success Response** | ||
|
@@ -874,32 +913,38 @@ This endpoint is used to upload an image in the Occupi system. Only Admins can u | |
|
||
- **Content:** `{ "status": 500, "message": "Internal server error", "error": {"code":"INTERNAL_SERVER_ERROR","details":null,"message":"Internal server error"} }` | ||
|
||
### Upload Room Image | ||
### Delete Room Image | ||
|
||
This endpoint is used to upload an image for a room in the Occupi system. Only Admins can upload images. | ||
This endpoint is used to delete an image for a room in the Occupi system. Only Admins can delete images. | ||
|
||
- **URL** | ||
|
||
`/api/upload-room-image` | ||
`/api/delete-room-image` | ||
|
||
- **Method** | ||
|
||
`POST` | ||
`DELETE` | ||
|
||
- **Request Form Data** | ||
- **Request JSON Data** | ||
|
||
- **Content** | ||
|
||
```copy | ||
"image": image_data, // required | ||
```json copy | ||
"roomId": "RM000" // required | ||
"imageId": "000000000000000000000" // required | ||
``` | ||
|
||
or | ||
|
||
``` | ||
/api/delete-room-image?roomId=RM000&imageId=000000000000000000000 | ||
``` | ||
|
||
**Success Response** | ||
|
||
- **Code:** 200 | ||
|
||
- **Content:** `{ "status": 200, "message": "Successfully uploaded image!", "data": {"id": "000000000000000000000"} }` | ||
- **Content:** `{ "status": 200, "message": "Successfully deleted image!", "data": null }` | ||
|
||
**Error Response** | ||
|
||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.