-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
47 changed files
with
938 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 11 additions & 5 deletions
16
data/src/main/java/com/semicolon/data/remote/api/RoomApi.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,28 @@ | ||
package com.semicolon.data.remote.api | ||
|
||
import com.semicolon.data.remote.request.room.CreateRoomRequest | ||
import com.semicolon.data.remote.response.room.ClubResponse | ||
import com.semicolon.data.remote.response.room.RoomsResponse | ||
import retrofit2.http.Body | ||
import retrofit2.http.GET | ||
import retrofit2.http.POST | ||
import retrofit2.http.Query | ||
import retrofit2.http.* | ||
|
||
interface RoomApi { | ||
|
||
@POST("rooms") | ||
suspend fun createRoom( | ||
@Body createRoomRequest: CreateRoomRequest | ||
) | ||
): ClubResponse | ||
|
||
@GET("rooms") | ||
suspend fun fetchRooms( | ||
@Query("page") page: Int, | ||
@Query("size") size: Int | ||
): RoomsResponse | ||
|
||
@POST("rooms/attendance") | ||
suspend fun joinRoom( | ||
@Query("roomId") roomId: String | ||
): ClubResponse | ||
|
||
@DELETE("rooms") | ||
suspend fun leaveRoom() | ||
} |
10 changes: 6 additions & 4 deletions
10
data/src/main/java/com/semicolon/data/remote/datasource/RemoteRoomDataSource.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
package com.semicolon.data.remote.datasource | ||
|
||
import com.semicolon.domain.entity.room.CreateRoomEntity | ||
import com.semicolon.domain.entity.room.RoomPageEntity | ||
import com.semicolon.domain.entity.room.RoomsEntity | ||
import com.semicolon.domain.entity.room.* | ||
|
||
interface RemoteRoomDataSource { | ||
|
||
suspend fun createRoom(createRoomEntity: CreateRoomEntity) | ||
suspend fun createRoom(createRoomEntity: CreateRoomEntity): ClubEntity | ||
|
||
suspend fun fetchRooms(roomPage: RoomPageEntity): RoomsEntity | ||
|
||
suspend fun joinRoom(joinRoomEntity: JoinRoomEntity): ClubEntity | ||
|
||
suspend fun leaveRoom() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
data/src/main/java/com/semicolon/data/remote/response/room/ClubResponse.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.semicolon.data.remote.response.room | ||
|
||
import com.amazonaws.services.chime.sdk.meetings.session.Attendee | ||
import com.amazonaws.services.chime.sdk.meetings.session.Meeting | ||
import com.google.gson.annotations.SerializedName | ||
import com.semicolon.domain.entity.room.ClubEntity | ||
|
||
data class ClubResponse( | ||
@SerializedName("Meeting") val meetingResponse: Meeting, | ||
@SerializedName("Attendance") val attendeeResponse: Attendee? | ||
) | ||
|
||
fun ClubResponse.toEntity() = ClubEntity( | ||
meeting = meetingResponse, | ||
attendee = attendeeResponse | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 8 additions & 4 deletions
12
data/src/main/java/com/semicolon/data/repository/RoomRepositoryImpl.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,23 @@ | ||
package com.semicolon.data.repository | ||
|
||
import com.semicolon.data.remote.datasource.RemoteRoomDataSource | ||
import com.semicolon.domain.entity.room.CreateRoomEntity | ||
import com.semicolon.domain.entity.room.RoomPageEntity | ||
import com.semicolon.domain.entity.room.RoomsEntity | ||
import com.semicolon.domain.entity.room.* | ||
import com.semicolon.domain.repository.RoomRepository | ||
import javax.inject.Inject | ||
|
||
class RoomRepositoryImpl @Inject constructor( | ||
private val remoteRoomDataSource: RemoteRoomDataSource | ||
) : RoomRepository { | ||
|
||
override suspend fun createRoom(createRoomEntity: CreateRoomEntity) = | ||
override suspend fun createRoom(createRoomEntity: CreateRoomEntity): ClubEntity = | ||
remoteRoomDataSource.createRoom(createRoomEntity) | ||
|
||
override suspend fun fetchRooms(roomPage: RoomPageEntity): RoomsEntity = | ||
remoteRoomDataSource.fetchRooms(roomPage) | ||
|
||
override suspend fun joinRoom(joinRoomEntity: JoinRoomEntity): ClubEntity = | ||
remoteRoomDataSource.joinRoom(joinRoomEntity) | ||
|
||
override suspend fun leaveRoom() = | ||
remoteRoomDataSource.leaveRoom() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
domain/src/main/java/com/semicolon/domain/entity/room/ClubEntity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package com.semicolon.domain.entity.room | ||
|
||
import com.amazonaws.services.chime.sdk.meetings.session.Attendee | ||
import com.amazonaws.services.chime.sdk.meetings.session.Meeting | ||
|
||
data class ClubEntity( | ||
val meeting: Meeting, | ||
val attendee: Attendee? | ||
) |
5 changes: 5 additions & 0 deletions
5
domain/src/main/java/com/semicolon/domain/entity/room/JoinRoomEntity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package com.semicolon.domain.entity.room | ||
|
||
data class JoinRoomEntity( | ||
val roomId: String | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 6 additions & 4 deletions
10
domain/src/main/java/com/semicolon/domain/repository/RoomRepository.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
package com.semicolon.domain.repository | ||
|
||
import com.semicolon.domain.entity.room.RoomsEntity | ||
import com.semicolon.domain.entity.room.RoomPageEntity | ||
import com.semicolon.domain.entity.room.CreateRoomEntity | ||
import com.semicolon.domain.entity.room.* | ||
|
||
interface RoomRepository { | ||
|
||
suspend fun createRoom(createRoomEntity: CreateRoomEntity) | ||
suspend fun createRoom(createRoomEntity: CreateRoomEntity): ClubEntity | ||
|
||
suspend fun fetchRooms(roomPage: RoomPageEntity): RoomsEntity | ||
|
||
suspend fun joinRoom(joinRoomEntity: JoinRoomEntity): ClubEntity | ||
|
||
suspend fun leaveRoom() | ||
} |
2 changes: 2 additions & 0 deletions
2
domain/src/main/java/com/semicolon/domain/usecase/room/CreateRoomUseCase.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
domain/src/main/java/com/semicolon/domain/usecase/room/JoinRoomUseCase.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.semicolon.domain.usecase.room | ||
|
||
import com.semicolon.domain.entity.room.JoinRoomEntity | ||
import com.semicolon.domain.repository.RoomRepository | ||
import javax.inject.Inject | ||
|
||
class JoinRoomUseCase @Inject constructor( | ||
private val roomRepository: RoomRepository | ||
) { | ||
suspend fun execute(joinRoomEntity: JoinRoomEntity) = | ||
roomRepository.joinRoom(joinRoomEntity) | ||
} |
11 changes: 11 additions & 0 deletions
11
domain/src/main/java/com/semicolon/domain/usecase/room/LeaveRoomUseCase.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.semicolon.domain.usecase.room | ||
|
||
import com.semicolon.domain.repository.RoomRepository | ||
import javax.inject.Inject | ||
|
||
class LeaveRoomUseCase @Inject constructor( | ||
private val roomRepository: RoomRepository | ||
) { | ||
suspend fun execute() = | ||
roomRepository.leaveRoom() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.