오디션 배역 상세 페이지 추가

This commit is contained in:
Yu Sung
2025-01-07 01:10:20 +09:00
parent 739a9b42b7
commit 36028aa108
19 changed files with 531 additions and 5 deletions

View File

@@ -11,6 +11,8 @@ import Moya
enum AuditionApi {
case getAuditionList(page: Int, size: Int)
case getAuditionDetail(auditionId: Int)
case getAuditionRoleDetail(auditionRoleId: Int)
case getAuditionApplicantList(auditionRoleId: Int, sortType: AuditionApplicantSortType, page: Int, size: Int)
}
extension AuditionApi: TargetType {
@@ -20,19 +22,24 @@ extension AuditionApi: TargetType {
var path: String {
switch self {
case .getAuditionList:
return "/audition"
case .getAuditionDetail(let auditionId):
return "/audition/\(auditionId)"
case .getAuditionRoleDetail(let auditionRoleId):
return "/audition/role/\(auditionRoleId)"
case .getAuditionApplicantList:
return "/audition/applicant"
}
}
var method: Moya.Method {
switch self {
case .getAuditionList, .getAuditionDetail:
case .getAuditionList, .getAuditionDetail, . getAuditionRoleDetail, .getAuditionApplicantList:
return .get
}
}
@@ -48,8 +55,18 @@ extension AuditionApi: TargetType {
return .requestParameters(parameters: parameters, encoding: URLEncoding.queryString)
case .getAuditionDetail:
case .getAuditionDetail, .getAuditionRoleDetail:
return .requestPlain
case .getAuditionApplicantList(let auditionRoleId, let sortType, let page, let size):
let parameters = [
"auditionRoleId": auditionRoleId,
"page": page - 1,
"size": size,
"sortType": sortType
] as [String : Any]
return .requestParameters(parameters: parameters, encoding: URLEncoding.queryString)
}
}