-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[Feat] #229 Coaching Service 구현 및 테스트 코드 작성
- Loading branch information
Showing
27 changed files
with
392 additions
and
243 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,5 +12,7 @@ protocol Store { | |
associatedtype State | ||
|
||
var state: State { get } | ||
|
||
@MainActor | ||
func send(action: Action) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 0 additions & 52 deletions
52
Smeem-iOS/Smeem-iOS/Network/API/Coaching/CoachingResponse.swift
This file was deleted.
Oops, something went wrong.
32 changes: 32 additions & 0 deletions
32
Smeem-iOS/Smeem-iOS/Network/API/Coaching/CoachingService.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// | ||
// CoachingService.swift | ||
// Smeem-iOS | ||
// | ||
// Created by 황찬미 on 11/24/24. | ||
// | ||
|
||
import Foundation | ||
import Moya | ||
|
||
final class CoachingService: CoachingServiceProtocol { | ||
|
||
var coachingProvider: MoyaProvider<CoachingEndPoint>! | ||
var detailDiaryProvider: MoyaProvider<DetailDiaryEndPoint> | ||
|
||
init(coachingProvider: MoyaProvider<CoachingEndPoint> = MoyaProvider<CoachingEndPoint>(plugins: [MoyaLoggingPlugin()]), | ||
detailDiaryProvider: MoyaProvider<DetailDiaryEndPoint> = MoyaProvider<DetailDiaryEndPoint>(plugins: [MoyaLoggingPlugin()])) { | ||
self.coachingProvider = coachingProvider | ||
self.detailDiaryProvider = detailDiaryProvider | ||
} | ||
|
||
func coachingPostAPI(diaryID: Int) async throws -> CoachingsResponse { | ||
let result: CoachingsResponse = try await coachingProvider.request(CoachingEndPoint.coaching(diaryId: diaryID)) | ||
return result | ||
} | ||
|
||
func detailDiaryAPI(diaryID: Int) async throws -> DetailDiaryResponse { | ||
let result: DetailDiaryResponse = try await detailDiaryProvider.request(DetailDiaryEndPoint.detailDiary(diaryID: diaryID)) | ||
return result | ||
} | ||
} | ||
|
13 changes: 13 additions & 0 deletions
13
Smeem-iOS/Smeem-iOS/Network/API/Coaching/CoachingServiceProtocol.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// | ||
// CoachingServiceProtocol.swift | ||
// Smeem-iOS | ||
// | ||
// Created by 황찬미 on 11/24/24. | ||
// | ||
|
||
import Foundation | ||
|
||
protocol CoachingServiceProtocol { | ||
func coachingPostAPI(diaryID: Int) async throws -> CoachingsResponse | ||
func detailDiaryAPI(diaryID: Int) async throws -> DetailDiaryResponse | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.