Skip to content

Commit

Permalink
Merge pull request #170 from PawWithU/qc/qa-1
Browse files Browse the repository at this point in the history
qc/qa-1:  1차 QA 반영#2
  • Loading branch information
kang9366 authored Jun 11, 2024
2 parents f7cf084 + 7665560 commit 1a49b55
Show file tree
Hide file tree
Showing 118 changed files with 2,782 additions and 765 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
package com.kusitms.connectdog.core.data.api

import com.kusitms.connectdog.core.data.api.model.AdditionalAuthBody
import com.kusitms.connectdog.core.data.api.model.DeleteAccountResponse
import com.kusitms.connectdog.core.data.api.model.AuthDto
import com.kusitms.connectdog.core.data.api.model.EmailDto
import com.kusitms.connectdog.core.data.api.model.FcmTokenRequestBody
import com.kusitms.connectdog.core.data.api.model.IsDuplicateNicknameResponse
import com.kusitms.connectdog.core.data.api.model.IsDuplicatePhoneNumberBody
import com.kusitms.connectdog.core.data.api.model.IsDuplicatePhoneNumberResponse
import com.kusitms.connectdog.core.data.api.model.LoginResponseItem
import com.kusitms.connectdog.core.data.api.model.MyInfoResponseItem
import com.kusitms.connectdog.core.data.api.model.NormalLoginBody
import com.kusitms.connectdog.core.data.api.model.PhoneDto
import com.kusitms.connectdog.core.data.api.model.Response
import com.kusitms.connectdog.core.data.api.model.ReviewResponseItem
import com.kusitms.connectdog.core.data.api.model.SocialLoginBody
import com.kusitms.connectdog.core.data.api.model.VolunteerResponse
import com.kusitms.connectdog.core.data.api.model.intermediator.IntermediatorInfoResponseItem
Expand All @@ -23,14 +24,18 @@ import com.kusitms.connectdog.core.data.api.model.volunteer.ApplyBody
import com.kusitms.connectdog.core.data.api.model.volunteer.BadgeResponse
import com.kusitms.connectdog.core.data.api.model.volunteer.BasicInformationResponse
import com.kusitms.connectdog.core.data.api.model.volunteer.BookmarkResponseItem
import com.kusitms.connectdog.core.data.api.model.volunteer.EmailAuthDto
import com.kusitms.connectdog.core.data.api.model.volunteer.EmailCertificationBody
import com.kusitms.connectdog.core.data.api.model.volunteer.EmailCertificationResponseItem
import com.kusitms.connectdog.core.data.api.model.volunteer.IsDuplicateNicknameBody
import com.kusitms.connectdog.core.data.api.model.volunteer.NormalVolunteerSignUpBody
import com.kusitms.connectdog.core.data.api.model.volunteer.NoticeDetailResponseItem
import com.kusitms.connectdog.core.data.api.model.volunteer.PasswordCheckResponse
import com.kusitms.connectdog.core.data.api.model.volunteer.PasswordDto
import com.kusitms.connectdog.core.data.api.model.volunteer.ReviewDetailResponse
import com.kusitms.connectdog.core.data.api.model.volunteer.ReviewDetailWithId
import com.kusitms.connectdog.core.data.api.model.volunteer.SocialVolunteerSignUpBody
import com.kusitms.connectdog.core.data.api.model.volunteer.UserInfoResponse
import com.kusitms.connectdog.core.data.api.model.volunteer.VolunteerAccountInfo
import okhttp3.MultipartBody
import okhttp3.RequestBody
import retrofit2.http.Body
Expand Down Expand Up @@ -71,7 +76,7 @@ internal interface ApiService {
suspend fun getReviewsHome(
@Query("page") page: Int,
@Query("size") size: Int
): List<ReviewDetailResponse>
): List<ReviewDetailWithId>

