-
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.
Browse files
Browse the repository at this point in the history
* add: usecase * feat: service&repository * refactor: 리뷰 삭제 리팩토링 * refactor: 리뷰 수정 리팩토링 * refactor: 토스트 string * refactor: service&repository * add: 리뷰 리스트&인포 usecase * refactor: suspend * add: 수정/삭제 string * add: 리뷰 요약/리스트 usecase * refactor: CA 리팩 * fix: 수정하기 됨 * refactor: 이미지 쪽 리팩 * refactor: 리뷰 작성 리팩 * refactor: 이미지 변환 content type 헤더 * delete: 이미지 서비스 합치기 * chore: 이미지 서비스 정리 * feat: 로그인 화면 finish() 추가 * refactor: timber * test: 이전 버전 * refactor: timber * refactor: imageusecase not working * chore: solved conflict * fix: not load meal's review * chore: pretter code * add: missed rebase * add: debug mode * chore: 리뷰 반영 * chore * package: change usecase folders * refactor: 다중 메뉴 선택 뷰 - 뷰모델 리팩토링 flow, repository, usecase * chore: @coderabbitai review * chore: @coderabbitai review2
- Loading branch information
Showing
74 changed files
with
1,055 additions
and
989 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
11 changes: 0 additions & 11 deletions
11
app/src/main/java/com/eatssu/android/data/repository/ImageRepository.kt
This file was deleted.
Oops, something went wrong.
17 changes: 0 additions & 17 deletions
17
app/src/main/java/com/eatssu/android/data/repository/ImageRepositoryImpl.kt
This file was deleted.
Oops, something went wrong.
17 changes: 17 additions & 0 deletions
17
app/src/main/java/com/eatssu/android/data/repository/MealRepository.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,17 @@ | ||
package com.eatssu.android.data.repository | ||
|
||
import com.eatssu.android.base.BaseResponse | ||
import com.eatssu.android.data.dto.response.MenuOfMealResponse | ||
import kotlinx.coroutines.flow.Flow | ||
|
||
interface MealRepository { | ||
// suspend fun getTodayMeal( | ||
// date: String, | ||
// restaurant: String, | ||
// time: String, | ||
// ): Flow<BaseResponse<ArrayList<GetMealResponse>>> | ||
|
||
suspend fun getMenuInfoByMealId( | ||
mealId: Long, | ||
): Flow<BaseResponse<MenuOfMealResponse>> | ||
} |
24 changes: 24 additions & 0 deletions
24
app/src/main/java/com/eatssu/android/data/repository/MealRepositoryImpl.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,24 @@ | ||
package com.eatssu.android.data.repository | ||
|
||
import com.eatssu.android.base.BaseResponse | ||
import com.eatssu.android.data.dto.response.MenuOfMealResponse | ||
import com.eatssu.android.data.service.MealService | ||
import kotlinx.coroutines.flow.Flow | ||
import kotlinx.coroutines.flow.flow | ||
import javax.inject.Inject | ||
|
||
class MealRepositoryImpl @Inject constructor(private val mealService: MealService) : | ||
MealRepository { | ||
|
||
// override suspend fun getTodayMeal( | ||
// date: String, | ||
// restaurant: String, | ||
// time: String | ||
// ): Flow<BaseResponse<ArrayList<GetMealResponse>>> = | ||
// flow { emit(mealService.getTodayMeal(date, restaurant, time)) } | ||
|
||
override suspend fun getMenuInfoByMealId(mealId: Long): Flow<BaseResponse<MenuOfMealResponse>> = | ||
flow { | ||
emit(mealService.getMenuInfoByMealId(mealId)) | ||
} | ||
} |
52 changes: 40 additions & 12 deletions
52
app/src/main/java/com/eatssu/android/data/repository/ReviewRepository.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,47 @@ | ||
package com.eatssu.android.data.repository | ||
|
||
import com.eatssu.android.data.service.ReviewService | ||
import com.eatssu.android.base.BaseResponse | ||
import com.eatssu.android.data.dto.request.ModifyReviewRequest | ||
import com.eatssu.android.data.dto.request.WriteReviewRequest | ||
import com.eatssu.android.data.dto.response.GetMealReviewInfoResponse | ||
import com.eatssu.android.data.dto.response.GetMenuReviewInfoResponse | ||
import com.eatssu.android.data.dto.response.GetReviewListResponse | ||
import com.eatssu.android.data.dto.response.ImageResponse | ||
import kotlinx.coroutines.flow.Flow | ||
import okhttp3.MultipartBody | ||
|
||
class ReviewRepository(private val reviewService: ReviewService) { | ||
interface ReviewRepository { | ||
|
||
// override suspend fun reissueToken( | ||
// refreshToken: String | ||
// ): Flow<ReissueResponse> = flow { | ||
// emit(authService.reissueToken(refreshToken)) | ||
// } | ||
suspend fun writeReview( | ||
menuId: Long, | ||
body: WriteReviewRequest, | ||
): Flow<BaseResponse<Void>> | ||
|
||
// suspend fun getMenuReviewInfo(menuId: Long) | ||
// : Flow<BaseResponse<GetMenuReviewInfoResponse>> = | ||
// flow { | ||
// emit(reviewService.getMenuReviewInfo(menuId)) | ||
// } | ||
suspend fun deleteReview( | ||
reviewId: Long, | ||
): Flow<BaseResponse<Void>> | ||
|
||
suspend fun modifyReview( | ||
reviewId: Long, | ||
body: ModifyReviewRequest, | ||
): Flow<BaseResponse<Void>> | ||
|
||
suspend fun getReviewList( | ||
menuType: String, | ||
mealId: Long?, | ||
menuId: Long?, | ||
): Flow<BaseResponse<GetReviewListResponse>> | ||
|
||
suspend fun getMenuReviewInfo( | ||
menuId: Long, | ||
): Flow<BaseResponse<GetMenuReviewInfoResponse>> | ||
|
||
|
||
suspend fun getMealReviewInfo( | ||
mealId: Long, | ||
): Flow<BaseResponse<GetMealReviewInfoResponse>> | ||
|
||
suspend fun getImageString( | ||
image: MultipartBody.Part, | ||
): Flow<BaseResponse<ImageResponse>> | ||
} |
65 changes: 65 additions & 0 deletions
65
app/src/main/java/com/eatssu/android/data/repository/ReviewRepositoryImpl.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,65 @@ | ||
package com.eatssu.android.data.repository | ||
|
||
import com.eatssu.android.base.BaseResponse | ||
import com.eatssu.android.data.dto.request.ModifyReviewRequest | ||
import com.eatssu.android.data.dto.request.WriteReviewRequest | ||
import com.eatssu.android.data.dto.response.GetMealReviewInfoResponse | ||
import com.eatssu.android.data.dto.response.GetMenuReviewInfoResponse | ||
import com.eatssu.android.data.dto.response.GetReviewListResponse | ||
import com.eatssu.android.data.dto.response.ImageResponse | ||
import com.eatssu.android.data.service.ReviewService | ||
import kotlinx.coroutines.flow.Flow | ||
import kotlinx.coroutines.flow.flow | ||
import okhttp3.MultipartBody | ||
import javax.inject.Inject | ||
|
||
class ReviewRepositoryImpl @Inject constructor(private val reviewService: ReviewService) : | ||
ReviewRepository { | ||
|
||
override suspend fun writeReview( | ||
menuId: Long, | ||
body: WriteReviewRequest, | ||
): Flow<BaseResponse<Void>> = | ||
flow { | ||
emit(reviewService.writeReview(menuId, body)) | ||
} | ||
|
||
override suspend fun deleteReview(reviewId: Long): Flow<BaseResponse<Void>> = | ||
flow { | ||
emit(reviewService.deleteReview(reviewId)) | ||
} | ||
|
||
override suspend fun modifyReview( | ||
reviewId: Long, | ||
body: ModifyReviewRequest, | ||
): Flow<BaseResponse<Void>> = | ||
flow { | ||
emit(reviewService.modifyReview(reviewId, body)) | ||
} | ||
|
||
override suspend fun getReviewList( | ||
menuType: String, | ||
mealId: Long?, | ||
menuId: Long?, | ||
): Flow<BaseResponse<GetReviewListResponse>> = flow { | ||
emit(reviewService.getReviewList(menuType, mealId, menuId)) | ||
} | ||
|
||
override suspend fun getMenuReviewInfo(menuId: Long): Flow<BaseResponse<GetMenuReviewInfoResponse>> = | ||
flow { | ||
emit(reviewService.getMenuReviewInfo(menuId)) | ||
} | ||
|
||
override suspend fun getMealReviewInfo(mealId: Long): Flow<BaseResponse<GetMealReviewInfoResponse>> = | ||
flow { | ||
emit(reviewService.getMealReviewInfo(mealId)) | ||
} | ||
|
||
override suspend fun getImageString( | ||
image: MultipartBody.Part, | ||
): Flow<BaseResponse<ImageResponse>> = | ||
flow { | ||
emit(reviewService.uploadImage(image)) | ||
} | ||
|
||
} |
18 changes: 0 additions & 18 deletions
18
app/src/main/java/com/eatssu/android/data/service/ImageService.kt
This file was deleted.
Oops, something went wrong.
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
2 changes: 1 addition & 1 deletion
2
...tssu/android/data/usecase/AlarmUsecase.kt → ...ndroid/data/usecase/alarm/AlarmUsecase.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
2 changes: 1 addition & 1 deletion
2
...case/GetDailyNotificationStatusUseCase.kt → ...larm/GetDailyNotificationStatusUseCase.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
2 changes: 1 addition & 1 deletion
2
...case/SetDailyNotificationStatusUseCase.kt → ...larm/SetDailyNotificationStatusUseCase.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
2 changes: 1 addition & 1 deletion
2
...oid/data/usecase/GetAccessTokenUseCase.kt → ...ata/usecase/auth/GetAccessTokenUseCase.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
2 changes: 1 addition & 1 deletion
2
...droid/data/usecase/GetMyReviewsUseCase.kt → .../data/usecase/auth/GetMyReviewsUseCase.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
Oops, something went wrong.