Skip to content

Commit

Permalink
Merge pull request #228 from mash-up-kr/develop
Browse files Browse the repository at this point in the history
[v1.0.8] 배포
  • Loading branch information
Ahn-seokjoo authored Sep 21, 2024
2 parents 3dd772a + 6b61b88 commit 51fc787
Show file tree
Hide file tree
Showing 13 changed files with 174 additions and 64 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/auto-assignee.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Auto Assignees

on:
pull_request:
types:
- opened

jobs:
add-auto-assignees:
runs-on: ubuntu-latest

steps:
- name: add assignees
run: |
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/mash-up-kr/Dorabangs_Android/issues/${{ github.event.number }}/assignees \
-d '{"assignees": ["${{ github.actor }}"]}'
7 changes: 6 additions & 1 deletion .github/workflows/common-setup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ jobs:
- name: Putting Json data
env:
GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }}
run: echo "$GOOGLE_SERVICES_JSON" > /home/runner/work/Dorabangs_Android/Dorabangs_Android/app/google-services.json
GOOGLE_SERVICES_JSON_DEBUG: ${{ secrets.GOOGLE_SERVICES_JSON_DEBUG }}
run: |
mkdir /home/runner/work/Dorabangs_Android/Dorabangs_Android/app/release
echo "$GOOGLE_SERVICES_JSON" > /home/runner/work/Dorabangs_Android/Dorabangs_Android/app/release/google-services.json
echo "$GOOGLE_SERVICES_JSON_DEBUG" > /home/runner/work/Dorabangs_Android/Dorabangs_Android/app/google-services.json
- name: Access SERVER_BASE_URL
run: |
Expand All @@ -27,3 +31,4 @@ jobs:
path: |
/home/runner/work/Dorabangs_Android/Dorabangs_Android/local.properties
/home/runner/work/Dorabangs_Android/Dorabangs_Android/app/google-services.json
/home/runner/work/Dorabangs_Android/Dorabangs_Android/app/release/google-services.json
1 change: 1 addition & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ android {

buildTypes {
debug {
applicationIdSuffix = ".debug"
isDebuggable = true
isMinifyEnabled = false
buildConfigField("Boolean", "DEBUG_MODE", "true")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package com.mashup.dorabangs.data.datasource.remote.api

import com.mashup.dorabangs.data.model.classification.AIClassificationAIPostListResponseModel
import com.mashup.dorabangs.domain.model.AIClassificationFolders
import com.mashup.dorabangs.domain.model.AIClassificationPosts

interface AIClassificationRemoteDataSource {

Expand All @@ -23,7 +22,7 @@ interface AIClassificationRemoteDataSource {
page: Int? = null,
limit: Int? = null,
order: String? = null,
): AIClassificationPosts
): AIClassificationAIPostListResponseModel

suspend fun deletePostFromAIClassification(
postId: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import com.mashup.dorabangs.data.model.classification.AIClassificationAIPostList
import com.mashup.dorabangs.data.model.toDomain
import com.mashup.dorabangs.data.network.service.AIClassificationService
import com.mashup.dorabangs.domain.model.AIClassificationFolders
import com.mashup.dorabangs.domain.model.AIClassificationPosts
import javax.inject.Inject

class AIClassificationRemoteDataSourceImpl @Inject constructor(
Expand Down Expand Up @@ -38,13 +37,13 @@ class AIClassificationRemoteDataSourceImpl @Inject constructor(
page: Int?,
limit: Int?,
order: String?,
): AIClassificationPosts =
): AIClassificationAIPostListResponseModel =
service.getAIClassificationPostsByFolder(
folderId = folderId,
page = page,
limit = limit,
order = order,
).toDomain()
)

override suspend fun deletePostFromAIClassification(postId: String) =
service.deletePostFromAIClassification(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.mashup.dorabangs.data.network.service

import com.mashup.dorabangs.data.model.AIClassificationFoldersResponseModel
import com.mashup.dorabangs.data.model.AIClassificationPostsResponseModel
import com.mashup.dorabangs.data.model.AiClassificationMoveSinglePostRequestModel
import com.mashup.dorabangs.data.model.classification.AIClassificationAIPostListResponseModel
import retrofit2.http.Body
Expand Down Expand Up @@ -40,7 +39,7 @@ interface AIClassificationService {
@Query("page") page: Int? = null,
@Query("limit") limit: Int? = null,
@Query("order") order: String? = null,
): AIClassificationPostsResponseModel
): AIClassificationAIPostListResponseModel

@DELETE("classification/posts/{postId}")
suspend fun deletePostFromAIClassification(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import com.mashup.dorabangs.data.datasource.remote.api.AIClassificationRemoteDat
import com.mashup.dorabangs.data.model.classification.toPagingDomain
import com.mashup.dorabangs.data.utils.doraPager
import com.mashup.dorabangs.domain.model.AIClassificationFolders
import com.mashup.dorabangs.domain.model.AIClassificationPosts
import com.mashup.dorabangs.domain.model.DoraSampleResponse
import com.mashup.dorabangs.domain.model.classification.AIClassificationFeedPost
import com.mashup.dorabangs.domain.repository.AIClassificationRepository
Expand Down Expand Up @@ -44,16 +43,19 @@ class AIClassificationRepositoryImpl @Inject constructor(

override suspend fun getAIClassificationPostsByFolder(
folderId: String,
page: Int?,
limit: Int?,
order: String?,
): AIClassificationPosts =
remoteDataSource.getAIClassificationPostsByFolder(
folderId = folderId,
page = page,
limit = limit,
order = order,
)
): Flow<PagingData<AIClassificationFeedPost>> =
doraPager(
apiExecutor = { page ->
remoteDataSource.getAIClassificationPostsByFolder(
folderId = folderId,
page = page,
limit = limit,
order = order,
).toPagingDomain()
},
).flow

override suspend fun deletePostFromAIClassification(postId: String): DoraSampleResponse {
return kotlin.runCatching {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package com.mashup.dorabangs.domain.repository

import androidx.paging.PagingData
import com.mashup.dorabangs.domain.model.AIClassificationFolders
import com.mashup.dorabangs.domain.model.AIClassificationPosts
import com.mashup.dorabangs.domain.model.DoraSampleResponse
import com.mashup.dorabangs.domain.model.classification.AIClassificationFeedPost
import kotlinx.coroutines.flow.Flow
Expand All @@ -22,10 +21,9 @@ interface AIClassificationRepository {

suspend fun getAIClassificationPostsByFolder(
folderId: String,
page: Int? = null,
limit: Int? = null,
order: String? = null,
): AIClassificationPosts
): Flow<PagingData<AIClassificationFeedPost>>

suspend fun deletePostFromAIClassification(
postId: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,11 @@ class GetAIClassificationPostsByFolderUseCase @Inject constructor(

suspend operator fun invoke(
folderId: String,
page: Int? = null,
limit: Int? = null,
order: Sort? = null,
) =
aiClassificationRepository.getAIClassificationPostsByFolder(
folderId = folderId,
page = page,
limit = limit,
order = order?.query,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,26 +55,22 @@ fun ClassificationListScreen(
pagingList[idx]?.let { item ->
when (item) {
is FeedUiModel.DoraChipUiModel -> {
if (state.selectedFolder == item.title || state.selectedFolder == "전체") {
ClassificationFolderMove(
selectedFolder = item.title,
onClickAllItemMoveButton = { onClickAllItemMoveButton(item.folderId) },
count = item.postCount,
)
}
ClassificationFolderMove(
selectedFolder = item.title,
onClickAllItemMoveButton = { onClickAllItemMoveButton(item.folderId) },
count = item.postCount,
)
}

is FeedUiModel.FeedCardUiModel -> {
if (state.selectedFolder == item.category || state.selectedFolder == "전체") {
ClassificationCardItem(
idx = idx,
lastIndex = pagingList.itemCount - 1,
cardItem = item,
onClickDeleteButton = onClickDeleteButton,
onClickMoveButton = onClickMoveButton,
onClickCardItem = onClickCardItem,
)
}
ClassificationCardItem(
idx = idx,
lastIndex = pagingList.itemCount - 1,
cardItem = item,
onClickDeleteButton = onClickDeleteButton,
onClickMoveButton = onClickMoveButton,
onClickCardItem = onClickCardItem,
)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import com.mashup.dorabangs.core.designsystem.component.chips.FeedUiModel

data class ClassificationState(
val chipState: ChipState = ChipState(),
val selectedFolder: String = "전체",
val isLoading: Boolean = false,
)

Expand Down
Loading

0 comments on commit 51fc787

Please sign in to comment.