-
Notifications
You must be signed in to change notification settings - Fork 9
[Feat/#1449] 스프린트 3 API 연결 #1455
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 9 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
a998f2c
feat: responseDto 생성
1971123-seongmin b29d03a
feat: domain 모델 및 mapper 추가
1971123-seongmin 4edc98f
feat: 서버통신 코드 추가 (repo/Impl, dataSource/Impl, service)
1971123-seongmin 176cb25
feat: 서버통신 모듈 생성
1971123-seongmin 768bbd4
feat: 앱잽탬프 팀 랭킹 ui 모델, State 생성
1971123-seongmin a960fed
feat: 앱잽탬프 팀 랭킹 뷰모델 추가
1971123-seongmin 7b9da05
feat: AppjamtampRankingScreen api 연결
1971123-seongmin 91b4e9e
feat: 앱잽탬프 팀 랭킹 컴포넌트 연결 및 각각의 파일 두개로 분리
1971123-seongmin c52633f
Merge branch 'develop' into feat/#1449-appjamtamp-api
1971123-seongmin e4afc4e
Merge branch 'develop' into feat/#1449-appjamtamp-api
1971123-seongmin 6cdd693
mod: 브랜치 충돌 해결
1971123-seongmin 20da69f
chore: api 설명 주석 추가
1971123-seongmin 5c111ba
mod: 코드리뷰 반영, column + row 구조 수정
1971123-seongmin 19c6409
mod: 코드리뷰 반영, UiModel ImmutableList 적용
1971123-seongmin d3e009f
feat: 코드리뷰 반영, AppjamtampRankingViewModel api 실패 시 에러 로그 추가
1971123-seongmin 646725b
feat: AppjamtampMissionEntity nullable 빠진 부분 추가 및 AppjamtampMissionLi…
1971123-seongmin d6f16af
feat: AppjamtampMissionListUiModel 추가
1971123-seongmin af23a14
mod: AppjamtampMission 앱잼팀 이름 서버 응답 적용
1971123-seongmin 14b0590
mod: AppjamtampTeamMissionList api 연결
1971123-seongmin 87bca33
mod: 앱잼팀 랭킹 클릭 함수 추가
1971123-seongmin e43a2f5
Merge branch 'develop' into feat/#1449-appjamtamp-api
1971123-seongmin 8217660
mod: 접근지정자 수정
1971123-seongmin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
...amtamp/src/main/java/org/sopt/official/data/appjamtamp/datasource/AppjamtampDataSource.kt
This file contains hidden or 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 org.sopt.official.data.appjamtamp.datasource | ||
|
|
||
| import org.sopt.official.data.appjamtamp.dto.response.AppjamtampTop10MissionScoreResponse | ||
| import org.sopt.official.data.appjamtamp.dto.response.AppjamtampTop3RecentMissionResponse | ||
|
|
||
| interface AppjamtampDataSource { | ||
| suspend fun getAppjamtampMissionTop3(size: Int): AppjamtampTop3RecentMissionResponse | ||
| suspend fun getAppjamtampMissionRanking(size: Int): AppjamtampTop10MissionScoreResponse | ||
| } |
20 changes: 20 additions & 0 deletions
20
...rc/main/java/org/sopt/official/data/appjamtamp/datasourceimpl/AppjamtampDataSourceImpl.kt
This file contains hidden or 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,20 @@ | ||
| package org.sopt.official.data.appjamtamp.datasourceimpl | ||
|
|
||
| import org.sopt.official.data.appjamtamp.datasource.AppjamtampDataSource | ||
| import org.sopt.official.data.appjamtamp.dto.response.AppjamtampTop10MissionScoreResponse | ||
| import org.sopt.official.data.appjamtamp.dto.response.AppjamtampTop3RecentMissionResponse | ||
| import org.sopt.official.data.appjamtamp.service.AppjamtampService | ||
| import javax.inject.Inject | ||
|
|
||
| internal class AppjamtampDataSourceImpl @Inject constructor( | ||
| private val appjamtampService: AppjamtampService | ||
| ) : AppjamtampDataSource { | ||
|
|
||
| override suspend fun getAppjamtampMissionTop3(size: Int): AppjamtampTop3RecentMissionResponse { | ||
| return appjamtampService.getAppjamtampMissionTop3(size = size) | ||
| } | ||
|
|
||
| override suspend fun getAppjamtampMissionRanking(size: Int): AppjamtampTop10MissionScoreResponse { | ||
| return appjamtampService.getAppjamtampMissionRanking(size = size) | ||
| } | ||
| } |
17 changes: 17 additions & 0 deletions
17
data/appjamtamp/src/main/java/org/sopt/official/data/appjamtamp/di/DataSourceModule.kt
This file contains hidden or 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,17 @@ | ||
| package org.sopt.official.data.appjamtamp.di | ||
|
|
||
| import dagger.Binds | ||
| import dagger.Module | ||
| import dagger.hilt.InstallIn | ||
| import dagger.hilt.components.SingletonComponent | ||
| import org.sopt.official.data.appjamtamp.datasource.AppjamtampDataSource | ||
| import org.sopt.official.data.appjamtamp.datasourceimpl.AppjamtampDataSourceImpl | ||
| import javax.inject.Singleton | ||
|
|
||
| @Module | ||
| @InstallIn(SingletonComponent::class) | ||
| internal abstract class DataSourceModule { | ||
| @Binds | ||
| @Singleton | ||
| abstract fun bindAppjamtampDataSource(appjamtampDataSourceImpl: AppjamtampDataSourceImpl): AppjamtampDataSource | ||
| } |
22 changes: 22 additions & 0 deletions
22
data/appjamtamp/src/main/java/org/sopt/official/data/appjamtamp/di/RepositoryModule.kt
This file contains hidden or 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,22 @@ | ||
| package org.sopt.official.data.appjamtamp.di | ||
|
|
||
| import dagger.Binds | ||
| import dagger.Module | ||
| import dagger.hilt.InstallIn | ||
| import dagger.hilt.components.SingletonComponent | ||
| import org.sopt.official.data.appjamtamp.repository.AppjamtampRepositoryImpl | ||
| import org.sopt.official.domain.appjamtamp.repository.AppjamtampRepository | ||
| import javax.inject.Singleton | ||
|
|
||
| @Module | ||
| @InstallIn(SingletonComponent::class) | ||
| abstract class RepositoryModule { | ||
|
|
||
| @Binds | ||
| @Singleton | ||
| abstract fun bindAppjamtampRepository( | ||
| appjamtampRepositoryImpl: AppjamtampRepositoryImpl | ||
| ): AppjamtampRepository | ||
|
|
||
|
|
||
| } | ||
19 changes: 19 additions & 0 deletions
19
data/appjamtamp/src/main/java/org/sopt/official/data/appjamtamp/di/ServiceModule.kt
This file contains hidden or 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,19 @@ | ||
| package org.sopt.official.data.appjamtamp.di | ||
|
|
||
| import dagger.Module | ||
| import dagger.Provides | ||
| import dagger.hilt.InstallIn | ||
| import dagger.hilt.components.SingletonComponent | ||
| import org.sopt.official.common.di.AppRetrofit | ||
| import org.sopt.official.data.appjamtamp.service.AppjamtampService | ||
| import retrofit2.Retrofit | ||
| import javax.inject.Singleton | ||
|
|
||
| @Module | ||
| @InstallIn(SingletonComponent::class) | ||
| internal object ServiceModule { | ||
| @Provides | ||
| @Singleton | ||
| fun provideAppjamtampService(@AppRetrofit(true) retrofit: Retrofit): AppjamtampService = | ||
| retrofit.create(AppjamtampService::class.java) | ||
| } |
25 changes: 25 additions & 0 deletions
25
...ava/org/sopt/official/data/appjamtamp/dto/response/AppjamtampTop10MissionScoreResponse.kt
This file contains hidden or 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,25 @@ | ||
| package org.sopt.official.data.appjamtamp.dto.response | ||
|
|
||
| import kotlinx.serialization.SerialName | ||
| import kotlinx.serialization.Serializable | ||
|
|
||
| @Serializable | ||
| data class AppjamtampTop10MissionScoreResponse( | ||
| @SerialName("ranks") | ||
| val ranks: List<AppjamtampMissionScoreResponse> | ||
| ) | ||
|
|
||
| @Serializable | ||
| data class AppjamtampMissionScoreResponse( | ||
| @SerialName("rank") | ||
| val rank: Int, | ||
|
|
||
| @SerialName("teamName") | ||
| val teamName: String, | ||
|
|
||
| @SerialName("todayPoints") | ||
| val todayPoints: Int, | ||
|
|
||
| @SerialName("totalPoints") | ||
| val totalPoints: Int | ||
| ) |
40 changes: 40 additions & 0 deletions
40
...ava/org/sopt/official/data/appjamtamp/dto/response/AppjamtampTop3RecentMissionResponse.kt
This file contains hidden or 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,40 @@ | ||
| package org.sopt.official.data.appjamtamp.dto.response | ||
|
|
||
| import kotlinx.serialization.SerialName | ||
| import kotlinx.serialization.Serializable | ||
|
|
||
| @Serializable | ||
| data class AppjamtampTop3RecentMissionResponse( | ||
| @SerialName("ranks") | ||
| val ranks: List<AppjamtampRecentMissionResponse> | ||
| ) | ||
|
|
||
| @Serializable | ||
| data class AppjamtampRecentMissionResponse( | ||
| @SerialName("stampId") | ||
| val stampId: Long, | ||
|
|
||
| @SerialName("missionId") | ||
| val missionId: Long, | ||
|
|
||
| @SerialName("userId") | ||
| val userId: Long, | ||
|
|
||
| @SerialName("imageUrl") | ||
| val imageUrl: String, | ||
|
|
||
| @SerialName("createdAt") | ||
| val createdAt: String?, | ||
|
|
||
| @SerialName("userName") | ||
| val userName: String, | ||
|
|
||
| @SerialName("userProfileImage") | ||
| val userProfileImage: String?, | ||
|
|
||
| @SerialName("teamName") | ||
| val teamName: String, | ||
|
|
||
| @SerialName("teamNumber") | ||
| val teamNumber: String | ||
| ) |
41 changes: 41 additions & 0 deletions
41
data/appjamtamp/src/main/java/org/sopt/official/data/appjamtamp/mapper/AppjamptampMapper.kt
This file contains hidden or 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,41 @@ | ||
| package org.sopt.official.data.appjamtamp.mapper | ||
|
|
||
| import org.sopt.official.data.appjamtamp.dto.response.AppjamtampMissionScoreResponse | ||
| import org.sopt.official.data.appjamtamp.dto.response.AppjamtampRecentMissionResponse | ||
| import org.sopt.official.data.appjamtamp.dto.response.AppjamtampTop3RecentMissionResponse | ||
| import org.sopt.official.data.appjamtamp.dto.response.AppjamtampTop10MissionScoreResponse | ||
| import org.sopt.official.domain.appjamtamp.entity.AppjamtampMissionScore | ||
| import org.sopt.official.domain.appjamtamp.entity.AppjamtampRecentMission | ||
|
|
||
|
|
||
| internal fun AppjamtampTop3RecentMissionResponse.toDomain(): List<AppjamtampRecentMission> { | ||
| return this.ranks.map { it.toDomain() } | ||
| } | ||
|
|
||
| internal fun AppjamtampRecentMissionResponse.toDomain(): AppjamtampRecentMission { | ||
| return AppjamtampRecentMission( | ||
| stampId = this.stampId, | ||
| missionId = this.missionId, | ||
| userId = this.userId, | ||
| imageUrl = this.imageUrl, | ||
| createdAt = this.createdAt, | ||
| userName = this.userName, | ||
| userProfileImage = this.userProfileImage, | ||
| teamName = this.teamName, | ||
| teamNumber = this.teamNumber | ||
| ) | ||
| } | ||
|
|
||
| internal fun AppjamtampTop10MissionScoreResponse.toDomain(): List<AppjamtampMissionScore> { | ||
| return this.ranks.map { it.toDomain() } | ||
| } | ||
|
|
||
| internal fun AppjamtampMissionScoreResponse.toDomain(): AppjamtampMissionScore { | ||
| return AppjamtampMissionScore( | ||
| rank = this.rank, | ||
| teamName = this.teamName, | ||
| todayPoints = this.todayPoints, | ||
| totalPoints = this.todayPoints | ||
| ) | ||
| } | ||
|
|
26 changes: 26 additions & 0 deletions
26
...mp/src/main/java/org/sopt/official/data/appjamtamp/repository/AppjamtampRepositoryImpl.kt
This file contains hidden or 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,26 @@ | ||
| package org.sopt.official.data.appjamtamp.repository | ||
|
|
||
| import org.sopt.official.common.coroutines.suspendRunCatching | ||
| import org.sopt.official.data.appjamtamp.datasource.AppjamtampDataSource | ||
| import org.sopt.official.data.appjamtamp.mapper.toDomain | ||
| import org.sopt.official.data.appjamtamp.service.AppjamtampService | ||
| import org.sopt.official.domain.appjamtamp.entity.AppjamtampMissionScore | ||
| import org.sopt.official.domain.appjamtamp.entity.AppjamtampRecentMission | ||
| import org.sopt.official.domain.appjamtamp.repository.AppjamtampRepository | ||
| import javax.inject.Inject | ||
|
|
||
| class AppjamtampRepositoryImpl @Inject constructor( | ||
| private val appjamtampDataSource: AppjamtampDataSource | ||
| ): AppjamtampRepository { | ||
| override suspend fun getAppjamtampMissionRanking( | ||
| size: Int | ||
| ): Result<List<AppjamtampMissionScore>> = suspendRunCatching { | ||
| appjamtampDataSource.getAppjamtampMissionRanking(size = size).toDomain() | ||
| } | ||
|
|
||
| override suspend fun getAppjamtampMissionTop3( | ||
| size: Int | ||
| ): Result<List<AppjamtampRecentMission>> = suspendRunCatching { | ||
| appjamtampDataSource.getAppjamtampMissionTop3(size = size).toDomain() | ||
| } | ||
| } |
27 changes: 27 additions & 0 deletions
27
data/appjamtamp/src/main/java/org/sopt/official/data/appjamtamp/service/AppjamtampService.kt
This file contains hidden or 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,27 @@ | ||
| package org.sopt.official.data.appjamtamp.service | ||
|
|
||
| import org.sopt.official.data.appjamtamp.dto.response.AppjamtampTop3RecentMissionResponse | ||
| import org.sopt.official.data.appjamtamp.dto.response.AppjamtampTop10MissionScoreResponse | ||
| import retrofit2.http.GET | ||
| import retrofit2.http.Query | ||
|
|
||
| interface AppjamtampService { | ||
|
|
||
| // 자신의 앱잼 정보 조회 | ||
| // /user/appjam-info | ||
|
|
||
| // 앱잼팀 오늘의 득점 랭킹 TOP10 조회하기 | ||
| @GET("appjamrank/today") | ||
| suspend fun getAppjamtampMissionRanking( | ||
| @Query("size") size: Int? = 10 | ||
| ): AppjamtampTop10MissionScoreResponse | ||
|
|
||
| // 앱잼팀 랭킹 최근 인증한 미션 TOP3 조회하기 | ||
| @GET("appjamrank/recent") | ||
| suspend fun getAppjamtampMissionTop3( | ||
| @Query("size") size: Int? = 3 | ||
| ): AppjamtampTop3RecentMissionResponse | ||
|
|
||
| // 앱잼탬프 미션 목록 조회하기 | ||
| // /appjamtamp/mission?teamNumber={teamNumber}&isCompleted=true | ||
| } |
8 changes: 8 additions & 0 deletions
8
...amtamp/src/main/java/org/sopt/official/domain/appjamtamp/entity/AppjamtampMissionScore.kt
This file contains hidden or 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,8 @@ | ||
| package org.sopt.official.domain.appjamtamp.entity | ||
|
|
||
| data class AppjamtampMissionScore( | ||
| val rank: Int, | ||
| val teamName: String, | ||
| val todayPoints: Int, | ||
| val totalPoints: Int | ||
| ) |
13 changes: 13 additions & 0 deletions
13
...mtamp/src/main/java/org/sopt/official/domain/appjamtamp/entity/AppjamtampRecentMission.kt
This file contains hidden or 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,13 @@ | ||
| package org.sopt.official.domain.appjamtamp.entity | ||
|
|
||
| data class AppjamtampRecentMission( | ||
| val stampId: Long, | ||
| val missionId: Long, | ||
| val userId: Long, | ||
| val imageUrl: String, | ||
| val createdAt: String?, | ||
| val userName: String, | ||
| val userProfileImage: String?, | ||
| val teamName: String, | ||
| val teamNumber: String | ||
| ) |
13 changes: 13 additions & 0 deletions
13
...tamp/src/main/java/org/sopt/official/domain/appjamtamp/repository/AppjamtampRepository.kt
This file contains hidden or 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,13 @@ | ||
| package org.sopt.official.domain.appjamtamp.repository | ||
|
|
||
| import org.sopt.official.domain.appjamtamp.entity.AppjamtampMissionScore | ||
| import org.sopt.official.domain.appjamtamp.entity.AppjamtampRecentMission | ||
|
|
||
| interface AppjamtampRepository { | ||
| suspend fun getAppjamtampMissionRanking( | ||
| size: Int | ||
| ): Result<List<AppjamtampMissionScore>> | ||
| suspend fun getAppjamtampMissionTop3( | ||
| size: Int | ||
| ): Result<List<AppjamtampRecentMission>> | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
진짜 정말 아주 사소한건데.. 빈줄이 2줄이나 들어감!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
앗 이거는 민성님이 만들어둔 것 그대로 가져온거라 (나중에 충돌 안나게 하기 위함 입니다) 그런 것 같아요 나중에 수정하도록 할게요