Adds refactoring

This commit is contained in:
BinaryAlley committed 2024-08-25 14:47:16 +03:00
1 parent ed0d341513
commit b9dcb831e9
10 files changed
+184 -102

No files matched your search

+179 -69
View File
@@ -16,25 +16,101 @@
#### Add Book Request
```js
POST /books
POST api/v1/books
```
```json
{
"name": "Yummy Menu",
"description": "A menu with yummy food",
"sections": [
{
"name": "Appetizers",
"description": "Starters",
"items": [
{
"name": "Fried Pickles",
"description": "Deep fried pickles"
}
]
}
]
"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": "54009621",
"oclcNumber": "ocm00012345",
"openLibraryId": "OL7603910M",
"libraryThingId": "3203347",
"googleBooksId": "aWZzLPhY4o0C",
"barnesAndNobleId": "1100307790",
"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
}
]
}
```
@@ -46,33 +122,92 @@ POST /books
```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"
}
]
}
"metadata": {
"publisher": "Houghton Mifflin",
"pageCount": 398,
"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"
},
"language": {
"languageCode": "en",
"languageName": "English",
"nativeName": "English"
},
"originalLanguage": {
"languageCode": "en",
"languageName": "English",
"nativeName": "English"
},
"tags": [
{
"name": "epic fantasy"
},
{
"name": "quest"
},
{
"name": "middle-earth"
}
],
"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"
"genres": [
{
"name": "fantasy"
},
{
"name": "adventure"
},
{
"name": "classic"
}
]
},
"format": "Paperback",
"edition": "50th Anniversary Edition",
"volumeNumber": 1,
"series": null,
"asin": "B007978NPG",
"goodreadsId": "3",
"lccn": "54009621",
"oclcNumber": "ocm00012345",
"openLibraryId": "OL7603910M",
"libraryThingId": "3203347",
"googleBooksId": "aWZzLPhY4o0C",
"barnesAndNobleId": "1100307790",
"appleBooksId": "id395211",
"isbNs": [
{
"value": "0395272238",
"format": "Isbn10"
},
{
"value": "9780395272237",
"format": "Isbn13"
}
],
"contributors": [],
"ratings": [
{
"value": 4.36,
"maxValue": 5,
"voteCount": 2345678
},
{
"value": 4.7,
"maxValue": 5,
"voteCount": 87654
}
],
"id": {
"value": "32b336e8-dafc-4a08-9dec-9454e66dd55d"
}
}
```
@@ -92,34 +227,9 @@ GET /books
```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"
{
"created": "2020-01-01T00:00:00.0000000Z",
"updated": "2020-01-01T00:00:00.0000000Z"
}
]
```
@@ -25,7 +25,6 @@ class Book
Optional<string> libraryThingId,
Optional<string> googleBooksId,
Optional<string> barnesAndNobleId,
Optional<string> koboId,
Optional<string> appleBooksId,
List<Isbn> isbns,
List<MediaContributorId> contributors,
@@ -85,7 +84,6 @@ class Book
"libraryThingId": "3203347",
"googleBooksId": "aWZzLPhY4o0C",
"barnesAndNobleId": "1100307790",
"koboId": "the-fellowship-of-the-ring",
"appleBooksId": "id395211",
"isbns": [
{
+2 -3
View File
@@ -45,13 +45,12 @@ Content-Type: application/json
},
"asin": "B007978NPG",
"goodreadsId": "3",
"lccn": "2001025199",
"oclcNumber": "48494995",
"lccn": "54009621",
"oclcNumber": "ocm00012345",
"openLibraryId": "OL7603910M",
"libraryThingId": "3203347",
"googleBooksId": "aWZzLPhY4o0C",
"barnesAndNobleId": "1100307790",
"koboId": "the-fellowship-of-the-ring",
"appleBooksId": "id395211",
"isbns": [
{