创建新的相机日志记录。所有字段都是可选的,系统会自动填充默认值。
请求参数
| 字段 |
类型 |
必填 |
默认值 |
说明 |
| camera_model |
string |
可选 |
"Unknown" |
相机型号 |
| battery_level |
integer |
可选 |
null |
电池电量 (0-100) |
| connection_status |
boolean |
可选 |
false |
连接状态 |
| app_version |
string |
可选 |
"unknown" |
App版本号 |
| issue_type |
string |
可选 |
"other" |
问题类型 |
| user_name |
string |
可选 |
null |
用户名称 |
| user_id |
string |
可选 |
null |
用户ID |
| is_resolved |
boolean |
可选 |
false |
是否已解决 |
| json_data |
object |
可选 |
null |
附加JSON数据 |
📝 issue_type 可选值
connection_failed, setting_failed, battery_low, firmware_error, network_timeout, authentication_failed, storage_full, temperature_high, other
请求示例
完整示例
curl -X POST "https://fujistyleapp.com/logs/api/camera-logs" \
-H "Content-Type: application/json" \
-d '{
"camera_model": "Canon EOS R5",
"battery_level": 78,
"connection_status": true,
"app_version": "1.2.3",
"issue_type": "connection_failed",
"user_name": "张三",
"user_id": "user123",
"json_data": {
"error_code": "TIMEOUT",
"retry_count": 3,
"signal_strength": -45
}
}'
最简示例(空数据也能成功)
curl -X POST "https://fujistyleapp.com/logs/api/camera-logs" \
-H "Content-Type: application/json" \
-d '{}'
基础示例
curl -X POST "https://fujistyleapp.com/logs/api/camera-logs" \
-H "Content-Type: application/json" \
-d '{
"camera_model": "Sony A7R IV",
"connection_status": false,
"issue_type": "battery_low"
}'
响应示例
200 OK
{
"success": true,
"id": 123,
"message": "Camera log uploaded successfully",
"processed_data": {
"camera_model": "Canon EOS R5",
"connection_status": true,
"app_version": "1.2.3",
"issue_type": "connection_failed",
"user_provided_fields": 6,
"auto_filled_fields": ["timestamp", "app_timestamp"]
}
}
一次性上传多条日志记录,建议每次不超过100条
请求示例
curl -X POST "https://fujistyleapp.com/logs/api/camera-logs/batch" \
-H "Content-Type: application/json" \
-d '{
"logs": [
{
"camera_model": "Canon EOS R5",
"connection_status": true,
"issue_type": "other"
},
{
"camera_model": "Sony A7R IV",
"connection_status": false,
"issue_type": "battery_low",
"battery_level": 15
},
{}
]
}'
响应示例
200 OK
{
"success": true,
"message": "Processed 3 logs",
"results": {
"successful": 3,
"failed": 0,
"details": [
{"index": 0, "id": 124, "status": "success"},
{"index": 1, "id": 125, "status": "success"},
{"index": 2, "id": 126, "status": "success"}
],
"errors": []
}
}