Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
ec8878c
[feat]: 투표 삭제 response 생성 (#90)
Nico1eKim Aug 15, 2025
24549b3
[feat]: 투표 삭제 service 작성 (#90)
Nico1eKim Aug 15, 2025
cc52a80
[feat]: 투표 삭제 repository 작성 (#90)
Nico1eKim Aug 15, 2025
5a5e2a0
[feat]: 투표 삭제 viewmodel 작성 및 screen에 적용 (#90)
Nico1eKim Aug 15, 2025
8381d6e
[refactor]: 기록에서 총평일 때 페이지 말고 총평으로 뜨도록 수정 (#90)
Nico1eKim Aug 15, 2025
2e051eb
[feat]: 댓글 삭제 response 작성 (#90)
Nico1eKim Aug 15, 2025
c877cce
[feat]: 댓글 삭제 service 작성 (#90)
Nico1eKim Aug 15, 2025
a31ce32
[feat]: 댓글 삭제 repository 작성 (#90)
Nico1eKim Aug 15, 2025
600c53d
[refactor]: 댓글 response에 isWriter 추가 (#90)
Nico1eKim Aug 15, 2025
0634669
[feat]: 댓글 삭제 viewmodel 작성 및 screen에 적용 (#90)
Nico1eKim Aug 15, 2025
10adad1
[refactor]: 댓글 삭제됐을 때 id null로 바뀌는 문제 해결 (#90)
Nico1eKim Aug 15, 2025
5ed4e68
[refactor]: 삭제된 댓글의 답글에 좋아요 누를 수 있도록 수정 (#90)
Nico1eKim Aug 15, 2025
8e63804
[refactor]: 댓글 바텀시트 닫으면 기록 재렌더링 하도록 수정 (#90)
Nico1eKim Aug 15, 2025
ffce475
[refactor]: 댓글 삭제 로직 수정 (#90)
Nico1eKim Aug 15, 2025
b7ff248
Merge branch 'develop' of https://github.com/THIP-TextHip/THIP-Androi…
Nico1eKim Aug 15, 2025
94e3aeb
Merge branch 'develop' of https://github.com/THIP-TextHip/THIP-Androi…
Nico1eKim Aug 15, 2025
2fa6bfb
Merge branch 'develop' of https://github.com/THIP-TextHip/THIP-Androi…
Nico1eKim Aug 15, 2025
e84f0ba
[ui]: bottom sheet 뜰 때 배경색 해결 (#90)
Nico1eKim Aug 16, 2025
27e9774
Merge branch 'develop' of https://github.com/THIP-TextHip/THIP-Androi…
Nico1eKim Aug 16, 2025
2756b8e
[chore]: 아이콘 svg로 변경 (#90)
Nico1eKim Aug 16, 2025
8eb8a35
[refactor]: 최근 피드 작성한 팔로잉 리스트 조회 로직 수정 (#90)
Nico1eKim Aug 16, 2025
ac6c77a
[feat]: 특정 유저의 공개 피드 조회 상단 화면 response 생성 (#90)
Nico1eKim Aug 16, 2025
42742de
[feat]: 특정 유저의 공개 피드 조회 상단 화면 service, repository 생성 (#90)
Nico1eKim Aug 16, 2025
e984dbd
[feat]: 특정 유저의 공개 피드 조회 상단 화면 viewmodel 생성 (#90)
Nico1eKim Aug 16, 2025
488d76c
[feat]: 특정 유저의 공개 피드 조회 상단 화면 screen에 viewmodel, navigation 연결 (#90)
Nico1eKim Aug 16, 2025
e546719
[feat]: 특정 유저의 공개 피드 조회 response 생성 (#90)
Nico1eKim Aug 16, 2025
b563be3
[feat]: 특정 유저의 공개 피드 조회 service, repository 생성 (#90)
Nico1eKim Aug 16, 2025
feaa81f
[ui]: 특정 유저의 공개 피드를 위한 card 생성 (#90)
Nico1eKim Aug 16, 2025
b4a7639
[feat]: 특정 유저의 공개 피드 조회 viewmodel 생성 및 screen에 연결 (#90)
Nico1eKim Aug 16, 2025
c0de2aa
[ui]: horizontal divider color 수정 (#90)
Nico1eKim Aug 16, 2025
789a505
[feat]: 오늘의 한마디 작성 request, response 생성 (#90)
Nico1eKim Aug 16, 2025
f8e5a8a
[feat]: 오늘의 한마디 작성 service, repository 작성 (#90)
Nico1eKim Aug 16, 2025
e19c792
[feat]: 오늘의 한마디 작성 viewmodel 작성 및 screen, navigation 연결 (#90)
Nico1eKim Aug 16, 2025
0ffce8b
[feat]: 진행중인 모임방에서 책상세 페이지로 넘어가도록 구현 (#90)
Nico1eKim Aug 16, 2025
2554e08
[ui]: tooltip 뜨는 위치 수정 (#90)
Nico1eKim Aug 16, 2025
8372dfb
[refactor]: 투표한 항목만 바뀌도록 로직 수정 (#90)
Nico1eKim Aug 16, 2025
940b89d
[ui]: 오늘의 한마디 페이지에서 textfield도 위로 올라오도록 수정 (#90)
Nico1eKim Aug 16, 2025
55b30b2
[chore]: 퍼센트 소수점 반올림하도록 수정 (#90)
Nico1eKim Aug 16, 2025
172b43c
[feat]: 기록 핀하기 response, service, repository 생성 (#90)
Nico1eKim Aug 16, 2025
401426c
[feat]: 기록 핀하기 viewmodel 작성 및 screen, navigation 연결 (#90)
Nico1eKim Aug 16, 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
@@ -0,0 +1,8 @@
package com.texthip.thip.data.model.comments.response

import kotlinx.serialization.Serializable

@Serializable
data class CommentsDeleteResponse(
val postId: Long
)
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,17 @@ data class CommentsResponse(

@Serializable
data class CommentList(
val commentId: Int,
val creatorId: Int,
val creatorProfileImageUrl: String,
val creatorNickname: String,
val aliasName: String,
val aliasColor: String,
val postDate: String,
val content: String,
val commentId: Int?,
val creatorId: Int?,
val creatorProfileImageUrl: String?,
val creatorNickname: String?,
val aliasName: String?,
val aliasColor: String?,
val postDate: String?,
val content: String?,
val likeCount: Int,
val isDeleted: Boolean,
val isWriter: Boolean,
val isLike: Boolean,
Comment on lines +24 to 25

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

새 불리언 필드(isWriter) 디코딩 안정성 — 기본값 추가 권장

백엔드 배포 타이밍 차이로 isWriter가 누락된 응답이 올 경우, 현재는 역직렬화 실패합니다. 기본값을 추가해 하위호환성을 확보하세요.

-    val isWriter: Boolean,
+    val isWriter: Boolean = false,
-    val isWriter: Boolean,
+    val isWriter: Boolean = false,

Also applies to: 42-43

🤖 Prompt for AI Agents
In
app/src/main/java/com/texthip/thip/data/model/comments/response/CommentsResponse.kt
around lines 24-25 (and likewise for the fields at 42-43), the Boolean fields
can be absent from older/rolled-back backend responses causing deserialization
failures; fix this by giving those properties safe default values (e.g., change
their declarations to include = false) so missing keys decode to the default
instead of throwing, and ensure any JSON annotations remain compatible with the
defaults.

val replyList: List<ReplyList>,
)
Expand All @@ -38,4 +39,5 @@ data class ReplyList(
val content: String,
val likeCount: Int,
val isLike: Boolean,
val isWriter: Boolean,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.texthip.thip.data.model.feed.response

import kotlinx.serialization.Serializable

@Serializable
data class FeedUsersInfoResponse(
val creatorId: Int,
val profileImageUrl: String,
val nickname: String,
val aliasName: String,
val aliasColor: String,
val followerCount: Int,
val totalFeedCount: Int,
val isFollowing: Boolean,
val latestFollowerProfileImageUrls: List<String>
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package com.texthip.thip.data.model.feed.response

import kotlinx.serialization.Serializable

@Serializable
data class FeedUsersResponse (
val feedList: List<FeedList>,
val nextCursor: String? = null,
val isLast: Boolean = false,
)

@Serializable
data class FeedList(
val feedId: Long,
val postDate: String,
val isbn: String,
val bookTitle: String,
val bookAuthor: String,
val contentBody: String,
val contentUrls: List<String>,
val likeCount: Int,
val commentCount: Int,
val isPublic: Boolean,
val isSaved: Boolean,
val isLiked: Boolean,
val isWriter: Boolean,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.texthip.thip.data.model.rooms.request

import kotlinx.serialization.Serializable

@Serializable
data class RoomsDailyGreetingRequest(
val content: String,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.texthip.thip.data.model.rooms.response

import kotlinx.serialization.Serializable

@Serializable
data class RoomsDailyGreetingResponse(
val attendanceCheckId: Long,
val roomId: Long,
val isFirstWrite: Boolean,
)
Comment on lines +7 to +10

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

ID 타입 일관성 확인 필요 (Int vs Long)

roomId가 Long인데, 서비스/레포지토리에서 roomId: Int로 사용 중인 것으로 요약에 언급되어 있습니다. API 계약과 맞춰 타입을 통일해 주세요. 숫자 폭이 충분하면 Int로, 아니면 호출부/엔드포인트도 Long로 맞추는 것이 안전합니다.

Int로 맞출 경우 예시:

 data class RoomsDailyGreetingResponse(
     val attendanceCheckId: Long,
-    val roomId: Long,
+    val roomId: Int,
     val isFirstWrite: Boolean,
 )

검증 스크립트:


🏁 Script executed:

#!/bin/bash
# RoomsDailyGreeting 관련 타입/시그니처 일관성 확인
rg -n -C2 'postRoomsDailyGreeting\s*\('
rg -n -C2 'RoomsDailyGreetingResponse'
rg -n -C2 'roomId:\s*(Int|Long)'

Length of output: 48247


roomId 타입 일관성 수정 필요 (Long → Int)
서비스/레포지토리에서 roomId를 Int로 사용 중이며, 다른 응답 모델들도 모두 Int를 사용하고 있습니다. API 계약과 코드 일관성을 위해 RoomsDailyGreetingResponseroomId를 Long에서 Int로 변경해주세요.

  • 수정 대상
    • app/src/main/java/com/texthip/thip/data/model/rooms/response/RoomsDailyGreetingResponse.kt:8

제안 변경안:

 data class RoomsDailyGreetingResponse(
     val attendanceCheckId: Long,
-    val roomId: Long,
+    val roomId: Int,
     val isFirstWrite: Boolean,
 )
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
val attendanceCheckId: Long,
val roomId: Long,
val isFirstWrite: Boolean,
)
data class RoomsDailyGreetingResponse(
val attendanceCheckId: Long,
val roomId: Int,
val isFirstWrite: Boolean,
)
🤖 Prompt for AI Agents
In
app/src/main/java/com/texthip/thip/data/model/rooms/response/RoomsDailyGreetingResponse.kt
around lines 7 to 10, the roomId property is declared as Long but
service/repository and other response models use Int; change the property type
from Long to Int (val roomId: Int), then update any direct usages or tests that
assume Long to use Int and ensure JSON (de)serialization expectations remain
consistent.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.texthip.thip.data.model.rooms.response

import kotlinx.serialization.Serializable

@Serializable
data class RoomsDeleteVoteResponse(
val roomId: Int
)
Comment on lines +1 to +8

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

서버 필드명(roomId)과 직렬화 규칙 확인 필요

서버가 snake_case(room_id)를 반환하면 현재 모델은 역직렬화에 실패할 수 있습니다. 서버 응답 키가 roomId인지 room_id인지 확인 후, 필요 시 @SerialName("room_id")를 적용해 주세요. 또한 응답에 voteId 등 추가 필드가 존재한다면 스펙에 맞춰 확장되어야 합니다.

다음 스크립트로 직렬화 관례와 사용처를 빠르게 점검할 수 있습니다.


🏁 Script executed:

#!/bin/bash
# 1) @SerialName 사용 관례 파악
rg -n --type=kt -C2 '@SerialName\('

# 2) RoomsDeleteVoteResponse 사용처와 필드 접근 패턴 확인
rg -n --type=kt -C3 '\bRoomsDeleteVoteResponse\b'
rg -n --type=kt -C3 '\bdeleteRoomsVote\s*\('

Length of output: 217


rg에서 --type=kt를 인식하지 못해 검색이 실패한 것 같습니다. glob 패턴을 사용하여 .kt 파일을 대상으로 다시 점검해 보겠습니다.


🏁 Script executed:

#!/bin/bash
# 1) @SerialName 어노테이션 사용 관례 파악
rg -n --glob '*.kt' -C2 '@SerialName\('

# 2) RoomsDeleteVoteResponse 사용처와 필드 접근 패턴 확인
rg -n --glob '*.kt' -C3 'RoomsDeleteVoteResponse'
rg -n --glob '*.kt' -C3 'deleteRoomsVote\s*\('

Length of output: 37652


@SerialName 어노테이션 추가 및 스펙 확인 필요

다른 응답 모델들과 일관된 직렬화 매핑을 위해, 아래 사항을 반영해 주세요:

• app/src/main/java/com/texthip/thip/data/model/rooms/response/RoomsDeleteVoteResponse.kt
roomId 프로퍼티에 @SerialName("roomId") 어노테이션 추가
• 서버가 실제로 반환하는 키가 roomId(camelCase)인지, room_id(snake_case)인지 확인
• 만약 응답에 voteId 등 추가 필드가 있다면 스펙에 맞춰 모델에 확장 반영

🤖 Prompt for AI Agents
In
app/src/main/java/com/texthip/thip/data/model/rooms/response/RoomsDeleteVoteResponse.kt
lines 1-8, the data class lacks explicit serialization mapping and may not match
the server's field naming; add the @SerialName annotation on the roomId property
(import kotlinx.serialization.SerialName) using the exact key the server returns
(either "roomId" or "room_id"), and if the API returns additional fields (e.g.,
voteId) extend the data class with those properties and corresponding
@SerialName annotations to match the spec.

Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ data class PostList(
val content: String,
val likeCount: Int,
val commentCount: Int,
val isOverview: Boolean,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

신규 필드(isOverview) 역직렬화 하위호환성 — 기본값 권장

서버가 즉시 해당 필드를 내려주지 않는 상황을 대비해 기본값을 넣어 두면 안전합니다.

-    val isOverview: Boolean,
+    val isOverview: Boolean = false,
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
val isOverview: Boolean,
val isOverview: Boolean = false,
🤖 Prompt for AI Agents
In
app/src/main/java/com/texthip/thip/data/model/rooms/response/RoomsPostsResponse.kt
around line 27, the new Boolean field `isOverview` lacks a default value which
can break deserialization when the server omits it; update the data class to
provide a safe default (e.g., `val isOverview: Boolean = false`) so old
responses without the field deserialize correctly, and if using a JSON library
with annotations, ensure the default is recognized (or add @JvmOverloads /
@JsonProperty default handling) so backward compatibility is preserved.

val isLiked: Boolean,
val isWriter: Boolean,
val isLocked: Boolean,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.texthip.thip.data.model.rooms.response

import kotlinx.serialization.Serializable

@Serializable
data class RoomsRecordsPinResponse(
val bookTitle: String,
val authorName: String,
val bookImageUrl: String,
val isbn: String,
)
Comment on lines +6 to +11

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

서버 필드 네이밍과 직렬화 키 일치 여부 확인

kotlinx.serialization에서 글로벌 네이밍 전략을 쓰지 않는다면 서버의 스네이크 케이스 필드와 매칭 문제가 생길 수 있습니다. 서버가 camelCase를 준수하지 않으면 @SerialName이 필요합니다.

다음 스크립트로 프로젝트의 Json 설정(네이밍 전략)과 SerialName 사용 관례를 확인할 수 있습니다:


🏁 Script executed:

#!/bin/bash
# Json 설정에서 namingStrategy 사용 여부 확인
rg -n -C2 'Json\s*\{' -g '!**/build/**' | rg -n -C1 'namingStrategy|JsonNamingStrategy|ignoreUnknownKeys|serializersModule'

# 프로젝트 내 @SerialName 사용 현황 확인
rg -n '@SerialName\(' -g '!**/build/**'

# RoomsRecordsPinResponse 사용처와 응답 파싱 경로 확인
rg -n -C2 'RoomsRecordsPinResponse|getRoomsRecordsPin\(' -g '!**/build/**'

Length of output: 26098


RoomsRecordsPinResponse 프로퍼티에 @SerialName 적용 필요

현재 RoomsRecordsPinResponse 데이터 클래스는 @Serializable만 선언되어 있어, 서버가 snake_case로 응답할 경우 기본 camelCase 매핑과 불일치하여 파싱 오류가 발생할 수 있습니다. 프로젝트 내 다른 Response DTO들은 모두 @SerialName을 명시적으로 사용하고 있으므로, 다음 중 하나를 적용해주세요:

• app/src/main/java/com/texthip/thip/data/model/rooms/response/RoomsRecordsPinResponse.kt 수정

 @Serializable
 data class RoomsRecordsPinResponse(
-    val bookTitle: String,
-    val authorName: String,
-    val bookImageUrl: String,
-    val isbn: String,
+    @SerialName("bookTitle")    val bookTitle: String,
+    @SerialName("authorName")   val authorName: String,
+    @SerialName("bookImageUrl") val bookImageUrl: String,
+    @SerialName("isbn")         val isbn: String,
 )

• 또는 Json { namingStrategy = JsonNamingStrategy.SnakeCase } 와 같은 전역 네이밍 전략 설정 검토

서버 스펙과 응답 키 명칭이 정확히 일치하는지 백엔드 문서도 함께 확인해주세요.

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In
app/src/main/java/com/texthip/thip/data/model/rooms/response/RoomsRecordsPinResponse.kt
around lines 6 to 11, the data class fields currently rely on default camelCase
serialization which will not match a snake_case server response; update the file
to either annotate each property with @SerialName using the expected snake_case
keys (e.g., @SerialName("book_title") for bookTitle, etc.) and ensure the class
is annotated @Serializable, or alternatively configure the project's Json
instance to use a SnakeCase naming strategy globally; pick one approach and
apply it so the serialized names exactly match the backend spec.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,5 @@ import kotlinx.serialization.Serializable

@Serializable
data class RoomsVoteResponse(
val voteItemId: Int,
val roomId: Int,
val type: Boolean,
)
val voteItems: List<VoteItems>,
)
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,4 @@ data class FollowingList(
@SerializedName("aliasName") val aliasName: String,
@SerializedName("aliasColor") val aliasColor: String,
@SerializedName("isFollowing") val isFollowing: Boolean
)

@Serializable
data class MyRecentFollowingsResponse(
@SerializedName("recentWriters") val recentWriters: List<RecentWriterList>
)

@Serializable
data class RecentWriterList(
@SerializedName("userId") val userId: Long,
@SerializedName("nickname") val nickname: String,
@SerializedName("profileImageUrl") val profileImageUrl: String?
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.texthip.thip.data.model.users.response

import kotlinx.serialization.Serializable

@Serializable
data class UsersMyFollowingsRecentFeedsResponse(
val recentWriters: List<RecentWriterList>
)

@Serializable
data class RecentWriterList(
val userId: Long,
val nickname: String,
val profileImageUrl: String
)
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,10 @@ class CommentsRepository @Inject constructor(
)
).handleBaseResponse().getOrThrow()
}

suspend fun deleteComment(
commentId: Long
) = runCatching {
commentsService.deleteComment(commentId).handleBaseResponse().getOrThrow()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class FeedRepository @Inject constructor(
val response = feedService.getFeedWriteInfo()
.handleBaseResponse()
.getOrThrow()

// 카테고리 순서 조정
val orderedCategories = response?.categoryList?.sortedBy { category ->
when (category.category) {
Expand All @@ -44,7 +44,7 @@ class FeedRepository @Inject constructor(
else -> 999
}
} ?: emptyList()

response?.copy(categoryList = orderedCategories)
}

Expand All @@ -69,7 +69,7 @@ class FeedRepository @Inject constructor(

// 임시 파일 목록 추적
val tempFiles = mutableListOf<File>()

try {
// 이미지 파일들을 MultipartBody.Part로 변환
val imageParts = if (imageUris.isNotEmpty()) {
Expand All @@ -95,7 +95,11 @@ class FeedRepository @Inject constructor(
}
}

private fun uriToMultipartBodyPart(uri: Uri, paramName: String, tempFiles: MutableList<File>): MultipartBody.Part? {
private fun uriToMultipartBodyPart(
uri: Uri,
paramName: String,
tempFiles: MutableList<File>
): MultipartBody.Part? {
return try {
// MIME 타입 확인
val mimeType = context.contentResolver.getType(uri) ?: "image/jpeg"
Expand All @@ -105,21 +109,21 @@ class FeedRepository @Inject constructor(
"image/jpeg", "image/jpg" -> "jpg"
else -> "jpg" // 기본값
}

// 파일명 생성
val fileName = "feed_image_${System.currentTimeMillis()}.$extension"
val tempFile = File(context.cacheDir, fileName)

// 임시 파일 목록에 추가
tempFiles.add(tempFile)

// InputStream을 use 블록으로 안전하게 관리
context.contentResolver.openInputStream(uri)?.use { inputStream ->
FileOutputStream(tempFile).use { outputStream ->
inputStream.copyTo(outputStream)
}
} ?: return null

// MultipartBody.Part 생성
val requestFile = tempFile.asRequestBody(mimeType.toMediaType())
MultipartBody.Part.createFormData(paramName, fileName, requestFile)
Expand All @@ -141,4 +145,16 @@ class FeedRepository @Inject constructor(
}
}
}

suspend fun getFeedUsersInfo(userId: Long) = runCatching {
feedService.getFeedUsersInfo(userId)
.handleBaseResponse()
.getOrThrow()
}

suspend fun getFeedUsers(userId: Long) = runCatching {
feedService.getFeedUsers(userId)
.handleBaseResponse()
.getOrThrow()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import com.texthip.thip.data.model.rooms.request.CreateRoomRequest
import com.texthip.thip.data.model.rooms.request.RoomJoinRequest
import com.texthip.thip.data.model.rooms.request.RoomSecretRoomRequest
import com.texthip.thip.data.model.rooms.request.RoomsCreateVoteRequest
import com.texthip.thip.data.model.rooms.request.RoomsDailyGreetingRequest
import com.texthip.thip.data.model.rooms.request.RoomsPostsLikesRequest
import com.texthip.thip.data.model.rooms.request.RoomsRecordRequest
import com.texthip.thip.data.model.rooms.request.RoomsVoteRequest
Expand Down Expand Up @@ -223,6 +224,16 @@ class RoomsRepository @Inject constructor(
).handleBaseResponse().getOrThrow()
}

suspend fun deleteRoomsVote(
roomId: Int,
voteId: Int
) = runCatching {
roomsService.deleteRoomsVote(
roomId = roomId,
voteId = voteId
).handleBaseResponse().getOrThrow()
}

suspend fun postRoomsPostsLikes(
postId: Int,
type: Boolean,
Expand All @@ -236,4 +247,26 @@ class RoomsRepository @Inject constructor(
)
).handleBaseResponse().getOrThrow()
}

suspend fun postRoomsDailyGreeting(
roomId: Int,
content: String
) = runCatching {
roomsService.postRoomsDailyGreeting(
roomId = roomId,
request = RoomsDailyGreetingRequest(
content = content
)
).handleBaseResponse().getOrThrow()
}

suspend fun getRoomsRecordsPin(
roomId: Int,
recordId: Int
) = runCatching {
roomsService.getRoomsRecordsPin(
roomId = roomId,
recordId = recordId
).handleBaseResponse().getOrThrow()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ package com.texthip.thip.data.repository

import com.texthip.thip.data.model.base.handleBaseResponse
import com.texthip.thip.data.model.users.request.FollowRequest
import com.texthip.thip.data.model.users.response.MyFollowingsResponse
import com.texthip.thip.data.model.users.response.MyPageInfoResponse
import com.texthip.thip.data.model.users.request.NicknameRequest
import com.texthip.thip.data.model.users.response.AliasChoiceResponse
import com.texthip.thip.data.model.users.response.FollowResponse
import com.texthip.thip.data.model.users.response.MyRecentFollowingsResponse
import com.texthip.thip.data.model.users.response.MyFollowingsResponse
import com.texthip.thip.data.model.users.response.MyPageInfoResponse
import com.texthip.thip.data.model.users.response.NicknameResponse
import com.texthip.thip.data.model.users.response.OthersFollowersResponse
import com.texthip.thip.data.service.UserService
Expand All @@ -28,8 +27,8 @@ class UserRepository @Inject constructor(
.getOrThrow()
}

suspend fun getRecentWriters(): Result<MyRecentFollowingsResponse?> = runCatching {
userService.getRecentWriters()
suspend fun getMyFollowingsRecentFeeds() = runCatching {
userService.getMyFollowingsRecentFeeds()
.handleBaseResponse()
.getOrThrow()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ import com.texthip.thip.data.model.base.BaseResponse
import com.texthip.thip.data.model.comments.request.CommentsCreateRequest
import com.texthip.thip.data.model.comments.request.CommentsLikesRequest
import com.texthip.thip.data.model.comments.response.CommentsCreateResponse
import com.texthip.thip.data.model.comments.response.CommentsDeleteResponse
import com.texthip.thip.data.model.comments.response.CommentsLikesResponse
import com.texthip.thip.data.model.comments.response.CommentsResponse
import retrofit2.http.Body
import retrofit2.http.DELETE
import retrofit2.http.GET
import retrofit2.http.POST
import retrofit2.http.Path
Expand All @@ -31,4 +33,9 @@ interface CommentsService {
@Path("postId") postId: Long,
@Body request: CommentsCreateRequest
): BaseResponse<CommentsCreateResponse>

@DELETE("comments/{commentId}")
suspend fun deleteComment(
@Path("commentId") commentId: Long
): BaseResponse<CommentsDeleteResponse>
}
Loading