Closed ryuichi-maeda closed 2 months ago
新しいメソッド is_active
が RoomRepositoryTrait
トレイトに追加され、部屋がアクティブかどうかを非同期にチェックします。また、create_room
メソッドが MutationRoot
に追加され、ユニークなピンを持つ新しい部屋を作成し、ホストユーザーを割り当てます。これにより、部屋作成の機能が実装されました。
ファイル名 | 変更内容 |
---|---|
src/domain_service/room_repository_trait.rs |
新しいメソッド is_active を追加 |
src/infrastructure/room_repository.rs |
check_existence を is_active にリネームし、新しい check_existence メソッドを追加 |
src/infrastructure/user_repository.rs |
find_by_id メソッドを更新し、データベースから GuestUser を取得するように変更 |
src/resolver/mutation_root_resolver.rs |
create_room メソッドを MutationRoot に追加 |
sequenceDiagram
participant User
participant Resolver
participant RoomRepo
participant UserRepo
User->>Resolver: create_room(user_id)
Resolver->>UserRepo: find_by_id(user_id)
UserRepo-->>Resolver: GuestUser
Resolver->>RoomRepo: is_active(pin)
RoomRepo-->>Resolver: boolean
Resolver->>RoomRepo: save_room(room)
RoomRepo-->>Resolver: Room
Resolver-->>User: Room
Objective | Addressed | Explanation |
---|---|---|
mutation に createRoom を作成する (#55) | ✅ | |
必要に応じて domain model なども作成する (#55) | ✅ |
新しい部屋ができたのさ、
ピンで探してアクティブか、
ユーザーの手でホスト決め、
データベースに保存して、
みんなで集まる楽しい場。
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
概要・変更点
ホストが最初にルームを作成するのに必要なMutationを実装しました。
関連ISSUE
55
CloseするISSUE
Close #55
Summary by CodeRabbit
新機能
機能改善
find_by_id
関数を更新。指定されたIDに基づいてデータベースからゲストユーザーをフェッチして返します。