diff --git a/core/data/src/main/java/com/wap/wapp/core/data/repository/event/EventRepository.kt b/core/data/src/main/java/com/wap/wapp/core/data/repository/event/EventRepository.kt index 3769ba1d..d9496e04 100644 --- a/core/data/src/main/java/com/wap/wapp/core/data/repository/event/EventRepository.kt +++ b/core/data/src/main/java/com/wap/wapp/core/data/repository/event/EventRepository.kt @@ -5,4 +5,12 @@ import java.time.LocalDate interface EventRepository { suspend fun getMonthEvents(date: LocalDate): Result> + + suspend fun postEvent( + eventTitle: String, + eventContent: String, + eventLocation: String, + eventDate: String, + eventTime: String, + ): Result } diff --git a/core/data/src/main/java/com/wap/wapp/core/data/repository/event/EventRepositoryImpl.kt b/core/data/src/main/java/com/wap/wapp/core/data/repository/event/EventRepositoryImpl.kt index f189e019..49acb09b 100644 --- a/core/data/src/main/java/com/wap/wapp/core/data/repository/event/EventRepositoryImpl.kt +++ b/core/data/src/main/java/com/wap/wapp/core/data/repository/event/EventRepositoryImpl.kt @@ -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 { + TODO("Not yet implemented") + } } diff --git a/core/domain/src/main/java/com/wap/wapp/core/domain/usecase/event/PostEventUseCase.kt b/core/domain/src/main/java/com/wap/wapp/core/domain/usecase/event/PostEventUseCase.kt index da704d8a..7e573841 100644 --- a/core/domain/src/main/java/com/wap/wapp/core/domain/usecase/event/PostEventUseCase.kt +++ b/core/domain/src/main/java/com/wap/wapp/core/domain/usecase/event/PostEventUseCase.kt @@ -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 = runCatching { + eventRepository.postEvent( + eventTitle = eventTitle, + eventContent = eventContent, + eventLocation = eventLocation, + eventDate = eventDate, + eventTime = eventTime, + ) + } +} diff --git a/core/network/src/main/java/com/wap/wapp/core/network/model/event/EventRequest.kt b/core/network/src/main/java/com/wap/wapp/core/network/model/event/EventRequest.kt new file mode 100644 index 00000000..1b72c02d --- /dev/null +++ b/core/network/src/main/java/com/wap/wapp/core/network/model/event/EventRequest.kt @@ -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 = "", +)