Skip to content

Commit

Permalink
Merge pull request #86 from ttoklip/70-feat-우리동네-댓글-좋아요-스크랩-구현
Browse files Browse the repository at this point in the history
feat: 마이페이지 주소 수정 기능, 함께해요 참여자 확인하기 기능 구현
  • Loading branch information
hangunhee39 authored Jul 18, 2024
2 parents f75ca93 + b35432d commit df7cdac
Show file tree
Hide file tree
Showing 84 changed files with 2,716 additions and 1,569 deletions.
26 changes: 5 additions & 21 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@
android:value="a6zjlu88zi" />

<activity
android:name=".presentation.mypage.ManageMyInfoActivity"
android:name=".presentation.mypage.manageinfo.ManageMyInfoActivity"
android:screenOrientation="portrait"
android:exported="false" />
<activity
android:name=".presentation.honeytip.read.ReadHoneyTipActivity"
android:screenOrientation="portrait"
android:exported="false" />
android:exported="true" />
<activity

android:name=".presentation.honeytip.write.WriteHoneyTipActivity"
Expand All @@ -69,7 +69,7 @@
android:screenOrientation="portrait"
android:exported="false" />
<activity
android:name=".presentation.mypage.MyHometownAddressActivity"
android:name=".presentation.mypage.manageinfo.MyHometownAddressActivity"
android:screenOrientation="portrait"
android:exported="false" />
<activity
Expand Down Expand Up @@ -133,11 +133,6 @@
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan"
android:exported="true" />
<activity
android:name=".presentation.hometown.together.write.tradelocation.TradeLocationActivity"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan"
android:exported="false" />

<activity
android:name=".presentation.otheruser.OtherUserActivity"
Expand All @@ -160,22 +155,11 @@
<activity android:name=".presentation.signup.location.DirectLocationActivity"
android:screenOrientation="portrait"
android:exported="false"/>
<activity android:name=".presentation.mypage.manageinfo.MyInfoLocationActivity"/>
<activity android:name=".presentation.signup.fragments.WebviewActivity"
android:screenOrientation="portrait"
android:exported="false"/>
<activity android:name=".presentation.mypage.MyInfoLocationActivity"
android:screenOrientation="portrait"
android:exported="false"/>
<activity
android:name=".presentation.hometown.PlaceActivity"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan"
android:exported="false" />
<activity
android:name=".presentation.hometown.AddressDetailActivity"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan"
android:exported="false" />

<activity
android:name="com.kakao.sdk.auth.AuthCodeHandlerActivity"
android:exported="true">
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/java/com/umc/ttoklip/data/api/HoneyTipApi.kt
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ interface HoneyTipApi {
@Part("title") title: RequestBody,
@Part("content") content: RequestBody,
@Part("category") category: RequestBody,
@Part images: List<MultipartBody.Part?>,
@Part("deleteImageIds") deleteImageIds: RequestBody,
@Part addImages: List<MultipartBody.Part?>,
@Part("url") url: RequestBody
): Response<ResponseBody<CreateHoneyTipResponse>>

