fix: pass face_settings to create_monitor_job in register and process endpoints
- files.rs: register_file now converts FaceSettings to json and passes to create_monitor_job - processing.rs: ProcessRequest now includes face_settings field - processing.rs: trigger_processing now passes face_settings to create_monitor_job and updates existing jobs - docs: updated API examples to use correct endpoints (/api/v1/files/register and /api/v1/files/:uuid/process)
This commit is contained in:
@@ -71,14 +71,42 @@ launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/com.momentry.worker.plis
|
||||
|
||||
## API 參數設定
|
||||
|
||||
### 創建 Job 時指定 face_settings
|
||||
### 方法 1:Register 時指定 face_settings
|
||||
|
||||
**Endpoint**: `POST /api/v1/jobs`
|
||||
**Endpoint**: `POST /api/v1/files/register`
|
||||
|
||||
**Request Body**:
|
||||
```json
|
||||
{
|
||||
"file_path": "/path/to/video.mp4",
|
||||
"face_settings": {
|
||||
"min_confidence": 0.5,
|
||||
"min_size": 1
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**完整 curl 範例**:
|
||||
```bash
|
||||
curl -s -X POST http://localhost:3002/api/v1/files/register \
|
||||
-H "Authorization: Bearer muser_demo_key_32chars_abcdef1234567890" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"file_path": "/Users/accusys/momentry/var/sftpgo/data/demo/Accusys-WD_FilmRiot_test.mp4",
|
||||
"face_settings": {
|
||||
"min_confidence": 0.5,
|
||||
"min_size": 1
|
||||
}
|
||||
}'
|
||||
```
|
||||
|
||||
### 方法 2:Deep Scan 時指定 face_settings
|
||||
|
||||
**Endpoint**: `POST /api/v1/files/{file_uuid}/process`
|
||||
|
||||
**Request Body**:
|
||||
```json
|
||||
{
|
||||
"file_uuid": "0489e104d7d1e11e613da01f7aa130ca",
|
||||
"processors": ["face"],
|
||||
"face_settings": {
|
||||
"min_confidence": 0.5,
|
||||
@@ -89,11 +117,10 @@ launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/com.momentry.worker.plis
|
||||
|
||||
**完整 curl 範例**:
|
||||
```bash
|
||||
curl -s -X POST http://localhost:3002/api/v1/jobs \
|
||||
curl -s -X POST http://localhost:3002/api/v1/files/0489e104d7d1e11e613da01f7aa130ca/process \
|
||||
-H "Authorization: Bearer muser_demo_key_32chars_abcdef1234567890" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"file_uuid": "0489e104d7d1e11e613da01f7aa130ca",
|
||||
"processors": ["face"],
|
||||
"face_settings": {
|
||||
"min_confidence": 0.5,
|
||||
|
||||
Reference in New Issue
Block a user