Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 7 additions & 0 deletions .claude/settings.local.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"permissions": {
"allow": [
"Bash(xargs grep:*)"
]
}
}
2 changes: 1 addition & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ android {
minSdk = 26
targetSdk = 35
versionCode = 11015
versionName = "1.4.1"
versionName = "1.5.0"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

<uses-feature android:name="android.hardware.camera.any" />

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.no5ing.bbibbi.data.datasource.network

import com.no5ing.bbibbi.data.datasource.network.response.KakaoSearchResponse
import retrofit2.http.GET
import retrofit2.http.Header
import retrofit2.http.Query

interface KakaoLocalApi {

@GET("v2/local/search/keyword.json")
suspend fun searchKeyword(
@Header("Authorization") authorization: String,
@Query("query") query: String,
@Query("x") x: String? = null,
@Query("y") y: String? = null,
@Query("radius") radius: Int? = null,
@Query("page") page: Int? = null,
@Query("size") size: Int? = null,
): KakaoSearchResponse
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import com.no5ing.bbibbi.data.model.notification.NotificationModel
import com.no5ing.bbibbi.data.model.post.AIImageCount
import com.no5ing.bbibbi.data.model.post.AIImageResponse
import com.no5ing.bbibbi.data.model.post.AIPost
import com.no5ing.bbibbi.data.model.post.AIPostType
import com.no5ing.bbibbi.data.model.post.CalendarBanner
import com.no5ing.bbibbi.data.model.post.CalendarElement
import com.no5ing.bbibbi.data.model.post.DailyCalendarElement
Expand Down Expand Up @@ -204,6 +205,7 @@ interface RestAPI {
suspend fun createAiPost(
@Body body: CreatePostRequest,
@Query("type") type: String? = null,
@Query("aiPostType") aiPostType: String? = null,
): ApiResponse<AIPost>

@POST("v1/posts/image-upload-request")
Expand Down Expand Up @@ -334,10 +336,16 @@ interface RestAPI {
@Query("size") size: Int?,
@Query("memberId") memberId: String?,
@Query("sort") sort: String? = "DESC",
@Query("aiPostType") aiPostType: String? = null,
): ApiResponse<Pagination<AIPost>>

@GET("v1/posts/ai-images/count")
suspend fun getAiImagePostCount(): ApiResponse<AIImageCount>
suspend fun getAiImagePostCount(
@Query("aiPostType") aiPostType: String? = null,
): ApiResponse<AIImageCount>

@GET("v1/posts/ai-images/types")
suspend fun getAiImageTypes(): ApiResponse<ArrayResponse<AIPostType>>
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,7 @@ data class CreatePostRequest(
val imageUrl: String,
val content: String,
val uploadTime: String,
val latitude: Double? = null,
val longitude: Double? = null,
val address: String? = null,
) : Parcelable, BaseModel()
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.no5ing.bbibbi.data.datasource.network.response

import com.fasterxml.jackson.annotation.JsonIgnoreProperties
import com.fasterxml.jackson.annotation.JsonProperty

@JsonIgnoreProperties(ignoreUnknown = true)
data class KakaoSearchResponse(
val meta: KakaoSearchMeta,
val documents: List<KakaoSearchDocument>,
)

@JsonIgnoreProperties(ignoreUnknown = true)
data class KakaoSearchMeta(
@JsonProperty("total_count") val totalCount: Int,
@JsonProperty("pageable_count") val pageableCount: Int,
@JsonProperty("is_end") val isEnd: Boolean,
)

@JsonIgnoreProperties(ignoreUnknown = true)
data class KakaoSearchDocument(
val id: String = "",
@JsonProperty("place_name") val placeName: String = "",
@JsonProperty("address_name") val addressName: String = "",
@JsonProperty("road_address_name") val roadAddressName: String = "",
val x: String = "",
val y: String = "",
val phone: String = "",
val distance: String = "",
@JsonProperty("category_name") val categoryName: String = "",
)
16 changes: 16 additions & 0 deletions app/src/main/java/com/no5ing/bbibbi/data/model/post/AIPostType.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.no5ing.bbibbi.data.model.post

import com.no5ing.bbibbi.data.model.BaseModel

data class AIPostType(
val aiPostType: String,
val imageUrl: String,
val startDate: String,
val aiPostTheme: String,
val endDate: String,
val postCount: Int,
) : BaseModel() {
fun getTypeName(): String {
return aiPostType
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ data class DailyCalendarElement(
val emojiCount: Int,
val allFamilyMembersUploaded: Boolean,
val createdAt: ZonedDateTime,
val address: String?,
) : Parcelable, BaseModel() {
fun toPost() = Post(
postId = postId,
Expand All @@ -30,5 +31,6 @@ data class DailyCalendarElement(
imageUrl = postImgUrl,
content = postContent,
createdAt = createdAt,
address = address,
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ data class Post(
val emojiCount: Int,
val imageUrl: String,
val content: String,
val address: String?,
val createdAt: ZonedDateTime,
) : Parcelable, BaseModel()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ class GetAIPostPagingSource @Inject constructor(
memberId = null,
page = loadParams.key ?: 1,
size = loadParams.loadSize,
aiPostType = arguments.get("aiPostType"),
).mapSuccess {
Pagination(
currentPage = currentPage,
Expand Down
17 changes: 17 additions & 0 deletions app/src/main/java/com/no5ing/bbibbi/di/NetworkModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
import com.fasterxml.jackson.module.kotlin.kotlinModule
import com.google.gson.Gson
import com.no5ing.bbibbi.BuildConfig
import com.no5ing.bbibbi.data.datasource.network.KakaoLocalApi
import com.no5ing.bbibbi.data.datasource.network.RestAPI
import com.no5ing.bbibbi.data.model.auth.AuthResult
import com.skydoves.sandwich.SandwichInitializer
Expand Down Expand Up @@ -215,6 +216,22 @@ object NetworkModule {
.build()
}

@Provides
@Singleton
fun provideKakaoLocalApi(): KakaoLocalApi {
return Retrofit.Builder()
.baseUrl("https://dapi.kakao.com/")
.addConverterFactory(
JacksonConverterFactory.create(
jacksonObjectMapper()
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
.registerModule(kotlinModule())
)
)
.build()
.create(KakaoLocalApi::class.java)
}

@Provides
@Singleton
fun provideRestFamilyApi(retrofit: Retrofit): RestAPI.FamilyApi {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ fun rememberHomePageState(
createdAt = ZonedDateTime.now(),
missionId = null,
type = PostType.SURVIVAL,
address = null,
)
)
},
Expand Down
Loading
Loading