Skip to content

Commit

Permalink
[OAS] OAS 최신 스펙 적용, Profile configure
Browse files Browse the repository at this point in the history
  • Loading branch information
jisu15-kim committed Nov 17, 2024
1 parent 305c519 commit a1a1519
Show file tree
Hide file tree
Showing 9 changed files with 238 additions and 107 deletions.
65 changes: 13 additions & 52 deletions OpenApiGenerator/Sources/OpenapiGenerated/Client.swift
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,7 @@ public struct Client: APIProtocol {
default:
return .undocumented(
statusCode: response.status.code,
.init(
headerFields: response.headerFields,
body: responseBody
)
.init()
)
}
}
Expand Down Expand Up @@ -266,10 +263,7 @@ public struct Client: APIProtocol {
default:
return .undocumented(
statusCode: response.status.code,
.init(
headerFields: response.headerFields,
body: responseBody
)
.init()
)
}
}
Expand Down Expand Up @@ -405,10 +399,7 @@ public struct Client: APIProtocol {
default:
return .undocumented(
statusCode: response.status.code,
.init(
headerFields: response.headerFields,
body: responseBody
)
.init()
)
}
}
Expand Down Expand Up @@ -555,10 +546,7 @@ public struct Client: APIProtocol {
default:
return .undocumented(
statusCode: response.status.code,
.init(
headerFields: response.headerFields,
body: responseBody
)
.init()
)
}
}
Expand Down Expand Up @@ -661,10 +649,7 @@ public struct Client: APIProtocol {
default:
return .undocumented(
statusCode: response.status.code,
.init(
headerFields: response.headerFields,
body: responseBody
)
.init()
)
}
}
Expand Down Expand Up @@ -798,10 +783,7 @@ public struct Client: APIProtocol {
default:
return .undocumented(
statusCode: response.status.code,
.init(
headerFields: response.headerFields,
body: responseBody
)
.init()
)
}
}
Expand Down Expand Up @@ -935,10 +917,7 @@ public struct Client: APIProtocol {
default:
return .undocumented(
statusCode: response.status.code,
.init(
headerFields: response.headerFields,
body: responseBody
)
.init()
)
}
}
Expand Down Expand Up @@ -1045,10 +1024,7 @@ public struct Client: APIProtocol {
default:
return .undocumented(
statusCode: response.status.code,
.init(
headerFields: response.headerFields,
body: responseBody
)
.init()
)
}
}
Expand Down Expand Up @@ -1182,10 +1158,7 @@ public struct Client: APIProtocol {
default:
return .undocumented(
statusCode: response.status.code,
.init(
headerFields: response.headerFields,
body: responseBody
)
.init()
)
}
}
Expand Down Expand Up @@ -1266,10 +1239,7 @@ public struct Client: APIProtocol {
default:
return .undocumented(
statusCode: response.status.code,
.init(
headerFields: response.headerFields,
body: responseBody
)
.init()
)
}
}
Expand Down Expand Up @@ -1374,10 +1344,7 @@ public struct Client: APIProtocol {
default:
return .undocumented(
statusCode: response.status.code,
.init(
headerFields: response.headerFields,
body: responseBody
)
.init()
)
}
}
Expand Down Expand Up @@ -1479,10 +1446,7 @@ public struct Client: APIProtocol {
default:
return .undocumented(
statusCode: response.status.code,
.init(
headerFields: response.headerFields,
body: responseBody
)
.init()
)
}
}
Expand Down Expand Up @@ -1587,10 +1551,7 @@ public struct Client: APIProtocol {
default:
return .undocumented(
statusCode: response.status.code,
.init(
headerFields: response.headerFields,
body: responseBody
)
.init()
)
}
}
Expand Down
148 changes: 140 additions & 8 deletions OpenApiGenerator/Sources/OpenapiGenerated/Types.swift
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ public enum Components {
/// 사용자 상태 (신규 사용자 또는 기존 사용자)
///
/// - Remark: Generated from `#/components/schemas/SendAuthCodeResponse/userStatus`.
@frozen public enum userStatusPayload: String, Codable, Hashable, Sendable, CaseIterable {
@frozen public enum userStatusPayload: String, Codable, Hashable, Sendable {
case NEW = "NEW"
case EXISTING = "EXISTING"
}
Expand Down Expand Up @@ -543,7 +543,7 @@ public enum Components {
/// - Remark: Generated from `#/components/schemas/GetMyUserInfoResponse/phoneNumber`.
public var phoneNumber: Swift.String
/// - Remark: Generated from `#/components/schemas/GetMyUserInfoResponse/profile`.
public var profile: Components.Schemas.UserProfile
public var profile: Components.Schemas.UserProfileDisplayInfo
/// - Remark: Generated from `#/components/schemas/GetMyUserInfoResponse/desiredPartner`.
public var desiredPartner: Components.Schemas.UserDesiredPartner
/// - Remark: Generated from `#/components/schemas/GetMyUserInfoResponse/profileWidgets`.
Expand All @@ -561,7 +561,7 @@ public enum Components {
id: Swift.String? = nil,
name: Swift.String,
phoneNumber: Swift.String,
profile: Components.Schemas.UserProfile,
profile: Components.Schemas.UserProfileDisplayInfo,
desiredPartner: Components.Schemas.UserDesiredPartner,
profileWidgets: [Components.Schemas.ProfileWidget]
) {
Expand Down Expand Up @@ -720,6 +720,138 @@ public enum Components {
case locationIds
}
}
/// 사용자 프로필 표시 정보
///
/// - Remark: Generated from `#/components/schemas/UserProfileDisplayInfo`.
public struct UserProfileDisplayInfo: Codable, Hashable, Sendable {
/// - Remark: Generated from `#/components/schemas/UserProfileDisplayInfo/gender`.
public var gender: Components.Schemas.Gender
/// 사용자의 출생년도
///
/// - Remark: Generated from `#/components/schemas/UserProfileDisplayInfo/birthYear`.
public var birthYear: Swift.Int
/// - Remark: Generated from `#/components/schemas/UserProfileDisplayInfo/jobOccupation`.
public var jobOccupation: Components.Schemas.JobOccupationDisplayInfo
/// - Remark: Generated from `#/components/schemas/UserProfileDisplayInfo/company`.
public var company: Components.Schemas.CompanyDisplayInfo?
/// 활동 지역 정보 목록
///
/// - Remark: Generated from `#/components/schemas/UserProfileDisplayInfo/locations`.
public var locations: [Components.Schemas.LocationDisplayInfo]
/// Creates a new `UserProfileDisplayInfo`.
///
/// - Parameters:
/// - gender:
/// - birthYear: 사용자의 출생년도
/// - jobOccupation:
/// - company:
/// - locations: 활동 지역 정보 목록
public init(
gender: Components.Schemas.Gender,
birthYear: Swift.Int,
jobOccupation: Components.Schemas.JobOccupationDisplayInfo,
company: Components.Schemas.CompanyDisplayInfo? = nil,
locations: [Components.Schemas.LocationDisplayInfo]
) {
self.gender = gender
self.birthYear = birthYear
self.jobOccupation = jobOccupation
self.company = company
self.locations = locations
}
public enum CodingKeys: String, CodingKey {
case gender
case birthYear
case jobOccupation
case company
case locations
}
}
/// 회사 표시 정보
///
/// - Remark: Generated from `#/components/schemas/CompanyDisplayInfo`.
public struct CompanyDisplayInfo: Codable, Hashable, Sendable {
/// 회사 식별자
///
/// - Remark: Generated from `#/components/schemas/CompanyDisplayInfo/id`.
public var id: Swift.String
/// 화면에 표시될 회사명
///
/// - Remark: Generated from `#/components/schemas/CompanyDisplayInfo/display`.
public var display: Swift.String
/// Creates a new `CompanyDisplayInfo`.
///
/// - Parameters:
/// - id: 회사 식별자
/// - display: 화면에 표시될 회사명
public init(
id: Swift.String,
display: Swift.String
) {
self.id = id
self.display = display
}
public enum CodingKeys: String, CodingKey {
case id
case display
}
}
/// 직군 표시 정보
///
/// - Remark: Generated from `#/components/schemas/JobOccupationDisplayInfo`.
public struct JobOccupationDisplayInfo: Codable, Hashable, Sendable {
/// - Remark: Generated from `#/components/schemas/JobOccupationDisplayInfo/code`.
public var code: Components.Schemas.JobOccupation
/// 화면에 표시될 직군명
///
/// - Remark: Generated from `#/components/schemas/JobOccupationDisplayInfo/display`.
public var display: Swift.String
/// Creates a new `JobOccupationDisplayInfo`.
///
/// - Parameters:
/// - code:
/// - display: 화면에 표시될 직군명
public init(
code: Components.Schemas.JobOccupation,
display: Swift.String
) {
self.code = code
self.display = display
}
public enum CodingKeys: String, CodingKey {
case code
case display
}
}
/// 지역 표시 정보
///
/// - Remark: Generated from `#/components/schemas/LocationDisplayInfo`.
public struct LocationDisplayInfo: Codable, Hashable, Sendable {
/// 지역 식별자
///
/// - Remark: Generated from `#/components/schemas/LocationDisplayInfo/id`.
public var id: Swift.String
/// 화면에 표시될 지역명
///
/// - Remark: Generated from `#/components/schemas/LocationDisplayInfo/display`.
public var display: Swift.String
/// Creates a new `LocationDisplayInfo`.
///
/// - Parameters:
/// - id: 지역 식별자
/// - display: 화면에 표시될 지역명
public init(
id: Swift.String,
display: Swift.String
) {
self.id = id
self.display = display
}
public enum CodingKeys: String, CodingKey {
case id
case display
}
}
/// 사용자가 원하는 파트너의 조건
///
/// - Remark: Generated from `#/components/schemas/UserDesiredPartner`.
Expand Down Expand Up @@ -945,21 +1077,21 @@ public enum Components {
/// 사용자의 운영 체제 유형
///
/// - Remark: Generated from `#/components/schemas/OSType`.
@frozen public enum OSType: String, Codable, Hashable, Sendable, CaseIterable {
@frozen public enum OSType: String, Codable, Hashable, Sendable {
case IOS = "IOS"
case AOS = "AOS"
}
/// 사용자의 성별
///
/// - Remark: Generated from `#/components/schemas/Gender`.
@frozen public enum Gender: String, Codable, Hashable, Sendable, CaseIterable {
@frozen public enum Gender: String, Codable, Hashable, Sendable {
case MALE = "MALE"
case FEMALE = "FEMALE"
}
/// 직업군 분류
///
/// - Remark: Generated from `#/components/schemas/JobOccupation`.
@frozen public enum JobOccupation: String, Codable, Hashable, Sendable, CaseIterable {
@frozen public enum JobOccupation: String, Codable, Hashable, Sendable {
case BUSINESS_ADMIN = "BUSINESS_ADMIN"
case SALES_MARKETING = "SALES_MARKETING"
case RESEARCH_DEVELOPMENT = "RESEARCH_DEVELOPMENT"
Expand All @@ -984,7 +1116,7 @@ public enum Components {
/// 선호하는 거리 (내 지역만, 주변 지역 포함, 어디든)
///
/// - Remark: Generated from `#/components/schemas/PreferDistance`.
@frozen public enum PreferDistance: String, Codable, Hashable, Sendable, CaseIterable {
@frozen public enum PreferDistance: String, Codable, Hashable, Sendable {
case ONLY_MY_AREA = "ONLY_MY_AREA"
case INCLUDE_SURROUNDING_REGIONS = "INCLUDE_SURROUNDING_REGIONS"
case ANYWHERE = "ANYWHERE"
Expand Down Expand Up @@ -1021,7 +1153,7 @@ public enum Components {
/// 프로필 위젯 타입
///
/// - Remark: Generated from `#/components/schemas/ProfileWidgetType`.
@frozen public enum ProfileWidgetType: String, Codable, Hashable, Sendable, CaseIterable {
@frozen public enum ProfileWidgetType: String, Codable, Hashable, Sendable {
case HOBBY = "HOBBY"
case STYLE = "STYLE"
case MBTI = "MBTI"
Expand Down
2 changes: 1 addition & 1 deletion OpenApiGenerator/Sources/openapi-generator-cli/3days-oas
Submodule 3days-oas updated 1 files
+73 −1 openapi.yaml
2 changes: 1 addition & 1 deletion Projects/App/Sources/Debug/AuthInfoView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ enum Sections: CaseIterable {
TableInfoModel(
title: "활동지역 ID",
value: AppCoordinator.shared.userInfo?.profile.locations != nil ? AppCoordinator.shared.userInfo!.profile.locations
.compactMap { $0 }
.compactMap { "\($0.name) / \($0.id)" }
.joined(separator: "\n") : "null"
)
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ public class AuthServiceMock: AuthServiceProtocol {
gender: .female,
birthYear: 0,
companyId: nil,
companyName: nil,
jobOccupation: "",
jobOccupationRawValue: "",
locations: []
),
dreamPartner: .init(
Expand Down
Loading

0 comments on commit a1a1519

Please sign in to comment.