Skip to content

Commit

Permalink
Merge branch 'develop' into mod-open-link-validity
Browse files Browse the repository at this point in the history
  • Loading branch information
DoReMinWoo committed Mar 6, 2024
2 parents 8e61153 + c0a72b2 commit 30580e1
Show file tree
Hide file tree
Showing 56 changed files with 773 additions and 433 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/pr_builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,6 @@ jobs:
HFM_BASE_URL: ${{ secrets.BASE_URL }}
run: echo "base.url=\"$BASE_URL\"" >> local.properties

- name: Access ACCESS_TOKEN
env:
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
run: echo "access.token=\"$ACCESS_TOKEN\"" >> local.properties

- name: Access IO_SENTRY_DSN
env:
IO_SENTRY_TOKEN: ${{ secrets.IO_SENTRY_DSN }}
Expand All @@ -67,6 +62,11 @@ jobs:
KAKAO_NATIVE_APP_KEY: ${{ secrets.KAKAO_NATIVE_APP_KEY }}
run: echo "kakao.native.app.key=\"$KAKAO_NATIVE_APP_KEY\"" >> local.properties

- name: Access AMPLITUDE_API_KEY
env:
AMPLITUDE_API_KEY: ${{ secrets.AMPLITUDE_API_KEY }}
run: echo "amplitude.dev.api.key=\"AMPLITUDE_API_KEY\"" >> local.properties

