*members(メンバー):
**character_id(キャラクターID)※
**owner_gid:キャラクター保有アカウントのgid
**position(役職):役職(フリーテキスト)
**level(レベル):スキルlevel(数字入力)
**status:承認状況
*AL(平均レベル):技能の平均レベル(数字入力)
*leader_id(リーダー):リーダーキャラID(メンバーから選択)
*local_list.json:地方名一覧
=成功したAPIテストしたAPI===✅ 認証系 API=====① 一般ユーザ登録=①―A アカウントA登録 & cookie保存==
curl -X POST http://localhost/api/user/register \
-H "Content-Type: application/json" \
-c cookie.txt \ -d '{"display":"ギルドの誰かユーザA","id":"testuseruserA","pass":"testpasspassA"}'\ -c cookieA.txt
==①―B アカウントB登録== curl -X POST http://localhost/api/user/register \ -H "Content-Type: application/json" \ -d '{"display":"ユーザB","id":"userB","pass":"passB"}' \ -c cookieB.txt ==② ログイン(一般 or 管理者)=アカウントAでログイン==
curl -X POST http://localhost/api/user/login \
-H "Content-Type: application/json" \
-d '{"id":"userA","pass":"passA"}' \ -b cookieA.txt -c cookieA.txt ==③ キャラA作成 & ユニット作成=====キャラA=== curl -X POST http://localhost/api/char/create \ -H "Content-Type: application/json" \ -b cookiecookieA.txt -c cookiecookieA.txt \ -d '{"idname":"キャラA","sheetUrl":"https://sheet/a","description":"testuserAのキャラ","passtags":"testpasstest"}' # 返り値の "id" を控える → 例: CHAR_A_ID
===③ 現在のログイン状態確認ユニットA=== curl -X POST http://localhost/api/userunit/me create \ -H "Content-Type: application/json" \ -b cookiecookieA.txt -c cookieA.txt\ -d '{"name":"ユニットA","description":"テストユニット"}'
===④ ログアウト=== curl http# 返り値の "id" を控える → 例://localhost/api/user/logout -b cookie.txt -c cookie.txtUNIT_ID
===⑤ 一般ユーザの削除(自分で削除)=④ アカウントBでログイン & キャラB作成== curl -X POST http://localhost/api/user/delete login \ -H "Content-Type: application/json" \ -d '{"id":"userB","pass":"passB"}' \ -b cookiecookieB.txt -c cookiecookieB.txt
==✅ キャラクター関連API==
===キャラクター作成===
curl -X POST http://localhost/api/char/create \
-H "Content-Type: application/json" \ -b cookiecookieB.txt -c cookiecookieB.txt \ -d '{ "name": "テストキャラキャラB", "sheetUrl": "https://example.comsheet/sheet123b", "description": "テスト用キャラクターです\n改行もできるよBのキャラ", "tags": "テスト,TRPG,ファンタジーtest"}' }'# 返り値 "id" → CHAR_B_ID
==⑤ アカウントAでユニットに自キャラA即時追加==★作成されたキャラ====(招待を経由しないパターン確認) "938146af"curl -X POST http: {//localhost/api/member/invite \ "id -H "Content-Type: application/json"938146af",\ "userId": "testuser", -b cookieA.txt -c cookieA.txt \ -d '{"nameunitOwnerGid": "テストキャラ9139e4d21e497f51", "sheetUrlunitId": "https:\/\/example.com\/sheet1231890fa5d", "descriptioncharOwnerGid": "テスト用キャラクターです\n改行もできるよ9139e4d21e497f51", "tagscharId": "テスト,TRPG,ファンタジーb944034b" }'
==✅ ユニット関連=====ユニット一覧取得=== curl http://localhost/api/unit/list \ -b cookie.txt===ユニット作成=⑥ アカウントA → アカウントB キャラBを招待== curl -X POST http://localhost/api/unitmember/create invite \
-H "Content-Type: application/json" \
-b cookiecookieA.txt -c cookieA.txt \ -d '{ "name": "テストユニット", "descriptionunitOwnerGid": "これはテスト用のユニットです。9139e4d21e497f51", "worksunitId": "冒険者1890fa5d", "location": { "place_namecharOwnerGid": "キングスフォール2f11472dba7fc9a7", "regioncharId": "ドーデン地方f2de295c", "scale": "村" },' "base": { "base_name": "宿屋",==⑦ アカウントBで招待承認== "base_description" curl -X GET http: "街の普通の宿屋だよ!", "base_cost": 500 }, "skill_type": "冒険者"//localhost/api/member/invites \ }'-b cookieB.txt
===ユニット更新&メンバー追加===※メンバーの更新は別APIで実行 curl -X POST http://localhost/api/unitmember/update accept \
-H "Content-Type: application/json" \
-b cookiecookieB.txt -c cookieB.txt \ -d '{ "idunitOwnerGid": "eda3130a9139e4d21e497f51", "nameunitId": "テストユニット1890fa5d", "descriptioncharOwnerGid": "これはテスト用のユニットです。2f11472dba7fc9a7", "workscharId": "冒険者f2de295c",}' "location": { "place_name": "キングスフォール",==⑧ 最終確認:ユニット詳細 & キャラ所属確認== "region": "ドーデン地方",===ユニットAには2キャラ入ってAL計算されている?=== "scale curl -X GET "http: //localhost/api/unit/detail?gid=9139e4d21e497f51&unitId=1890fa5d"村" }, "base": { -b cookieB.txt -c cookieB.txt "base_name": "宿屋", "base_description": "街の普通の宿屋だよ!",===キャラBに unit_memberships が反映されている?=== "base_cost curl -X GET "http: 500 }, //localhost/api/character/detail?gid=2f11472dba7fc9a7&charId=f2de295c"skill_type": "冒険者" }' -b cookieB.txt -c cookieB.txt
===ユニット削除=今後ためす==
curl -X POST http://localhost/api/unit/delete \
-H "Content-Type: application/json" \
-b cookie.txt \
-d '{
"id": "ac900354ユニットID"
}'
curl -X POST http://localhost/api/user/delete -b cookie.txt -c cookie.txt