Closed smurzz closed 1 year ago
id
: [Datentyp: String]ownerId
: [Datentyp: String]galleryId
: [Datentyp: String]ownerName
: [Datentyp: String]galleryTitle
: [Datentyp: String]title
: [Datentyp: String]description
: [Datentyp: String]imagesIds
: [Datentyp: ListyearOfCreation;
: [Datentyp: Integer]likedByUsers
: [Datentyp: Setmaterials
: [Datentyp: Listdimension
[Datentyp: Dimension] artDirections
[Datentyp: Set<ArtDirection>]***price;
: [Datentyp: Double]tags
: [Datentyp: Listlocation
: [Datentyp: String]createdAt
: [Datentyp: Date]comments
[Datentyp: List<Comment>]*Referenzen zu Image-Objekten im Image-Dokument durch ID-Werte _Maximale Größe_ der Liste - 5 Maximale Größe der Collection 10
Response Status: 200 Response Body: Array<ArtWork>
Beispiel:
[
{
"_id": "649ab0617af2d57328bb0cc6",
"ownerId": "6499f827716de01a654c37ac",
"galleryId": "649aaa307af2d57328bb0cc4",
"ownerName": "user user",
"galleryTitle": "title3",
"title": "titleArtwork",
"imagesIds": [
"649ab8137af2d57328bb0cc9"
],
"description": "descriptionArtwork",
"yearOfCreation": 2000,
"materials": [
"material1",
"material2",
"material3",
"material4",
"material5",
"material6",
"material7",
"material8",
"material9",
"materials10"
],
"dimension": {
"height": 23.5,
"width": 13.7,
"depth": 2
},
"price": 20,
"tags": [
"tag1",
"tag2",
"tag3",
"tag4",
"tag5",
"tag6",
"tag7",
"tag8",
"tag9",
"tag10"
],
"location": "Lol",
"createdAt": "2023-06-27T09:48:17.849Z"
},
{
"id": "649ab1637af2d57328bb0cc7",
"title": "titleArtwork",
"images": [],
"description": null,
"yearOfCreation": null,
"materials": null,
"dimension": null,
"price": null,
"location": null,
"createdAt": "2023-06-27T09:52:35.565+00:00",
"comments": null,
"ownerId": "6499f827716de01a654c37ac",
"galleryId": "649a91377af2d57328bb0ca5",
"ownerName": "user user",
"galleryTitle": "title3",
"likes": 0
}
]
Request path variable: id
Response Status: 200 Response Body: {"id", "title", "images", "description", "yearOfCreation", "materials, "dimension" "price", "tags", "location", "createdAt", "comments", "ownerId", "ownerName", "galleryId", "galleryTitle", "likes", "likedByCurrentUser", "*artDirections**"}
images
- eine List von Image Objekten;materials
- eine Liste von Strings, die der Benutzer frei eingeben kann (maximale Größe - 10)tags
- eine Liste von Strings, die der Benutzer frei eingeben kann (maximale Größe - 10)likes
- eine Integer-Zahl der LikeslikedByCurrentUser
- boolean-Wert, der zeigt, ob der aktuelle User das Artwork "geliket" hat oder nichtartDirections
- ein Set der bestimmten KunstrichtungenResponse Error :
NOT_FOUND 404 Artwork with id is not found.
Beispiel: http://localhost:8080/artworks/649ab0617af2d57328bb0cc6
Response:
{
"id": "649ab0617af2d57328bb0cc6",
"title": "titleArtwork",
"images": [],
"description": "descriptionArtwork",
"yearOfCreation": 2000,
"materials": [
"material1",
"material2",
"material3",
"material4",
"material5",
"material6",
"material7",
"material8",
"material9",
"materials10"
],
"dimension": {
"height": 23.5,
"width": 13.7,
"depth": 2.0
},
"price": 20.0,
"location": "Lol",
"createdAt": "2023-06-27T09:48:17.849+00:00",
"comments": null,
"ownerId": "6499f827716de01a654c37ac",
"galleryId": "649a91377af2d57328bb0ca5",
"ownerName": "user user",
"galleryTitle": "title3",
"likes": 0
}
Request Headers: Authentication: Bearer [access-token] Request Headers: Content-type: multipart/form-data Request Parameter: file
Response Body: Image saved for ArtWork. Response Status: 201 Request Error:
400 BAD_REQUEST: Maximum number of images reached for the artwork Image is not valid 401 UNAUTHORIZED 403 FORBIDDEN: You are not allowed to add an image for another user or artwork 404 NOT_FOUND: Artwork not found 500 INTERNAL_SERVER_ERROR: Error by saving image id for artwork
Validierung: Akzeptable Bildformate: .jpg, .jpeg, .png Maximale Bildgröße: 5Mb
Request Headers: Authentication: Bearer [access-token] Request body: {"title", "description", "yearOfCreation", "materials", "dimension", "price", "tags", "artDirections", "location"}
Validierung:
Response Status: 201 Response Error:
400 BAD_REQUEST: sehe Validierung 401 UNAUTHORIZED 403 FORBIDDEN: You are not allowed to create an artwork for another user or gallery 404 NOT_FOUND: User doesn't have a gallery. 500 INTERNAL_SERVER_ERROR: Error by creating artwork**
Beispiel: http://localhost:8080/artworks
Beispiel Request Body:
{
"title": "titleArtwork",
"description": "descriptionArtwork",
"yearOfCreation": 2000,
"materials": [
"material1",
"material2",
"material3",
"material4",
"material5",
"material6",
"material7",
"material8",
"material9",
"materials10"
],
"tags": [
"tag1",
"tag2",
"tag3",
"tag4",
"tag6",
"tag7",
"tag8",
"tag9",
"tag10",
"tag5"
],
"artDirections": ["ABSTRACT", "REALISM", "IMPRESSIONISM", "SURREALISM", "EXPRESSIONISM", "MINIMALISM", "CUBISM", "POP_ART", "CONCEPTUAL_ART", "STREET_ART_GRAFFITI"],
"dimension": {
"height": 23.5,
"width": 13.7,
"depth": 2.0
},
"price": 20.0,
"location": "Lol"
}
{
"id": "649ab0617af2d57328bb0cc6",
"title": "titleArtwork",
"images": [],
"description": "descriptionArtwork",
"yearOfCreation": 2000,
"materials": [
"material1",
"material2",
"material3",
"material4",
"material5",
"material6",
"material7",
"material8",
"material9",
"materials10"
],
"tags": [
"tags1",
"tags2",
"tags3",
"tags4",
"tags5",
"tags6",
"tags7",
"tags8",
"tags9",
"tags10"
],
"dimension": {
"height": 23.5,
"width": 13.7,
"depth": 2.0
},
"artDirections": ["ABSTRACT", "REALISM", "IMPRESSIONISM", "SURREALISM", "EXPRESSIONISM", "MINIMALISM", "CUBISM", "POP_ART", "CONCEPTUAL_ART", "STREET_ART_GRAFFITI", "REALISM"],
"price": 20.0,
"location": "Lol",
"createdAt": "2023-06-27T09:48:17.849+00:00",
"comments": null,
"ownerId": "6499f827716de01a654c37ac",
"galleryId": "649a91377af2d57328bb0ca5",
"ownerName": "user user",
"galleryTitle": "title3",
"likes": 0
}
Request Headers: Authentication: Bearer [access-token] Request path variable: id Request Headers: Content-type: multipart/form-data Request Parameter: files
Response Body: Images saved for ArtWork._ Response Status: 201 Request Error:
400 BAD_REQUEST: Maximum number of images reached for the artwork 400 BAD_REQUEST: "Image with name < imageName > is not valid" 400 BAD_REQUEST: "Invalid image(s)" Image is not valid 401 UNAUTHORIZED 403 FORBIDDEN: You are not allowed to add an image for another user or artwork 404 NOT_FOUND: Artwork not found 500 INTERNAL_SERVER_ERROR: Error by saving image id for artwork
Validierung: Akzeptable Bildformate: .jpg, .jpeg, .png Maximale Bildgröße: 5Mb
Request Headers: Authentication: Bearer [access-token] Request body: {"title", "description", "yearOfCreation", "materials", "dimension", "price", "tags", "artDirections", "location"}
Validierung:
Request Status: 200 Request Error:
400 BAD_REQUEST: sehe Validierung 401 UNAUTHORIZED 403 FORBIDDEN: You are not allowed to update an artwork for another user 404 NOT_FOUND: ArtWork is not found.
Beispiel: http://localhost:8080/artworks/64a96661f0ffe638a2509647
Beispiel Request Body:
{
"title": "titleArtworkEdited",
"description": "titleArtworkEdited",
"yearOfCreation": 2009,
"materials": [
"material1",
"material2",
"material3"
],
"tags": [],
"artDirections": ["ABSTRACT", "REALISM", "IMPRESSIONISM", "SURREALISM", "EXPRESSIONISM", "MINIMALISM", "CUBISM"],
"dimension": {
"height": 23.7,
"width": 13.7,
"depth": 3.0
},
"price": 20.0,
"location": "Nowhere"
}
Beispiel Response Body:
{
"id": "64a96661f0ffe638a2509647",
"title": "titleArtworkEdited",
"images": [],
"description": "titleArtworkEdited",
"yearOfCreation": 2009,
"materials": [
"material1",
"material2",
"material3"
],
"tags": [],
"artDirections": [
"REALISM",
"MINIMALISM",
"SURREALISM",
"EXPRESSIONISM",
"ABSTRACT",
"IMPRESSIONISM",
"CUBISM"
],
"dimension": {
"height": 23.7,
"width": 13.7,
"depth": 3.0
},
"price": 20.0,
"location": "Nowhere",
"createdAt": "2023-07-08T13:36:33.343+00:00",
"comments": null,
"ownerId": "6499f827716de01a654c37ac",
"galleryId": "64a96650f0ffe638a2509646",
"ownerName": "user user",
"galleryTitle": "title2",
"likes": 1
}
Request Headers: Authentication: Bearer [access-token] Request path variable: id
Response Body: {"id", "title", "images", "description", "yearOfCreation", "materials, "dimension" "price", "tags", "artDirections", "location", "createdAt", "comments", "ownerId", "ownerName", "galleryId", "galleryTitle", "likes", "likedByCurrentUser"}
likes
- eine Integer-Zahl der LikeslikedByCurrentUser
- boolean-Wert, der zeigt, ob der aktuelle User das Artwork "geliket" hat oder nichtResponse Status: 200 Request Error:
401 UNAUTHORIZED 404 NOT_FOUND: Artwork not found
Beispiel: http://localhost:8080/artworks/64a96661f0ffe638a2509647/like
{
"id": "64a96661f0ffe638a2509647",
"title": "titleArtworkEdited",
"images": [],
"description": "titleArtworkEdited",
"yearOfCreation": 2009,
"materials": [
"material1",
"material2",
"material3"
],
"tags": [],
"artDirections": [
"SURREALISM",
"ABSTRACT",
"MINIMALISM",
"CUBISM",
"EXPRESSIONISM",
"REALISM",
"IMPRESSIONISM"
],
"dimension": {
"height": 23.7,
"width": 13.7,
"depth": 3.0
},
"price": 20.0,
"location": "Nowhere",
"createdAt": "2023-07-08T13:36:33.343+00:00",
"comments": null,
"ownerId": "6499f827716de01a654c37ac",
"galleryId": "64a96650f0ffe638a2509646",
"ownerName": "user user",
"galleryTitle": "title2",
"likes": 1,
"likedByCurrentUser": true
}
Request Headers: Authentication: Bearer [access-token] Request path variable: id
Response Status: 204 Response Error:
401 UNAUTHORIZED 403 FORBIDDEN: You are not allowed to remove an artwork for another user 404 NOT_FOUND: User is not found. 404 NOT_FOUND: Artwork is not found.
Beispiel: http://localhost:8080/artworks/649a91377af2d57328bb0ca5
Request Headers: Authentication: Bearer [access-token] Request path variable: id Request path variable: imageId
Response Status: 204 Response Error:
401 UNAUTHORIZED 403 FORBIDDEN: You are not allowed to remove an image for another user or artwork 404 NOT_FOUND: User is not found. 404 NOT_FOUND: Artwork is not found. 404 NOT_FOUND: Image is not found by ArtWork
Beispiel: http://localhost:8080/artworks/64a95f5df0ffe638a250963b/images/64a96012f0ffe638a250963d
Bild-Model Attribute in Backend:
Bitte hinterlasst eure Vorschläge für User-Attribute in den Kommentaren.