- name: Access DEFAULTS_ORG
env:
DEFAULTS_ORG: ${{ secrets.DEFAULTS_ORG }}
Expand Down
5 changes: 5 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,12 @@ android {
buildTypes {
debug {
isMinifyEnabled = false
buildConfigField("String", "AMPLITUDE_API_KEY", properties["amplitude.dev.api.key"].toString())
}
release {
isMinifyEnabled = true
isShrinkResources = true
buildConfigField("String", "AMPLITUDE_API_KEY", properties["amplitude.prod.api.key"].toString())
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
Expand Down Expand Up @@ -115,6 +117,9 @@ dependencies {

// Kakao
implementation(libs.kakao)

// Amplitude
implementation(libs.amplitude)
}

ktlint {
Expand Down
1 change: 1 addition & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />

<application
android:name=".PingleApp"
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/java/org/sopt/pingle/PingleApp.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import com.naver.maps.map.NaverMapSdk
import dagger.hilt.android.HiltAndroidApp
import org.sopt.pingle.BuildConfig.KAKAO_NATIVE_APP_KEY
import org.sopt.pingle.BuildConfig.NAVER_MAP_CLIENT_ID
import org.sopt.pingle.util.AmplitudeUtils.initAmplitude
import org.sopt.pingle.util.PingleDebugTree
import timber.log.Timber

Expand All @@ -19,6 +20,7 @@ class PingleApp : Application() {
setDarkMode()
setNaverMap()
setKakao()
initAmplitude(applicationContext)
}

private fun setTimber() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,5 @@ interface PingleLocalDataSource {
var refreshToken: String
var groupId: Int
var groupName: String
var meetingCount: String
var participantCount: String
var isOwner: Boolean
var groupKeyword: String
var code: String
fun clear(): Unit
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package org.sopt.pingle.data.datasource.remote

import org.sopt.pingle.data.model.remote.response.ResponseMainListDto
import org.sopt.pingle.util.base.BaseResponse

interface MainListRemoteDataSource {
suspend fun getMainListPingleList(
searchWord: String?,
category: String?,
teamId: Long,
order: String
): BaseResponse<ResponseMainListDto>
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package org.sopt.pingle.data.datasource.remote

import org.sopt.pingle.data.model.remote.response.ResponsePinListDto
import org.sopt.pingle.data.model.remote.response.ResponsePingleListDto
import org.sopt.pingle.data.model.remote.response.ResponsePinDto
import org.sopt.pingle.data.model.remote.response.ResponsePingleDto
import org.sopt.pingle.util.base.BaseResponse

interface MapRemoteDataSource {
suspend fun getPinListWithoutFiltering(
teamId: Long,
category: String?,
searchWord: String?
): BaseResponse<List<ResponsePinListDto>>
): BaseResponse<List<ResponsePinDto>>

suspend fun getPingleList(teamId: Long, pinId: Long, category: String?): BaseResponse<List<ResponsePingleListDto>>
suspend fun getMapPingleList(teamId: Long, pinId: Long, category: String?): BaseResponse<List<ResponsePingleDto>>
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package org.sopt.pingle.data.datasource.remote

import org.sopt.pingle.data.model.remote.response.ResponseMyGroupDto
import org.sopt.pingle.util.base.BaseResponse

interface MyGroupListRemoteDataSource {
suspend fun getMyGroupList(): BaseResponse<List<ResponseMyGroupDto>>
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,26 +55,6 @@ class PingleLocalDataSourceImpl @Inject constructor(
get() = pref.getString(GROUP_NAME, "") ?: ""
set(value) = pref.edit { putString(GROUP_NAME, value) }

override var meetingCount: String
get() = pref.getString(MEETING_COUNT, "") ?: ""
set(value) = pref.edit { putString(MEETING_COUNT, value) }

override var participantCount: String
get() = pref.getString(PARTICIPANTS_COUNT, "") ?: ""
set(value) = pref.edit { putString(PARTICIPANTS_COUNT, value) }

override var groupKeyword: String
get() = pref.getString(GROUP_KEYWORD, "") ?: ""
set(value) = pref.edit { putString(GROUP_KEYWORD, value) }

override var isOwner: Boolean
get() = pref.getBoolean(IS_OWNER, false)
set(value) = pref.edit { putBoolean(IS_OWNER, value) }

override var code: String
get() = pref.getString(GROUP_CODE, "") ?: ""
set(value) = pref.edit { putString(GROUP_CODE, value) }

override fun clear() {
pref.edit {
clear()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package org.sopt.pingle.data.datasourceimpl.remote

import javax.inject.Inject
import org.sopt.pingle.data.datasource.remote.MainListRemoteDataSource
import org.sopt.pingle.data.model.remote.response.ResponseMainListDto
import org.sopt.pingle.data.service.MainListService
import org.sopt.pingle.util.base.BaseResponse

class MainListRemoteDataSourceImpl @Inject constructor(
private val mainListService: MainListService
) : MainListRemoteDataSource {
override suspend fun getMainListPingleList(
searchWord: String?,
category: String?,
teamId: Long,
order: String
): BaseResponse<ResponseMainListDto> = mainListService.getMainListPingleList(
searchWord = searchWord,
category = category,
teamId = teamId,
order = order
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package org.sopt.pingle.data.datasourceimpl.remote

import javax.inject.Inject
import org.sopt.pingle.data.datasource.remote.MapRemoteDataSource
import org.sopt.pingle.data.model.remote.response.ResponsePinListDto
import org.sopt.pingle.data.model.remote.response.ResponsePingleListDto
import org.sopt.pingle.data.model.remote.response.ResponsePinDto
import org.sopt.pingle.data.model.remote.response.ResponsePingleDto
import org.sopt.pingle.data.service.MapService
import org.sopt.pingle.util.base.BaseResponse

Expand All @@ -14,17 +14,17 @@ class MapRemoteDataSourceImpl @Inject constructor(
teamId: Long,
category: String?,
searchWord: String?
): BaseResponse<List<ResponsePinListDto>> =
): BaseResponse<List<ResponsePinDto>> =
mapService.getPinListWithoutFiltering(
teamId = teamId,
category = category,
searchWord = searchWord
)

override suspend fun getPingleList(
override suspend fun getMapPingleList(
teamId: Long,
pinId: Long,
category: String?
): BaseResponse<List<ResponsePingleListDto>> =
mapService.getPingleList(teamId = teamId, pinId = pinId, category = category)
): BaseResponse<List<ResponsePingleDto>> =
mapService.getMapPingleList(teamId = teamId, pinId = pinId, category = category)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package org.sopt.pingle.data.datasourceimpl.remote

import javax.inject.Inject
import org.sopt.pingle.data.datasource.remote.MyGroupListRemoteDataSource
import org.sopt.pingle.data.model.remote.response.ResponseMyGroupDto
import org.sopt.pingle.data.service.MyGroupListService
import org.sopt.pingle.util.base.BaseResponse

class MyGroupListRemoteDataSourceImpl @Inject constructor(
private val myGroupListService: MyGroupListService
) : MyGroupListRemoteDataSource {
override suspend fun getMyGroupList(): BaseResponse<List<ResponseMyGroupDto>> =
myGroupListService.getMyGroupList()
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package org.sopt.pingle.data.model.remote.response

import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

@Serializable
data class ResponseMainListDto(
@SerialName("searchCount")
val searchCount: Int,
@SerialName("meetings")
val meetings: List<ResponsePingleDto>
)
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import kotlinx.serialization.Serializable
import org.sopt.pingle.domain.model.PinEntity

@Serializable
data class ResponsePinListDto(
data class ResponsePinDto(
@SerialName("id")
val id: Long,
@SerialName("x")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import kotlinx.serialization.Serializable
import org.sopt.pingle.domain.model.PingleEntity

@Serializable
data class ResponsePingleListDto(
data class ResponsePingleDto(
@SerialName("id")
val id: Long,
@SerialName("category")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package org.sopt.pingle.data.repository

import javax.inject.Inject
import org.sopt.pingle.data.datasource.remote.MainListRemoteDataSource
import org.sopt.pingle.domain.model.PingleEntity
import org.sopt.pingle.domain.repository.MainListRepository

class MainListRepositoryImpl @Inject constructor(
private val mainListRemoteDataSource: MainListRemoteDataSource
) : MainListRepository {
override suspend fun getMainListPingleList(
searchWord: String?,
category: String?,
teamId: Long,
order: String
): Result<List<PingleEntity>> = runCatching {
mainListRemoteDataSource.getMainListPingleList(
searchWord = searchWord,
category = category,
teamId = teamId,
order = order
).data.meetings.map { meeting -> meeting.toPingleEntity() }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ class MapRepositoryImpl @Inject constructor(
emit(result.getOrThrow())
}

override suspend fun getPingleList(teamId: Long, pinId: Long, category: String?): Flow<List<PingleEntity>> = flow {
override suspend fun getMapPingleList(teamId: Long, pinId: Long, category: String?): Flow<List<PingleEntity>> = flow {
val result = runCatching {
mapRemoteDataSource.getPingleList(
mapRemoteDataSource.getMapPingleList(
teamId = teamId,
pinId = pinId,
category = category
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package org.sopt.pingle.data.repository

import javax.inject.Inject
import org.sopt.pingle.data.datasource.remote.MyGroupListRemoteDataSource
import org.sopt.pingle.domain.model.MyGroupEntity
import org.sopt.pingle.domain.repository.MyGroupListRepository

class MyGroupListRepositoryImpl @Inject constructor(
private val myGroupListRemoteDataSource: MyGroupListRemoteDataSource
) : MyGroupListRepository {
override suspend fun getMyGroupList(): Result<List<MyGroupEntity>> = runCatching {
myGroupListRemoteDataSource.getMyGroupList().data.map { myGroup -> myGroup.toResponseMyGroupEntity() }
}
}
26 changes: 26 additions & 0 deletions app/src/main/java/org/sopt/pingle/data/service/MainListService.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package org.sopt.pingle.data.service

import org.sopt.pingle.data.model.remote.response.ResponseMainListDto
import org.sopt.pingle.util.base.BaseResponse
import retrofit2.http.GET
import retrofit2.http.Query

interface MainListService {
@GET("$VERSION/$MEETINGS/$SEARCH")
suspend fun getMainListPingleList(
@Query(SEARCH_WORD) searchWord: String?,
@Query(CATEGORY) category: String?,
@Query(TEAM_ID) teamId: Long,
@Query(ORDER) order: String
): BaseResponse<ResponseMainListDto>

companion object {
const val VERSION = "v1"
const val MEETINGS = "meetings"
const val SEARCH = "search"
const val SEARCH_WORD = "q"
const val CATEGORY = "category"
const val TEAM_ID = "teamId"
const val ORDER = "order"
}
}
10 changes: 5 additions & 5 deletions app/src/main/java/org/sopt/pingle/data/service/MapService.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.sopt.pingle.data.service

import org.sopt.pingle.data.model.remote.response.ResponsePinListDto
import org.sopt.pingle.data.model.remote.response.ResponsePingleListDto
import org.sopt.pingle.data.model.remote.response.ResponsePinDto
import org.sopt.pingle.data.model.remote.response.ResponsePingleDto
import org.sopt.pingle.util.base.BaseResponse
import retrofit2.http.GET
import retrofit2.http.Path
Expand All @@ -13,14 +13,14 @@ interface MapService {
@Path("$TEAM_ID") teamId: Long,
@Query(CATEGORY) category: String?,
@Query(SEARCH_WORD) searchWord: String?
): BaseResponse<List<ResponsePinListDto>>
): BaseResponse<List<ResponsePinDto>>

@GET("$VERSION/$TEAMS/{$TEAM_ID}/$PINS/{$PIN_ID}/$MEETINGS")
suspend fun getPingleList(
suspend fun getMapPingleList(
@Path("$TEAM_ID") teamId: Long,
@Path("$PIN_ID") pinId: Long,
@Query(CATEGORY) category: String?
): BaseResponse<List<ResponsePingleListDto>>
): BaseResponse<List<ResponsePingleDto>>

companion object {
const val VERSION = "v1"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package org.sopt.pingle.data.service

import org.sopt.pingle.data.model.remote.response.ResponseMyGroupDto
import org.sopt.pingle.util.base.BaseResponse
import retrofit2.http.GET

interface MyGroupListService {
@GET("$VERSION/$USERS/$ME/$TEAMS")
suspend fun getMyGroupList(): BaseResponse<List<ResponseMyGroupDto>>

companion object {
const val VERSION = "v1"
const val USERS = "users"
const val ME = "me"
const val TEAMS = "teams"
}
}
Loading

0 comments on commit 30580e1

Please sign in to comment.