更新
This commit is contained in:
@@ -21,7 +21,8 @@ interface MomentService {
|
||||
suspend fun createMoment(
|
||||
content: String,
|
||||
authorId: Int,
|
||||
imageUriList: List<String>
|
||||
imageUriList: List<String>,
|
||||
relPostId: Int? = null
|
||||
): MomentItem
|
||||
}
|
||||
|
||||
@@ -96,9 +97,10 @@ class TestMomentServiceImpl() : MomentService {
|
||||
override suspend fun createMoment(
|
||||
content: String,
|
||||
authorId: Int,
|
||||
imageUriList: List<String>
|
||||
imageUriList: List<String>,
|
||||
relPostId: Int?
|
||||
): MomentItem {
|
||||
return testMomentBackend.createMoment(content, authorId, imageUriList)
|
||||
return testMomentBackend.createMoment(content, authorId, imageUriList, relPostId)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -140,6 +142,9 @@ class TestMomentBackend(
|
||||
if (myLikeIdList.contains(it.id)) {
|
||||
it.liked = true
|
||||
}
|
||||
if (it.relPostId != null) {
|
||||
it.relMoment = rawList.first { it1 -> it1.id == it.relPostId }
|
||||
}
|
||||
}
|
||||
|
||||
// delay
|
||||
@@ -186,7 +191,8 @@ class TestMomentBackend(
|
||||
suspend fun createMoment(
|
||||
content: String,
|
||||
authorId: Int,
|
||||
imageUriList: List<String>
|
||||
imageUriList: List<String>,
|
||||
relPostId: Int?
|
||||
): MomentItem {
|
||||
TestDatabase.momentIdCounter += 1
|
||||
val person = TestDatabase.accountData.first {
|
||||
@@ -206,7 +212,8 @@ class TestMomentBackend(
|
||||
shareCount = 0,
|
||||
favoriteCount = 0,
|
||||
images = imageUriList,
|
||||
authorId = person.id
|
||||
authorId = person.id,
|
||||
relPostId = relPostId
|
||||
)
|
||||
TestDatabase.momentData += newMoment
|
||||
return newMoment
|
||||
|
||||
Reference in New Issue
Block a user