Lit-innosence / tus_yuurikai_system

MIT License
2 stars 0 forks source link

API メソッド形式 #7

Open Dot-P opened 2 months ago

Dot-P commented 2 months ago

ユーザー情報登録 - path (Request)

/locker/user-register/

ユーザー情報登録 - JSON (Request)

{
    "data": {
        "main_user": {
            "student_id": "4622999",
            "family_name": "山田",
            "given_name": "太郎",
        },
        "co_user": {
            "student_id": "4623000",
            "family_name": "山田",
            "given_name": "次郎",
        }
    }
}
Dot-P commented 2 months ago

ロッカー利用者検索 - Path (Request)

/locker/user-search/<year>/ /locker/user-search/<year>/?floor=3 /locker/user-search/<year>/?name=yamada /locker/user-search/<year>/?floor=3?name=yamada

ロッカー利用者検索 - JSON (Response)

{
    "data": [
        {
            "locker_id": "2001",
            "floor": 2,
            "main_user": {
                "student_id": "4622999",
                "family_name": "山田",
                "given_name": "太郎"
            },
            "co_user": {
                "student_id": "4623000",
                "family_name": "山田",
                "given_name": "次郎"
            },
            "year": 2024
        },
        {
            "locker_id": "3001",
            "floor": 3,
            "main_user": {
                "student_id": "4522999",
                "family_name": "佐藤",
                "given_name": "太郎"
            },
            "co_user": {
                "student_id": "4523000",
                "family_name": "佐藤",
                "given_name": "次郎"
            },
            "year": 2024
        }
    ]
}
Dot-P commented 2 months ago

ロッカー空き状態確認 - パス (Request)

/locker/availability?floor=2

ロッカー空き状態確認 - JSON (Response)

{
    "data": [
       {
           "locker_id": "2001",
           "floor": 2,
           "status": "VACANT"
       },
       {
           "locker_id": "2002",
           "floor": 2,
           "status": "OCCUPIED"
       },
       {
           "locker_id": "2003",
           "floor": 2,
           "status": "OUT-OF-WORK"
       }
    ]
}
Dot-P commented 2 months ago

ロッカー番号登録 - パス (Request)

/locker/locker-register

ロッカー番号登録 - JSON (Request)

{
    "data": {
        "student_id": "4622000",
        "locker_id": "2001"
    }
}