Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
2044f69
fix: 게시글 구단 필터 배열 형태로 변경
nueijeel Jan 25, 2025
3a8d700
fix: 끌어올리기 api 변경으로 사용되지 않는 예외 클래스 제거
nueijeel Jan 26, 2025
73ec03c
fix: 끌어올리기 api response 수정
nueijeel Jan 26, 2025
17f7dfc
fix: Board 데이터 관련 dto, model 수정
nueijeel Jan 26, 2025
418144e
fix: Notification 데이터 관련 dto, model, mapper 수정
nueijeel Jan 26, 2025
a4c2ac7
fix: EnrollState EnumClass 수정
nueijeel Jan 26, 2025
d28b99d
fix: 게시글 상세 화면 수정
nueijeel Jan 26, 2025
61ebfe4
fix: 직관신청 취소 시 다이얼로그 닫히게 처리
nueijeel Jan 31, 2025
b82b37f
feature: 보낸 신청 목록 불러오는 로직 구현
nueijeel Jan 31, 2025
0d67ba7
feature: 게시글 목록 api 호출 시 page 값 쿼리 파라미터로 추가
nueijeel Feb 3, 2025
22c5fef
feature: Home Fragment 게시글 목록 페이지네이션 구현
nueijeel Feb 3, 2025
f07f66f
fix: HomeFragment 스크롤 페이징 처리 수정
nueijeel Feb 4, 2025
02d036d
feature: FavoriteFragment 스크롤 페이징 처리 구현
nueijeel Feb 4, 2025
6b40e6d
fix: HomeFragment 스크롤 페이징 처리 시 불필요한 코드 삭제
nueijeel Feb 4, 2025
7b9f601
feature: MyPostFragment 스크롤 페이징 처리 구현
nueijeel Feb 4, 2025
4a10103
feature: SentJoinFragment 스크롤 페이징 처리 구현
nueijeel Feb 4, 2025
451c38c
feature: NotificationFragment 스크롤 페이징 처리 구현
nueijeel Feb 4, 2025
20a65f7
refactor: ktlint에 맞게 수정
nueijeel Feb 4, 2025
ecdda2f
refactor: 들여쓰기 및 trailing comma 수정
nueijeel Feb 4, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,14 @@ interface BoardService {
suspend fun getBoardList(
@Query("gameStartDate") gameStartDate: String? = null,
@Query("maxPerson") maxPerson: Int? = null,
@Query("preferredTeamId") preferredTeamId: Int? = null,
@Query("preferredTeamIdList") preferredTeamIdList: Array<Int>? = null,
@Query("page") page: Int? = null,
): Response<GetBoardListResponseDTO?>

@GET("boards/list/{userId}")
suspend fun getUserBoardList(
@Path("userId") userId: Long,
@Query("page") page: Int,
): Response<GetUserBoardListResponseDTO?>

@GET("boards/{boardId}")
Expand All @@ -63,7 +65,9 @@ interface BoardService {
): Response<GetBoardResponseDTO?>

@GET("boards/bookmark")
suspend fun getLikedBoard(): Response<GetLikedBoardResponseDTO?>
suspend fun getLikedBoard(
@Query("page") page: Int,
): Response<GetLikedBoardResponseDTO?>

@GET("boards/temp")
suspend fun getTempBoard(): Response<GetTempBoardResponseDTO?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ interface EnrollService {
): Response<PatchEnrollAcceptResponseDTO?>

@GET("enrolls/request")
suspend fun getRequestedEnrollList(): Response<GetRequestedEnrollListResponseDTO?>
suspend fun getRequestedEnrollList(
@Query("page") page: Int,
): Response<GetRequestedEnrollListResponseDTO?>

@GET("enrolls/receive")
suspend fun getReceivedEnroll(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,21 @@ import retrofit2.Response
import retrofit2.http.DELETE
import retrofit2.http.GET
import retrofit2.http.Path
import retrofit2.http.Query

interface NotificationService {
@GET("notifications/receive")
suspend fun getReceivedNotificationList(): Response<GetReceivedNotificationListResponseDTO>
suspend fun getReceivedNotificationList(
@Query("page") page: Int,
): Response<GetReceivedNotificationListResponseDTO?>

@GET("notifications/receive/{notificationId}")
suspend fun getReceivedNotification(
@Path("notificationId") notificationId: Long,
): Response<GetReceivedNotificationResponseDTO>
): Response<GetReceivedNotificationResponseDTO?>

@DELETE("notifications/receive/{notificationId}")
suspend fun deleteReceivedNotification(
@Path("notificationId") notificationId: Long,
): Response<DeleteReceivedNotificationResponseDTO>
): Response<DeleteReceivedNotificationResponseDTO?>
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@ data class BoardDTO(
val gameInfo: GameInfoDTO,
val liftUpDate: String,
val userInfo: UserInfoDTO,
val buttonStatus: String?,
val bookMarked: Boolean,
)
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@ package com.catchmate.data.dto.board

data class GetBoardListResponseDTO(
val boardInfoList: List<BoardDTO>,
val totalPages: Int,
val totalElements: Int,
val isFirst: Boolean,
val isLast: Boolean,
)
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ data class GetBoardResponseDTO(
val maxPerson: Int,
val preferredGender: String,
val preferredAgeRange: String,
val gameInfo: GameInfoDTO,
val liftUpDate: String,
val gameInfo: GameInfoDTO,
val userInfo: UserInfoDTO,
val buttonStatus: String,
val bookMarked: Boolean,
)
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@ package com.catchmate.data.dto.board

data class GetLikedBoardResponseDTO(
val boardInfoList: List<BoardDTO>,
val totalPages: Int,
val totalElements: Int,
val isFirst: Boolean,
val isLast: Boolean,
)
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@ package com.catchmate.data.dto.board

data class GetUserBoardListResponseDTO(
val boardInfoList: List<BoardDTO>,
val totalPages: Int,
val totalElements: Int,
val isFirst: Boolean,
val isLast: Boolean,
)
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.catchmate.data.dto.board

data class PatchBoardLiftUpResponseDTO(
val liftUpDate: String,
val state: Boolean,
val remainTime: String,
)
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ data class PatchBoardResponseDTO(
val maxPerson: Int,
val preferredGender: String,
val preferredAgeRange: String,
val gameInfo: GameInfoDTO,
val liftUpDate: String,
val gameInfo: GameInfoDTO,
val userInfo: UserInfoDTO,
val buttonStatus: String?,
val bookMarked: Boolean,
)
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ data class PostBoardResponseDTO(
val maxPerson: Int,
val preferredGender: String,
val preferredAgeRange: String,
val gameInfo: GameInfoDTO,
val liftUpDate: String,
val gameInfo: GameInfoDTO,
val userInfo: UserInfoDTO,
val buttonStatus: String?,
val bookMarked: Boolean,
)
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ data class EnrollBoardInfoDTO(
val maxPerson: Int,
val preferredGender: String,
val preferredAgeRange: String,
val gameInfo: GameInfoDTO,
val liftUpDate: String,
val gameInfo: GameInfoDTO,
val userInfo: UserInfoDTO,
val buttonStatus: String?,
val bookMarked: Boolean,
)
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@ package com.catchmate.data.dto.enroll

data class GetRequestedEnrollListResponseDTO(
val enrollInfoList: List<EnrollInfoDTO>,
val totalPages: Int,
val totalElements: Int,
val isFirst: Boolean,
val isLast: Boolean,
)
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@ package com.catchmate.data.dto.notification

data class GetReceivedNotificationListResponseDTO(
val notificationInfoList: List<NotificationInfoDTO>,
val totalPages: Int,
val totalElements: Int,
val isFirst: Boolean,
val isLast: Boolean,
)
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ data class GetReceivedNotificationResponseDTO(
val title: String,
val body: String,
val createdAt: String,
val acceptStatus: String,
val read: Boolean,
)
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ data class NotificationInfoDTO(
val title: String,
val body: String,
val createdAt: String,
val acceptStatus: String,
val read: Boolean,
)
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,23 @@ object BoardMapper {
gameInfo = toGameInfo(responseDTO.gameInfo),
liftUpDate = responseDTO.liftUpDate,
userInfo = toUserInfo(responseDTO.userInfo),
buttonStatus = responseDTO.buttonStatus,
bookMarked = responseDTO.bookMarked,
)

fun toPatchBoardLiftUpResponse(dto: PatchBoardLiftUpResponseDTO): PatchBoardLiftUpResponse = PatchBoardLiftUpResponse(dto.liftUpDate)
fun toPatchBoardLiftUpResponse(dto: PatchBoardLiftUpResponseDTO): PatchBoardLiftUpResponse =
PatchBoardLiftUpResponse(
state = dto.state,
remainTime = dto.remainTime,
)

fun toGetBoardListResponse(responseDTO: GetBoardListResponseDTO): GetBoardListResponse =
GetBoardListResponse(
boardInfoList = responseDTO.boardInfoList.map { toBoard(it) },
totalPages = responseDTO.totalPages,
totalElements = responseDTO.totalElements,
isFirst = responseDTO.isFirst,
isLast = responseDTO.isLast,
)

private fun toBoard(dto: BoardDTO): Board =
Expand All @@ -150,11 +160,17 @@ object BoardMapper {
gameInfo = toGameInfo(dto.gameInfo),
liftUpDate = dto.liftUpDate,
userInfo = toUserInfo(dto.userInfo),
buttonStatus = dto.buttonStatus,
bookMarked = dto.bookMarked,
)

fun toGetUserBoardListResponse(dto: GetUserBoardListResponseDTO): GetUserBoardListResponse =
GetUserBoardListResponse(
boardInfoList = dto.boardInfoList.map { toBoard(it) },
totalPages = dto.totalPages,
totalElements = dto.totalElements,
isFirst = dto.isFirst,
isLast = dto.isLast,
)

fun toGetBoardResponse(responseDTO: GetBoardResponseDTO): GetBoardResponse =
Expand All @@ -167,9 +183,11 @@ object BoardMapper {
maxPerson = responseDTO.maxPerson,
preferredGender = responseDTO.preferredGender,
preferredAgeRange = responseDTO.preferredAgeRange,
gameInfo = toGameInfo(responseDTO.gameInfo),
liftUpDate = responseDTO.liftUpDate,
gameInfo = toGameInfo(responseDTO.gameInfo),
userInfo = toUserInfo(responseDTO.userInfo),
buttonStatus = responseDTO.buttonStatus,
bookMarked = responseDTO.bookMarked,
)

fun toGetTempBoardResponse(dto: GetTempBoardResponseDTO): GetTempBoardResponse =
Expand All @@ -196,6 +214,10 @@ object BoardMapper {
fun toGetLikedBoardResponse(responseDTO: GetLikedBoardResponseDTO): GetLikedBoardResponse =
GetLikedBoardResponse(
boardInfoList = responseDTO.boardInfoList.map { toBoard(it) },
totalPages = responseDTO.totalPages,
totalElements = responseDTO.totalElements,
isFirst = responseDTO.isFirst,
isLast = responseDTO.isLast,
)

fun toPostBoardLikeResponse(dto: PostBoardLikeResponseDTO): PostBoardLikeResponse = PostBoardLikeResponse(dto.state)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ object EnrollMapper {
fun toGetRequestedEnrollListResponse(responseDTO: GetRequestedEnrollListResponseDTO): GetRequestedEnrollListResponse =
GetRequestedEnrollListResponse(
enrollInfoList = responseDTO.enrollInfoList.map { toEnrollInfo(it) },
totalPages = responseDTO.totalPages,
totalElements = responseDTO.totalElements,
isFirst = responseDTO.isFirst,
isLast = responseDTO.isLast,
)

private fun toEnrollInfo(dto: EnrollInfoDTO): EnrollInfo =
Expand Down Expand Up @@ -107,6 +111,8 @@ object EnrollMapper {
gameInfo = toGameInfo(dto.gameInfo),
liftUpDate = dto.liftUpDate,
userInfo = toEnrollUserInfo(dto.userInfo),
buttonStatus = dto.buttonStatus,
bookMarked = dto.bookMarked,
)

private fun toGameInfo(dto: GameInfoDTO): GameInfo =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ object NotificationMapper {
fun toGetReceivedNotificationListResponse(responseDTO: GetReceivedNotificationListResponseDTO): GetReceivedNotificationListResponse =
GetReceivedNotificationListResponse(
notificationInfoList = responseDTO.notificationInfoList.map { toNotificationInfo(it) },
totalPages = responseDTO.totalPages,
totalElements = responseDTO.totalElements,
isFirst = responseDTO.isFirst,
isLast = responseDTO.isLast,
)

private fun toNotificationInfo(dto: NotificationInfoDTO): NotificationInfo =
Expand All @@ -31,6 +35,7 @@ object NotificationMapper {
title = dto.title,
body = dto.body,
createdAt = dto.createdAt,
acceptStatus = dto.acceptStatus,
read = dto.read,
)

Expand All @@ -47,6 +52,8 @@ object NotificationMapper {
gameInfo = toGameInfo(dto.gameInfo),
liftUpDate = dto.liftUpDate,
userInfo = toUserInfo(dto.userInfo),
buttonStatus = dto.buttonStatus,
bookMarked = dto.bookMarked,
)

private fun toGameInfo(dto: GameInfoDTO): GameInfo =
Expand Down Expand Up @@ -89,6 +96,7 @@ object NotificationMapper {
title = dto.title,
body = dto.body,
createdAt = dto.createdAt,
acceptStatus = dto.acceptStatus,
read = dto.read,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import com.catchmate.data.datasource.remote.BoardService
import com.catchmate.data.datasource.remote.RetrofitClient
import com.catchmate.data.mapper.BoardMapper
import com.catchmate.domain.exception.BookmarkFailureException
import com.catchmate.domain.exception.LiftUpFailureException
import com.catchmate.domain.exception.NonExistentTempBoardException
import com.catchmate.domain.exception.ReissueFailureException
import com.catchmate.domain.model.board.DeleteBoardLikeResponse
Expand Down Expand Up @@ -123,11 +122,7 @@ class BoardRepositoryImpl
Result.success(body)
} else {
val stringToJson = JSONObject(response.errorBody()?.string()!!)
if (response.code() == 400) {
Result.failure(LiftUpFailureException("$stringToJson"))
} else {
Result.failure(Exception("$stringToJson"))
}
Result.failure(Exception("$stringToJson"))
}
} catch (e: ReissueFailureException) {
Result.failure(e)
Expand All @@ -138,10 +133,11 @@ class BoardRepositoryImpl
override suspend fun getBoardList(
gameStartDate: String?,
maxPerson: Int?,
preferredTeamId: Int?,
preferredTeamIdList: Array<Int>?,
page: Int?,
): Result<GetBoardListResponse> =
try {
val response = boardApi.getBoardList(gameStartDate, maxPerson, preferredTeamId)
val response = boardApi.getBoardList(gameStartDate, maxPerson, preferredTeamIdList, page)
if (response.isSuccessful) {
Log.d("BoardRepo", "통신 성공")
val body =
Expand All @@ -162,9 +158,12 @@ class BoardRepositoryImpl
Result.failure(e)
}

override suspend fun getUserBoardList(userId: Long): Result<GetUserBoardListResponse> =
override suspend fun getUserBoardList(
userId: Long,
page: Int,
): Result<GetUserBoardListResponse> =
try {
val response = boardApi.getUserBoardList(userId)
val response = boardApi.getUserBoardList(userId, page)
if (response.isSuccessful) {
Log.d("BoardRepo", "통신 성공")
val body =
Expand Down Expand Up @@ -208,9 +207,9 @@ class BoardRepositoryImpl
Result.failure(e)
}

override suspend fun getLikedBoard(): Result<GetLikedBoardResponse> =
override suspend fun getLikedBoard(page: Int): Result<GetLikedBoardResponse> =
try {
val response = boardApi.getLikedBoard()
val response = boardApi.getLikedBoard(page)
if (response.isSuccessful) {
Log.d("BoardRepo", "통신 성공")
val body =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ class EnrollRepositoryImpl
Result.failure(e)
}

override suspend fun getRequestedEnrollList(): Result<GetRequestedEnrollListResponse> =
override suspend fun getRequestedEnrollList(page: Int): Result<GetRequestedEnrollListResponse> =
try {
val response = enrollApi.getRequestedEnrollList()
val response = enrollApi.getRequestedEnrollList(page)
if (response.isSuccessful) {
Log.d("EnrollRepo", "통신 성공 : ${response.code()}")
val body =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ class NotificationRepositoryImpl
) : NotificationRepository {
private val notificationApi = retrofitClient.createApi<NotificationService>()

override suspend fun getReceivedNotificationList(): Result<GetReceivedNotificationListResponse> =
override suspend fun getReceivedNotificationList(page: Int): Result<GetReceivedNotificationListResponse> =
try {
val response = notificationApi.getReceivedNotificationList()
val response = notificationApi.getReceivedNotificationList(page)
if (response.isSuccessful) {
Log.d("NotiRepo", "통신 성공 : ${response.code()}")
val body =
Expand Down

This file was deleted.

Loading