Skip to content

Commit

Permalink
Refactor/#719 데이터 모델 리팩토링 (#855)
Browse files Browse the repository at this point in the history
* refactor: Activity 목록 조회 반환 타입을 List<ActivityResponse>로 변경

* refactor: OpenProfileUrl 업데이트 API 제거

* refactor: 사용자의 Activity 목록 조회 반환 타입을 List<ActivityResponse>로 변경

* refactor: 사용자의 Activity 삭제 반환 타입을 List<ActivityResponse>로 변경

* refactor: 사용자 조회 Response에서 openProfileUrl을 제거하고 활동 목록을 조회하도록 변경

* refactor: MemberActivitiesResponse mapper 제거

* refactor: Member mapper에 활동 목록 변환 로직 추가

* refactor: ActivityType을 String에서 enum으로 받도록 변경

* refactor: ActivityType의 FIELD를 INTEREST_FIELD로 변경

* refactor: MemberOpenProfileUrlUpdateRequest 제거

* refactor: 라인 포맷팅

* refactor: 사용자 활동 추가의 반환 타입을 List<ActivityResponse>로 변경

* refactor: 사용하지 않는 클래스 제거

* refactor: MemberActivitiesUpdateRequest를 MemberActivitiesAddRequest로 변경

* refactor(event): Conference, Competition, EventDetail을 Event로 통합

* refactor(scrappedEvent): ScrappedEvent를 Event로 통합

* refactor(recruitment): Recruitment 리팩터링

* refactor : MessageRoom, Message 모델 리팩토링

* refactor : Message Repository 리팩토링

* refactor : MessageRoom 화면 리팩토링

* refactor : Message 리팩토링

* refactor : FeedList 리팩토링

* refactor : FeedDetail 리팩토링

* refactor : FeedWriting 리팩토링

* refactor : BaseUrl 주소 변경 및 버젼 변경

---------

Co-authored-by: buna <tmdgh1592@naver.com>
Co-authored-by: ki960213 <ki960213@gmail.com>
  • Loading branch information
