Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 @@ -30,5 +30,5 @@ data class AlarmDto(
@SerializedName("memberId")
val memberId: String?,
@SerializedName("postId")
val postId: Int?
val postId: Long?
)
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ interface BookmarkApiService {
suspend fun requestBookmarkPost(@Body body: CreateBookmarkRequest): NetworkResponse<CreateBookmarkResponse>

@POST("/api/v1/bookmark/delete/{postId}")
suspend fun requestDeleteBookmarkPost(@Path("postId") postId: Int): NetworkResponse<Void>
suspend fun requestDeleteBookmarkPost(@Path("postId") postId: Long): NetworkResponse<Void>

@GET("/api/v1/bookmark/list")
suspend fun requestAllMyBookmarkPostList(@Query("end") end: Int): NetworkResponse<ListAllMyBookmarkPostResponse>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ import com.google.gson.annotations.SerializedName

data class CreateBookmarkRequest(
@SerializedName("postId")
val postId: Int
val postId: Long
)
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ data class CreateBookmarkResponse(
@SerializedName("memberId")
val memberId: String,
@SerializedName("postId")
val postId: Int
val postId: Long
)

data class ListAllMyBookmarkPostResponse(
Expand All @@ -20,7 +20,7 @@ data class ListAllMyBookmarkPostResponse(

data class BookmarkPostDto(
@SerializedName("postId")
val postId: Int,
val postId: Long,
@SerializedName("thumbnailImage")
val thumbnailImage: String
)
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ interface CommentApiService {

/*** v2 ***/
@GET("/api/v2/comments/{postId}")
suspend fun requestPostComment(@Path("postId") postId: Int): NetworkResponse<ListAllCommentResponse>
suspend fun requestPostComment(@Path("postId") postId: Long): NetworkResponse<ListAllCommentResponse>

@POST("/api/v2/comments")
suspend fun requestCreatePostComment(@Body body: CreateCommentRequest): NetworkResponse<CreateCommentResponse>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ data class CreateCommentRequest(
@SerializedName("contents")
val contents: String,
@SerializedName("postId")
val postId: Int,
val postId: Long,
@SerializedName("mentionList")
val mentionList: List<MentionUserDto>
)
Expand All @@ -17,7 +17,7 @@ data class CreateCommentReplyRequest(
@SerializedName("contents")
val contents: String,
@SerializedName("postId")
val postId: Int,
val postId: Long,
@SerializedName("mentionList")
val mentionList: List<MentionUserDto>
)
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ interface FolderApiService {
@Multipart
@POST("/api/v1/folders/patch")
suspend fun requestEditFolder(
@Part("folderId") folderId: Int,
@Part("folderId") folderId: Long,
@Part("name") name: String,
@Part("privacy") privacy: String,
@Part("subheading") subheading: String?,
Expand All @@ -30,23 +30,27 @@ interface FolderApiService {
suspend fun requestCreateFolderInPost(@Body body: CreateFolderInPostRequest): NetworkResponse<CreateFolderInPostResponse>

@POST("/api/v1/folders/delete/{folderId}")
suspend fun requestDeleteFolder(@Path("folderId") folderId: Int): NetworkResponse<Void>
suspend fun requestDeleteFolder(@Path("folderId") folderId: Long): NetworkResponse<Void>

@POST("/api/v1/folders/order")
suspend fun requestOrderFolder(@Body body: List<EditOrderDto>): NetworkResponse<Void>
@POST("/api/v2/folders/move")
suspend fun requestFolderMove(@Body body: FolderMoveRequest): NetworkResponse<Void>

// 폴더 리스트
@GET("/api/v1/folders/list/{memberId}")
@GET("/api/v2/folders/list/{memberId}")
suspend fun requestAllFolderList(@Path("memberId") memberId: String): NetworkResponse<ListAllFolderResponse>

@GET("/api/v1/folders/my")
@GET("/api/v2/folders/my")
suspend fun requestAllMyFolderList(): NetworkResponse<ListAllMyFolderResponse>

// 폴더 정보
@GET("/api/v1/folders/{folderId}/info")
suspend fun requestFolderInfo(@Path("folderId") folderId: Int): NetworkResponse<FolderInfoResponse>
@GET("/api/v2/folders/{folderId}/info")
suspend fun requestFolderInfo(@Path("folderId") folderId: Long): NetworkResponse<FolderInfoResponse>

// 폴더 내 게시글
@GET("/api/v1/folders/{folderId}")
suspend fun requestDetailListFolder(@Path("folderId") folderId: Int, @Query("end") end: Int): NetworkResponse<DetailFolderResponse>
@GET("/api/v2/folders/{folderId}")
suspend fun requestDetailListFolder(
@Path("folderId") folderId: Long,
@Query("end") end: Int,
@Query("order") order: String
): NetworkResponse<DetailFolderResponse>
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,22 @@ package daily.dayo.data.datasource.remote.folder
import androidx.paging.PagingSource
import androidx.paging.PagingState
import daily.dayo.data.mapper.toFolderPost
import daily.dayo.domain.model.FolderOrder
import daily.dayo.domain.model.FolderPost
import daily.dayo.domain.model.NetworkResponse

class FolderPagingSource(
private val apiService: FolderApiService,
private val size: Int,
private val folderId: Int
private val folderId: Long,
private val folderOrder: FolderOrder
) : PagingSource<Int, FolderPost>() {

override suspend fun load(
params: LoadParams<Int>
): LoadResult<Int, FolderPost> {
val nextPageNumber = params.key ?: 0
apiService.requestDetailListFolder(folderId = folderId, end = nextPageNumber).let { ApiResponse ->
apiService.requestDetailListFolder(folderId = folderId, end = nextPageNumber, order = folderOrder.toString()).let { ApiResponse ->
return try {
when (ApiResponse) {
is NetworkResponse.Success -> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package daily.dayo.data.datasource.remote.folder

import daily.dayo.domain.model.Privacy
import com.google.gson.annotations.SerializedName
import daily.dayo.domain.model.Privacy

data class CreateFolderInPostRequest(
@SerializedName("name")
Expand All @@ -10,4 +10,11 @@ data class CreateFolderInPostRequest(
val subheading: String,
@SerializedName("privacy")
val privacy: Privacy
)

data class FolderMoveRequest(
@SerializedName("postIdList")
val postIdList: List<Long>,
@SerializedName("targetFolderId")
val targetFolderId: Long
)
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import com.google.gson.annotations.SerializedName

data class CreateFolderResponse(
@SerializedName("folderId")
val id: Int
val id: Long
)

data class ListAllFolderResponse(
Expand Down Expand Up @@ -48,17 +48,17 @@ data class DetailFolderResponse(

data class CreateFolderInPostResponse(
@SerializedName("folderId")
val folderId: Int
val folderId: Long
)

data class EditFolderResponse(
@SerializedName("folderId")
val folderId: Int
val folderId: Long
)

data class FolderDto(
@SerializedName("folderId")
val folderId: Int,
val folderId: Long,
@SerializedName("name")
val name: String,
@SerializedName("postCount")
Expand All @@ -75,14 +75,14 @@ data class FolderPostDto(
@SerializedName("createDate")
val createDate: String,
@SerializedName("postId")
val postId: Int,
val postId: Long,
@SerializedName("thumbnailImage")
val thumbnailImage: String
)

data class EditOrderDto(
@SerializedName("folderId")
var folderId: Int,
var folderId: Long,
@SerializedName("orderIndex")
var orderIndex: Int
)
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ interface HeartApiService {
suspend fun requestLikePost(@Body body: CreateHeartRequest): NetworkResponse<CreateHeartResponse>

@POST("/api/v1/heart/delete/{postId}")
suspend fun requestUnlikePost(@Path("postId") postId: Int): NetworkResponse<DeleteHeartResponse>
suspend fun requestUnlikePost(@Path("postId") postId: Long): NetworkResponse<DeleteHeartResponse>

@GET("/api/v1/heart/list")
suspend fun requestAllMyLikePostList(@Query("end") end: Int): NetworkResponse<ListAllMyHeartPostResponse>

@GET("/api/v1/heart/post/{postId}/list")
suspend fun requestPostLikeUsers(@Path("postId") postId: Int, @Query("end") end: Int): NetworkResponse<PostMemberHeartListResponse>
suspend fun requestPostLikeUsers(@Path("postId") postId: Long, @Query("end") end: Int): NetworkResponse<PostMemberHeartListResponse>
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import daily.dayo.domain.model.NetworkResponse
class HeartPostUsersPagingSource(
private val apiService: HeartApiService,
private val size: Int,
private val postId: Int
private val postId: Long
) : PagingSource<Int, LikeUser>() {

override suspend fun load(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ import com.google.gson.annotations.SerializedName

data class CreateHeartRequest(
@SerializedName("postId")
val postId: Int
val postId: Long
)
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ data class CreateHeartResponse(
@SerializedName("memberId")
val memberId: String,
@SerializedName("postId")
val postId: Int,
val postId: Long,
@SerializedName("allCount")
val allCount: Int
)
Expand All @@ -27,7 +27,7 @@ data class ListAllMyHeartPostResponse(

data class MyHeartPostDto(
@SerializedName("postId")
val postId: Int,
val postId: Long,
@SerializedName("thumbnailImage")
val thumbnailImage: String
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ interface PostApiService {
@Part("category") category: String,
@Part("contents") contents: String,
@Part files: List<MultipartBody.Part>,
@Part("folderId") folderId: Int,
@Part("folderId") folderId: Long,
@Part("tags") tags: Array<String>
): NetworkResponse<CreatePostResponse>

@POST("/api/v1/posts/{postId}/edit")
suspend fun requestEditPost(
@Path("postId") postId: Int,
@Path("postId") postId: Long,
@Body body: EditPostRequest
): NetworkResponse<EditPostResponse>

Expand All @@ -42,10 +42,10 @@ interface PostApiService {
suspend fun requestDayoPickPostListCategory(@Path("category") category: Category): NetworkResponse<DayoPickPostListResponse>

@GET("/api/v1/posts/{postId}")
suspend fun requestPostDetail(@Path("postId") postId: Int): NetworkResponse<DetailPostResponse>
suspend fun requestPostDetail(@Path("postId") postId: Long): NetworkResponse<DetailPostResponse>

@POST("/api/v1/posts/delete/{postId}")
suspend fun requestDeletePost(@Path("postId") postId: Int): NetworkResponse<Void>
suspend fun requestDeletePost(@Path("postId") postId: Long): NetworkResponse<Void>

@GET("/api/v1/posts/feed/list")
suspend fun requestAllFeedList(@Query("end") end: Int): NetworkResponse<ListFeedResponse>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ data class EditPostRequest (
@SerializedName("contents")
val contents : String,
@SerializedName("folderId")
val folderId : Int,
val folderId : Long,
@SerializedName("hashtags")
val hashtags : List<String>
)
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package daily.dayo.data.datasource.remote.post

import daily.dayo.domain.model.Category
import com.google.gson.annotations.SerializedName
import daily.dayo.domain.model.Category

data class ListFeedResponse(
@SerializedName("count")
Expand All @@ -14,12 +14,12 @@ data class ListFeedResponse(

data class EditPostResponse(
@SerializedName("postId")
val postId: Int
val postId: Long
)

data class CreatePostResponse(
@SerializedName("id")
val id: Int
val id: Long
)

data class ListAllPostResponse(
Expand Down Expand Up @@ -53,7 +53,7 @@ data class DetailPostResponse(
@SerializedName("createDateTime")
val createDateTime: String,
@SerializedName("folderId")
val folderId: Int,
val folderId: Long,
@SerializedName("folderName")
val folderName: String,
@SerializedName("hashtags")
Expand All @@ -80,7 +80,7 @@ data class PostDto(
@SerializedName("heartCount")
val heartCount: Int,
@SerializedName("id")
val postId: Int,
val postId: Long,
@SerializedName("memberId")
val memberId: String,
@SerializedName("nickname")
Expand All @@ -99,7 +99,7 @@ data class DayoPick(
@SerializedName("heartCount")
val heartCount: Int,
@SerializedName("id")
val postId: Int,
val postId: Long,
@SerializedName("memberId")
val memberId: String,
@SerializedName("nickname")
Expand Down Expand Up @@ -128,7 +128,7 @@ data class FeedDto(
@SerializedName("heartCount")
val heartCount: Int,
@SerializedName("id")
val postId: Int,
val postId: Long,
@SerializedName("memberId")
val memberId: String,
@SerializedName("nickname")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ data class CreateReportPostRequest(
@SerializedName("comment")
val comment: String,
@SerializedName("postId")
val postId: Int
val postId: Long
)

data class CreateReportCommentRequest(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ data class SearchResultResponse(

data class SearchDto(
@SerializedName("postId")
val postId: Int,
val postId: Long,
@SerializedName("thumbnailImage")
val thumbnailImage: String,
)
Expand Down
12 changes: 0 additions & 12 deletions data/src/main/java/daily/dayo/data/mapper/FolderMapper.kt
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,4 @@ fun FolderPostDto.toFolderPost(): FolderPost =
createDate = createDate,
postId = postId,
thumbnailImage = thumbnailImage
)

fun FolderOrder.toEditOrderDto(): EditOrderDto =
EditOrderDto(
folderId = folderId,
orderIndex = orderIndex
)

fun EditOrderDto.toFolderOrder(): FolderOrder =
FolderOrder(
folderId = folderId,
orderIndex = orderIndex
)
Loading