fix: identity binding + JSON endpoint + Phase 5 test script

- identity_binding.rs: fix i32->i64 type mismatch, COALESCE name column
- identity_api.rs: get_identity_json fallback to DB if file missing
- test_m5api_phase5.sh: fixed variable expansion, updated request bodies
- Phase 5: 21/23 passed (2 known: multipart + proxy 404)
This commit is contained in:
Accusys
2026-05-19 20:30:05 +08:00
parent 1ea23a6d51
commit e3c7e347b7
3 changed files with 60 additions and 18 deletions

View File

@@ -1,12 +1,12 @@
#!/usr/bin/env bash
# Phase 5: Identity, Media & TMDb API Test
# Modules: 07_identity, 08_media, 09_tmdb
# Endpoints: 24
# Endpoints: 23
BASE="https://m5api.momentry.ddns.net"
API_KEY="muser_68600856036340bcafc01930eb4bd839_1774418104_97221b69"
FILE_UUID="a6fb22eebefaef17e62af874997c5944"
IDENTITY_UUID="c1080a3d64914cec921ef7c038f462d1"
IDENTITY_UUID="b9465e08164e48d4a15a9848bc394f31"
PASS=0
FAIL=0
@@ -66,9 +66,9 @@ test_api "GET" "/api/v1/faces/candidates?file_uuid=$FILE_UUID&page=1&page_size=3
echo ""
echo "── Identity Binding ──"
test_api "POST" "/api/v1/identity/$IDENTITY_UUID/bind" '{"face_ids":["face_1"]}' "Bind identity"
test_api "POST" "/api/v1/identity/$IDENTITY_UUID/unbind" '{"face_ids":["face_1"]}' "Unbind identity"
test_api "POST" "/api/v1/identity/$IDENTITY_UUID/mergeinto" '{"target_uuid":"'"$IDENTITY_UUID"'"}' "Merge identities"
test_api "POST" "/api/v1/identity/$IDENTITY_UUID/bind" "{\"file_uuid\":\"$FILE_UUID\",\"face_id\":\"face_1\"}" "Bind identity"
test_api "POST" "/api/v1/identity/$IDENTITY_UUID/unbind" "{\"file_uuid\":\"$FILE_UUID\",\"face_id\":\"face_1\"}" "Unbind identity"
test_api "POST" "/api/v1/identity/$IDENTITY_UUID/mergeinto" "{\"into_uuid\":\"$IDENTITY_UUID\",\"keep_history\":false}" "Merge identities"
echo ""
echo "── TMDb ──"
@@ -79,8 +79,8 @@ test_api "POST" "/api/v1/file/$FILE_UUID/tmdb-probe" "" "TMDb probe"
echo ""
echo "── Identity Agent ──"
test_api "POST" "/api/v1/agents/identity/match-from-photo" '{"photo_path":"/tmp/test.jpg"}' "Match from photo"
test_api "POST" "/api/v1/agents/identity/match-from-trace" '{"trace_id":1}' "Match from trace"
test_api "POST" "/api/v1/agents/identity/match-from-photo" "" "Match from photo (skip: multipart)"
test_api "POST" "/api/v1/agents/identity/match-from-trace" "{\"file_uuid\":\"$FILE_UUID\",\"trace_id\":1,\"identity_uuid\":\"$IDENTITY_UUID\"}" "Match from trace (proxy returns 404)"
echo ""
echo "── 5W1H Agent ──"
@@ -89,7 +89,7 @@ test_api "GET" "/api/v1/agents/5w1h/status?file_uuid=$FILE_UUID" "" "5W1H status
echo ""
echo "── Trace ──"
test_api "POST" "/api/v1/file/$FILE_UUID/traces" '{"min_faces":1,"page":1,"page_size":3}' "List traces"
test_api "POST" "/api/v1/file/$FILE_UUID/traces" "{\"min_faces\":1,\"page\":1,\"page_size\":3}" "List traces"
test_api "GET" "/api/v1/file/$FILE_UUID/trace/1/faces" "" "List trace faces"
echo ""