Expand Down
7 changes: 5 additions & 2 deletions app/src/main/java/com/umc/ttoklip/data/api/MyPage2Api.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,12 @@ interface MyPage2Api {
@Multipart
@PATCH("/api/v1/my-page/edit")
suspend fun editMyPageInfo(
@Part("street") street: RequestBody,
@Part("nickname") nickname: RequestBody,
@Part("categories") categories: RequestBody,
@Part profileImage: MultipartBody.Part?,
@Part categories:List<MultipartBody.Part>?,
@PartMap params:MutableMap<String,RequestBody>
@Part("independentYear") independentYear: RequestBody,
@Part("independentMonth") independentMonth: RequestBody
): Response<ResponseBody<CreateHoneyTipResponse>>

@GET("/api/v1/privacy/check-nickname")
Expand Down
10 changes: 9 additions & 1 deletion app/src/main/java/com/umc/ttoklip/data/api/NaverApi.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.umc.ttoklip.data.api

import com.umc.ttoklip.data.model.naver.GeocodingResponse
import com.umc.ttoklip.data.model.naver.geocoding.GeocodingResponse
import com.umc.ttoklip.data.model.naver.reversegeocoding.ReverseGeocodingResponse
import retrofit2.Response
import retrofit2.http.GET
import retrofit2.http.Query
Expand All @@ -10,4 +11,11 @@ interface NaverApi {
suspend fun fetchGeocoding(
@Query("query") query: String
): Response<GeocodingResponse>

@GET("map-reversegeocode/v2/gc")
suspend fun getReverseGeocodingInfo(
@Query("coords") coords: String,
@Query("output") output: String,
@Query("orders") orders: String = "addr",
): Response<ReverseGeocodingResponse>
}
6 changes: 6 additions & 0 deletions app/src/main/java/com/umc/ttoklip/data/api/ReadTogetherApi.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import com.umc.ttoklip.data.model.ResponseBody
import com.umc.ttoklip.data.model.StandardResponse
import com.umc.ttoklip.data.model.town.CommentResponse
import com.umc.ttoklip.data.model.town.CreateCommentRequest
import com.umc.ttoklip.data.model.town.ParticipantsResponse
import com.umc.ttoklip.data.model.town.PatchCartStatusRequest
import com.umc.ttoklip.data.model.town.ReportRequest
import com.umc.ttoklip.data.model.town.ViewTogetherResponse
Expand Down Expand Up @@ -71,4 +72,9 @@ interface ReadTogetherApi {
@Path("postId") postId: Long,
@Body request: PatchCartStatusRequest
): Response<ResponseBody<CommonResponse>>

@GET("/api/v1/town/carts/participants/members/{cartId}")
suspend fun fetchParticipants(
@Path("cartId") cartId: Int
): Response<ResponseBody<ParticipantsResponse>>
}
14 changes: 10 additions & 4 deletions app/src/main/java/com/umc/ttoklip/data/api/WriteCommsApi.kt
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
package com.umc.ttoklip.data.api

import com.umc.ttoklip.data.model.ResponseBody
import com.umc.ttoklip.data.model.honeytip.CreateHoneyTipResponse
import com.umc.ttoklip.data.model.town.CreateCommunicationsResponse
import com.umc.ttoklip.data.model.town.EditCommunication
import com.umc.ttoklip.data.model.town.PatchCommunicationResponse
import okhttp3.MultipartBody
import okhttp3.RequestBody
import retrofit2.Response
import retrofit2.http.Body
import retrofit2.http.Multipart
import retrofit2.http.PATCH
import retrofit2.http.POST
Expand All @@ -25,9 +29,11 @@ interface WriteCommsApi {
@Multipart
@PATCH("/api/v1/town/comms/{postId}")
suspend fun patchCommunications(
@Part("title") title: String,
@Part("content") content: String,
@Part images: List<MultipartBody.Part>,
@Path("postId") postId: Long
@Path("postId") postId: Long,
@Part("title") title: RequestBody,
@Part("content") content: RequestBody,
@Part("deleteImageIds") deleteImageIds: RequestBody,
@Part addImages: List<MultipartBody.Part?>,
@Part("url") url: RequestBody
): Response<ResponseBody<PatchCommunicationResponse>>
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ data class EditHoneyTip(
val title: String,
val content: String,
val category: String,
val image: Array<String>,
val image: List<ImageUrl>,
val url: String,
): Serializable
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ package com.umc.ttoklip.data.model.honeytip
import java.io.Serializable

data class ImageUrl(
val imageId: Int,
val imageUrl : String
)
): Serializable
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.umc.ttoklip.data.model.mypage

