feat: 상단에 최근 공지사항 표시
This commit is contained in:
@@ -10,6 +10,7 @@ import Moya
|
||||
|
||||
enum NoticeApi {
|
||||
case getNotices
|
||||
case getLatestNotice
|
||||
}
|
||||
|
||||
extension NoticeApi: TargetType {
|
||||
@@ -21,6 +22,9 @@ extension NoticeApi: TargetType {
|
||||
switch self {
|
||||
case .getNotices:
|
||||
return "/notice"
|
||||
|
||||
case .getLatestNotice:
|
||||
return "/notice/latest"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,6 +37,9 @@ extension NoticeApi: TargetType {
|
||||
case .getNotices:
|
||||
let parameters = ["timezone": TimeZone.current.identifier] as [String: Any]
|
||||
return .requestParameters(parameters: parameters, encoding: URLEncoding.queryString)
|
||||
|
||||
case .getLatestNotice:
|
||||
return .requestPlain
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -17,5 +17,9 @@ final class NoticeRepository {
|
||||
func getNotices() -> AnyPublisher<Response, MoyaError> {
|
||||
return api.requestPublisher(.getNotices)
|
||||
}
|
||||
|
||||
func getLatestNotice() -> AnyPublisher<Response, MoyaError> {
|
||||
return api.requestPublisher(.getLatestNotice)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user