3 people authored Nov 28, 2023
1 parent 7ddcbc1 commit 1678659
Show file tree
Hide file tree
Showing 119 changed files with 743 additions and 1,340 deletions.
8 changes: 4 additions & 4 deletions android/2023-emmsale/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ android {
applicationId = "com.emmsale"
minSdk = 28
targetSdk = 33
versionCode = 58
versionName = "2.1.5"
versionCode = 59
versionName = "2.2.5"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"

Expand All @@ -36,11 +36,11 @@ android {
}
buildTypes {
debug {
buildConfigField("String", "BASE_URL", "\"https://kerdy.kro.kr\"")
buildConfigField("String", "BASE_URL", "\"https://dev.kerdy.kro.kr\"")
buildConfigField(
"String",
"IMAGE_URL_PREFIX",
"\"https://d3ms3abrjbgefs.cloudfront.net/dev/\"",
"\"https://kerdy-dev.s3.ap-northeast-2.amazonaws.com/dev/\"",
)
}
release {
Expand Down
2 changes: 1 addition & 1 deletion android/2023-emmsale/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
android:launchMode="singleTask"
android:parentActivityName=".presentation.ui.main.MainActivity"
android:windowSoftInputMode="adjustResize" />
<activity android:name=".presentation.ui.postWriting.PostWritingActivity" />
<activity android:name=".presentation.ui.feedWriting.FeedWritingActivity" />
<activity
android:name=".presentation.ui.splash.SplashActivity"
android:exported="true">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,11 @@ data class MemberCreateRequest(
)

@Serializable
data class MemberActivitiesUpdateRequest(
data class MemberActivitiesAddRequest(
@SerialName("activityIds")
val activityIds: List<Long>,
)

@Serializable
data class MemberOpenProfileUrlUpdateRequest(
@SerialName("openProfileUrl")
val openProfileUrl: String,
)

@Serializable
data class MemberDescriptionUpdateRequest(
@SerialName("description")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,23 @@ package com.emmsale.data.apiModel.response
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

@Serializable
data class ActivitiesResponse(
@SerialName("activityType")
val category: String = "-",
@SerialName("activityResponses")
val activities: List<ActivityResponse> = emptyList(),
)

@Serializable
data class ActivityResponse(
@SerialName("id")
val id: Long,
@SerialName("name")
val name: String,
)

@Serializable
data class MemberActivitiesResponse(
@SerialName("activityType")
val activityType: String,
@SerialName("memberActivityResponses")
val memberActivityResponses: List<ActivityResponse>,
)
val activityType: ActivityType,
) {
enum class ActivityType {
@SerialName("동아리")
CLUB,

@SerialName("교육")
EDUCATION,

@SerialName("직무")
INTEREST_FIELD,
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,99 +4,7 @@ import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

@Serializable
data class ConferenceResponse(
@SerialName("id")
val id: Long,
@SerialName("name")
val name: String,
@SerialName("eventStartDate")
val startDate: String, // format : "2023:09:03:12:00:00",
@SerialName("eventEndDate")
val endDate: String, // format : "2023:09:03:12:00:00",
@SerialName("applyStartDate")
val applyStartDate: String, // format : "2023:09:03:12:00:00"
@SerialName("applyEndDate")
val applyEndDate: String, // format : "2023:09:03:12:00:00"
@SerialName("tags")
val tags: List<String>,
@SerialName("thumbnailUrl")
val posterUrl: String? = null,
@SerialName("eventMode")
val onOfflineMode: OnOfflineMode,
@SerialName("paymentType")
val paymentType: PaymentType,
) {
enum class OnOfflineMode {
@SerialName("온라인")
ONLINE,

@SerialName("오프라인")
OFFLINE,

@SerialName("온오프라인")
ON_OFFLINE,
}

enum class PaymentType {
@SerialName("유료")
PAID,

@SerialName("무료")
FREE,

@SerialName("유무료")
PAID_OR_FREE,
}
}

@Serializable
data class CompetitionResponse(
@SerialName("id")
val id: Long,
@SerialName("name")
val name: String,
@SerialName("eventStartDate")
val startDate: String, // format : "2023:09:03:12:00:00",
@SerialName("eventEndDate")
val endDate: String, // format : "2023:09:03:12:00:00",
@SerialName("applyStartDate")
val applyStartDate: String, // format : "2023:09:03:12:00:00"
@SerialName("applyEndDate")
val applyEndDate: String, // format : "2023:09:03:12:00:00"
@SerialName("tags")
val tags: List<String>,
@SerialName("thumbnailUrl")
val posterUrl: String? = null,
@SerialName("eventMode")
val onOfflineMode: OnOfflineMode,
@SerialName("paymentType")
val paymentType: PaymentType,
) {
enum class OnOfflineMode {
@SerialName("온라인")
ONLINE,

@SerialName("오프라인")
OFFLINE,

@SerialName("온오프라인")
ON_OFFLINE,
}

enum class PaymentType {
@SerialName("유료")
PAID,

@SerialName("무료")
FREE,

@SerialName("유무료")
PAID_OR_FREE,
}
}

@Serializable
data class EventDetailResponse(
data class EventResponse(
@SerialName("id")
val id: Long,
@SerialName("name")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,23 @@ import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

@Serializable
data class FeedDetailResponse(
data class FeedResponse(
@SerialName("id")
val id: Long,
@SerialName("eventId")
val eventId: Long,
@SerialName("writer")
val writer: WriterResponse,
@SerialName("title")
val title: String,
@SerialName("content")
val content: String,
@SerialName("writer")
val writer: MemberResponse,
@SerialName("images")
val imageUrls: List<String>,
@SerialName("commentCount")
val commentCount: Int,
@SerialName("createdAt")
val createdAt: String,
@SerialName("updatedAt")
val updatedAt: String,
)

@Serializable
data class WriterResponse(
@SerialName("memberId")
val memberId: Long,
@SerialName("name")
val name: String,
@SerialName("imageUrl")
val imageUrl: String,
)
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ data class MemberResponse(
val description: String = "",
@SerialName("imageUrl")
val imageUrl: String,
@SerialName("openProfileUrl")
val openProfileUrl: String = "",
@SerialName("activities")
val activities: List<ActivityResponse> = emptyList(),
)
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,26 @@ import kotlinx.serialization.Serializable
data class MessageRoomResponse(
@SerialName("roomId")
val roomId: String,
@SerialName("interlocutorId")
val senderId: Long,
@SerialName("interlocutorName")
val senderName: String,
@SerialName("interlocutorProfile")
val senderProfileImageUrl: String,
@SerialName("interlocutor")
val interlocutor: MemberResponse,
@SerialName("recentlyMessage")
val recentMessage: String,
@SerialName("recentlyMessageTime")
val recentMessageTime: String,
val recentMessage: MessageResponse,
)

@Serializable
data class MessageSendResponse(
@SerialName("roomId")
val roomId: String,
)

@Serializable
data class MessageResponse(
@SerialName("senderId")
val senderId: Long,
@SerialName("id")
val id: Long,
@SerialName("sender")
val sender: MemberResponse,
@SerialName("content")
val message: String,
val content: String,
@SerialName("createdAt")
val createdAt: String,
)

@Serializable
data class MessageSendResponse(
@SerialName("roomId")
val roomId: String,
)

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,16 @@ import kotlinx.serialization.Serializable

@Serializable
data class RecruitmentResponse(
@SerialName("id")
@SerialName("postId")
val id: Long,
@SerialName("memberId")
val memberId: Long,
@SerialName("name")
val name: String,
@SerialName("imageUrl")
val imageUrl: String,
@SerialName("content")
val content: String,
@SerialName("updatedAt")
val updatedAt: String,
@SerialName("member")
val member: MemberResponse,
@SerialName("eventId")
val eventId: Long,
)

@Serializable
Expand Down

This file was deleted.

Loading

0 comments on commit 1678659

Please sign in to comment.