From 0dc4e01043635e1d62bf566b6052c8028e8f1071 Mon Sep 17 00:00:00 2001 From: dlwogus0128 <79050615+dlwogus0128@users.noreply.github.com> Date: Mon, 20 Jan 2025 21:13:59 +0900 Subject: [PATCH] =?UTF-8?q?[Feat]=20#473=20-=20home/employment=20=EB=84=A4?= =?UTF-8?q?=ED=8A=B8=EC=9B=8C=ED=81=AC=20=EB=A0=88=EC=9D=B4=EC=96=B4=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Modules/Networks/Sources/API/HomeAPI.swift | 7 +++++-- .../Sources/Entity/HomeEmploymentEntity.swift | 18 ++++++++++++++++++ .../Networks/Sources/Service/HomeService.swift | 5 +++++ 3 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 SOPT-iOS/Projects/Modules/Networks/Sources/Entity/HomeEmploymentEntity.swift diff --git a/SOPT-iOS/Projects/Modules/Networks/Sources/API/HomeAPI.swift b/SOPT-iOS/Projects/Modules/Networks/Sources/API/HomeAPI.swift index b24a8f62..0165719e 100644 --- a/SOPT-iOS/Projects/Modules/Networks/Sources/API/HomeAPI.swift +++ b/SOPT-iOS/Projects/Modules/Networks/Sources/API/HomeAPI.swift @@ -18,6 +18,7 @@ public enum HomeAPI { case getInsightPosts case getGroupAll case getCoffeeChat + case getEmployment } extension HomeAPI: BaseAPI { @@ -35,19 +36,21 @@ extension HomeAPI: BaseAPI { return "/meeting/all" case .getCoffeeChat: return "/coffeechat" + case .getEmployment: + return "/employment" } } public var method: Moya.Method { switch self { - case .getDescription, .getAppServiceAccessStatus, .getInsightPosts, .getGroupAll, .getCoffeeChat: + case .getDescription, .getAppServiceAccessStatus, .getInsightPosts, .getGroupAll, .getCoffeeChat, .getEmployment: return .get } } public var task: Moya.Task { switch self { - case .getDescription, .getAppServiceAccessStatus, .getInsightPosts, .getCoffeeChat: + case .getDescription, .getAppServiceAccessStatus, .getInsightPosts, .getCoffeeChat, .getEmployment: return .requestPlain case .getGroupAll: return .requestParameters(parameters: ["page": 1, "take": 10, "category": "행사,세미나"], encoding: URLEncoding.queryString) diff --git a/SOPT-iOS/Projects/Modules/Networks/Sources/Entity/HomeEmploymentEntity.swift b/SOPT-iOS/Projects/Modules/Networks/Sources/Entity/HomeEmploymentEntity.swift new file mode 100644 index 00000000..7a9ee3c8 --- /dev/null +++ b/SOPT-iOS/Projects/Modules/Networks/Sources/Entity/HomeEmploymentEntity.swift @@ -0,0 +1,18 @@ +// +// HomeEmploymentEntity.swift +// Networks +// +// Created by Jae Hyun Lee on 1/20/25. +// Copyright © 2025 SOPT-iOS. All rights reserved. +// + +import Foundation + +// MARK: - HomeEmploymentEntity + +public struct HomeEmploymentEntity: Codable { + public let id: Int + public let categoryName, title, profileImage, name: String + public let content: String + public let images: [String] +} diff --git a/SOPT-iOS/Projects/Modules/Networks/Sources/Service/HomeService.swift b/SOPT-iOS/Projects/Modules/Networks/Sources/Service/HomeService.swift index 3396b693..fbe5321e 100644 --- a/SOPT-iOS/Projects/Modules/Networks/Sources/Service/HomeService.swift +++ b/SOPT-iOS/Projects/Modules/Networks/Sources/Service/HomeService.swift @@ -19,6 +19,7 @@ public protocol HomeService { func getInsightPosts() -> AnyPublisher<[HomeInsightPostsEntity], Error> func getGroupAll() -> AnyPublisher<[HomeGroupEntity], Error> func getCoffeeChat() -> AnyPublisher<[HomeCoffeeChatEntity], Error> + func getHomeEmploymentEntity() -> AnyPublisher<[HomeEmploymentEntity], Error> } extension DefaultHomeService: HomeService { @@ -41,4 +42,8 @@ extension DefaultHomeService: HomeService { public func getCoffeeChat() -> AnyPublisher<[HomeCoffeeChatEntity], any Error> { requestObjectInCombine(.getCoffeeChat) } + + public func getHomeEmploymentEntity() -> AnyPublisher<[HomeEmploymentEntity], any Error> { + requestObjectInCombine(.getEmployment) + } }