Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/#96 컨퍼런스 조회 #196

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
15e9dc1
feat: backend-main으로 보내는 PR이 있을 때 새로 빌드를 실행하는 스크립트 추가
hong-sile Jul 19, 2023
ce9045a
Merge pull request #60 from woowacourse-teams/Feature/#56-actions_PR_…
hong-sile Jul 19, 2023
704ab65
feat: 빌드 하기전 backend-main으로 체크아웃하는 기능 추가
hong-sile Jul 19, 2023
f1b8174
feat: 빌드 하기전 backend-main으로 체크아웃하는 기능 추가
hong-sile Jul 19, 2023
e11bc72
feat: 깃허브 백엔드 자동 테스트 스크립트 작성
hong-sile Jul 19, 2023
6d2a92e
fix: 인식 안되는 특수문자 제거
hong-sile Jul 19, 2023
04fbfd3
fix: github workflow jdk의 distribution 추가
hong-sile Jul 19, 2023
52cc778
Merge branch 'woowacourse-teams:main' into main
tmdgh1592 Jul 19, 2023
7a2499e
chore: fragment-ktx 의존성 추가
tmdgh1592 Jul 17, 2023
1d381de
chore: retrofit, okhttp, kotlin-serialization 의존성 추가
tmdgh1592 Jul 17, 2023
ae31a89
merge: android-main 머지
tmdgh1592 Jul 28, 2023
892ec96
refactor: EventRepository getEvents() 메서드 시그니처 변경
tmdgh1592 Jul 28, 2023
0a0dfac
feat: EventViewModel에서 행사 정보를 불러오는 기능 구현
tmdgh1592 Jul 28, 2023
f6a6cc3
feat: 행사 목록을 서버로부터 불러와서 화면에 보여주는 기능 구현
tmdgh1592 Jul 28, 2023
9a7da71
fix: dp, px 변환 로직 에러 수정
tmdgh1592 Jul 31, 2023
a057e02
feat: 컨퍼런스 행사 목록아이템 화면 구현
tmdgh1592 Jul 31, 2023
5430808
feat: 컨퍼런스 행사 목록아이템 Divider 구현
tmdgh1592 Jul 31, 2023
9e9dd89
feat: 이벤트 태그의 높이 변경
tmdgh1592 Jul 31, 2023
914500c
feat: Event 리사이클러뷰에서 태그 리스트의 태그를 화면에 보여주는 기능 구현
tmdgh1592 Jul 31, 2023
64a04dc
refactor: 컨퍼런스 목록을 가져오는 API 수정
tmdgh1592 Jul 31, 2023
60d4506
Merge remote-tracking branch 'upstream/android-main' into Feature/#96…
tmdgh1592 Aug 1, 2023
016c308
refactor: ActivityTag, EventTag 패딩 값 변경
tmdgh1592 Aug 1, 2023
4fa04fc
refactor: Conference 목록을 불러오는 api 형식 변경
tmdgh1592 Aug 1, 2023
7bdfd8e
Merge remote-tracking branch 'upstream/android-main' into Feature/#96…
tmdgh1592 Aug 1, 2023
d8d435e
refactor: imageUrl에 대해 둥근 이미지를 적용하는 BindingAdapter에서 imageUrl이 null인 …
tmdgh1592 Aug 1, 2023
97f4c0f
refactor: EventCategory를 enum 클래스로 변경
tmdgh1592 Aug 1, 2023
ccbfb7a
fix: reflection 못하는 버그 수정
tmdgh1592 Aug 1, 2023
4e4842c
feat: 마감된 컨퍼런스는 진행 상태 텍스트를 회색으로 보여주도록 변경
tmdgh1592 Aug 1, 2023
179e98d
fix: 이벤트 진행 상태 텍스트뷰가 제대로 정렬되지 않는 버그 수정
tmdgh1592 Aug 1, 2023
8599a7a
feat: Event 리사이클러뷰와 필터 설정 뷰 사이에 구분선 추가
tmdgh1592 Aug 1, 2023
192f0cf
feat: 컨퍼런스 포스터 이미지 로딩 에러 이미지 적용
tmdgh1592 Aug 1, 2023
688f6a2
fix: 컨퍼런스 뷰별로 포스터 크기 다른 버그 수정
tmdgh1592 Aug 1, 2023
9f1fdfb
Merge remote-tracking branch 'upstream/android-main' into Feature/#96…
tmdgh1592 Aug 1, 2023
e32bb16
merge: android-main 머지
tmdgh1592 Aug 1, 2023
5441a7e
refactor: XML 라인 포맷팅
tmdgh1592 Aug 1, 2023
cb834fd
fix: px 확장함수 대신 dp를 사용하도록 변경
tmdgh1592 Aug 1, 2023
6dd4bca
fix: EventsFragment에서 EventFragment로 변경
tmdgh1592 Aug 1, 2023
eff7aa3
fix: Configuration Change 시에 태그가 계속 추가되는 버그 수정
tmdgh1592 Aug 1, 2023
a2a5cfc
refactor: Event에서 Conference로 네이밍 구체화
tmdgh1592 Aug 1, 2023
83448b0
refactor: EventFragment에 컨퍼런스, 대회 탭 보여주는 기능 구현
tmdgh1592 Aug 1, 2023
1355061
feat: 컨퍼런스 필터링 ViewModel 구현
tmdgh1592 Aug 2, 2023
c1252cb
Merge remote-tracking branch 'upstream/android-main' into Feature/#96…
tmdgh1592 Aug 2, 2023
07eac84
feat: 컨퍼런스 필터 기본 화면 구현
tmdgh1592 Aug 2, 2023
4580d51
feat: IconTextButton 커스텀뷰 구현
tmdgh1592 Aug 2, 2023
159eb79
refactor: EventFragmentStateAdapter 매직 넘버 제거
tmdgh1592 Aug 2, 2023
f723484
refactor: EventTag의 부모 View를 TextView로 변경
tmdgh1592 Aug 2, 2023
06cd4da
feat: 필터 설정 화면에서 선택한 태그를 컨퍼런스 화면에서 보여주는 기능 구현
tmdgh1592 Aug 2, 2023
aff13fd
feat: 필터 설정 화면에서 이미 설정된 필터를 적용하는 기능 구현
tmdgh1592 Aug 2, 2023
428fc5d
feat: 전체 선택/해제 기능 구현
tmdgh1592 Aug 3, 2023
89d9349
feat: 행사 필터링 기능 구현
tmdgh1592 Aug 3, 2023
20d6482
feat: 기간 필터링 여부에 따른 필터 Chip 변경 구현
tmdgh1592 Aug 3, 2023
73efc7e
feat: 필터링 날짜 설정하는 기능 구현
tmdgh1592 Aug 3, 2023
868c9ca
feat: DatePickerDialog 스타일 적용
tmdgh1592 Aug 3, 2023
93516cc
fix: 캘린더 클릭하면 예외 발생하는 버그 수정
tmdgh1592 Aug 3, 2023
c44cf9d
fix: 필터 화면에서 기간 설정이 안 되는 버그 수정
tmdgh1592 Aug 3, 2023
336a249
merge: android-main 머지 / 충돌 해결
tmdgh1592 Aug 3, 2023
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
5 changes: 2 additions & 3 deletions android/2023-emmsale/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ plugins {
kotlin("plugin.serialization") version "1.8.21"
id("kotlin-kapt")
id("com.google.firebase.crashlytics")
id("kotlin-parcelize")
}

