Adds the capability of adding a Book via API

This commit is contained in:
BinaryAlley committed 2024-08-24 22:11:55 +03:00
1 parent 6459b6f2c2
commit 0eb7b453f6
61 files changed
+1276 -255

No files matched your search

+125
View File
@@ -0,0 +1,125 @@
# Lumina API
- [Lumina API](#lumina-api)
- [Book](#book)
- [Add Book](#add-book)
- [Add Book Request](#add-book-request)
- [Add Book Response](#add-book-response)
- [Get Books](#get-books)
- [Get Books Request](#get-books-request)
- [Get Books Response](#get-books-response)
## Book
### Add Book
#### Add Book Request
```js
POST /books
```
```json
{
"name": "Yummy Menu",
"description": "A menu with yummy food",
"sections": [
{
"name": "Appetizers",
"description": "Starters",
"items": [
{
"name": "Fried Pickles",
"description": "Deep fried pickles"
}
]
}
]
}
```
#### Add Book Response
```js
201 Created
```
```json
{
"id": "00000000-0000-0000-0000-000000000000",
"name": "Yummy Menu",
"description": "A menu with yummy food",
"averageRating": null,
"sections": [
{
"id": "00000000-0000-0000-0000-000000000000",
"name": "Appetizers",
"description": "Starters",
"items": [
{
"id": "00000000-0000-0000-0000-000000000000",
"name": "Fried Pickles",
"description": "Deep fried pickles"
}
]
}
],
"hostId": "00000000-0000-0000-0000-000000000000",
"dinnerIds": [
"00000000-0000-0000-0000-000000000000",
],
"menuReviewIds": [
"00000000-0000-0000-0000-000000000000",
],
"createdDateTime": "2020-01-01T00:00:00.0000000Z",
"updatedDateTime": "2020-01-01T00:00:00.0000000Z"
}
```
### Get Books
#### Get Books Request
```js
GET /books
```
#### Get Books Response
```js
200 Ok
```
```json
[
{
"id": "00000000-0000-0000-0000-000000000000",
"name": "Yummy Menu",
"description": "A menu with yummy food",
"averageRating": null,
"sections": [
{
"id": "00000000-0000-0000-0000-000000000000",
"name": "Appetizers",
"description": "Starters",
"items": [
{
"id": "00000000-0000-0000-0000-000000000000",
"name": "Fried Pickles",
"description": "Deep fried pickles"
}
]
}
],
"hostId": "00000000-0000-0000-0000-000000000000",
"dinnerIds": [
"00000000-0000-0000-0000-000000000000",
],
"menuReviewIds": [
"00000000-0000-0000-0000-000000000000",
],
"createdDateTime": "2020-01-01T00:00:00.0000000Z",
"updatedDateTime": "2020-01-01T00:00:00.0000000Z"
}
]
```
@@ -50,6 +50,16 @@ class Book
"releaseCountry": "uk",
"releaseVersion": "50th Anniversary Edition"
},
"genres": [
{ "name": "fantasy" },
{ "name": "adventure" },
{ "name": "classic" }
],
"tags": [
{ "name": "epic fantasy" },
{ "name": "quest" },
{ "name": "middle-earth" }
],
"language": {
"languageCode": "en",
"languageName": "English",
@@ -60,16 +70,6 @@ class Book
"languageName": "English",
"nativeName": "English"
},
"tags": [
{ "name": "epic fantasy" },
{ "name": "quest" },
{ "name": "middle-earth" }
],
"genres": [
{ "name": "fantasy" },
{ "name": "adventure" },
{ "name": "classic" }
],
"publisher": "Houghton Mifflin",
"pageCount": 398
},
@@ -119,78 +119,4 @@ class Book
}
]
}
{
"id": {
"value": "00000000-0000-0000-0000-000000000000"
},
"metadata": {
"title": "The Lord of the Rings - The Fellowship of the Ring",
"originalTitle": "The Lord of the Rings - The Fellowship of the Ring",
"description": "The greatest fantasy movie ever made",
"releaseInfo": {
"originalReleaseDate": "2001-12-19",
"originalReleaseYear": 2001,
"reReleaseDate": "2024-06-08",
"reReleaseYear": 2024,
"releaseCountry": "us",
"releaseVersion": "Director's Cut"
},
"language": {
"languageCode": "en",
"languageName": "English",
"nativeName": "English"
},
"originalLanguage": {
"languageCode": "en",
"languageName": "English",
"nativeName": "English"
},
"tags": [
{ "name": "epic quest" },
{ "name": "friendship" },
{ "name": "middle-earth" }
],
"genres": [
{ "name": "fantasy" },
{ "name": "adventure" },
{ "name": "action" }
],
"publisher": "Allen & Unwin",
"pageCount": 432
},
"format": "Hardcover",
"edition": "First Edition",
"volumeNumber": 1,
"series": "The Lord of the Rings",
"isbn": "978-0261103573",
"asin": "B00GO9BZLU",
"goodreadsId": "3",
"lccn": "2001271784",
"oclcNumber": "46516480",
"openLibraryId": "OL7603610M",
"libraryThingId": "3203347",
"googleBooksId": "aWZzLPhY4o0C",
"barnesAndNobleId": "1100307790",
"koboId": "lord-of-the-rings-fellowship-of-the-ring",
"appleBooksId": "id395211",
"contributors": [
{
"value": "00000000-0000-0000-0000-000000000000",
}
],
"ratings": [
{
"source": "Goodreads",
"value": 4.36,
"maxValue": 5,
"voteCount": 2345678
},
{
"source": "Amazon",
"value": 4.7,
"maxValue": 5,
"voteCount": 87654
}
]
}
```
File renamed without changes.
+96
View File
@@ -0,0 +1,96 @@
POST {{host}}/api/v1/books
Content-Type: application/json
{
"metadata": {
"title": "The Fellowship of the Ring",
"originalTitle": "The Fellowship of the Ring",
"description": "The first part of J.R.R. Tolkien's epic adventure The Lord of the Rings. In a sleepy village in the Shire, young Frodo Baggins finds himself faced with an immense task, as his elderly cousin Bilbo entrusts the Ring to his care. Frodo must leave his home and make a perilous journey across Middle-earth to the Cracks of Doom, there to destroy the Ring and foil the Dark Lord in his evil purpose.",
"releaseInfo": {
"originalReleaseDate": "1954-07-29",
"originalReleaseYear": 1954,
"reReleaseDate": "2001-09-06",
"reReleaseYear": 2001,
"releaseCountry": "uk",
"releaseVersion": "50th Anniversary Edition"
},
"genres": [
{ "name": "fantasy" },
{ "name": "adventure" },
{ "name": "classic" }
],
"tags": [
{ "name": "epic fantasy" },
{ "name": "quest" },
{ "name": "middle-earth" }
],
"language": {
"languageCode": "en",
"languageName": "English",
"nativeName": "English"
},
"originalLanguage": {
"languageCode": "en",
"languageName": "English",
"nativeName": "English"
},
"publisher": "Houghton Mifflin",
"pageCount": 398
},
"format": "Paperback",
"edition": "50th Anniversary Edition",
"volumeNumber": 1,
"series": {
"title": "The Lord of the Rings"
},
"asin": "B007978NPG",
"goodreadsId": "3",
"lccn": "2001025199",
"oclcNumber": "48494995",
"openLibraryId": "OL7603910M",
"libraryThingId": "3203347",
"googleBooksId": "aWZzLPhY4o0C",
"barnesAndNobleId": "1100307790",
"koboId": "the-fellowship-of-the-ring",
"appleBooksId": "id395211",
"isbns": [
{
"value": "0395272238",
"format": "Isbn10"
},
{
"value": "9780395272237",
"format": "Isbn13"
}
],
"contributors": [
{
"name": "J.R.R. Tolkien",
"role": {
"name": "author",
"category": "book"
}
},
{
"name": "Alan Lee",
"role": {
"name": "illustrator",
"category": "book"
}
}
],
"ratings": [
{
"source": "Goodreads",
"value": 4.36,
"maxValue": 5,
"voteCount": 2345678
},
{
"source": "Amazon",
"value": 4.7,
"maxValue": 5,
"voteCount": 87654
}
]
}
+1
View File
@@ -0,0 +1 @@
GET {{host}}/api/v1/books