Skip to content

Commit

Permalink
[FEATURE] #50 : 이벤트 등록 EventRequest DTO 생성
Browse files Browse the repository at this point in the history
  • Loading branch information
tgyuuAn committed Nov 29, 2023
1 parent 9b37a5c commit 2d8980e
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,12 @@ import java.time.LocalDate

interface EventRepository {
suspend fun getMonthEvents(date: LocalDate): Result<List<Event>>

suspend fun postEvent(
eventTitle: String,
eventContent: String,
eventLocation: String,
eventDate: String,
eventTime: String,
): Result<Unit>
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,14 @@ class EventRepositoryImpl @Inject constructor(
eventResponse.toDomain()
}
}

override suspend fun postEvent(
eventTitle: String,
eventContent: String,
eventLocation: String,
eventDate: String,
eventTime: String,
): Result<Unit> {
TODO("Not yet implemented")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,20 @@ import javax.inject.Inject

class PostEventUseCase @Inject constructor(
private val eventRepository: EventRepository,
)
) {
suspend operator fun invoke(
eventTitle: String,
eventContent: String,
eventLocation: String,
eventDate: String,
eventTime: String,
): Result<Unit> = runCatching {
eventRepository.postEvent(
eventTitle = eventTitle,
eventContent = eventContent,
eventLocation = eventLocation,
eventDate = eventDate,
eventTime = eventTime,
)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.wap.wapp.core.network.model.event

data class EventRequest(
val eventTitle: String = "",
val eventContent: String = "",
val eventLocation: String = "",
val eventDate: String = "",
val eventTime: String = "",
)

0 comments on commit 2d8980e

Please sign in to comment.