data class Interest(
val id: Int,
val categoryName: String
)
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ package com.umc.ttoklip.data.model.mypage
data class MyPageInfoResponse(
var street: String?,
var nickname: String,
var profileImage: String?,
var profileImgUrl: String?,
var independentYear: Int,
var independentMonth: Int
var independentMonth: Int,
var interests: List<Interest>
){
constructor(): this(null, "", null, 0, 0)
constructor(): this(null, "", null, 0, 0, emptyList())
}
/*
street": null,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.umc.ttoklip.data.model.naver
package com.umc.ttoklip.data.model.naver.geocoding

data class AddressElements(
val types: List<String>,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.umc.ttoklip.data.model.naver
package com.umc.ttoklip.data.model.naver.geocoding

data class Addresses(
val roadAddress: String,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.umc.ttoklip.data.model.naver
package com.umc.ttoklip.data.model.naver.geocoding

data class GeocodingResponse(
val status: String,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.umc.ttoklip.data.model.naver
package com.umc.ttoklip.data.model.naver.geocoding

data class Meta(
val totalCount: Int,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package kr.ac.tukorea.whereareu.data.model.naver

data class AreaInfo(
val name: String,
val coords:Coords
)

data class Coords(
val center: Center
)

data class Center(
val crs: String,
val x: Float,
val y: Float
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package kr.ac.tukorea.whereareu.data.model.naver

data class Land(
val number1: String,
val number2: String,
val addition0: LandInfo,
val name: String
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package kr.ac.tukorea.whereareu.data.model.naver

data class LandInfo(
val type: String,
val value: String
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package kr.ac.tukorea.whereareu.data.model.naver

data class ReverseGeoCodingResult(
val region: RegionInfo,
val land: Land
)

data class RegionInfo(
val area1: AreaInfo,
val area2: AreaInfo,
val area3: AreaInfo,
val area4: AreaInfo,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.umc.ttoklip.data.model.naver.reversegeocoding

import kr.ac.tukorea.whereareu.data.model.naver.ReverseGeoCodingResult
import kr.ac.tukorea.whereareu.data.model.naver.StatusResult

data class ReverseGeocodingResponse(
val status: StatusResult,
val results: List<ReverseGeoCodingResult>
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package kr.ac.tukorea.whereareu.data.model.naver

data class StatusResult(
val code: Int,
val name: String,
val message: String
)
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import com.umc.ttoklip.presentation.hometown.adapter.Together

data class CommunityRecent3(
val communityId: Int,
val street: String,
var street: String,
val title: String
){
fun toModel()= Together(title,street, communityId,"소통해요")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.umc.ttoklip.data.model.town

import java.io.Serializable

data class EditCommunication(
val postId: Long,
val title: String,
val content: String,
): Serializable
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.umc.ttoklip.data.model.town

data class ImageUrl(
val imageUrl: String
val communityImageId: Int,
val communityImageUrl: String
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.umc.ttoklip.data.model.town

data class Participants(
val nickname: String,
val profileImgUrl: String
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.umc.ttoklip.data.model.town

data class ParticipantsResponse(
val cartMemberResponses: List<Participants>
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.umc.ttoklip.data.model.town

data class TownImageUrl(
val imageUrl: String
)
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ data class ViewTogetherResponse(
val writer: String,
val cartId: Long,
val content: String,
val imageUrls: List<ImageUrl>,
val imageUrls: List<TownImageUrl>,
val title: String,
val writtenTime: String,
val totalPrice: Long,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ interface HoneyTipRepository {
title: RequestBody,
content: RequestBody,
category: RequestBody,
images: List<MultipartBody.Part?>,
deleteImageIds: RequestBody,
addImages: List<MultipartBody.Part?>,
url: RequestBody
): NetworkResult<CreateHoneyTipResponse>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,11 @@ class HoneyTipRepositoryImpl @Inject constructor(
title: RequestBody,
content: RequestBody,
category: RequestBody,
images: List<MultipartBody.Part?>,
deleteImageIds: RequestBody,
addImages: List<MultipartBody.Part?>,
url: RequestBody
): NetworkResult<CreateHoneyTipResponse> {
return handleApi({ api.patchHoneyTip(honeyTipId, title, content, category, images, url) })
return handleApi({ api.patchHoneyTip(honeyTipId, title, content, category, deleteImageIds, addImages, url) })
{ response: ResponseBody<CreateHoneyTipResponse> -> response.result }
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@ import retrofit2.http.Part
interface MyPageRepository2 {
suspend fun getMyPageInfo(): NetworkResult<MyPageInfoResponse>
suspend fun editMyPageInfo(
photo: MultipartBody.Part?,
info: MutableMap<String, RequestBody>, cate: List<MultipartBody.Part>?
street: RequestBody,
nickname: RequestBody,
categories: RequestBody,
profileImage: MultipartBody.Part?,
independentYear: RequestBody,
independentMonth: RequestBody
): NetworkResult<CreateHoneyTipResponse>

suspend fun checkNickname(nick:String): NetworkResult<SignupResponse>
suspend fun checkNickname(nick: String): NetworkResult<SignupResponse>
}
Loading

0 comments on commit df7cdac

Please sign in to comment.