Skip to content

Commit

Permalink
Merge pull request #55 from Student-Center/feature/WEAV-147
Browse files Browse the repository at this point in the history
[WEAV-147] 이상형 정보 수정 기능 구현
  • Loading branch information
jisu15-kim authored Nov 25, 2024
2 parents 979fde2 + 303961a commit d72a713
Show file tree
Hide file tree
Showing 28 changed files with 1,596 additions and 136 deletions.
134 changes: 134 additions & 0 deletions OpenApiGenerator/Sources/OpenapiGenerated/Client.swift
Original file line number Diff line number Diff line change
Expand Up @@ -789,6 +789,140 @@ public struct Client: APIProtocol {
}
)
}
/// 내 원하는 파트너 수정
///
/// 현재 로그인한 사용자의 원하는 파트너 정보를 수정합니다.
///
/// - Remark: HTTP `PUT /users/my/desiredPartner`.
/// - Remark: Generated from `#/paths//users/my/desiredPartner/put(updateMyDesiredPartner)`.
public func updateMyDesiredPartner(_ input: Operations.updateMyDesiredPartner.Input) async throws -> Operations.updateMyDesiredPartner.Output {
try await client.send(
input: input,
forOperation: Operations.updateMyDesiredPartner.id,
serializer: { input in
let path = try converter.renderedPath(
template: "/users/my/desiredPartner",
parameters: []
)
var request: HTTPTypes.HTTPRequest = .init(
soar_path: path,
method: .put
)
suppressMutabilityWarning(&request)
converter.setAcceptHeader(
in: &request.headerFields,
contentTypes: input.headers.accept
)
let body: OpenAPIRuntime.HTTPBody?
switch input.body {
case let .json(value):
body = try converter.setRequiredRequestBodyAsJSON(
value,
headerFields: &request.headerFields,
contentType: "application/json; charset=utf-8"
)
}
return (request, body)
},
deserializer: { response, responseBody in
switch response.status.code {
case 200:
let contentType = converter.extractContentTypeIfPresent(in: response.headerFields)
let body: Operations.updateMyDesiredPartner.Output.Ok.Body
let chosenContentType = try converter.bestContentType(
received: contentType,
options: [
"application/json"
]
)
switch chosenContentType {
case "application/json":
body = try await converter.getResponseBodyAsJSON(
Components.Schemas.UpdateUserDesiredPartnerResponse.self,
from: responseBody,
transforming: { value in
.json(value)
}
)
default:
preconditionFailure("bestContentType chose an invalid content type.")
}
return .ok(.init(body: body))
case 400:
let contentType = converter.extractContentTypeIfPresent(in: response.headerFields)
let body: Components.Responses.BadRequest.Body
let chosenContentType = try converter.bestContentType(
received: contentType,
options: [
"application/json"
]
)
switch chosenContentType {
case "application/json":
body = try await converter.getResponseBodyAsJSON(
Components.Schemas.ErrorResponse.self,
from: responseBody,
transforming: { value in
.json(value)
}
)
default:
preconditionFailure("bestContentType chose an invalid content type.")
}
return .badRequest(.init(body: body))
case 401:
let contentType = converter.extractContentTypeIfPresent(in: response.headerFields)
let body: Components.Responses.Unauthorized.Body
let chosenContentType = try converter.bestContentType(
received: contentType,
options: [
"application/json"
]
)
switch chosenContentType {
case "application/json":
body = try await converter.getResponseBodyAsJSON(
Components.Schemas.ErrorResponse.self,
from: responseBody,
transforming: { value in
.json(value)
}
)
default:
preconditionFailure("bestContentType chose an invalid content type.")
}
return .unauthorized(.init(body: body))
case 500:
let contentType = converter.extractContentTypeIfPresent(in: response.headerFields)
let body: Components.Responses.InternalServerError.Body
let chosenContentType = try converter.bestContentType(
received: contentType,
options: [
"application/json"
]
)
switch chosenContentType {
case "application/json":
body = try await converter.getResponseBodyAsJSON(
Components.Schemas.ErrorResponse.self,
from: responseBody,
transforming: { value in
.json(value)
}
)
default:
preconditionFailure("bestContentType chose an invalid content type.")
}
return .internalServerError(.init(body: body))
default:
return .undocumented(
statusCode: response.status.code,
.init()
)
}
}
)
}
/// 프로필 위젯 추가 및 수정
///
/// 현재 사용자의 프로필 위젯을 추가 및 수정합니다.
Expand Down
Loading

0 comments on commit d72a713

Please sign in to comment.