-
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.
add new API endpoints for file manager/consume page
This rethinks the way the requests are handled in an attempt to simplify usage and optimize response sizes. There are 7 new endpoints to replace existing ones: - `/bibles/language/LANGUAGE_ID` returns basic details about the Bible versions for a language - `/bibles/BIBLE_ID/book/BOOK_ID` returns info about a given book of a given Bible version, including URLs for downloading - `/passages/language/LANGUAGE_ID/resource/TYPE` returns basic details for all passages tied to the given resource type with content in the given language - `/passages/PASSAGE_ID/language/LANGUAGE_ID` returns content ids for all resources tied to the given passage whether through verse or overlapping passage, in the given language. Also includes supporting resources for the given passage. - `/resources/language/LANGUAGE_ID/book/BOOK_ID?resourceType=CBBTER&resourceType=TyndaleBibleDictionary` returns all the content ids and basic info for a given book and language, filtered to the resources you specified. Groups by chapter. - `/resources/content/CONTENT_ID` returns the JSON content for text types or redirects to the CDN for other types - `/resources/metadata/CONTENT_ID` returns the display name and any other relevant metadata for content
- Loading branch information
Kyle Grinstead
committed
Sep 28, 2023
1 parent
473b3b9
commit f718a0c
Showing
16 changed files
with
493 additions
and
273 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 |
---|---|---|
@@ -1,20 +1,29 @@ | ||
namespace Aquifer.API.Modules.Bibles; | ||
using Aquifer.API.Utilities; | ||
|
||
public class BibleBookResponse | ||
namespace Aquifer.API.Modules.Bibles; | ||
|
||
public class BibleResponse | ||
{ | ||
public int LanguageId { get; set; } | ||
public int Id { get; set; } | ||
public string Name { get; set; } = null!; | ||
public string Abbreviation { get; set; } = null!; | ||
|
||
public IEnumerable<BibleBookResponseContent> Contents { get; set; } = | ||
new List<BibleBookResponseContent>(); | ||
public IEnumerable<BibleResponseBook> Books { get; set; } = | ||
new List<BibleResponseBook>(); | ||
} | ||
|
||
public class BibleBookResponseContent | ||
public class BibleResponseBook | ||
{ | ||
public int BookId { get; set; } | ||
public BibleUtilities.BookCode BookCode { get; set; } | ||
public string DisplayName { get; set; } = null!; | ||
public string TextUrl { get; set; } = null!; | ||
public object? AudioUrls { get; set; } | ||
public int TextSize { get; set; } | ||
public int AudioSize { get; set; } | ||
public int ChapterCount { get; set; } | ||
} | ||
|
||
public class BibleBookDetailsResponse : BibleResponseBook | ||
{ | ||
public string TextUrl { get; set; } = null!; | ||
public object? AudioUrls { get; set; } | ||
} |
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
43 changes: 0 additions & 43 deletions
43
src/Aquifer.API/Modules/Passages/PassageResourcesResponse.cs
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
using Aquifer.Data.Entities; | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Aquifer.API.Modules.Passages; | ||
|
||
public class PassagesBookResponse | ||
{ | ||
public int BookId { get; set; } | ||
public IEnumerable<PassagesResponsePassage> Passages { get; set; } = null!; | ||
} | ||
|
||
public class PassagesResponsePassage | ||
{ | ||
public int Id { get; set; } | ||
public int BookId => PassageStartDetails.BookId; | ||
public int StartChapter => PassageStartDetails.Chapter; | ||
public int EndChapter => PassageEndDetails.Chapter; | ||
public int StartVerse => PassageStartDetails.Verse; | ||
public int EndVerse => PassageEndDetails.Verse; | ||
|
||
[JsonIgnore] | ||
public (int BookId, int Chapter, int Verse) PassageStartDetails { get; set; } | ||
|
||
[JsonIgnore] | ||
public (int BookId, int Chapter, int Verse) PassageEndDetails { get; set; } | ||
} | ||
|
||
public class PassageDetailsResponse : PassagesResponsePassage | ||
{ | ||
public IEnumerable<PassageDetailsResponseContent> Contents { get; set; } = null!; | ||
} | ||
|
||
public class PassageDetailsResponseContent | ||
{ | ||
public int ContentId { get; set; } | ||
public ResourceEntityType TypeName { get; set; } | ||
public ResourceContentMediaType MediaTypeName { get; set; } | ||
public int ContentSize { get; set; } | ||
} |
22 changes: 22 additions & 0 deletions
22
src/Aquifer.API/Modules/Resources/ResourceContentInfoForBookResponse.cs
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using Aquifer.Data.Entities; | ||
|
||
namespace Aquifer.API.Modules.Resources; | ||
|
||
public class ResourceContentInfoForBookResponse | ||
{ | ||
public IEnumerable<ResourceContentInfoForChapter> Chapters { get; set; } = null!; | ||
} | ||
|
||
public class ResourceContentInfoForChapter | ||
{ | ||
public int ChapterNumber { get; set; } | ||
public IEnumerable<ResourceContentInfo> Contents { get; set; } = null!; | ||
} | ||
|
||
public class ResourceContentInfo | ||
{ | ||
public int ContentId { get; set; } | ||
public int ContentSize { get; set; } | ||
public ResourceContentMediaType MediaType { get; set; } | ||
public ResourceEntityType Type { get; set; } | ||
} |
Oops, something went wrong.