EventController - adkuba/TL-backend GitHub Wiki
- Create event
- Create events
- Add pictures
- Add pictures URL
- Delete event
- Get events by timeline id
- Get all subEvents by main timelineId
Path
POST /api/events
Request Body
Parameter | Type | Description |
---|---|---|
id |
String | optional, autogenerated ID |
title |
String | event's title |
timelineId |
String | event's timelineId |
description |
String | event's description |
pictures |
List<FileResource> | event's images |
date |
LocalDate | event's date yyyy-MM-dd |
Response
HTTP Status Code | Scenario |
---|---|
201 Ok | event created |
400 Bad Request | error |
Returns created event.
Path
POST /api/events/multiple
Request Body
List of Events
Response
HTTP Status Code | Scenario |
---|---|
201 Ok | events created |
400 Bad Request | error |
Returns created events in list.
Path
POST /api/events/{id}/pictures
Path variable
Variable | Type | Description |
---|---|---|
id |
String | event's id |
Request param
Parameter | Type | Description |
---|---|---|
pictures |
List<MultipartFile> | images to add |
consumes "multipart/form-data"
Response
HTTP Status Code | Scenario |
---|---|
201 Ok | images added to event |
400 Bad Request | error |
Returns event with added pictures. Pictures are now in Google Storage and parsed to URL link in response.
Links already uploaded pictures to event. Usefull during event edit.
Path
POST /api/events/{id}/picturesURL
Path variable
Variable | Type | Description |
---|---|---|
id |
String | event's id |
Request param
Parameter | Type | Description |
---|---|---|
picturesURL |
List<String> | imagesURL to add |
Response
HTTP Status Code | Scenario |
---|---|
201 Ok | images added to event |
400 Bad Request | error |
Returns event with added pictures.
Path
DELETE /api/events/{id}
Path variable
Variable | Type | Description |
---|---|---|
id |
String | event's id |
Response
HTTP Status Code | Scenario |
---|---|
204 No Content | event deleted |
Path
GET /api/events/public
Request params
Parameter | Type | Description |
---|---|---|
timelineId |
String | main timeline id |
view |
Boolean | not required, user statistics by jwt token |
Response
List of EventResponse, mapped by eventsMapper.
{
"id": "ddggshe34f",
"title": "myEvent",
"shortDescription": "my event's short desc",
"description": "my event's desc",
"links": [ #hashMap
{
"Link's title",
"link's url"
}
],
"pictures": [
"url1",
"url2"
],
"date": 2020-12-23 #localDate
}
Returns all sub events - events linked with additional sub timeline, sub timeline is linked to main timeline.
Path
GET /api/events/allSubEventsByMainTimelineId
Request params
Parameter | Type | Description |
---|---|---|
timelineId |
String | main timeline id |
Returns List<List<EventResponse>> you can imagine inside list as subTimeline.