/**
* 회원가입
Expand All @@ -84,7 +89,7 @@ internal interface ApiService {
@POST("/volunteers/sign-up/email")
suspend fun postEmail(
@Body emailCertificationBody: EmailCertificationBody
): EmailCertificationResponseItem
): AuthDto

@POST("/volunteers/sign-up")
suspend fun postNormalVolunteerSignUp(
Expand Down Expand Up @@ -157,7 +162,12 @@ internal interface ApiService {
@Body socialLoginBody: SocialLoginBody
): LoginResponseItem

/**
@POST("/volunteers/search/send-email")
suspend fun volunteerPasswordSearchAuth(
@Body body: EmailDto
): EmailAuthDto

/**s
* 이동봉사자 > 마이페이지
*/
@GET("/volunteers/my/info")
Expand All @@ -172,9 +182,6 @@ internal interface ApiService {
@GET("/volunteers/my/bookmarks")
suspend fun getBookmarkData(): List<BookmarkResponseItem>

@DELETE("/volunteers/my/delete")
suspend fun deleteAccount(): DeleteAccountResponse

@PATCH("/volunteers/my/profile")
suspend fun updateUserInfo(
@Body userInfo: UserInfoResponse
Expand Down Expand Up @@ -239,7 +246,7 @@ internal interface ApiService {
@Path("intermediaryId") intermediaryId: Long,
@Query("page") page: Int?,
@Query("size") size: Int?
): List<ReviewResponseItem>
): List<ReviewDetailResponse>

@Multipart
@POST("/volunteers/posts/{postId}/reviews")
Expand All @@ -249,11 +256,35 @@ internal interface ApiService {
@Part files: List<MultipartBody.Part>
)

@POST("/volunteers/password/check")
suspend fun checkVolunteerPassword(
@Body password: PasswordDto
): PasswordCheckResponse

@PATCH("/volunteers/password")
suspend fun changeVolunteerPassword(
@Body password: PasswordDto
)

@DELETE("/volunteers/my")
suspend fun volunteerWithdraw()

/**
* fcm
*/
@POST("/volunteers/fcm")
suspend fun postFcmToken(
@Body fcmToken: FcmTokenRequestBody
)

@PATCH("/volunteers/notifications/setting")
suspend fun patchNotification()

@GET("/volunteers/setting/my/info")
suspend fun getVolunteerAccountInfo(): VolunteerAccountInfo

@POST("/volunteers/search/email")
suspend fun volunteerEmailSearch(
@Body body: PhoneDto
): EmailDto
}
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
package com.kusitms.connectdog.core.data.api

import com.kusitms.connectdog.core.data.api.model.EmailDto
import com.kusitms.connectdog.core.data.api.model.FcmTokenRequestBody
import com.kusitms.connectdog.core.data.api.model.IsDuplicatePhoneNumberBody
import com.kusitms.connectdog.core.data.api.model.IsDuplicatePhoneNumberResponse
import com.kusitms.connectdog.core.data.api.model.PhoneDto
import com.kusitms.connectdog.core.data.api.model.Response
import com.kusitms.connectdog.core.data.api.model.ReviewResponseItem
import com.kusitms.connectdog.core.data.api.model.VolunteerResponse
import com.kusitms.connectdog.core.data.api.model.intermediator.DuplicateDto
import com.kusitms.connectdog.core.data.api.model.intermediator.InterAnnouncementDetailResponse
import com.kusitms.connectdog.core.data.api.model.intermediator.InterApplicationCompletedResponseItem
import com.kusitms.connectdog.core.data.api.model.intermediator.InterApplicationInProgressResponseItem
import com.kusitms.connectdog.core.data.api.model.intermediator.InterApplicationRecruitingResponseItem
import com.kusitms.connectdog.core.data.api.model.intermediator.InterApplicationWaitingResponseItem
import com.kusitms.connectdog.core.data.api.model.intermediator.InterProfileFindingResponseItem
import com.kusitms.connectdog.core.data.api.model.intermediator.InterProfileInfoResponse
import com.kusitms.connectdog.core.data.api.model.intermediator.IntermediatorAccountInfo
import com.kusitms.connectdog.core.data.api.model.intermediator.IntermediatorProfileInfoResponseItem
import com.kusitms.connectdog.core.data.api.model.intermediator.NameDto
import com.kusitms.connectdog.core.data.api.model.volunteer.EmailAuthDto
import com.kusitms.connectdog.core.data.api.model.volunteer.PasswordCheckResponse
import com.kusitms.connectdog.core.data.api.model.volunteer.PasswordDto
import com.kusitms.connectdog.core.data.api.model.volunteer.ReviewDetailResponse
import okhttp3.MultipartBody
import okhttp3.RequestBody
Expand Down Expand Up @@ -44,6 +51,21 @@ internal interface InterApiService {
@Body body: IsDuplicatePhoneNumberBody
): IsDuplicatePhoneNumberResponse

@POST("/intermediaries/name/isDuplicated")
suspend fun checkIsDuplicateName(
@Body body: NameDto
): DuplicateDto

@POST("/intermediaries/password/check")
suspend fun checkInterPassword(
@Body body: PasswordDto
): PasswordCheckResponse

@PATCH("/intermediaries/password")
suspend fun changeInterPassword(
@Body body: PasswordDto
)

/**
* 봉사관리
*/
Expand Down Expand Up @@ -114,7 +136,7 @@ internal interface InterApiService {
suspend fun getIntermediatorReview(
@Query("page") page: Int?,
@Query("size") size: Int?
): List<ReviewResponseItem>
): List<ReviewDetailResponse>

