Skip to content

Commit

Permalink
[Feat] #471 - home/posts 네트워크 레이어 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
dlwogus0128 committed Jan 18, 2025
1 parent d205620 commit ddf4e5b
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
7 changes: 5 additions & 2 deletions SOPT-iOS/Projects/Modules/Networks/Sources/API/HomeAPI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import Core
public enum HomeAPI {
case getDescription
case getAppServiceAccessStatus
case getInsightPosts
}

extension HomeAPI: BaseAPI {
Expand All @@ -26,19 +27,21 @@ extension HomeAPI: BaseAPI {
return "/description"
case .getAppServiceAccessStatus:
return "/app-service"
case .getInsightPosts:
return "/posts"
}
}

public var method: Moya.Method {
switch self {
case .getDescription, .getAppServiceAccessStatus:
case .getDescription, .getAppServiceAccessStatus, .getInsightPosts:
return .get
}
}

public var task: Moya.Task {
switch self {
case .getDescription, .getAppServiceAccessStatus:
case .getDescription, .getAppServiceAccessStatus, .getInsightPosts:
return .requestPlain
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//
// HomeInsightPostsEntity.swift
// Networks
//
// Created by Jae Hyun Lee on 1/18/25.
// Copyright © 2025 SOPT-iOS. All rights reserved.
//

import Foundation

// MARK: - Entity

public struct HomeInsightPostsEntity: Codable {
public let id: Int
public let title, category: String
public let profileImage: String?
public let name: String?
public let content: String
public let isHotPost: Bool
}

0 comments on commit ddf4e5b

Please sign in to comment.