Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
9be6818
[feat]: 프로필 업데이트 요청 dto 생성 (#73)
JJUYAAA Aug 17, 2025
3de2c8a
[feat]: 프로필 업데이트 요청 dto 생성 (#73)
JJUYAAA Aug 17, 2025
74c2074
[feat]: 프로필 업데이트 뷰모델, 서비스 메서드 생성 - 에러 메세지 표시 부분 오류 해결 필요#73)
JJUYAAA Aug 17, 2025
fda6aa1
[feat]: 회원가입 응답, 요청 dto 생성 (#73)
JJUYAAA Aug 18, 2025
4098c6d
[feat]: 회원가입 레포지토리, 서비스 메서드 생성 (#73)
JJUYAAA Aug 18, 2025
5bb468d
[feat]: 회원가입 - 토큰매니저 생성 (#73)
JJUYAAA Aug 18, 2025
65d5f72
[feat]: 회원가입 뷰모델 생성, 닉네임검증/ 칭호선택 뷰모델 주석처리(임시) (#73)
JJUYAAA Aug 18, 2025
c797935
[feat]: 회원가입 관련 스크린 수정 (#73)
JJUYAAA Aug 18, 2025
d116345
[feat]: 회원가입 관련 dto 수정 (#73)
JJUYAAA Aug 18, 2025
767ea08
[feat]: mainactivity 토큰매니저 주입 (#73)
JJUYAAA Aug 18, 2025
1f1e2c1
[feat]: signup 메서드 수정 (#73)
JJUYAAA Aug 18, 2025
33cde28
[feat]: 회원가입 네비게이션 생성 (#73)
JJUYAAA Aug 18, 2025
2f548b1
[feat]: 닉네임, 칭호 선택 뷰모델 삭제 -> 회원가입 뷰모델로 통일 (#73)
JJUYAAA Aug 18, 2025
ad4bafc
[feat]: 사용자 검색 응답 dto 생성 (#73)
JJUYAAA Aug 18, 2025
ce0d299
[feat]: 사용자 검색 메서드 생성 (#73)
JJUYAAA Aug 18, 2025
46a8b35
[feat]: 사용자 검색 뷰모델 생성 (#73)
JJUYAAA Aug 18, 2025
a8efc5b
[feat]: 사용자 검색 화면 screen, content 분리 및 뷰모델 적용 (#73)
JJUYAAA Aug 18, 2025
e318580
[feat]: 프로필 편집 토스트, 뒤로가기 구현 (#73)
JJUYAAA Aug 18, 2025
208818c
[feat]: 고객센터 screen 추가, 네비게이션 연결 (#73)
JJUYAAA Aug 18, 2025
f961f96
[feat]: 사용자 찾기 로직에 사용되는 메서드 추가 (#73)
JJUYAAA Aug 18, 2025
7a4d646
[feat]: 다른 사용자 팔로워 조회 응답 dto (#73)
JJUYAAA Aug 18, 2025
a2884ff
[feat]: MyRecentFollowingsResponse 필드값 수정 + 피드스크린 init 삭제(#73)
JJUYAAA Aug 18, 2025
0e74ef5
Merge branch 'develop' into feat/#73-users_api
JJUYAAA Aug 18, 2025
8592b8c
Merge branch 'develop' into feat/#73-users_api
Nico1eKim Aug 18, 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
1 change: 1 addition & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ dependencies {
implementation(libs.kotlinx.serialization.json)
implementation(libs.coil.compose)
implementation(libs.foundation)
implementation(libs.androidx.datastore.preferences)
testImplementation(libs.junit)
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.espresso.core)
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/java/com/texthip/thip/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,18 @@ import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import com.texthip.thip.data.manager.TokenManager
import com.texthip.thip.ui.theme.ThipTheme
import com.texthip.thip.ui.theme.ThipTheme.colors
import com.texthip.thip.ui.theme.ThipTheme.typography
import dagger.hilt.android.AndroidEntryPoint
import javax.inject.Inject

@AndroidEntryPoint
class MainActivity : ComponentActivity() {
@Inject
lateinit var tokenManager: TokenManager

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
enableEdgeToEdge()
Expand Down
64 changes: 64 additions & 0 deletions app/src/main/java/com/texthip/thip/data/manager/TokenManager.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
package com.texthip.thip.data.manager

import android.content.Context
import androidx.datastore.core.DataStore
import androidx.datastore.preferences.core.Preferences
import androidx.datastore.preferences.core.edit
import androidx.datastore.preferences.core.stringPreferencesKey
import androidx.datastore.preferences.preferencesDataStore
import dagger.hilt.android.qualifiers.ApplicationContext
import kotlinx.coroutines.flow.first
import kotlinx.coroutines.flow.map
import javax.inject.Inject
import javax.inject.Singleton


private val Context.dataStore: DataStore<Preferences> by preferencesDataStore(name = "thip_tokens")

@Singleton
class TokenManager @Inject constructor(
@ApplicationContext private val context: Context
) {
// 저장할 데이터의 Key 정의
companion object {
private val TEMP_TOKEN_KEY = stringPreferencesKey("temp_token")
private val ACCESS_TOKEN_KEY = stringPreferencesKey("access_token")
private val REFRESH_TOKEN_KEY = stringPreferencesKey("refresh_token")
}

// 임시 토큰 저장
suspend fun saveTempToken(token: String) {
context.dataStore.edit { prefs ->
prefs[TEMP_TOKEN_KEY] = token
}
}

// 임시 토큰 읽기
suspend fun getTempToken(): String? {
return context.dataStore.data.map { prefs ->
prefs[TEMP_TOKEN_KEY]
}.first() // Flow에서 첫 번째 값을 한번만 읽어옴
}

// 정식 토큰들(Access, Refresh) 저장
suspend fun saveAccessTokens(accessToken: String, refreshToken: String) {
context.dataStore.edit { prefs ->
prefs[ACCESS_TOKEN_KEY] = accessToken
prefs[REFRESH_TOKEN_KEY] = refreshToken
}
}

// Access Token 읽기 (Flow로 제공하여 토큰 변화를 감지할 수 있게 함)
fun getAccessToken(): kotlinx.coroutines.flow.Flow<String?> {
return context.dataStore.data.map { prefs ->
prefs[ACCESS_TOKEN_KEY]
}
}

// 모든 토큰 삭제 (로그아웃 시)
suspend fun clearTokens() {
context.dataStore.edit { prefs ->
prefs.clear()
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.texthip.thip.data.model.users.request

import kotlinx.serialization.Serializable

@Serializable
data class ProfileUpdateRequest(
val nickname: String?,
val aliasName: String
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.texthip.thip.data.model.users.request

import kotlinx.serialization.Serializable

@Serializable
data class SignupRequest(
val nickname: String,
val aliasName: String
)
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,16 @@ data class FollowingList(
@SerializedName("aliasName") val aliasName: String,
@SerializedName("aliasColor") val aliasColor: String,
@SerializedName("isFollowing") val isFollowing: Boolean
)

@Serializable
data class MyRecentFollowingsResponse(
@SerializedName("myFollowingUsers") val myFollowingUsers: 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
@@ -1,22 +1,22 @@
package com.texthip.thip.data.model.users.response

import com.google.gson.annotations.SerializedName
import kotlinx.serialization.Serializable

@Serializable
data class OthersFollowersResponse(
val followers: List<FollowerList>,
val totalFollowerCount: Int,
val nextCursor: String?,
val isLast: Boolean
@SerializedName("followers") val followers: List<FollowerList>,
@SerializedName("totalFollowerCount") val totalFollowerCount: Int,
@SerializedName("nextCursor") val nextCursor: String?,
@SerializedName("isLast") val isLast: Boolean
)

@Serializable
data class FollowerList(
val userId: Long,
val nickname: String,
val profileImageUrl: String?,
val aliasName: String,
val aliasColor: String,
val followerCount: Int,
)

@SerializedName("userId") val userId: Long,
@SerializedName("nickname") val nickname: String,
@SerializedName("profileImageUrl") val profileImageUrl: String?,
@SerializedName("aliasName") val aliasName: String,
@SerializedName("aliasColor") val aliasColor: String,
@SerializedName("followerCount") val followerCount: Int
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.texthip.thip.data.model.users.response

import com.google.gson.annotations.SerializedName
import kotlinx.serialization.Serializable

@Serializable
data class SignupResponse(
@SerializedName("accessToken") val accessToken: String,
@SerializedName("userId") val userId: Long
)
Comment on lines +6 to +10
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

직렬화 어노테이션 혼용 — 한 가지로 통일 권장

@Serializable(kotlinx)와 @SerializedName(Gson)을 동시에 사용하는 것은 혼동을 야기합니다. 현재 Retrofit 컨버터 구성이 어떤지에 따라 아래 둘 중 하나로 통일하세요.

  • 옵션 A) Gson만 사용 시: @Serializable 제거, Gson만 유지
-package com.texthip.thip.data.model.users.response
-
-import com.google.gson.annotations.SerializedName
-import kotlinx.serialization.Serializable
-
-@Serializable
-data class SignupResponse(
-    @SerializedName("accessToken") val accessToken: String,
-    @SerializedName("userId") val userId: Long
-)
+package com.texthip.thip.data.model.users.response
+
+import com.google.gson.annotations.SerializedName
+
+data class SignupResponse(
+    @SerializedName("accessToken") val accessToken: String,
+    @SerializedName("userId") val userId: Long
+)
  • 옵션 B) Kotlinx Serialization만 사용 시: @SerialName으로 전환, Gson 제거
-package com.texthip.thip.data.model.users.response
-
-import com.google.gson.annotations.SerializedName
-import kotlinx.serialization.Serializable
-
-@Serializable
-data class SignupResponse(
-    @SerializedName("accessToken") val accessToken: String,
-    @SerializedName("userId") val userId: Long
-)
+package com.texthip.thip.data.model.users.response
+
+import kotlinx.serialization.SerialName
+import kotlinx.serialization.Serializable
+
+@Serializable
+data class SignupResponse(
+    @SerialName("accessToken") val accessToken: String,
+    @SerialName("userId") val userId: Long
+)

Retrofit 컨버터 구성 실사용 여부를 아래 스크립트로 확인해 주세요. 결과에 따라 A/B 중 하나를 적용하면 좋습니다.


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== addConverterFactory 사용 위치 ==="
rg -n -C3 --hidden 'addConverterFactory'

echo
echo "=== Gson 컨버터 사용 여부 ==="
rg -n -C3 --hidden 'GsonConverterFactory'

echo
echo "=== Kotlinx 컨버터 사용 여부 ==="
rg -n -C3 --hidden 'kotlinx\.serialization|KotlinxSerializationConverter'

echo
echo "=== 모델 어노테이션 사용 분포 ==="
rg -n --hidden '@Serializable|@SerializedName' app/src/main/java/com/texthip/thip/data/model -C2

Length of output: 943


Kotlinx Serialization 컨버터 사용 중 — @SerialName으로 통일 필요

네트워크 모듈에서 json.asConverterFactory(…)를 통해 GsonConverterFactory 없이 KotlinxSerializationConverter만 설정되어 있으므로, 해당 모델에서 Gson 어노테이션(@SerializedName)을 제거하고 Kotlinx 어노테이션(@SerialName)으로 전환하세요.

적용 위치:

  • app/src/main/java/com/texthip/thip/data/model/users/response/SignupResponse.kt
@@ app/src/main/java/com/texthip/thip/data/model/users/response/SignupResponse.kt
-import com.google.gson.annotations.SerializedName
-import kotlinx.serialization.Serializable
+import kotlinx.serialization.Serializable
+import kotlinx.serialization.SerialName

 @Serializable
 data class SignupResponse(
-    @SerializedName("accessToken") val accessToken: String,
-    @SerializedName("userId") val userId: Long
+    @SerialName("accessToken") val accessToken: String,
+    @SerialName("userId") val userId: Long
 )
📝 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
@Serializable
data class SignupResponse(
@SerializedName("accessToken") val accessToken: String,
@SerializedName("userId") val userId: Long
)
import kotlinx.serialization.Serializable
import kotlinx.serialization.SerialName
@Serializable
data class SignupResponse(
@SerialName("accessToken") val accessToken: String,
@SerialName("userId") val userId: Long
)
🤖 Prompt for AI Agents
In
app/src/main/java/com/texthip/thip/data/model/users/response/SignupResponse.kt
around lines 6 to 10, replace the Gson annotation usages with Kotlinx
Serialization ones: remove @SerializedName and annotate properties with
@SerialName("accessToken") and @SerialName("userId"); ensure the file imports
kotlinx.serialization.SerialName and retains @Serializable on the data class so
the kotlinx serialization converter can map JSON fields correctly.

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

import com.google.gson.annotations.SerializedName
import kotlinx.serialization.Serializable
Comment on lines +3 to +4
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Gson 주석과 kotlinx.serialization 혼용 — 한 가지 직렬화 전략으로 통일 권장.

현재 @serializable(kotlinx)와 @SerializedName(Gson)을 혼용 중입니다. Retrofit에서 GsonConverterFactory와 KotlinxSerializationConverterFactory를 함께 쓰면, 등록 순서에 따라 서로 다른 파서가 선택되어 예기치 않은 동작/버그가 발생할 수 있습니다. 해당 응답 모델을 Kotlinx로 사용할 계획이라면 @SerialName으로 통일하고 Gson 주석과 import를 제거해주세요. 반대로 Gson을 쓸 계획이면 @serializable를 제거하세요.

권장 변경(Kotlinx로 통일 시):

-import com.google.gson.annotations.SerializedName
+import kotlinx.serialization.SerialName
 import kotlinx.serialization.Serializable
 @Serializable
 data class UserItem(
-    @SerializedName("userId") val userId: Int,
-    @SerializedName("nickname") val nickname: String,
-    @SerializedName("profileImageUrl") val profileImageUrl: String?,
-    @SerializedName("aliasName") val aliasName: String,
-    @SerializedName("aliasColor") val aliasColor: String,
-    @SerializedName("followerCount") val followerCount: Int
+    @SerialName("userId") val userId: Long,
+    @SerialName("nickname") val nickname: String,
+    @SerialName("profileImageUrl") val profileImageUrl: String?,
+    @SerialName("aliasName") val aliasName: String,
+    @SerialName("aliasColor") val aliasColor: String,
+    @SerialName("followerCount") val followerCount: Int
 )

Retrofit 구성 시 ConverterFactory 순서도 확인이 필요합니다(Gson 제거 또는 Kotlinx 우선 등록).

📝 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
import com.google.gson.annotations.SerializedName
import kotlinx.serialization.Serializable
// app/src/main/java/com/texthip/thip/data/model/users/response/UserSearchResponse.kt
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
@Serializable
data class UserItem(
@SerialName("userId") val userId: Long,
@SerialName("nickname") val nickname: String,
@SerialName("profileImageUrl") val profileImageUrl: String?,
@SerialName("aliasName") val aliasName: String,
@SerialName("aliasColor") val aliasColor: String,
@SerialName("followerCount") val followerCount: Int
)
🤖 Prompt for AI Agents
In
app/src/main/java/com/texthip/thip/data/model/users/response/UserSearchResponse.kt
around lines 3-4, the file mixes Gson (@SerializedName) and
kotlinx.serialization (@Serializable) annotations causing ambiguous parser
selection; standardize to kotlinx.serialization by removing the Gson import and
any @SerializedName usages, replace them with @SerialName where needed, keep
@Serializable on the data class, and then verify Retrofit converter registration
removes GsonConverterFactory or registers the kotlinx converter with higher
priority.


@Serializable
data class UserSearchResponse(
val userList: List<UserItem>
)
@Serializable
data class UserItem(
@SerializedName("userId") val userId: Int,
@SerializedName("nickname") val nickname: String,
@SerializedName("profileImageUrl") val profileImageUrl: String?,
@SerializedName("aliasName") val aliasName: String,
@SerializedName("aliasColor") val aliasColor: String,
@SerializedName("followerCount") val followerCount: Int
)
Comment on lines +12 to +18
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🛠️ Refactor suggestion

🧩 Analysis chain

userId 타입 불일치(Int vs Long) — 도메인 전반 Long으로 일원화 권장.

SignupResponse에서 userId: Long으로 정의된 반면, 여기서는 Int입니다. 사용자 식별자는 장기적으로 Int 범위를 초과할 가능성이 있고, 타입 혼재는 변환/비교 시 미묘한 버그를 유발합니다. 전역적으로 Long으로 통일하는 것을 권장합니다.

다음 스크립트로 userId 타입 불일치 지점을 점검할 수 있습니다:


🏁 Script executed:

#!/bin/bash
# userId 타입 선언 위치와 사용처 탐색
rg -n -C2 -P 'data\s+class\s+\w+\s*\(.*\buserId:\s*(Int|Long)' app | sed 's/^/DECL: /'
rg -n -C2 -P '\buserId\s*:\s*(Int|Long)\b' app | sed 's/^/TYPE: /'
rg -n -C2 -P '\buserId\b' app/src/main/java | sed 's/^/USE: /'

Length of output: 44260


userId 타입 불일치(Int vs Long) — 도메인 전반 Long으로 통일 필요

현재 아래 모델 및 DTO에서 userIdInt로 정의되어 있지만, 다른 곳은 모두 Long을 사용하고 있어 타입 혼재로 인한 변환·비교 버그 위험과 향후 32비트 범위 초과 가능성이 있습니다. 전역적으로 Long으로 일원화해 주세요.

수정이 필요한 주요 파일:

  • app/src/main/java/com/texthip/thip/data/model/users/response/UserSearchResponse.kt
  • app/src/main/java/com/texthip/thip/data/model/rooms/response/RoomsUsersResponse.kt
  • app/src/main/java/com/texthip/thip/data/model/rooms/response/RoomsPostsResponse.kt

(필요 시 테스트·모킹용 클래스에서도 userId: IntuserId: Long으로 변경)

예시:

 data class UserItem(
-    @SerializedName("userId") val userId: Int,
+    @SerializedName("userId") val userId: Long,
     @SerializedName("nickname") val nickname: String,
     ...
 )

— 변경 후 앱 전반의 사용자 식별자 타입이 일관된지, 호출부·뷰모델에서 Long으로 사용되는지 확인해 주세요.

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

Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
package com.texthip.thip.data.repository

import com.texthip.thip.data.manager.TokenManager
import com.texthip.thip.data.model.base.handleBaseResponse
import com.texthip.thip.data.model.users.request.FollowRequest
import com.texthip.thip.data.model.users.request.NicknameRequest
import com.texthip.thip.data.model.users.request.ProfileUpdateRequest
import com.texthip.thip.data.model.users.request.SignupRequest
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.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.model.users.response.SignupResponse
import com.texthip.thip.data.model.users.response.UserSearchResponse
import com.texthip.thip.data.service.UserService
import javax.inject.Inject
import javax.inject.Singleton

@Singleton
class UserRepository @Inject constructor(
private val userService: UserService
private val userService: UserService,
private val tokenManager: TokenManager
) {
//내 팔로잉 목록 조회
suspend fun getMyFollowings(
Expand Down Expand Up @@ -72,4 +78,32 @@ class UserRepository @Inject constructor(
.handleBaseResponse()
.getOrThrow()
}

suspend fun updateProfile(request: ProfileUpdateRequest): Result<Unit?> = runCatching {
userService.updateProfile(request)
.handleBaseResponse()
.getOrThrow()
}

suspend fun signup(request: SignupRequest): Result<SignupResponse?> {
val tempToken = tokenManager.getTempToken()

if (tempToken.isNullOrBlank()) {
return Result.failure(Exception("임시 토큰이 없습니다. 로그인을 다시 시도해주세요."))
}
return runCatching {
userService.signup("Bearer $tempToken", request)
.handleBaseResponse()
.getOrThrow()
}
}

suspend fun searchUsers(
keyword: String,
isFinalized: Boolean
): Result<UserSearchResponse?> = runCatching {
userService.searchUsers(isFinalized = isFinalized, keyword = keyword)
.handleBaseResponse()
.getOrThrow()
}
}
25 changes: 25 additions & 0 deletions app/src/main/java/com/texthip/thip/data/service/UserService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,21 @@ package com.texthip.thip.data.service
import com.texthip.thip.data.model.base.BaseResponse
import com.texthip.thip.data.model.users.request.FollowRequest
import com.texthip.thip.data.model.users.request.NicknameRequest
import com.texthip.thip.data.model.users.request.ProfileUpdateRequest
import com.texthip.thip.data.model.users.request.SignupRequest
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.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.model.users.response.SignupResponse
import com.texthip.thip.data.model.users.response.UserSearchResponse
import com.texthip.thip.data.model.users.response.UsersMyFollowingsRecentFeedsResponse
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.Header
import retrofit2.http.PATCH
import retrofit2.http.POST
import retrofit2.http.Path
import retrofit2.http.Query
Expand Down Expand Up @@ -49,4 +55,23 @@ interface UserService {
@Path("followingUserId") followingUserId: Long,
@Body request: FollowRequest
): BaseResponse<FollowResponse>

@PATCH("users")
suspend fun updateProfile(
@Body request: ProfileUpdateRequest
): BaseResponse<Unit>

@POST("users/signup")
suspend fun signup(
@Header("Authorization") tempToken: String,
@Body request: SignupRequest
): BaseResponse<SignupResponse>

@GET("users")
suspend fun searchUsers(
@Query("isFinalized") isFinalized: Boolean,
@Query("keyword") keyword: String,
@Query("size") size: Int = 30
): BaseResponse<UserSearchResponse>

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package com.texthip.thip.ui.feed.mock

import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.painter.Painter
import com.texthip.thip.data.model.users.response.UserItem
import com.texthip.thip.utils.color.hexToColor

data class MySubscriptionData(
val profileImageUrl: String? = null,
Expand All @@ -11,3 +13,14 @@ data class MySubscriptionData(
val subscriberCount: Int = 0,
var isSubscribed: Boolean = true
)

fun UserItem.toMySubscriptionData(): MySubscriptionData {
return MySubscriptionData(
profileImageUrl = this.profileImageUrl,
nickname = this.nickname,
role = this.aliasName,
roleColor = hexToColor(this.aliasColor),
subscriberCount = this.followerCount,
isSubscribed = false // API 응답에 구독 여부 정보가 없음
)
}
Loading