android {
Expand Down Expand Up @@ -78,7 +79,6 @@ dependencies {
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1")
implementation("androidx.browser:browser:1.5.0")
implementation("androidx.work:work-runtime-ktx:2.8.1")
implementation("com.google.firebase:firebase-messaging-ktx:23.2.0")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
implementation("androidx.fragment:fragment-ktx:1.6.1")
Expand All @@ -95,13 +95,12 @@ dependencies {
implementation("com.google.firebase:firebase-analytics-ktx")
implementation("com.google.firebase:firebase-messaging-ktx")
implementation("com.google.firebase:firebase-crashlytics-ktx")
implementation("com.google.firebase:firebase-messaging:23.2.0")

testImplementation("org.junit.jupiter", "junit-jupiter", "5.8.2")
testImplementation("org.assertj", "assertj-core", "3.22.0")
testImplementation("io.mockk:mockk-android:1.13.5")
testImplementation("io.mockk:mockk-agent:1.13.5")
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.2")
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.3")

// imageview
implementation("de.hdodenhof:circleimageview:3.1.0")
Expand Down
5 changes: 4 additions & 1 deletion android/2023-emmsale/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@
android:theme="@style/Theme.Emmsale"
android:usesCleartextTraffic="true"
tools:targetApi="33">
<activity
android:name=".presentation.ui.main.event.conferenceFilter.ConferenceFilterActivity"
android:exported="true" />
<activity
android:name=".presentation.ui.main.MainActivity"
android:exported="false" />
android:exported="true" />
<activity
android:name=".presentation.ui.onboarding.OnboardingActivity"
android:exported="true" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ class ServiceFactory {
fun <T> create(service: Class<T>): T = retrofit.create(service)

companion object {
private const val BASE_URL = "https://kerdy.kro.kr/"
private const val BASE_URL = "https://prod.kerdy.kro.kr"
}
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package com.emmsale.data.event
package com.emmsale.data.conference

import java.time.LocalDateTime

data class Event(
data class Conference(
val id: Long,
val name: String,
val startDate: LocalDateTime,
val endDate: LocalDateTime,
val status: String,
val status: ConferenceStatus,
val tags: List<String>,
val posterUrl: String,
val posterUrl: String?,
val dDay: Int,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.emmsale.data.conference

import com.emmsale.data.common.ApiResult

interface ConferenceRepository {
suspend fun getConferences(
category: EventCategory,
year: Int? = null,
month: Int? = null,
status: ConferenceStatus? = null,
tag: String? = null,
): ApiResult<List<Conference>>
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package com.emmsale.data.conference

import com.emmsale.data.common.ApiResult
import com.emmsale.data.common.handleApi
import com.emmsale.data.conference.dto.ConferenceApiModel
import com.emmsale.data.conference.dto.toData
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext

class ConferenceRepositoryImpl(
private val dispatcher: CoroutineDispatcher = Dispatchers.IO,
private val conferenceService: ConferenceService,
) : ConferenceRepository {
override suspend fun getConferences(
category: EventCategory,
year: Int?,
month: Int?,
status: ConferenceStatus?,
tag: String?,
): ApiResult<List<Conference>> = withContext(dispatcher) {
handleApi(
conferenceService.getEvents(category.text, year, month, status?.text, tag),
List<ConferenceApiModel>::toData
)
}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package com.emmsale.data.event
package com.emmsale.data.conference

import com.emmsale.data.event.dto.ConferenceApiModel
import com.emmsale.data.conference.dto.ConferenceApiModel
import retrofit2.Response
import retrofit2.http.GET
import retrofit2.http.Query

interface EventService {
@GET("/events/conferences")
interface ConferenceService {
@GET("/events")
suspend fun getEvents(
@Query("category") category: String,
@Query("year") year: Int? = null,
@Query("month") month: Int? = null,
@Query("status") status: String? = null,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.emmsale.data.conference

enum class ConferenceStatus(val text: String) {
IN_PROGRESS("진행 중"),
SCHEDULED("진행 예정"),
ENDED("종료된 행사");

companion object {
fun from(status: String): ConferenceStatus = values().find { it.text == status }
?: throw IllegalArgumentException("${status}는 올바르지 않은 행사 상태입니다.")
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.emmsale.data.conference

enum class EventCategory(val text: String) {
CONFERENCE("CONFERENCE"),
COMPETITION("COMPETITION");
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.emmsale.data.event.dto
package com.emmsale.data.conference.dto

import com.emmsale.data.event.Event
import com.emmsale.data.conference.Conference
import com.emmsale.data.conference.ConferenceStatus
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import java.time.LocalDateTime
Expand All @@ -21,16 +22,16 @@ data class ConferenceApiModel(
@SerialName("tags")
val tags: List<String>,
@SerialName("imageUrl")
val posterUrl: String,
val posterUrl: String? = null,
@SerialName("remainingDays")
val dDay: Int,
) {
fun toData(): Event = Event(
fun toData(): Conference = Conference(
id = id,
name = name,
startDate = parseDate(startDate),
endDate = parseDate(endDate),
status = status,
status = ConferenceStatus.from(status),
tags = tags,
posterUrl = posterUrl,
dDay = dDay,
Expand All @@ -46,4 +47,4 @@ data class ConferenceApiModel(
}
}

fun List<ConferenceApiModel>.toData(): List<Event> = map { it.toData() }
fun List<ConferenceApiModel>.toData(): List<Conference> = map { it.toData() }

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.emmsale.data.eventTag

class ConferenceTag(
id: Long,
name: String,
) : EventTag(id, name)
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.emmsale.data.eventTag

sealed class EventTag(
val id: Long,
val name: String,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.emmsale.data.eventTag

import com.emmsale.data.common.ApiResult
import com.emmsale.data.conference.EventCategory

interface EventTagRepository {
suspend fun getEventTags(category: EventCategory): ApiResult<List<EventTag>>
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.emmsale.data.eventTag

import com.emmsale.data.common.ApiResult
import com.emmsale.data.common.handleApi
import com.emmsale.data.conference.EventCategory
import com.emmsale.data.eventTag.dto.ConferenceTagApiModel
import com.emmsale.data.eventTag.mapper.toData
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext

class EventTagRepositoryImpl(
private val dispatcher: CoroutineDispatcher = Dispatchers.IO,
private val eventTagService: EventTagService,
) : EventTagRepository {
override suspend fun getEventTags(category: EventCategory): ApiResult<List<EventTag>> =
withContext(dispatcher) {
handleApi(
response = eventTagService.getConferenceTags(category.text),
mapToDomain = List<ConferenceTagApiModel>::toData
)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.emmsale.data.eventTag

import com.emmsale.data.eventTag.dto.ConferenceTagApiModel
import retrofit2.Response
import retrofit2.http.GET
import retrofit2.http.Query

interface EventTagService {
@GET("/event/tag")
suspend fun getConferenceTags(
@Query("category") category: String,
): Response<List<ConferenceTagApiModel>>
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package com.emmsale.data.eventTag

import com.emmsale.data.eventTag.dto.ConferenceTagApiModel
import retrofit2.Response

class FakeEventTagService : EventTagService {
override suspend fun getConferenceTags(
category: String,
): Response<List<ConferenceTagApiModel>> = Response.success(provideConferenceTags())

private fun provideConferenceTags(): List<ConferenceTagApiModel> = listOf(
ConferenceTagApiModel(
id = 1,
name = "백엔드"
),
ConferenceTagApiModel(
id = 2,
name = "프론트엔드"
),
ConferenceTagApiModel(
id = 3,
name = "안드로이드"
),
ConferenceTagApiModel(
id = 4,
name = "IOS"
),
ConferenceTagApiModel(
id = 5,
name = "AI"
),
ConferenceTagApiModel(
id = 6,
name = "알고리즘"
),
ConferenceTagApiModel(
id = 7,
name = "정보보안"
),
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.emmsale.data.eventTag.dto

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

@Serializable
data class ConferenceTagApiModel(
@SerialName("id")
val id: Long,
@SerialName("name")
val name: String,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.emmsale.data.eventTag.mapper

import com.emmsale.data.eventTag.ConferenceTag
import com.emmsale.data.eventTag.EventTag
import com.emmsale.data.eventTag.dto.ConferenceTagApiModel

fun ConferenceTagApiModel.toData(): EventTag = ConferenceTag(
id = id,
name = name,
)

fun List<ConferenceTagApiModel>.toData(): List<EventTag> = map { it.toData() }

fun ConferenceTag.toApiModel(): ConferenceTagApiModel = ConferenceTagApiModel(
id = id,
name = name,
)
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ package com.emmsale.di

import com.emmsale.data.activity.ActivityRepository
import com.emmsale.data.activity.ActivityRepositoryImpl
import com.emmsale.data.event.EventRepository
import com.emmsale.data.event.EventRepositoryImpl
import com.emmsale.data.conference.ConferenceRepository
import com.emmsale.data.conference.ConferenceRepositoryImpl
import com.emmsale.data.eventTag.EventTagRepository
import com.emmsale.data.eventTag.EventTagRepositoryImpl
import com.emmsale.data.eventdetail.EventDetailRepository
import com.emmsale.data.eventdetail.EventDetailRepositoryImpl
import com.emmsale.data.fcmToken.FcmTokenRepository
Expand Down Expand Up @@ -35,12 +37,15 @@ class RepositoryContainer(
val memberRepository: MemberRepository by lazy {
MemberRepositoryImpl(memberService = serviceContainer.memberService)
}
val eventRepository: EventRepository by lazy {
EventRepositoryImpl(eventService = serviceContainer.eventService)
val conferenceRepository: ConferenceRepository by lazy {
ConferenceRepositoryImpl(conferenceService = serviceContainer.conferenceService)
}
val fcmTokenRepository: FcmTokenRepository by lazy {
FcmTokenRepositoryImpl(fcmTokenService = serviceContainer.fcmTokenService)
}
val eventTagRepository: EventTagRepository by lazy {
EventTagRepositoryImpl(eventTagService = serviceContainer.eventTagService)
}
val eventDetailRepository: EventDetailRepository by lazy {
EventDetailRepositoryImpl(eventDetailService = serviceContainer.eventDetailService)
}
Expand Down
Loading