feat: 메인 라이브
- 여러개로 나눠져 있던 API 하나로 병합
This commit is contained in:
@@ -40,6 +40,7 @@ enum LiveApi {
|
||||
case likeHeart(request: LiveRoomLikeHeartRequest)
|
||||
case getTotalHeartCount(roomId: Int)
|
||||
case heartStatus(roomId: Int)
|
||||
case getLiveMain(isAdultContentVisible: Bool, contentType: ContentType)
|
||||
}
|
||||
|
||||
extension LiveApi: TargetType {
|
||||
@@ -141,12 +142,15 @@ extension LiveApi: TargetType {
|
||||
|
||||
case .heartStatus(let roomId):
|
||||
return "/live/room/\(roomId)/heart-list"
|
||||
|
||||
case .getLiveMain:
|
||||
return "/api/live"
|
||||
}
|
||||
}
|
||||
|
||||
var method: Moya.Method {
|
||||
switch self {
|
||||
case .roomList, .recentVisitRoomUsers, .getReservations, .getReservation, .getRoomDetail, .getTags, .getRecentRoomInfo, .getRoomInfo, .donationStatus, .donationTotal, .getDonationMessageList, .getUserProfile, .getAllMenuPreset, .getTotalHeartCount, .heartStatus:
|
||||
case .roomList, .recentVisitRoomUsers, .getReservations, .getReservation, .getRoomDetail, .getTags, .getRecentRoomInfo, .getRoomInfo, .donationStatus, .donationTotal, .getDonationMessageList, .getUserProfile, .getAllMenuPreset, .getTotalHeartCount, .heartStatus, .getLiveMain:
|
||||
return .get
|
||||
|
||||
case .makeReservation, .enterRoom, .createRoom, .quitRoom, .donation, .refundDonation, .kickOut, .likeHeart:
|
||||
@@ -248,6 +252,18 @@ extension LiveApi: TargetType {
|
||||
|
||||
case .likeHeart(let request):
|
||||
return .requestJSONEncodable(request)
|
||||
|
||||
case .getLiveMain(let isAdultContentVisible, let contentType):
|
||||
let parameters = [
|
||||
"timezone": TimeZone.current.identifier,
|
||||
"isAdultContentVisible": isAdultContentVisible,
|
||||
"contentType": contentType
|
||||
] as [String: Any]
|
||||
|
||||
return .requestParameters(
|
||||
parameters: parameters,
|
||||
encoding: URLEncoding.queryString
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user