Skip to content

Conversation

@blu3fishez
Copy link
Collaborator

  • 작성자: 김찬우
  • 작성 날짜: 2024.11.27

✅ 체크리스트

  • 코드가 정상적으로 작동하는지 확인했습니다.
  • 주요 변경사항에 대한 설명을 작성했습니다.
  • 코드 스타일 가이드에 따라 코드를 작성했습니다.

🧩 작업 내용

  • 작업한 주요 기능 및 수정 사항
  • 하루 동안 진행된 핵심적인 변경사항 간단 정리

📝 작업 상세 내역

스터디 기능을 위한 Redis Entity

  • 스터디 룸에 현재 질문지 위치 상태를 추가 해야했고, 그리고 추가적으로 최대 질문지 인덱스도 추가했습니다.
  • 스토리지 자체에 질문지를 받고 있지 않기 때문에 질문지 개수만 추가했습니다!
import { Entity, Field, Schema } from "nestjs-redis-om";

export interface Connection {
    socketId: string;
    nickname: string;
    createAt: number;
}

export enum RoomStatus {
    PUBLIC = "PUBLIC",
    PRIVATE = "PRIVATE",
}

@Schema("room", {})
export class RoomEntity extends Entity {
    @Field({ type: "string", indexed: true })
    id: string;

    @Field({ type: "string" })
    title: string;

    @Field({ type: "string[]" })
    category: string[];

    @Field({ type: "boolean" })
    inProgress: boolean;

    @Field({ type: "number" })
    currentIndex: number;

    @Field({ type: "string" })
    status: RoomStatus;

    @Field({ type: "number" })
    maxParticipants: number;

    @Field({ type: "number" })
    maxQuestionListLength: number;

    @Field({ type: "number", sortable: true })
    createdAt: number;

    // Connection
    @Field({ type: "string" })
    host: string;

    // Record<string, Connection>
    @Field({ type: "string" })
    connectionMap: string;
}

스터디 기능 추가

  • 명세서에서 적었던 서버측 핸들러 이벤트 5개 추가했습니다.

📌 테스트 및 검증 결과

  • 시나리오를 통해 다양한 유즈 케이스를 테스트 했습니다.

  • 진행을 시작하지 않고 사용할 수 없는 API 를 사용하면 -1 을 반환

  • 방장만이 쓸 수 있는 API의 경우도 -1 혹은 error 반환

  • 범위를 벗어나는 인덱스의 경우 -1 반환

  • next_question 마지막 인덱스에서 다시 호출될 경우 마지막 인덱스 다시 반환

image

  • 테스트 하는 과정은 Postman으로 수행

💬 다음 작업 또는 논의 사항

  • 내일 오전 중으로 유저 기능 구현할 예정

🐥 리뷰 받고 싶은 포인트

  • 혹시 모를 실수가 있는지만 살짝 코드 훑기? 부탁드립니다

Copy link
Member

@ShipFriend0516 ShipFriend0516 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

좋습니다! 방 들어왔을 때 질문지 내용이 안내려오고 있는데 확인한번 해주시면 감사하겠습니다

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

질문지 내용이 없는 것 같습니다

- 질문지 내용도 받아오도록 스펙 변경
- 진행중인 세션에 참가 시 `server:room__progess` 이벤트를 emit하도록 변경
@ShipFriend0516 ShipFriend0516 merged commit d777674 into boostcampwm-2024:dev Nov 28, 2024
@blu3fishez blu3fishez deleted the feature/study-websocket branch September 1, 2025 06:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants