接口文档

项目地址:https://gz100.ncscu.cn

1. 登录接口

POST /api/car/auth/login

说明:管理员登录,账号密码固定为 admin / 123456。

请求参数

字段 类型 必填 说明
username string 是 用户名
password string 是 密码

请求示例

curl -X POST https://gz100.ncscu.cn/api/car/auth/login \
  -H "Content-Type: application/json" \
  -d '{"username":"admin","password":"123456"}'

响应示例

{
  "code": 200,
  "msg": "登录成功",
  "data": {
    "username": "admin",
    "role": "admin"
  },
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}

2. 天气查询接口

GET /api/car/weather?city=[城市]

说明:根据传入城市返回随机天气和温度。

请求参数

字段 类型 必填 说明
city string 是 城市名称,可任意输入

请求示例

curl "https://gz100.ncscu.cn/api/car/weather?city=北京"

响应示例

{
  "city": "北京",
  "weather": "多云",
  "temperature": 18
}