Skip to content

Commit

Permalink
Merge pull request #526 from BCSDLab/release/v4.3.0
Browse files Browse the repository at this point in the history
Update v4.3.0
  • Loading branch information
kongwoojin authored Jan 21, 2025
2 parents 55b13fe + a28b60e commit aba3ee8
Show file tree
Hide file tree
Showing 150 changed files with 6,572 additions and 888 deletions.
6 changes: 5 additions & 1 deletion build-logic/convention/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,14 @@ gradlePlugin {
id = "in.koreatech.plugin.hilt"
implementationClass = "AndroidApplicationHiltConventionPlugin"
}

register("AndroidApplicationOrbitPlugin"){
id = "in.koreatech.plugin.orbit"
implementationClass = "AndroidApplicationOrbitConventionPlugin"
}
register("AndroidLibraryOrbitPlugin"){
id = "in.koreatech.plugin.library.orbit"
implementationClass = "AndroidLibraryOrbitConventionPlugin"
}
register("AndroidLibraryPlugin") {
id = "in.koreatech.plugin.library"
implementationClass = "AndroidLibraryConventionPlugin"
Expand All @@ -47,5 +50,6 @@ gradlePlugin {
id = "in.koreatech.plugin.oss"
implementationClass = "OssLicensePlugin"
}

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import com.android.build.api.dsl.LibraryExtension
import `in`.koreatech.convention.configureAndroidOrbit
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.kotlin.dsl.configure

internal class AndroidLibraryOrbitConventionPlugin : Plugin<Project> {
override fun apply(target: Project) {
with(target) {
extensions.configure<LibraryExtension> {
configureAndroidOrbit(this)
}
}
}
}
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ buildscript {
}

extra.apply {
set("versionName", "4.2.0")
set("versionCode", 40200)
set("versionName", "4.3.0")
set("versionCode", 40300)
// 코인 버전 관리

set("versionBusinessName", "1.0.1")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,20 @@ object AnalyticsConstant {

const val BUSINESS_BENEFIT_1 = "BUSINESS_benefit_1"
const val BUSINESS_CALL_1 = "BUSINESS_call_1"

object LOST_AND_FOUND {
const val LOST_ITEM_ADD_ITEM = "lost_item_add_item"
const val FIND_USER_ADD_ITEM = "find_user_add_item"
const val LOST_ITEM_CATEGORY = "lost_item_category"
const val FIND_USER_CATEGORY = "find_user_category"
const val LOST_WRITE = "item_lost_write"
const val FOUND_WRITE = "find_user_write"
const val ITEM_WRITE = "item_write"
const val LOST_ITEM_WRITE_CONFIRM = "lost_item_write_confirm"
const val FIND_USER_WRITE_CONFIRM = "find_user_write_confirm"
const val FIND_USER_DELETE = "find_user_delete"
const val FIND_USER_DELETE_CONFIRM = "find_user_delete_confirm"
}
}

const val PREVIOUS_PAGE = "previous_page"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,10 @@ interface Navigator {
targetId: Pair<String, Any?> = Pair("", 0),
type: Pair<String, Any?> = Pair("", ""),
): Intent
}

fun navigateToArticleLostAndFound(
context: Context,
targetId: Pair<String, Any?> = Pair("", 0),
type: Pair<String, Any?> = Pair("", ""),
): Intent
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ enum class NavigatorType(
enum class SchemeType(
val type: String
) {
SHOP("shop"), DINING("dining"), ARTICLE("keyword")
SHOP("shop"), DINING("dining"), ARTICLE("keyword"), LOST_AND_FOUND("lost_and_found")
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import android.app.Activity
import android.content.Context
import android.content.Intent
import androidx.core.os.bundleOf
import `in`.koreatech.koin.core.navigation.SchemeType

inline fun <reified T : Activity> Context.buildIntent(
vararg argument: Pair<String, Any?>,
Expand All @@ -21,7 +22,8 @@ inline fun <reified T : Activity> Context.goToActivity(
* @input : koin://shop?id
* @output : shop
*/
fun String.toHost(): String {
fun String.toHost(boardId: Int = -1): String {
if (boardId == 14) return SchemeType.LOST_AND_FOUND.type // TODO: Find a better way to handle lost and found board
val host = this.split("://", "?")
return if (host.size > 1) host[1] else ""
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ package `in`.koreatech.koin.core.navigation.utils
const val EXTRA_URL = "extra_url"
const val EXTRA_TYPE = "extra_type"
const val EXTRA_ID = "extra_id"
const val EXTRA_BOARD_ID = "extra_board_id"
const val EXTRA_NAV_TYPE = "extra_nav_type"
24 changes: 23 additions & 1 deletion data/src/main/java/in/koreatech/koin/data/api/ArticleApi.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package `in`.koreatech.koin.data.api

import `in`.koreatech.koin.data.response.article.ArticleLostAndFoundPaginationResponse
import `in`.koreatech.koin.data.response.article.ArticleLostAndFoundResponse
import `in`.koreatech.koin.data.response.article.ArticlePaginationResponse
import `in`.koreatech.koin.data.response.article.ArticleResponse
import `in`.koreatech.koin.data.response.article.KeywordsResponse
Expand Down Expand Up @@ -56,4 +58,24 @@ interface ArticleApi {
*/
@GET("articles/hot/keyword")
suspend fun fetchMostSearchedKeywords(@Query("count") count: Int): KeywordsResponse
}

/**
* 분실물 게시글 목록과 페이지 정보를 가져옴
* @param page 페이지 번호
* @param limit 페이지 당 게시글 수
*/
@GET("articles/lost-item")
suspend fun fetchArticleLostAndFoundPagination(
@Query("page") page: Int,
@Query("limit") limit: Int
): ArticleLostAndFoundPaginationResponse

/**
* 분실물 게시글 조회
* @param id 게시글 아이디
*/
@GET("articles/lost-item/{id}")
suspend fun fetchArticleLostAndFound(
@Path("id") id: Int
): ArticleLostAndFoundResponse
}
3 changes: 3 additions & 0 deletions data/src/main/java/in/koreatech/koin/data/api/UploadUrlApi.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,7 @@ interface UploadUrlApi {

@POST(URLConstant.UPLOAD.MARKETURL)
suspend fun postUploadMarketUrl(@Body uploadUrlRequest: UploadUrlRequest): UploadUrlResponse

@POST(URLConstant.UPLOAD.LOSTANDFOUNDURL)
suspend fun postUploadLostAndFoundUrl(@Body uploadUrlRequest: UploadUrlRequest): UploadUrlResponse
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package `in`.koreatech.koin.data.api.auth

import `in`.koreatech.koin.data.request.article.ArticleKeywordRequest
import `in`.koreatech.koin.data.response.article.ArticleKeywordWrapperResponse
import `in`.koreatech.koin.data.request.article.ArticleLostAndFoundRequest
import `in`.koreatech.koin.data.response.article.ArticleLostAndFoundResponse
import `in`.koreatech.koin.data.response.article.KeywordsResponse
import retrofit2.Response
import retrofit2.http.Body
Expand All @@ -22,4 +24,14 @@ interface ArticleAuthApi {

@DELETE("articles/keyword/{id}")
suspend fun deleteKeyword(@Path("id") keywordId: Int): Response<Unit>

@POST("articles/lost-item")
suspend fun uploadArticleLostAndFound(
@Body request: ArticleLostAndFoundRequest
): Response<ArticleLostAndFoundResponse>

@DELETE("articles/lost-item/{id}")
suspend fun deleteArticleLostAndFound(
@Path("id") id: Int
): Response<Unit>
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import `in`.koreatech.koin.data.request.timetable.TimetableFrameQueryRequest
import `in`.koreatech.koin.data.request.timetable.TimetableLecturesQueryRequest
import `in`.koreatech.koin.data.response.timetable.SemesterCheckResponse
import `in`.koreatech.koin.data.response.timetable.TimetableFrameResponse
import `in`.koreatech.koin.data.response.timetable.TimetableFramesResponse
import `in`.koreatech.koin.data.response.timetable.TimetableLecturesResponse
import retrofit2.Response
import retrofit2.http.Body
Expand Down Expand Up @@ -46,16 +47,32 @@ interface TimetableAuthApi {
@Body frame: TimetableFrameCreateQueryRequest
): TimetableFrameResponse

@POST("/v2/timetables/frame/rollback")
suspend fun postRollbackFrame(
@Query("timetable_frame_id") frameId: Int
): TimetableLecturesResponse

@DELETE("/v2/timetables/frame")
suspend fun deleteTimetableFrame(
@Query("id") frameId: Int
): Response<Unit>

/**
* @param semester 학기명
* @return 학기의 프레임 리스트
*/
@GET("/v2/timetables/frames")
suspend fun getTimetableFrames(
@Query("semester") semester: String
): List<TimetableFrameResponse>

/**
* 학생이 추가한 모든 학기의 프레임을 불러옴
* @return 학생이 추가한 모든 시간표 프레임
*/
@GET("/v2/timetables/frames")
suspend fun getAllFrames(): TimetableFramesResponse

@DELETE("/v2/timetables/lecture/{id}")
suspend fun deleteTimetableLecture(
@Path("id") id: Int
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package `in`.koreatech.koin.data.api.auth
import `in`.koreatech.koin.data.constant.URLConstant
import `in`.koreatech.koin.data.request.store.StoreReviewReportsRequest
import `in`.koreatech.koin.data.request.user.ABTestRequest
import `in`.koreatech.koin.data.request.user.PasswordRequest
import `in`.koreatech.koin.data.request.user.DeviceTokenRequest
import `in`.koreatech.koin.data.request.user.PasswordRequest
import `in`.koreatech.koin.data.request.user.ReviewRequest
import `in`.koreatech.koin.data.request.user.UserRequest
import `in`.koreatech.koin.data.response.notification.NotificationPermissionInfoResponse
Expand All @@ -13,6 +13,7 @@ import `in`.koreatech.koin.data.response.user.ABTestResponse
import `in`.koreatech.koin.data.response.user.ABTestTokenResponse
import `in`.koreatech.koin.data.response.user.UserInfoEditResponse
import `in`.koreatech.koin.data.response.user.UserResponse
import `in`.koreatech.koin.data.response.user.UserTypeResponse
import retrofit2.Response
import retrofit2.http.Body
import retrofit2.http.DELETE
Expand All @@ -35,6 +36,9 @@ interface UserAuthApi {
@GET(URLConstant.USER.CHECKNICKNAME + "/{nickname}")
suspend fun checkNickName(): UserInfoEditResponse

@GET(URLConstant.USER.AUTH)
suspend fun getUserType(): UserTypeResponse

@POST("/notification")
suspend fun updateDeviceToken(@Body deviceTokenRequest: DeviceTokenRequest)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ object URLConstant {
const val CHECKEMAIL: String = "$USER/check/email"
const val CHECKPASSWORD: String = "$USER/check/password"
const val PROFILEUPLOAD: String = "$USER/profile/upload"
const val AUTH: String = "$USER/auth"
const val ID = "portal_account"
const val EMAIL = "email"
const val PW = "password"
Expand Down Expand Up @@ -155,5 +156,6 @@ object URLConstant {
const val url = "/{domain}/upload/url"
const val OWNERURL = "/owners/upload/url"
const val MARKETURL = "/market/upload/url"
const val LOSTANDFOUNDURL = "/lost_items/upload/url"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import `in`.koreatech.koin.domain.repository.PreSignedUrlRepository
import `in`.koreatech.koin.domain.repository.StoreRepository
import `in`.koreatech.koin.domain.repository.UploadUrlRepository
import `in`.koreatech.koin.domain.usecase.business.UploadFileUseCase
import `in`.koreatech.koin.domain.usecase.presignedurl.GetLostAndFoundPreSignedUrlUseCase
import `in`.koreatech.koin.domain.usecase.presignedurl.GetMarketPreSignedUrlUseCase
import `in`.koreatech.koin.domain.usecase.store.SearchStoreUseCase
import kotlinx.coroutines.CoroutineDispatcher
Expand Down Expand Up @@ -44,4 +45,13 @@ object UseCaseModule {
): UploadFileUseCase {
return UploadFileUseCase(preSignedUrlRepository, coroutineDispatcher)
}

@Provides
@Singleton
fun provideGetLostAndFoundPreSignedUrlUseCase(
uploadUrlRepository: UploadUrlRepository,
@IoDispatcher coroutineDispatcher: CoroutineDispatcher,
): GetLostAndFoundPreSignedUrlUseCase {
return GetLostAndFoundPreSignedUrlUseCase(uploadUrlRepository, coroutineDispatcher)
}
}
20 changes: 20 additions & 0 deletions data/src/main/java/in/koreatech/koin/data/mapper/ArticleMapper.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package `in`.koreatech.koin.data.mapper

import `in`.koreatech.koin.data.request.article.ArticleLostAndFoundRequest
import `in`.koreatech.koin.domain.model.article.ArticleLostAndFoundUpload

fun List<ArticleLostAndFoundUpload>.toArticleLostAndFoundRequest(): ArticleLostAndFoundRequest {
return ArticleLostAndFoundRequest(
articles = this.map { it.toArticleLostAndFoundBody() }
)
}

fun ArticleLostAndFoundUpload.toArticleLostAndFoundBody(): ArticleLostAndFoundRequest.ArticleLostAndFoundBody {
return ArticleLostAndFoundRequest.ArticleLostAndFoundBody(
category = category,
foundPlace = foundPlace,
foundDate = foundDate,
content = content,
images = images
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import `in`.koreatech.koin.domain.model.user.Gender
import `in`.koreatech.koin.domain.model.user.Graduated
import `in`.koreatech.koin.domain.model.user.User

fun UserResponse.toUser() = User.Student(
fun UserResponse.toUser(userType: String) = User.Student(
anonymousNickname = anonymousNickname,
email = email,
name = name,
Expand All @@ -20,7 +20,8 @@ fun UserResponse.toUser() = User.Student(
},
nickname = nickname,
phoneNumber = phoneNumber,
major = major
major = major,
userType = userType
)

fun User.Student.toUserRequest() = UserRequest(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ import `in`.koreatech.koin.data.source.local.ArticleLocalDataSource
import `in`.koreatech.koin.data.source.remote.ArticleRemoteDataSource
import `in`.koreatech.koin.domain.model.article.Article
import `in`.koreatech.koin.domain.model.article.ArticleHeader
import `in`.koreatech.koin.domain.model.article.ArticleNoti
import `in`.koreatech.koin.domain.model.article.ArticleLostAndFound
import `in`.koreatech.koin.domain.model.article.ArticleLostAndFoundPagination
import `in`.koreatech.koin.domain.model.article.ArticleLostAndFoundUpload
import `in`.koreatech.koin.domain.model.article.ArticlePagination
import `in`.koreatech.koin.domain.model.article.articleNotiContent
import `in`.koreatech.koin.domain.model.user.User
import `in`.koreatech.koin.domain.repository.ArticleRepository
import `in`.koreatech.koin.domain.repository.UserRepository
Expand Down Expand Up @@ -204,4 +205,32 @@ class ArticleRepositoryImpl @Inject constructor(
emit(articleLocalDataSource.clearSearchHistory())
}
}

override fun fetchArticleLostAndFoundPagination(
page: Int,
limit: Int
): Flow<ArticleLostAndFoundPagination> {
return flow {
emit(
articleRemoteDataSource.fetchArticleLostAndFoundPagination(page, limit)
.toArticleLostAndFoundPagination()
)
}
}

override fun fetchArticleLostAndFound(articleId: Int): Flow<ArticleLostAndFound> {
return flow {
emit(
articleRemoteDataSource.fetchArticleLostAndFound(articleId).toArticleLostAndFound()
)
}
}

override suspend fun uploadArticleLostAndFound(articleLostAndFoundList: List<ArticleLostAndFoundUpload>): Result<ArticleLostAndFound> {
return articleRemoteDataSource.uploadArticleLostAndFound(articleLostAndFoundList).map { it.toArticleLostAndFound() }
}

override suspend fun deleteArticleLostAndFound(articleId: Int): Result<Unit> {
return articleRemoteDataSource.deleteArticleLostAndFound(articleId)
}
}
Loading

0 comments on commit aba3ee8

Please sign in to comment.