-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* question 질문 관련 쪽 작업 중
- Loading branch information
Showing
46 changed files
with
1,748 additions
and
1,623 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
41 changes: 41 additions & 0 deletions
41
OPeace/Projects/Core/Networking/Model/Sources/Questions/DTO/FlagQuestionDTOModel.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,41 @@ | ||
// | ||
// FlagQuestionDTOModel.swift | ||
// Model | ||
// | ||
// Created by Wonji Suh on 11/11/24. | ||
// | ||
|
||
import Foundation | ||
|
||
public struct FlagQuestionDTOModel: Codable, Equatable { | ||
public let data: FlagQuestionResponseDTOModel | ||
|
||
public init(data: FlagQuestionResponseDTOModel) { | ||
self.data = data | ||
} | ||
} | ||
|
||
public struct FlagQuestionResponseDTOModel: Codable, Equatable { | ||
public let id, question: Int | ||
public let userID, reason, createAt: String | ||
public let status: Bool | ||
public let message: String | ||
|
||
public init( | ||
id: Int = .zero, | ||
question: Int = .zero, | ||
userID: String = "", | ||
reason: String = "", | ||
createAt: String = "", | ||
status: Bool = false, | ||
message: String = "" | ||
) { | ||
self.id = id | ||
self.question = question | ||
self.userID = userID | ||
self.reason = reason | ||
self.createAt = createAt | ||
self.status = status | ||
self.message = message | ||
} | ||
} |
32 changes: 0 additions & 32 deletions
32
OPeace/Projects/Core/Networking/Model/Sources/Questions/DeleteQuestionModel.swift
This file was deleted.
Oops, something went wrong.
17 changes: 17 additions & 0 deletions
17
...cts/Core/Networking/Model/Sources/Questions/Extension/Extension+DeleteQuestionModel.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,17 @@ | ||
// | ||
// Extension+DeleteQuestionModel.swift | ||
// Model | ||
// | ||
// Created by Wonji Suh on 11/11/24. | ||
// | ||
|
||
public extension DeleteQuestionModel { | ||
func toFlagQuestionDTOToModel() -> FlagQuestionDTOModel { | ||
let data: FlagQuestionResponseDTOModel = .init( | ||
status: self.data?.status ?? false, | ||
message: self.data?.message ?? "" | ||
) | ||
|
||
return FlagQuestionDTOModel(data: data) | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
...cts/Core/Networking/Model/Sources/Questions/Extension/Extension+ReportQuestionModel.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,22 @@ | ||
// | ||
// Extension+ReportQuestionModel.swift | ||
// Model | ||
// | ||
// Created by Wonji Suh on 11/11/24. | ||
// | ||
|
||
import Foundation | ||
|
||
public extension ReportQuestionModel { | ||
func toFlagQuestionDTOToModel() -> FlagQuestionDTOModel { | ||
let data: FlagQuestionResponseDTOModel = .init( | ||
id: self.data?.id ?? .zero, | ||
question: self.data?.question ?? .zero, | ||
userID: self.data?.userID ?? "", | ||
reason: self.data?.reason ?? "", | ||
createAt: self.data?.createAt ?? "" | ||
) | ||
|
||
return FlagQuestionDTOModel(data: data) | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
...s/Core/Networking/Model/Sources/Questions/Extension/Extension+VoteQuestionLikeModel.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,20 @@ | ||
// | ||
// Extension+VoteQuestionLikeModel.swift | ||
// Model | ||
// | ||
// Created by Wonji Suh on 11/11/24. | ||
// | ||
|
||
import Foundation | ||
|
||
public extension VoteQuestionLikeModel { | ||
func toFlagQuestionDTOToModel() -> FlagQuestionDTOModel { | ||
let data: FlagQuestionResponseDTOModel = .init( | ||
question: self.data?.question ?? .zero, | ||
userID: self.data?.userID ?? "", | ||
createAt: self.data?.createAt ?? "" | ||
) | ||
|
||
return FlagQuestionDTOModel(data: data) | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
OPeace/Projects/Core/Networking/Model/Sources/Questions/Model/DeleteQuestionModel.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,20 @@ | ||
// | ||
// DeleteQuestionModel.swift | ||
// Model | ||
// | ||
// Created by 서원지 on 8/26/24. | ||
// | ||
|
||
import Foundation | ||
|
||
public struct DeleteQuestionModel: Decodable { | ||
let data: DeleteQuestionResponseModel? | ||
|
||
} | ||
|
||
// MARK: - DataClass | ||
struct DeleteQuestionResponseModel: Decodable { | ||
let status: Bool? | ||
let message: String? | ||
|
||
} |
27 changes: 27 additions & 0 deletions
27
OPeace/Projects/Core/Networking/Model/Sources/Questions/Model/ReportQuestion.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,27 @@ | ||
// | ||
// ReportQuestion.swift | ||
// Model | ||
// | ||
// Created by 서원지 on 8/26/24. | ||
// | ||
|
||
import Foundation | ||
// MARK: - Welcome | ||
public struct ReportQuestionModel: Decodable { | ||
let data: ReportQuestionResponseModel? | ||
|
||
} | ||
|
||
// MARK: - DataClass | ||
struct ReportQuestionResponseModel: Decodable { | ||
let id, question: Int? | ||
let userID, reason, createAt: String? | ||
|
||
enum CodingKeys: String, CodingKey { | ||
case id, question | ||
case userID = "user_id" | ||
case reason | ||
case createAt = "create_at" | ||
} | ||
} | ||
|
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
46 changes: 0 additions & 46 deletions
46
OPeace/Projects/Core/Networking/Model/Sources/Questions/ReportQuestion.swift
This file was deleted.
Oops, something went wrong.
40 changes: 40 additions & 0 deletions
40
...cts/Core/Networking/Model/Sources/SignUp/Extension/Extension+UpdateUserInfoDTOModel.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,40 @@ | ||
// | ||
// Extension+UpdateUserInfoDTOModel.swift | ||
// Model | ||
// | ||
// Created by Wonji Suh on 11/11/24. | ||
// | ||
|
||
public extension UpdateUserInfoModel { | ||
func toUpdateUserInfoDTOToModel() -> UpdateUserInfoDTOModel { | ||
let data: UpdateUserInfoResponseDTOModel = .init( | ||
socialID: self.data?.socialID ?? "", | ||
socialType: self.data?.socialType ?? "", | ||
email: self.data?.email ?? "", | ||
createdAt: self.data?.createdAt ?? "", | ||
nickname: self.data?.nickname, | ||
year: self.data?.year , | ||
job: self.data?.job, | ||
generation: self.data?.generation ?? "", | ||
isFirstLogin: self.data?.isFirstLogin ?? false | ||
) | ||
|
||
return UpdateUserInfoDTOModel(data: data) | ||
} | ||
} | ||
|
||
public extension UpdateUserInfoDTOModel { | ||
static var mockModel: UpdateUserInfoDTOModel = UpdateUserInfoDTOModel( | ||
data: UpdateUserInfoResponseDTOModel( | ||
socialID: "apple_001096.cf7680b2761f4de694a1d1c21ea507a6.1112", | ||
socialType: "apple", | ||
email: "[email protected]", | ||
createdAt: "2024-08-29 01:39:57", | ||
nickname: "오피스", | ||
year: 1998, | ||
job: "개발", | ||
generation: "Z 세대", | ||
isFirstLogin: true | ||
) | ||
) | ||
} |
Oops, something went wrong.