wafflestudio / seminar-2021

2021 Rookies 세미나
47 stars 110 forks source link

Android 과제 4번 api response 관련 질문 #664

Closed JYPSloth closed 2 years ago

JYPSloth commented 2 years ago

요약

과제를 하기 위해 필요한 정보가 api의 response에 담겨 있지 않은 것 같습니다ㅠㅠ





상황

seminar 목록을 불러오기 위해 관련 코드를 짜고 있는데, api 명세에 있는 response와 실제 response가 다르고, 필요한 내용이 들어있지 않아서 과제 수행에 어려움이 있습니다.





문제 내용

우선 과제를 하려면 /seminar/로 get 요청을 보내서 세미나 목록을 전부 받아오고, 각각의 seminar에서 instructors와 participants의 이름을 가져와서 화면에 보여주어야 합니다.

{
    "id": Seminar id,
    "name": Seminar name,
    "capacity": Seminar capacity,
    "count": Seminar count,
    "time": Seminar time,
    "online": Seminar online,
    "instructors": [
        {
            "id": User id,
            "username": User username,
            "email": User email,
            "first_name": User first_name,
            "last_name": User last_name,
            "joined_at": UserSeminar joined_at(datetime)
        },
        ...
    ]
    "participants": [
         {
            "id": User id,
            "username": User username,
            "email": User email,
            "first_name": User first_name,
            "last_name": User last_name,
            "joined_at": UserSeminar joined_at(datetime)
            "is_active": UserSeminar is_active(bool),
            "dropped_at": UserSeminar dropped_at(datetime, 정보가 없는 경우 null)
         },
         ...
    ] (참여하는 Participant가 없는 경우 [], is_active가 false인 Participant도 포함)
}

백엔드 assignment2 리드미를 보면 위와 같이 response가 들어온다고 되어 있는데, 실제로는

{
    "id": 1,
    "online": true,
    "participants": [],
    "instructors": [
        {
            "id": 1,
            "company": "",
            "year": null
        }
    ],
    "time": "10:00",
    "name": "Android",
    "capacity": 10,
    "count": 4
}

이렇게만 들어옵니다. 이 response만 가지고는 instructors의 이름과 participants의 이름을 알 수 없는 것 같습니다. /seminar/{id}/로 요청해도 똑같은 response가 나옵니다. 저기 나와 있는 instructor id를 통해 /user/{id}/로 요청려고 해도, 서버에게 요청할 수 있는 건 user id이지 instructor의 id가 아니라서(user는 user대로, instructor는 instructor대로 id가 부여되는 것 같습니다.) 이름을 알아낼 수가 없더라구요ㅜㅜ 그래서 지금 로그인이랑 가입까지는 구현했는데 세미나목록 띄우는 부분부터 막혀서 진전이 안 되고 있습니다..어뜩하죠?!

veldic commented 2 years ago

관련해서 확인해보겠습니다. 일단 백엔드 과제 명시대로 구현해주세요!

veldic commented 2 years ago

다시 확인해주세요!

JYPSloth commented 2 years ago

넵 확인했습니다!! 감사합니다