diff --git a/app/openapi/generated/index.ts b/app/openapi/generated/index.ts index 0bea2a0..9a370a6 100644 --- a/app/openapi/generated/index.ts +++ b/app/openapi/generated/index.ts @@ -1,4 +1,4 @@ // This file is auto-generated by @hey-api/openapi-ts -export { getSearch, type Options } from './sdk.gen'; -export type { ClientOptions, GetSearchData, GetSearchResponse, GetSearchResponses, SearchEntryDto, SearchResponseDto } from './types.gen'; +export { getDetail, getListKodik, getSearchKodik, type Options } from './sdk.gen'; +export type { CharacterDto, ClientOptions, ContentDetailEntry, ContentSearchEntry, GetDetailData, GetDetailResponse, GetDetailResponses, GetListKodikData, GetListKodikResponse, GetListKodikResponses, GetSearchKodikData, GetSearchKodikResponse, GetSearchKodikResponses, RelatedDto, SearchEntries, TranslationDto, Uuid } from './types.gen'; diff --git a/app/openapi/generated/sdk.gen.ts b/app/openapi/generated/sdk.gen.ts index a7734ba..754287b 100644 --- a/app/openapi/generated/sdk.gen.ts +++ b/app/openapi/generated/sdk.gen.ts @@ -2,7 +2,7 @@ import type { Client, Composable, Options as Options2, TDataShape } from './client'; import { client } from './client.gen'; -import type { GetSearchData, GetSearchResponse } from './types.gen'; +import type { GetDetailData, GetDetailResponse, GetListKodikData, GetListKodikResponse, GetSearchKodikData, GetSearchKodikResponse } from './types.gen'; export type Options = Options2 & { /** @@ -19,6 +19,16 @@ export type Options(options: Options) => (options.client ?? client).get({ url: '/search', ...options }); +export const getDetail = (options: Options) => (options.client ?? client).get({ url: '/detail', ...options }); + +/** + * List + */ +export const getListKodik = (options: Options) => (options.client ?? client).get({ url: '/list/kodik', ...options }); + +/** + * Search Kodik + */ +export const getSearchKodik = (options: Options) => (options.client ?? client).get({ url: '/search/kodik', ...options }); diff --git a/app/openapi/generated/types.gen.ts b/app/openapi/generated/types.gen.ts index 4cc12b9..7a226df 100644 --- a/app/openapi/generated/types.gen.ts +++ b/app/openapi/generated/types.gen.ts @@ -4,7 +4,34 @@ export type ClientOptions = { baseURL: 'http://localhost:8080' | (string & {}); }; -export type SearchEntryDto = { +export type CharacterDto = { + id?: string; + type?: string; + name?: string; + posterUrl?: string; +}; + +export type ContentDetailEntry = { + title?: string; + posterUrl?: string; + description?: string; + kind?: string; + episodes?: number; + duration?: number; + status?: string; + releasedOn?: string; + translations?: Array; + genres?: Array; + origin?: string; + rating?: string; + producers?: Array; + related?: Array; + characters?: Array; + studios?: Array; + directors?: Array; +}; + +export type ContentSearchEntry = { id?: string; posterURLs?: Array; title?: string; @@ -17,24 +44,73 @@ export type SearchEntryDto = { durationMin?: number; }; -export type SearchResponseDto = { - result?: Array; +export type RelatedDto = { + id?: string; + type?: string; + name?: string; + posterUrl?: string; }; -export type GetSearchData = { +export type SearchEntries = { + result?: Array; +}; + +export type TranslationDto = { + id?: number; + title?: string; + type?: string; +}; + +export type Uuid = string; + +export type GetDetailData = { + body?: never; + path?: never; + query?: { + id?: Uuid; + }; + url: '/detail'; +}; + +export type GetDetailResponses = { + /** + * OK + */ + 200: ContentDetailEntry; +}; + +export type GetDetailResponse = GetDetailResponses[keyof GetDetailResponses]; + +export type GetListKodikData = { + body?: never; + path?: never; + query?: never; + url: '/list/kodik'; +}; + +export type GetListKodikResponses = { + /** + * OK + */ + 200: SearchEntries; +}; + +export type GetListKodikResponse = GetListKodikResponses[keyof GetListKodikResponses]; + +export type GetSearchKodikData = { body?: never; path?: never; query?: { title?: string; }; - url: '/search'; + url: '/search/kodik'; }; -export type GetSearchResponses = { +export type GetSearchKodikResponses = { /** * OK */ - 200: SearchResponseDto; + 200: SearchEntries; }; -export type GetSearchResponse = GetSearchResponses[keyof GetSearchResponses]; +export type GetSearchKodikResponse = GetSearchKodikResponses[keyof GetSearchKodikResponses]; diff --git a/app/pages/anime/[id].vue b/app/pages/anime/[id].vue index 2d474bf..20dbde1 100644 --- a/app/pages/anime/[id].vue +++ b/app/pages/anime/[id].vue @@ -5,222 +5,146 @@ import Tabs from '~/components/ui/tabs/Tabs.vue'; import TabsContent from '~/components/ui/tabs/TabsContent.vue'; import TabsList from '~/components/ui/tabs/TabsList.vue'; import TabsTrigger from '~/components/ui/tabs/TabsTrigger.vue'; +import { getDetail } from '~/openapi/generated'; -const data = { - title: " .hack//G.U. Trilogy", - poster: "example/hackguposter.jpg", - description: `Based on the CyberConnect2 HIT GAME, now will be released in a CG Movie! - -The Movie will be placed in the storyline of each .hack//G.U. games trilogy. The story follows Haseo, a player in the online MMORPG called The World:R2 at first depicted as a PKK (Player Killer Killer) known as the "Terror of Death", a former member of the disbanded Twilight Brigade guild. Haseo encounters Azure Kite (believing him to be Tri-Edge and blaming him for what happened to Shino) but is hopelessly outmatched. Azure Kite easily defeats Haseo and Data Drains him, reducing his level from 133 to 1 and leaving him without any items, weapons, or member addresses. He is left with a mystery on his hands as to the nature of the Data Drain and why Azure Kite is in possession of such a skill. - -Eventually Haseo gains the "Avatar" of Skeith. Acquiring the ability to call Skeith and wield his abilities, such as Data Drain. With Skeith as his strength, Haseo begins the quest for a way to save Shino. - -He is seen seeking out a PK (Player Killer) known as Tri-Edge, whose victims supposedly are unable to return to The World after he PKs them. Haseo's friend, Shino, was attacked six months prior to the events of the game by Tri-Edge, and the player herself, Shino Nanao, was left in a coma. - -(Source: AniDB) -`, - format: "Movie", - episodes: 1, - duration: "1 hour, 33 mins", - status: "Finished", - release: "Mar 25, 2008", - season: "Spring 2008", - translations: ["Anilibria", "Soviet Romantica", "AniDUB", "AniStar"], - genres: ["Action", "Fantasy", "Sci-Fi"], - average: 67, - mean: 67, - popularity: 5481, - favorites: 36, - producers: ["Bandai Visual", "CyberConnect2", "Hanabee Entartainment", "Funimation"], - source: "Video Game", - romaji: ".hack//G.U. Trilogy", - native: ".hack//G.U. Trilogy", - relations: [ - { - url: "/example/relation1.png", - type: "Prequel", - name: ".hack//Roots" - }, - { - url: "/example/relation2.jpg", - type: "Sequel", - name: ".hack//G.U. Returner" - }, - { - url: "/example/relation3.jpg", - type: "Alternative", - name: ".hack//G.U." - }, - { - url: "/example/relation4.jpg", - type: "Alternative", - name: ".hack//G.U.+" - }, - { - url: "/example/relation5.jpg", - type: "Side Story", - name: ".hack//G.U. Returner Trilogy" - }, - { - url: "/example/relation6.jpg", - type: "Summary", - name: "Daitai 3-pun de Wakaru .hack History " - }, - ] -} +const { data, status, error } = await getDetail({ + composable: 'useFetch', + query: { + id: 'ba9c5699-a720-412a-958e-3d5555d97b8f' + } +}) diff --git a/app/pages/index.vue b/app/pages/index.vue index 6b6dc04..5500e1a 100644 --- a/app/pages/index.vue +++ b/app/pages/index.vue @@ -1,21 +1,18 @@ @@ -48,6 +45,9 @@ const { data: trendingAnimeData, status, error } = await getSearch({ +