Skip to content

Planet List Mock API

源码: web/src/mock/modules/planet/list.ts

接口列表

方法路径说明
GET/api/v1/planets获取星球列表

请求参数

无请求参数。

响应格式

GET /api/v1/planets

返回 planets.json 中定义的 6 颗星球配置:

json
{
  "code": 0,
  "msg": "ok",
  "data": [
    {
      "id": "nature_planet",
      "name": "自然星球",
      "category_id": "nature",
      "sub_series": [
        { "sub_category_id": "weather", "name": "天气" },
        { "sub_category_id": "landscape", "name": "地貌" }
      ]
    }
  ]
}

每个星球定义包含:

字段类型说明
idstring星球唯一标识
namestring星球名称
category_idstring关联的分类ID
sub_seriesarray子系列列表(含 sub_category_idname

星球解锁顺序

nature_planet → human_planet → animal_planet → object_planet → plant_planet → astronomy_planet

默认只解锁 nature_planet,完成当前星球全部内容后自动解锁下一个。

被哪个 Store 调用

  • CharacterStore (web/src/stores/character.ts)
    • load()GET /api/v1/planets
    • getPlanet(planetId) / getPlanetByCategory(categoryId) 依赖此数据