Skip to content

Commit

Permalink
Merge pull request #43 from MONEYMONG/release/release-1.4.0
Browse files Browse the repository at this point in the history
Release/release 1.4.0
  • Loading branch information
eunseo0105 authored Dec 30, 2024
2 parents d26f74d + 6f5dfd7 commit 7206f22
Show file tree
Hide file tree
Showing 45 changed files with 1,502 additions and 499 deletions.
8 changes: 8 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
## 요약

## 작업내용
- [ ] 기능개발
- [ ] 버그개선
- [ ] 리팩토링
- [ ] 핫픽스
- [ ] 빌드 파일 수정
- [ ] 기타

## 스크린샷

## 기타
2 changes: 1 addition & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ android {
applicationId = "com.moneymong.moneymong"
minSdk = 24
targetSdk = 34
versionCode = 27
versionCode = 28
versionName = "1.2.2"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
Expand Down
8 changes: 3 additions & 5 deletions app/src/main/java/com/moneymong/moneymong/MainViewModel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@ class MainViewModel @Inject constructor(
) : BaseViewModel<MainState, MainSideEffect>(MainState()) {

fun checkShouldUpdate(version: String) = intent {
val shouldUpdate =
checkVersionUpdateUseCase(version = version).isFailure
reduce {
state.copy(shouldUpdate = shouldUpdate)
}
checkVersionUpdateUseCase(version = version)
.onSuccess { reduce { state.copy(shouldUpdate = false) } }
.onFailure { reduce { state.copy(shouldUpdate = it.message?.contains("업데이트") == true) } }
}
}
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ fun MDSButton(
@DrawableRes iconResource: Int? = null,
enabled: Boolean = true,
contentHorizontalPadding: Dp = 0.dp,
cornerShape : Dp = 10.dp,
) {
val backgroundColor = if (enabled) type.backgroundColor else disabledBackgroundColor
val contentColor = if (enabled) type.contentColor else disabledContentColor
Expand All @@ -38,10 +39,10 @@ fun MDSButton(
modifier = modifier
.background(
color = backgroundColor,
shape = RoundedCornerShape(10.dp)
shape = RoundedCornerShape(cornerShape)
)
.clip(
RoundedCornerShape(10.dp)
RoundedCornerShape(cornerShape)
)
.clickable(
onClick = onClick,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.moneymong.moneymong.model.sign

data class UnivResponse(
val universityName: String,
val grade: Int
val universityName: String?,
val grade: Int?
)
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
package com.moneymong.moneymong.network.api

import com.moneymong.moneymong.model.agency.AgencyJoinRequest
import com.moneymong.moneymong.model.agency.AgencyRegisterRequest
import com.moneymong.moneymong.model.agency.AgenciesGetResponse
import com.moneymong.moneymong.model.agency.AgencyGetResponse
import com.moneymong.moneymong.model.agency.AgencyJoinRequest
import com.moneymong.moneymong.model.agency.AgencyJoinResponse
import com.moneymong.moneymong.model.agency.AgencyRegisterRequest
import com.moneymong.moneymong.model.agency.MyAgencyResponse
import com.moneymong.moneymong.model.agency.RegisterAgencyResponse
import com.moneymong.moneymong.model.member.InvitationCodeResponse
import retrofit2.http.Body
import retrofit2.http.DELETE
import retrofit2.http.GET
import retrofit2.http.Header
import retrofit2.http.PATCH
import retrofit2.http.POST
import retrofit2.http.Path
Expand All @@ -33,6 +33,11 @@ interface AgencyApi {
@GET("api/v1/agencies/me")
suspend fun fetchMyAgencyList(): Result<List<MyAgencyResponse>>

@GET("api/v1/agencies/search")
suspend fun fetchAgencyByName(
@Query("keyword") name: String
): Result<List<AgencyGetResponse>>

// POST
@POST("/api/v1/agencies/{agencyId}/invitation-code")
suspend fun agencyCodeNumbers(
Expand All @@ -55,5 +60,5 @@ interface AgencyApi {
@DELETE("api/v1/agencies/{agencyId}")
suspend fun deleteAgency(
@Path("agencyId") agencyId: Int
) : Result<Unit>
): Result<Unit>
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,10 @@ class MoneyMongTokenAuthenticator @Inject constructor(
}
}
.onFailure {
runBlocking {
tokenRepository.notifyTokenUpdateFailed(true)
}
tokenRepository.notifyTokenUpdateFailed(true)
}
}.onFailure {
runBlocking {
tokenRepository.notifyTokenUpdateFailed(true)
}
tokenRepository.notifyTokenUpdateFailed(true)
}
newRequest
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
package com.moneymong.moneymong.data.datasource.agency

import com.moneymong.moneymong.model.agency.AgenciesGetResponse
import com.moneymong.moneymong.model.agency.AgencyGetResponse
import com.moneymong.moneymong.model.agency.AgencyJoinRequest
import com.moneymong.moneymong.model.agency.AgencyRegisterRequest
import com.moneymong.moneymong.model.agency.AgencyJoinResponse
import com.moneymong.moneymong.model.agency.AgenciesGetResponse
import com.moneymong.moneymong.model.agency.AgencyRegisterRequest
import com.moneymong.moneymong.model.agency.MyAgencyResponse
import com.moneymong.moneymong.model.agency.RegisterAgencyResponse

interface AgencyRemoteDataSource {
suspend fun registerAgency(request: AgencyRegisterRequest): Result<RegisterAgencyResponse>
suspend fun getAgencies(page: Int, size: Int): Result<AgenciesGetResponse>
suspend fun fetchMyAgencyList(): Result<List<MyAgencyResponse>>
suspend fun fetchAgencyByName(agencyName: String): Result<List<AgencyGetResponse>>
suspend fun agencyCodeNumbers(agencyId : Long, data: AgencyJoinRequest) : Result<AgencyJoinResponse>
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package com.moneymong.moneymong.data.datasource.agency

import com.moneymong.moneymong.network.api.AgencyApi
import com.moneymong.moneymong.model.agency.AgencyJoinRequest
import com.moneymong.moneymong.model.agency.AgencyRegisterRequest
import com.moneymong.moneymong.model.agency.AgenciesGetResponse
import com.moneymong.moneymong.model.agency.AgencyGetResponse
import com.moneymong.moneymong.model.agency.AgencyJoinRequest
import com.moneymong.moneymong.model.agency.AgencyJoinResponse
import com.moneymong.moneymong.model.agency.AgencyRegisterRequest
import com.moneymong.moneymong.model.agency.MyAgencyResponse
import com.moneymong.moneymong.model.agency.RegisterAgencyResponse
import com.moneymong.moneymong.network.api.AgencyApi
import javax.inject.Inject

class AgencyRemoteDataSourceImpl @Inject constructor(
Expand All @@ -25,6 +26,10 @@ class AgencyRemoteDataSourceImpl @Inject constructor(
return agencyApi.fetchMyAgencyList()
}

override suspend fun fetchAgencyByName(agencyName: String): Result<List<AgencyGetResponse>> {
return agencyApi.fetchAgencyByName(name = agencyName)
}

override suspend fun agencyCodeNumbers(
agencyId: Long,
data: AgencyJoinRequest
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.moneymong.moneymong.data.datasource.agency

import com.moneymong.moneymong.model.agency.AgencyJoinRequest
import com.moneymong.moneymong.model.agency.AgencyRegisterRequest
import com.moneymong.moneymong.model.agency.AgenciesGetResponse
import com.moneymong.moneymong.model.agency.AgencyGetResponse
import com.moneymong.moneymong.model.agency.AgencyJoinRequest
import com.moneymong.moneymong.model.agency.AgencyJoinResponse
import com.moneymong.moneymong.model.agency.AgencyRegisterRequest
import com.moneymong.moneymong.model.agency.MyAgencyResponse
import com.moneymong.moneymong.model.agency.RegisterAgencyResponse
import kotlinx.coroutines.delay
Expand All @@ -24,6 +24,10 @@ class AgencyRemoteDataSourceMock : AgencyRemoteDataSource {
return Result.success(emptyList())
}

override suspend fun fetchAgencyByName(agencyName: String): Result<List<AgencyGetResponse>> {
return Result.success(emptyList())
}

override suspend fun agencyCodeNumbers(
agencyId: Long,
data: AgencyJoinRequest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ class AgencyRepositoryImpl @Inject constructor(
override suspend fun fetchMyAgencyList(): Result<List<MyAgencyResponse>> =
agencyRemoteDataSource.fetchMyAgencyList()

override suspend fun fetchAgencyByName(agencyName: String): Result<List<AgencyGetResponse>> =
agencyRemoteDataSource.fetchAgencyByName(agencyName)

override suspend fun agencyCodeNumbers(
agencyId: Long,
data: AgencyJoinRequest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,19 @@ class TokenRepositoryImpl @Inject constructor(
return loginLocalDataSource.getRefreshToken()
}

override suspend fun postAccessToken(type: LoginType, accessToken: String): Result<TokenResponse> {
return tokenRemoteDataSource.postAccessToken(type = type, accessToken = accessToken).onSuccess {
loginLocalDataSource.setDataStore(
it.accessToken,
it.refreshToken,
it.loginSuccess,
it.schoolInfoProvided
)
}
override suspend fun postAccessToken(
type: LoginType,
accessToken: String
): Result<TokenResponse> {
return tokenRemoteDataSource.postAccessToken(type = type, accessToken = accessToken)
.onSuccess {
loginLocalDataSource.setDataStore(
it.accessToken,
it.refreshToken,
it.loginSuccess,
it.schoolInfoProvided
)
}
}

override suspend fun getAccessToken(): Result<String> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ interface AgencyRepository {
suspend fun registerAgency(request: AgencyRegisterRequest): Result<RegisterAgencyResponse>
fun getAgencies(): Flow<PagingData<AgencyGetResponse>>
suspend fun fetchMyAgencyList(): Result<List<MyAgencyResponse>>
suspend fun fetchAgencyByName(agencyName: String): Result<List<AgencyGetResponse>>
suspend fun agencyCodeNumbers(agencyId: Long, data: AgencyJoinRequest): Result<AgencyJoinResponse>

suspend fun saveAgencyId(agencyId: Int)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import com.moneymong.moneymong.model.agency.AgencyGetResponse
import kotlinx.coroutines.flow.Flow
import javax.inject.Inject

class GetAgenciesUseCase @Inject constructor(
class FetchAgenciesUseCase @Inject constructor(
private val agencyRepository: AgencyRepository
) {
operator fun invoke(): Flow<PagingData<AgencyGetResponse>> {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.moneymong.moneymong.domain.usecase.agency

import com.moneymong.moneymong.domain.repository.agency.AgencyRepository
import com.moneymong.moneymong.model.agency.AgencyGetResponse
import javax.inject.Inject

class FetchAgencyByNameUseCase @Inject constructor(
private val agencyRepository: AgencyRepository,
) {

suspend operator fun invoke(agencyName: String): Result<List<AgencyGetResponse>> {
return agencyRepository.fetchAgencyByName(agencyName = agencyName)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import com.moneymong.moneymong.domain.repository.user.UserRepository
import com.moneymong.moneymong.model.user.UserResponse
import javax.inject.Inject

class GetMyInfoUseCase @Inject constructor(
class FetchMyInfoUseCase @Inject constructor(
private val userRepository: UserRepository
) {
suspend operator fun invoke(): Result<UserResponse> {
Expand Down
Loading

0 comments on commit 7206f22

Please sign in to comment.