28 lines
615 B
Swift
28 lines
615 B
Swift
//
|
|
// EventRepository.swift
|
|
// SodaLive
|
|
//
|
|
// Created by klaus on 2023/08/09.
|
|
//
|
|
|
|
import Foundation
|
|
import CombineMoya
|
|
import Combine
|
|
import Moya
|
|
|
|
final class EventRepository {
|
|
private let api = MoyaProvider<EventApi>()
|
|
|
|
func getEvents() -> AnyPublisher<Response, MoyaError> {
|
|
return api.requestPublisher(.getEvents)
|
|
}
|
|
|
|
func getEventPopup() -> AnyPublisher<Response, MoyaError> {
|
|
return api.requestPublisher(.getEventPopup)
|
|
}
|
|
|
|
func getEventDetail(id: Int) -> AnyPublisher<Response, MoyaError> {
|
|
return api.requestPublisher(.getEventDetail(id: id))
|
|
}
|
|
}
|