@GET("/intermediaries/posts/recruiting")
suspend fun getFindingApplication(
Expand All @@ -132,10 +154,29 @@ internal interface InterApiService {
@Body fcmToken: FcmTokenRequestBody
)

@PATCH("/intermediaries/notifications/setting")
suspend fun patchNotification()

@POST("/intermediaries/search/send-email")
suspend fun interPasswordSearchAuth(
@Body body: EmailDto
): EmailAuthDto

@Multipart
@POST("/intermediaries/posts")
suspend fun postApplication(
@Part("request") json: RequestBody,
@Part files: List<MultipartBody.Part>
)

@GET("/intermediaries/setting/my/info")
suspend fun getInterAccountInfo(): IntermediatorAccountInfo

@DELETE("/intermediaries/my")
suspend fun interWithdraw()

@POST("/intermediaries/search/email")
suspend fun interEmailSearch(
@Body body: PhoneDto
): EmailDto
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.kusitms.connectdog.core.data.api.model

data class AuthDto(
val authCode: String
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.kusitms.connectdog.core.data.api.model

data class EmailDto(
val email: String
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.kusitms.connectdog.core.data.api.model

data class PhoneDto(
val phone: String
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.kusitms.connectdog.core.data.api.model.intermediator

data class DuplicateDto(
val isDuplicated: Boolean
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.kusitms.connectdog.core.data.api.model.intermediator

data class IntermediatorAccountInfo(
val realName: String,
val phone: String,
val email: String
)
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ data class IntermediatorProfileInfoResponseItem(
val completedCount: Long,
val intermediaryName: String,
val intro: String,
val profileImage: String,
val profileImage: String?,
val progressingCount: Long,
val recruitingCount: Long,
val waitingCount: Long
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.kusitms.connectdog.core.data.api.model.intermediator

import com.squareup.moshi.JsonClass

@JsonClass(generateAdapter = true)
data class NameDto(
val name: String
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.kusitms.connectdog.core.data.api.model.volunteer

data class EmailAuthDto(
val authCode: String,
val accessToken: String
)

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,6 @@ data class NoticeDetailResponseItem(
val postStatus: String,
val specifics: String?,
val startDate: String
)
) {
val pickUpDate = if (startDate == endDate) "$startDate $pickUpTime" else pickUpTime
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.kusitms.connectdog.core.data.api.model.volunteer

data class PasswordCheckResponse(
val isChecked: Boolean
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.kusitms.connectdog.core.data.api.model.volunteer

data class PasswordDto(
val password: String
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.kusitms.connectdog.core.data.api.model.volunteer

data class ReviewDetailWithId(
val profileImageNum: Int,
val dogName: String,
val volunteerNickname: String,
val createdDate: String,
val mainImage: String,
val images: List<String>,
val content: String,
val postId: Long,
val postMainImage: String,
val startDate: String,
val endDate: String,
val departureLoc: String,
val arrivalLoc: String,
val intermediaryId: Long,
val intermediaryName: String,
val reviewId: Long
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.kusitms.connectdog.core.data.api.model.volunteer

data class VolunteerAccountInfo(
val name: String,
val phone: String,
val socialType: String?,
val email: String?
)
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,11 @@ internal class VolunteerDataModule {

@Provides
@Singleton
fun provideLoginRepository(apiService: ApiService): LoginRepository {
return LoginRepositoryImpl(apiService)
fun provideLoginRepository(
apiService: ApiService,
intermediatorApi: InterApiService
): LoginRepository {
return LoginRepositoryImpl(apiService, intermediatorApi)
}

@Provides
Expand All @@ -55,8 +58,11 @@ internal class VolunteerDataModule {

@Provides
@Singleton
fun provideMyPageRepository(apiService: ApiService): MyPageRepository {
return MyPageRepositoryImpl(apiService)
fun provideMyPageRepository(
apiService: ApiService,
intermediatorApi: InterApiService
): MyPageRepository {
return MyPageRepositoryImpl(apiService, intermediatorApi)
}

@Provides
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.kusitms.connectdog.core.data.mapper

import com.kusitms.connectdog.core.data.api.model.ReviewResponseItem
import com.kusitms.connectdog.core.data.api.model.volunteer.ReviewDetailResponse
import com.kusitms.connectdog.core.data.api.model.volunteer.ReviewDetailWithId
import com.kusitms.connectdog.core.model.Review
import com.kusitms.connectdog.core.util.dateRangeFormat

Expand All @@ -12,7 +13,7 @@ internal fun ReviewResponseItem.toData(): Review {
userName = volunteerNickname,
mainImage = mainImage,
contentImages = images,
date = dateRangeFormat(startDate, endDate),
date = if (startDate == endDate) startDate else dateRangeFormat(startDate, endDate),
location = "$departureLoc$arrivalLoc",
organization = intermediaryName,
content = content
Expand All @@ -34,3 +35,20 @@ fun ReviewDetailResponse.toData(): Review {
postMainImage = postMainImage
)
}

fun ReviewDetailWithId.toData(): Review {
return Review(
profileNum = profileImageNum,
dogName = dogName,
userName = volunteerNickname,
mainImage = mainImage,
contentImages = images,
date = if (startDate == endDate) startDate else dateRangeFormat(startDate, endDate),
location = "$departureLoc$arrivalLoc",
organization = intermediaryName,
content = content,
intermediaryId = intermediaryId,
postMainImage = postMainImage,
reviewId = reviewId
)
}
Loading

0 comments on commit 1a49b55

Please sign in to comment.