fix types

This commit is contained in:
jxxghp
2023-06-28 20:16:59 +08:00
parent a2ce0840e3
commit 7106d2f70b
6 changed files with 143 additions and 140 deletions

117
src/api/types.ts Normal file
View File

@@ -0,0 +1,117 @@
// 订阅
export interface Subscribe {
id: number;
// 订阅名称
name: string;
// 订阅年份
year: string;
// 订阅类型 电影/电视剧
type: string;
// 搜索关键字
keyword?: string;
tmdbid: number;
doubanid?: string;
// 季号
season?: number;
// 海报
poster?: string;
// 背景图
backdrop?: string;
// 评分
vote?: number;
// 描述
description?: string;
// 过滤规则
filter?: string;
// 包含
include?: string;
// 排除
exclude?: string;
// 总集数
total_episode?: number;
// 开始集数
start_episode?: number;
// 缺失集数
lack_episode?: number;
// 附加信息
note?: string;
// 状态N-新建, R-订阅中
state: string;
}
// 历史记录
export interface TransferHistory {
// ID
id: number;
// 源目录
src?: string;
// 目的目录
dest?: string;
// 转移模式link/copy/move/softlink
mode?: string;
// 类型:电影、电视剧
type?: string;
// 二级分类
category?: string;
// 标题
title?: string;
// 年份
year?: string;
// TMDBID
tmdbid?: number;
// IMDBID
imdbid?: string;
// TVDBID
tvdbid?: number;
// 豆瓣ID
doubanid?: string;
// 季Sxx
seasons?: string;
// 集Exx
episodes?: string;
// 海报
image?: string;
// 下载器Hash
download_hash?: string;
// 状态 1-成功0-失败
status: boolean;
// 失败原因
errmsg?: string;
// 日期
date?: string;
}
// 媒体信息
export interface MediaInfo {
// 类型 电影、电视剧
type?: string
// 媒体标题
title?: string
// 年份
year?: string
// TMDB ID
tmdb_id?: number
// IMDB ID
imdb_id?: string
// TVDB ID
tvdb_id?: string
// 豆瓣ID
douban_id?: string
// 媒体原语种
original_language?: string
// 媒体原发行标题
original_title?: string
// 媒体发行日期
release_date?: string
// 背景图片
backdrop_path?: string
// 海报图片
poster_path?: string
// 评分
vote_average: number
// 描述
overview?: string
// 二级分类
category?: string
}

View File

@@ -0,0 +1,20 @@
<script lang="ts" setup>
import { MediaInfo } from "@/api/types";
// 输入参数
const props = defineProps({
media: Object as PropType<MediaInfo>
});
</script>
<template>
<VResponsive aspect-ratio="1/2" max-width="11rem">
<VCard>
<VImg
:src="props.media?.poster_path"
cover
/>
</VCard>
</VResponsive>
</template>

View File

@@ -10,23 +10,5 @@ import MediaCardListView from '@/views/discover/MediaCardListView.vue';
<MediaCardListView apipath="/tmdb/movies"/>
<p class="text-2xl font-weight-medium my-5">
TMDB电视剧
</p>
<MediaCardListView apipath="/tmdb/tvs"/>
<p class="text-2xl font-weight-medium my-5">
豆瓣电影
</p>
<MediaCardListView apipath="/douban/movies"/>
<p class="text-2xl font-weight-medium my-5">
豆瓣电视剧
</p>
<MediaCardListView apipath="/douban/tvs"/>
</div>
</template>

View File

@@ -1,39 +1,7 @@
<script lang="ts" setup>
import api from "@/api";
// 定义订阅字典结构
interface MediaInfo {
// 类型 电影、电视剧
type?: string
// 媒体标题
title?: string
// 年份
year?: string
// TMDB ID
tmdb_id?: number
// IMDB ID
imdb_id?: string
// TVDB ID
tvdb_id?: string
// 豆瓣ID
douban_id?: string
// 媒体原语种
original_language?: string
// 媒体原发行标题
original_title?: string
// 媒体发行日期
release_date?: string
// 背景图片
backdrop_path?: string
// 海报图片
poster_path?: string
// 评分
vote_average: number
// 描述
overview?: string
// 二级分类
category?: string
}
import { MediaInfo } from "@/api/types";
import MediaCard from "@/components/cards/MediaCard.vue";
// 输入参数
const props = defineProps({
@@ -63,12 +31,8 @@ onMounted(fetchData);
<template>
<VRow>
<VCol v-for="data in dataList" :key="data.tmdb_id" cols="6" md="3" lg="2">
<VCard>
<VImg
:src="data.poster_path"
cover
/>
</VCard>
<MediaCard :media="data">
</MediaCard>
</VCol>
</VRow>
</template>

View File

@@ -1,48 +1,8 @@
<script setup lang="ts">
import api from "@/api";
import type { TransferHistory } from "@/api/types";
import { onMounted, ref } from "vue";
interface TransferHistory {
// ID
id: number;
// 源目录
src?: string;
// 目的目录
dest?: string;
// 转移模式link/copy/move/softlink
mode?: string;
// 类型:电影、电视剧
type?: string;
// 二级分类
category?: string;
// 标题
title?: string;
// 年份
year?: string;
// TMDBID
tmdbid?: number;
// IMDBID
imdbid?: string;
// TVDBID
tvdbid?: number;
// 豆瓣ID
doubanid?: string;
// 季Sxx
seasons?: string;
// 集Exx
episodes?: string;
// 海报
image?: string;
// 下载器Hash
download_hash?: string;
// 状态 1-成功0-失败
status: boolean;
// 失败原因
errmsg?: string;
// 日期
date?: string;
}
// 表头
const headers = [
{ title: "标题", key: "title" },

View File

@@ -1,47 +1,7 @@
<script lang="ts" setup>
import api from "@/api";
import { formatSeason } from "@core/utils/formatters";
// 定义订阅字典结构
interface Subscribe {
id: number;
// 订阅名称
name: string;
// 订阅年份
year: string;
// 订阅类型 电影/电视剧
type: string;
// 搜索关键字
keyword?: string;
tmdbid: number;
doubanid?: string;
// 季号
season?: number;
// 海报
poster?: string;
// 背景图
backdrop?: string;
// 评分
vote?: number;
// 描述
description?: string;
// 过滤规则
filter?: string;
// 包含
include?: string;
// 排除
exclude?: string;
// 总集数
total_episode?: number;
// 开始集数
start_episode?: number;
// 缺失集数
lack_episode?: number;
// 附加信息
note?: string;
// 状态N-新建, R-订阅中
state: string;
}
import type { Subscribe } from "@/api/types";
// 输入参数
const props = defineProps({