Skip to content

Commit fa3880f

Browse files
authored
Merge pull request #36 from YAPP-Github/feature/NDGL-118
[NDGL-118] 내 여행 관련 API 연동
2 parents 81bbc6f + 1e71e68 commit fa3880f

40 files changed

Lines changed: 809 additions & 330 deletions

core/ui/src/main/java/com/yapp/ndgl/core/ui/designsystem/NDGLInputModal.kt

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -57,24 +57,14 @@ fun NDGLInputModal(
5757
textAlign: TextAlign = TextAlign.Start,
5858
) {
5959
val focusRequester = remember { FocusRequester() }
60-
var textFieldValue by remember(value) {
60+
var textFieldValue by remember {
6161
mutableStateOf(TextFieldValue(value, selection = TextRange(value.length)))
6262
}
6363

6464
LaunchedEffect(Unit) {
6565
focusRequester.requestFocus()
6666
}
6767

68-
// value가 변경되면 textFieldValue 업데이트
69-
LaunchedEffect(value) {
70-
if (textFieldValue.text != value) {
71-
textFieldValue = TextFieldValue(
72-
text = value,
73-
selection = TextRange(value.length),
74-
)
75-
}
76-
}
77-
7868
Dialog(onDismissRequest = onDismissRequest) {
7969
Surface(
8070
modifier = modifier.wrapContentHeight(),

core/ui/src/main/res/drawable/ic_140_no_schedule_calendar.xml renamed to core/ui/src/main/res/drawable/img_no_schedule_calendar.xml

File renamed without changes.
File renamed without changes.

core/ui/src/main/res/values/strings.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,12 @@
6262
<string name="start_time_setting">여행 시작 시간 설정</string>
6363
<string name="edit_travel">편집하기</string>
6464
<string name="edit_done">편집 완료</string>
65-
<string name="add_schedule">일정 추가하기</string>
65+
<string name="add_schedule_button_text">일정 추가하기</string>
6666
<string name="select_all">전체 선택</string>
6767
<string name="delete_selected">선택 삭제</string>
68-
<string name="no_schedule_message">아직 %d일차 일정이 없어요</string>
68+
<string name="no_schedule_message">일정이 없어요</string>
69+
<string name="no_schedule_message_detail">아직 %d일차 일정이 없어요</string>
70+
<string name="add_schedule_button_text_no_schedule">%d일차 첫 일정 추가하기</string>
6971

7072
<!-- Dialog - Cancel Edit -->
7173
<string name="cancel_edit_dialog_title">편집 중단</string>

data/travel/src/main/java/com/yapp/ndgl/data/travel/api/UserTravelApi.kt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
package com.yapp.ndgl.data.travel.api
22

33
import com.yapp.ndgl.data.core.model.BaseResponse
4+
import com.yapp.ndgl.data.travel.model.AddItineraryRequest
5+
import com.yapp.ndgl.data.travel.model.AddItineraryResponse
46
import com.yapp.ndgl.data.travel.model.BulkUpdateStartTimeRequest
57
import com.yapp.ndgl.data.travel.model.UpcomingTravelList
68
import com.yapp.ndgl.data.travel.model.UpcomingTravelResponse
79
import com.yapp.ndgl.data.travel.model.UpdateItineraryRequest
10+
import com.yapp.ndgl.data.travel.model.UpdateTravelPlaceRequest
811
import com.yapp.ndgl.data.travel.model.UserTravelTemplateContentInfo
912
import com.yapp.ndgl.data.travel.model.UserTravelTemplateItinerary
1013
import retrofit2.http.Body
1114
import retrofit2.http.GET
1215
import retrofit2.http.PATCH
16+
import retrofit2.http.POST
1317
import retrofit2.http.PUT
1418
import retrofit2.http.Path
1519
import retrofit2.http.Query
@@ -41,6 +45,19 @@ interface UserTravelApi {
4145
@Body request: BulkUpdateStartTimeRequest,
4246
): BaseResponse<Unit>
4347

48+
@PATCH("/api/v1/travels/{id}/itinerary/{userTravelPlaceId}")
49+
suspend fun updateTravelPlace(
50+
@Path("id") id: Long,
51+
@Path("userTravelPlaceId") userTravelPlaceId: Long,
52+
@Body request: UpdateTravelPlaceRequest,
53+
): BaseResponse<Unit>
54+
55+
@POST("/api/v1/travels/{id}/itinerary")
56+
suspend fun addItinerary(
57+
@Path("id") id: Long,
58+
@Body request: AddItineraryRequest,
59+
): BaseResponse<AddItineraryResponse>
60+
4461
@PUT("/api/v1/travels/{id}/itinerary")
4562
suspend fun updateItinerary(
4663
@Path("id") id: Long,
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package com.yapp.ndgl.data.travel.model
2+
3+
import kotlinx.serialization.SerialName
4+
import kotlinx.serialization.Serializable
5+
6+
@Serializable
7+
data class AddItineraryRequest(
8+
val googlePlaceId: String,
9+
val day: Int,
10+
val sequence: Int,
11+
val startTime: String? = null,
12+
val estimatedDuration: Int,
13+
val memo: String? = null,
14+
@SerialName("budget")
15+
val cost: Int? = null,
16+
val distanceKm: Double? = null,
17+
val transportation: List<TransportationItem>? = null,
18+
)
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
package com.yapp.ndgl.data.travel.model
2+
3+
import kotlinx.serialization.SerialName
4+
import kotlinx.serialization.Serializable
5+
6+
@Serializable
7+
data class AddItineraryResponse(
8+
val id: Long,
9+
val day: Int,
10+
val sequence: Int,
11+
val startTime: String? = null,
12+
val estimatedDuration: Int,
13+
val memo: String? = null,
14+
@SerialName("budget")
15+
val cost: Int? = null,
16+
val distanceKm: Double? = null,
17+
val transportation: List<Transportation>? = null,
18+
val travelerTips: List<String>? = null,
19+
val planB: List<PlanBPlace>? = null,
20+
val place: ItineraryPlace,
21+
) {
22+
@Serializable
23+
data class Transportation(
24+
val mode: TransportCategory,
25+
val timeMin: Int,
26+
)
27+
28+
@Serializable
29+
data class PlanBPlace(
30+
val googlePlaceId: String,
31+
val name: String,
32+
val thumbnail: String? = null,
33+
val category: PlaceCategory,
34+
)
35+
36+
@Serializable
37+
data class ItineraryPlace(
38+
val googlePlaceId: String,
39+
val thumbnail: String? = null,
40+
val latitude: Double,
41+
val longitude: Double,
42+
val name: String,
43+
val regularOpeningHours: String? = null,
44+
val googleMapsUri: String? = null,
45+
val category: PlaceCategory,
46+
val priceRange: String? = null,
47+
)
48+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package com.yapp.ndgl.data.travel.model
2+
3+
data class ChangePlaceEvent(
4+
val travelId: Long,
5+
val itineraryId: Long,
6+
val day: Int,
7+
val oldGooglePlaceId: String,
8+
val newGooglePlaceId: String,
9+
)
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package com.yapp.ndgl.data.travel.model
2+
3+
import kotlinx.serialization.Serializable
4+
5+
@Serializable
6+
data class TransportationItem(
7+
val mode: TransportCategory,
8+
val timeMin: Int,
9+
)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package com.yapp.ndgl.data.travel.model
2+
3+
data class TravelCreatedEvent(
4+
val userTravelId: Long,
5+
val templateId: Long,
6+
)

0 commit comments

Comments
 (0)