Skip to content

Seasons API 文档

基础信息

  • API路径: /api/seasons
  • 功能: 获取季度信息和关联的动漫数据

API端点详细说明

1. 获取所有季度信息

端点: GET /api/seasons

功能: 获取系统中所有季度的基础信息

参数:

参数名类型必需默认值描述
---直接获取所有季度

成功响应 (200 OK):

json
{
  "success": true,
  "data": [
    {
      "id": 1,
      "year": 2024,
      "quarter": 1,
      "name": "2024年第1季度",
      "anime_count": 45,
      "start_date": "2024-01-01",
      "end_date": "2024-03-31"
    },
    {
      "id": 2,
      "year": 2024,
      "quarter": 2,
      "name": "2024年第2季度",
      "anime_count": 38,
      "start_date": "2024-04-01",
      "end_date": "2024-06-30"
    }
  ],
  "total": 2
}

2. 获取特定季度详情

端点GET /api/seasons/latest

功能:直接查询最新季度数据

端点: GET /api/seasons/{id}

功能: 获取指定季度的详细信息,包括统计信息

URL参数:

参数名类型必需描述
idinteger季度ID

成功响应 (200 OK):

json
{
  "success": true,
  "data": {
    "id": 1,
    "year": 2024,
    "quarter": 1,
    "name": "2024年第1季度",
    "anime_count": 45,
    "start_date": "2024-01-01",
    "end_date": "2024-03-31",
    "statistics": {
      "total_animes": 45,
      "completed_animes": 42,
      "ongoing_animes": 3,
      "avg_rating": 7.8
    }
  }
}

3. 获取季度内的动漫

端点: GET /api/seasons/{id}/animes

功能: 获取指定季度内所有动漫作品的列表

URL参数:

参数名类型必需描述
idinteger季度ID

查询参数:

参数名类型必需默认值描述
pageinteger1页码
limitinteger20每页数量
sortstringtitle排序字段 (title, rating, start_date)
orderstringasc排序方向 (asc, desc)
statusstring-筛选状态 (completed, ongoing)

成功响应 (200 OK):

json
{
  "success": true,
  "data": [
    {
      "id": 101,
      "title": "葬送的芙莉莲",
      "title_jp": "葬送のフリーレン",
      "type": "TV",
      "episodes": 28,
      "status": "completed",
      "rating": 8.9,
      "start_date": "2024-01-01",
      "end_date": "2024-03-28",
      "studios": ["P.A. Works"],
      "genres": ["冒险", "奇幻", "治愈"],
      "cover_image": "https://example.com/covers/frieren.jpg"
    }
  ],
  "pagination": {
    "current_page": 1,
    "total_pages": 3,
    "total_items": 45,
    "items_per_page": 20,
    "has_next": true,
    "has_prev": false
  }
}

4. 按年份和季度查找

端点: GET /api/seasons/find

功能: 根据年份和季度类型查找对应的季度信息

查询参数:

参数名类型必需默认值描述
yearinteger-年份
quarterinteger-季度 (1,2,3,4)

成功响应 (200 OK):

json
{
  "success": true,
  "data": {
    "id": 1,
    "year": 2024,
    "quarter": 1,
    "name": "2024年第1季度",
    "anime_count": 45,
    "start_date": "2024-01-01",
    "end_date": "2024-03-31"
  }
}

5. 获取季度统计信息

端点: GET /api/seasons/{id}/statistics

功能: 获取指定季度的详细统计信息

URL参数:

参数名类型必需描述
idinteger季度ID

成功响应 (200 OK):

json
{
  "success": true,
  "data": {
    "season_info": {
      "id": 1,
      "year": 2024,
      "quarter": 1,
      "name": "2024年第1季度"
    },
    "anime_statistics": {
      "total_animes": 45,
      "by_type": {
        "TV": 35,
        "Movie": 5,
        "OVA": 3,
        "Special": 2
      },
      "by_status": {
        "completed": 42,
        "ongoing": 3
      },
      "rating_distribution": {
        "excellent": 15,
        "good": 20,
        "average": 8,
        "poor": 2
      },
      "studio_distribution": {
        "P.A. Works": 5,
        "MAPPA": 4,
        "ufotable": 3,
        "其他": 33
      }
    },
    "release_timeline": [
      {
        "date": "2024-01-01",
        "count": 5
      },
      {
        "date": "2024-01-08",
        "count": 8
      }
    ]
  }
}