Skip to content

Commit

Permalink
Hotfix : fix some apiService according to new api doc and recover wro…
Browse files Browse the repository at this point in the history
…ng delete
  • Loading branch information
ksh-g001 committed Aug 7, 2024
1 parent b529b1b commit d6879c6
Show file tree
Hide file tree
Showing 18 changed files with 69 additions and 44 deletions.
37 changes: 19 additions & 18 deletions android/HowAboutTrip/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ android {
versionCode = 1
versionName = "1.0"

buildFeatures{
buildFeatures {
dataBinding = true
buildConfig = true
}
Expand All @@ -33,13 +33,14 @@ android {
resValue("string", "GOOGLE_MAP_API_KEY", getApiKey("google_map_api_key"))
resValue("string", "GOOGLE_PLACE_API_KEY", getApiKey("google_place_api_key"))

buildConfigField("String", "ERROR_IMAGE_URl", getApiKey("error_image_url"))
buildConfigField("String", "ERROR_IMAGE_URL", getApiKey("ERROR_IMAGE_URL"))
buildConfigField("String", "GOOGLE_OAUTH_ID", getApiKey("google_oauth_id"))
buildConfigField("String", "GOOGLE_MAP_API_KEY", getApiKey("google_map_api_key"))
buildConfigField("String", "GOOGLE_PLACE_API_KEY", getApiKey("google_place_api_key"))
buildConfigField("String", "GOOGLE_SERVER_ID", getApiKey("google_server_id"))
buildConfigField("String", "API_SERVER", getApiKey("api_server"))
buildConfigField("String", "TEMPORARY_IMAGE_URL", getApiKey("temporary_image_url"))
buildConfigField("String", "ERROR_IMAGE_URL", getApiKey("ERROR_IMAGE_URL"))
buildConfigField("String", "USER_AGENT", getApiKey("user_agent"))
}

Expand All @@ -61,31 +62,31 @@ android {
}
}

fun getApiKey(propertyKey: String):String = gradleLocalProperties(rootDir, providers).getProperty(propertyKey)
fun getApiKey(propertyKey: String): String = gradleLocalProperties(rootDir, providers).getProperty(propertyKey)

dependencies {

implementation ("org.jetbrains.kotlin:kotlin-stdlib:1.9.23")
implementation("org.jetbrains.kotlin:kotlin-stdlib:1.9.23")
implementation("androidx.core:core-ktx:1.13.1")
implementation("androidx.appcompat:appcompat:1.7.0")
implementation("com.google.android.material:material:1.12.0")
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
implementation ("com.google.android.gms:play-services-ads:23.1.0")
implementation("com.google.android.gms:play-services-ads:23.2.0")

implementation("com.airbnb.android:lottie:6.4.0")

implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.8.2")
implementation("androidx.fragment:fragment-ktx:1.8.0")
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.2")
implementation("androidx.datastore:datastore-preferences:1.1.1")
implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.8.4")
implementation("androidx.fragment:fragment-ktx:1.8.2")
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.4")

implementation(platform("com.google.firebase:firebase-bom:33.1.0"))
implementation("androidx.datastore:datastore-preferences:1.1.1")
implementation(platform("com.google.firebase:firebase-bom:33.1.2"))
implementation("com.google.firebase:firebase-analytics")
implementation("com.google.firebase:firebase-auth:23.0.0")

implementation("com.google.android.gms:play-services-auth:21.2.0")

implementation("com.google.dagger:hilt-android:2.46")
implementation("androidx.activity:activity-ktx:1.9.0")
implementation("androidx.activity:activity:1.9.0")
implementation("androidx.activity:activity-ktx:1.9.1")
kapt("com.google.dagger:hilt-android-compiler:2.46")

implementation("com.squareup.retrofit:retrofit:2.0.0-beta2")
Expand All @@ -97,17 +98,17 @@ dependencies {
implementation("com.github.bumptech.glide:glide:5.0.0-rc01")
implementation("de.hdodenhof:circleimageview:3.1.0")

implementation("com.google.android.gms:play-services-maps:18.2.0")
implementation("com.google.android.gms:play-services-maps:19.0.0")
implementation("com.google.android.libraries.places:places:3.5.0")
implementation("androidx.activity:activity-ktx:1.9.0")

implementation("androidx.room:room-ktx:2.7.0-alpha04")
kapt("androidx.room:room-compiler:2.7.0-alpha04")

testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
androidTestImplementation("androidx.test.ext:junit:1.2.1")
androidTestImplementation("androidx.test.espresso:espresso-core:3.6.1")
}

kapt {
correctErrorTypes = true
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ class RecentAirplaneAdapter(recentAirplane: List<RecentAirplane>, private val on
if(data.image == null){
Glide.with(binding.root)
.load(R.drawable.event_image_airplnae_temp)
.error(BuildConfig.ERROR_IMAGE_URl)
.error(BuildConfig.ERROR_IMAGE_URL)
.into(binding.image)
}else{
Glide.with(binding.root)
.load(data.image)
.error(BuildConfig.ERROR_IMAGE_URl)
.error(BuildConfig.ERROR_IMAGE_URL)
.into(binding.image)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ class RecentHotelAdapter(recentHotel : List<RecentHotel>, private val onItemClic
if(data.image == null){
Glide.with(binding.root)
.load("https://www.hankyu-hotel.com/-/media/hotel/res/osaka/accommodation/images/02_Standard%20Twin_1.jpg")
.error(BuildConfig.ERROR_IMAGE_URl)
.error(BuildConfig.ERROR_IMAGE_URL)
.into(binding.image)
}else{
Glide.with(binding.root)
.load(data.image)
.error(BuildConfig.ERROR_IMAGE_URl)
.error(BuildConfig.ERROR_IMAGE_URL)
.into(binding.image)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class BillListAdapter (

) : RecyclerView.Adapter<BillListAdapter.ViewHolder>(){
inner class ViewHolder(val binding: BillListItemBinding) : RecyclerView.ViewHolder(binding.root){
fun bind(data : ){
fun bind(){

}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class AiScheduleAdapter(private val context: Context, data : List<AiSchedule>, p
binding.places.text = getPlacesText(data.places)
Glide.with(binding.root)
.load(data.image)
.error(BuildConfig.ERROR_IMAGE_URl)
.error(BuildConfig.ERROR_IMAGE_URL)
.into(binding.image)

setDaysTab(binding, data.dailySchedule.size)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class CalendarListAdapter (private val context: Context, data : GetScheduleListR
Log.d("CalendarListAdapter", "$position\n${data.imageUrl}")
Glide.with(binding.root)
.load(data.imageUrl)
.error(BuildConfig.ERROR_IMAGE_URl)
.error(BuildConfig.ERROR_IMAGE_URL)
.into(binding.image)

binding.delete.setOnClickListener {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class RecentAddedCalendarsAdapter(data : GetLatestSchedulesResponse, private val
binding.places.text = getPlacesString(data.plan)
Glide.with(binding.root)
.load(data.imageUrl)
.error(BuildConfig.ERROR_IMAGE_URl)
.error(BuildConfig.ERROR_IMAGE_URL)
.into(binding.image)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ class EventTicketViewPagerAdapter(eventInfo : List<EventViewPager>)
if(data.image == null){
Glide.with(binding.root)
.load("https://img.freepik.com/free-photo/famous-tower-bridge-in-the-evening-london-england_268835-1390.jpg?w=1380&t=st=1711373689~exp=1711374289~hmac=48368a0b7fab5f7d212f39979735f02fd5ed184aab1ef0e8535de2e856482de6")
.error(BuildConfig.ERROR_IMAGE_URl)
.error(BuildConfig.ERROR_IMAGE_URL)
.into(binding.image)
}else{
Glide.with(binding.root)
.load(data.image)
.error(BuildConfig.ERROR_IMAGE_URl)
.error(BuildConfig.ERROR_IMAGE_URL)
.into(binding.image)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ class EventViewPagerAdapter(
if(data.image == null){
Glide.with(binding.root)
.load("https://img.freepik.com/free-photo/asian-woman-wearing-japanese-traditional-kimono-at-yasaka-pagoda-and-sannen-zaka-street-in-kyoto-japan_335224-121.jpg?w=1380&t=st=1711376316~exp=1711376916~hmac=c66b5094e4df32daf35dbf1047664b2c5317cbb3215b8c6615900aa0f80fbf6b")
.error(BuildConfig.ERROR_IMAGE_URl)
.error(BuildConfig.ERROR_IMAGE_URL)
.into(binding.image)
}else{
Glide.with(binding.root)
.load(data.image)
.error(BuildConfig.ERROR_IMAGE_URl)
.error(BuildConfig.ERROR_IMAGE_URL)
.into(binding.image)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ class RecentAddedRecordsAdapter(
if (!data.image.isNullOrBlank() && !data.countryImage.isNullOrBlank()){
Glide.with(binding.root)
.load(data.image)
.error(BuildConfig.ERROR_IMAGE_URl)
.error(BuildConfig.ERROR_IMAGE_URL)
.into(binding.firstImage)

Glide.with(binding.root)
.load(data.countryImage)
.error(BuildConfig.ERROR_IMAGE_URl)
.error(BuildConfig.ERROR_IMAGE_URL)
.into(binding.secondImage)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import retrofit2.http.Path
import retrofit2.http.Query

interface ScheduleService {

@POST("gpt/schedules")
fun createScheduleList(
@Body createCondition: CreateScheduleListRequest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class AuthInterceptor(@ApplicationContext private val context: Context) : Interc
var request = requestBuilder.build()

var response: Response = chain.proceed(request)
if (response.code == 400) {
if (response.code == 400 || response.code == 401) {
response.close() // 기존 응답 닫기

synchronized(this) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class WeatherActivity : AppCompatActivity(), OnAirportListener {
binding.description.text = it.description
Glide.with(binding.root)
.load(it.iconUrl)
.error(BuildConfig.ERROR_IMAGE_URl)
.error(BuildConfig.ERROR_IMAGE_URL)
.into(binding.image)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class AiScheduleDialog(private val data : AiSchedule, private val onAddListener:
binding.title.text = data.title
Glide.with(binding.root)
.load(data.image)
.error(BuildConfig.ERROR_IMAGE_URl)
.error(BuildConfig.ERROR_IMAGE_URL)
.into(binding.image)
binding.places.text = getPlacesText(data.places)
setDaysTab()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class CalendarFragment : Fragment(), OnDesListener, RecentAddedCalendarsAdapter.
val dDay = resources.getString(R.string.d_day) + if (nearSchedule!!.dday.toInt() == 0) getString(R.string.d_day_zero) else nearSchedule!!.dday.toString()
Glide.with(binding.root)
.load(nearSchedule!!.imageUrl)
.error(BuildConfig.ERROR_IMAGE_URl)
.error(BuildConfig.ERROR_IMAGE_URL)
.into(binding.scheduleImage)
binding.dDay.text = dDay
binding.scheduleTitle.text = nearSchedule!!.scheduleName
Expand Down
23 changes: 19 additions & 4 deletions android/HowAboutTrip/app/src/main/res/layout/fragment_calendar.xml
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,15 @@
android:id="@+id/ai_layout"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginTop="6dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/schedule"
app:layout_constraintEnd_toStartOf="@id/add_layout">

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:padding="10dp"
android:onClick="@{() -> calendar.moveAddAICalendar()}"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent">
Expand All @@ -132,6 +133,8 @@
android:layout_height="35dp"
android:background="@android:color/transparent"
android:scaleType="fitCenter"
android:clickable="false"
android:focusable="false"
android:src="@drawable/icon_ai_calendar_linear"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
Expand All @@ -146,6 +149,8 @@
android:text="@string/calendar_ai"
android:textColor="@color/black"
android:textSize="13dp"
android:clickable="false"
android:focusable="false"
android:layout_marginTop="5dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
Expand All @@ -158,13 +163,14 @@
android:id="@+id/add_layout"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginTop="6dp"
app:layout_constraintStart_toEndOf="@+id/ai_layout"
app:layout_constraintTop_toBottomOf="@+id/schedule"
app:layout_constraintEnd_toStartOf="@id/search_layout">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:padding="10dp"
android:onClick="@{() -> calendar.add()}"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent">
Expand All @@ -176,6 +182,8 @@
android:background="@android:color/transparent"
android:scaleType="fitCenter"
android:src="@drawable/icon_calendar_add"
android:clickable="false"
android:focusable="false"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
Expand All @@ -189,6 +197,8 @@
android:gravity="center"
android:fontFamily="@font/bm_hanna"
android:layout_marginTop="5dp"
android:clickable="false"
android:focusable="false"
app:layout_constraintTop_toBottomOf="@+id/add"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"/>
Expand All @@ -201,14 +211,15 @@
android:id="@+id/search_layout"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginTop="6dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/add_layout"
app:layout_constraintTop_toBottomOf="@+id/schedule">

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:padding="10dp"
android:onClick="@{()-> calendar.moveCalendarList()}"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent">
Expand All @@ -219,6 +230,8 @@
android:layout_height="35dp"
android:background="@android:color/transparent"
android:scaleType="fitCenter"
android:clickable="false"
android:focusable="false"
android:src="@drawable/icon_calendar_search"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
Expand All @@ -234,6 +247,8 @@
android:text="@string/calendar_search"
android:textColor="@color/black"
android:textSize="13dp"
android:clickable="false"
android:focusable="false"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/search" />
Expand All @@ -255,7 +270,7 @@
android:id="@+id/textView10"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="40dp"
android:layout_marginTop="30dp"
android:fontFamily="@font/bm_hanna"
android:text="@string/recent_added_calendar"
android:textColor="@color/black"
Expand Down
Loading

0 comments on commit d6879c6

Please sign in to comment.