-
GET
/api/getRunRecords
获取用户的跑步记录
runId
string
跑步记录ID(不填则获取列表)
limit
number
每页记录数量(默认10)
GET /api/getRunRecords?userId=user123&limit=10&skip=0
Response:
{
"success": true,
"data": {
"records": [
{
"runId": "run_123456",
"date": "2023-04-05",
"time": "00:30:15",
"distance": 3.5,
"speed": "8'35\"",
"calories": 280,
"runType": 0
},
// 更多记录...
],
"total": 25,
"page": 1,
"limit": 10
}
}
-
POST
/api/saveRunRecord
保存用户的跑步记录
date
string
记录日期 (YYYY-MM-DD)
time
string
运动时间 (HH:MM:SS)
runType
number
跑步类型(0:户外跑, 1:室内跑)
POST /api/saveRunRecord
Content-Type: application/json
{
"userId": "user123",
"runId": "run_123456",
"date": "2023-04-05",
"time": "00:30:15",
"distance": 3.5,
"speed": "8'35\"",
"calories": 280,
"runType": 0,
"points": [
{"latitude": 39.9042, "longitude": 116.4074, "timestamp": 1617606000},
{"latitude": 39.9043, "longitude": 116.4075, "timestamp": 1617606010}
]
}
-
POST
/api/shareRunRecord
分享跑步记录并更新分享计数
shareType
string
分享类型(如 'timeline', 'werun', 'appMessage' 等)
POST /api/shareRunRecord
Content-Type: application/json
{
"userId": "user123",
"runId": "run_123456",
"shareType": "timeline"
}
Response:
{
"success": true,
"message": "Share record updated successfully",
"data": {
"record": {
// 跑步记录详情
},
"shareData": {
"title": "我完成了3.5公里跑步,消耗了280卡路里!",
"path": "/pages/run-share/run-share?runId=run_123456&userId=user123",
"imageUrl": "https://static.luozhinet.com/xcx/assets/icons/share-run.png",
"shareType": "timeline"
}
}
}