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
@@ -0,0 +1,93 @@
package com.on.turip.data.contents.repository

import com.on.turip.domain.contents.Content
import com.on.turip.domain.contents.Creator
import com.on.turip.domain.contents.PagedContentsResult
import com.on.turip.domain.contents.TripDuration
import com.on.turip.domain.contents.Video
import com.on.turip.domain.contents.repository.ContentsRepository

class DummyContentsRepository(
private val dummyData: List<Video> = dummyVideos,
) : ContentsRepository {
override suspend fun loadContentsSize(region: String): Int = dummyData.size

override suspend fun loadContents(
region: String,
size: Int,
lastId: Long,
): PagedContentsResult =
PagedContentsResult(
videos = dummyData,
loadable = false,
)

companion object {
val dummyVideos =
listOf(
Video(
content =
Content(
id = 1,
creator =
Creator(
id = 101,
channelName = "여행하는 뭉치",
profileImage = "http://turip.com/static/youtuber1",
),
title = "느좋 감성 대구 여행 어쩌구저쩌구",
url = "https://youtu.be/dummy1",
uploadedDate = "2025-07-15",
),
tripDuration =
TripDuration(
nights = 2,
days = 3,
),
tripPlaceCount = 5,
),
Video(
content =
Content(
id = 2,
creator =
Creator(
id = 102,
channelName = "뚜벅이의 하루",
profileImage = "http://turip.com/static/youtuber2",
),
title = "제주도 혼자 여행 브이로그",
url = "https://youtu.be/dummy2",
uploadedDate = "2025-06-28",
),
tripDuration =
TripDuration(
nights = 3,
days = 4,
),
tripPlaceCount = 8,
),
Video(
content =
Content(
id = 3,
creator =
Creator(
id = 103,
channelName = "감성캠퍼",
profileImage = "http://turip.com/static/youtuber3",
),
title = "강원도 캠핑 2박 3일 여행",
url = "https://youtu.be/dummy3",
uploadedDate = "2025-05-10",
),
tripDuration =
TripDuration(
nights = 2,
days = 3,
),
tripPlaceCount = 4,
),
)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.on.turip.domain.contents

data class Content(
val id: Long,
val creator: Creator,
val title: String,
val url: String,
val uploadedDate: String,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.on.turip.domain.contents

data class Creator(
val id: Long,
val channelName: String,
val profileImage: String,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.on.turip.domain.contents

data class PagedContentsResult(
val videos: List<Video>,
val loadable: Boolean,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.on.turip.domain.contents

data class TripDuration(
val nights: Int,
val days: Int,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.on.turip.domain.contents

data class Video(
val content: Content,
val tripDuration: TripDuration,
val tripPlaceCount: Int,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.on.turip.domain.contents.repository

import com.on.turip.domain.contents.PagedContentsResult

interface ContentsRepository {
suspend fun loadContentsSize(region: String): Int

suspend fun loadContents(
region: String,
size: Int,
lastId: Long,
): PagedContentsResult
}