-
Notifications
You must be signed in to change notification settings - Fork 2
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
- Loading branch information
1 parent
b8ffcc1
commit 8732f6d
Showing
10 changed files
with
156 additions
and
54 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
31 changes: 31 additions & 0 deletions
31
Segno/Segno/Data/Network/Endpoints/NewDiaryPostEndpoint.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,31 @@ | ||
// | ||
// NewDiaryPostEndpoint.swift | ||
// Segno | ||
// | ||
// Created by YOONJONG on 2022/12/08. | ||
// | ||
|
||
import Foundation | ||
|
||
enum NewDiaryPostEndpoint: Endpoint { | ||
case item(NewDiaryDetail) | ||
|
||
var baseURL: URL? { | ||
return URL(string: BaseURL.urlString) | ||
} | ||
|
||
var httpMethod: HTTPMethod { | ||
return .POST | ||
} | ||
|
||
var path: String { | ||
return "diary" | ||
} | ||
|
||
var parameters: HTTPRequestParameter? { | ||
switch self { | ||
case .item(let diary): | ||
return HTTPRequestParameter.body(diary) | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// | ||
// NewDiaryDetailDTO.swift | ||
// Segno | ||
// | ||
// Created by YOONJONG on 2022/12/08. | ||
// | ||
|
||
struct NewDiaryDetailDTO: Decodable { | ||
let token: String | ||
let title: String | ||
let tags: [String] | ||
let imagePath: String | ||
let bodyText: String? | ||
let musicInfo: MusicInfo? | ||
let location: Location? | ||
|
||
init(title: String, tags: [String], imagePath: String, bodyText: String?, musicInfo: MusicInfo?, location: Location?, token: String) { | ||
self.title = title | ||
self.tags = tags | ||
self.imagePath = imagePath | ||
self.bodyText = bodyText | ||
self.musicInfo = musicInfo | ||
self.location = location | ||
self.token = token | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// | ||
// NewDiaryDetail.swift | ||
// Segno | ||
// | ||
// Created by YOONJONG on 2022/12/08. | ||
// | ||
|
||
struct NewDiaryDetail: Encodable { | ||
let title: String | ||
let tags: [String] | ||
let imagePath: String | ||
let bodyText: String? | ||
let musicInfo: MusicInfo? | ||
let location: Location? | ||
let token: String | ||
|
||
init(title: String, tags: [String], imagePath: String, bodyText: String?, musicInfo: MusicInfo?, location: Location?, token: String) { | ||
self.title = title | ||
self.tags = tags | ||
self.imagePath = imagePath | ||
self.bodyText = bodyText | ||
self.musicInfo = musicInfo | ||
self.location = location | ||
self.token = token | ||
} | ||
} |
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