콘텐츠 업로드
- 미리듣기 여부 선택 버튼 추가
This commit is contained in:
		| @@ -288,62 +288,84 @@ struct ContentCreateView: View { | |||||||
|                                             .frame(maxWidth: .infinity, alignment: .leading) |                                             .frame(maxWidth: .infinity, alignment: .leading) | ||||||
|                                     } |                                     } | ||||||
|                                     .padding(.top, 26.7) |                                     .padding(.top, 26.7) | ||||||
|                                 } |                                      | ||||||
|                                  |                                     VStack(spacing: 13.3) { | ||||||
|                                 if !viewModel.isFree { |                                         Text("미리듣기") | ||||||
|                                     VStack(spacing: 10) { |  | ||||||
|                                         Text("미리듣기 시간 설정") |  | ||||||
|                                             .font(.custom(Font.bold.rawValue, size: 16.7)) |                                             .font(.custom(Font.bold.rawValue, size: 16.7)) | ||||||
|                                             .foregroundColor(Color(hex: "eeeeee")) |                                             .foregroundColor(Color(hex: "eeeeee")) | ||||||
|                                             .frame(maxWidth: .infinity, alignment: .leading) |                                             .frame(maxWidth: .infinity, alignment: .leading) | ||||||
|                                          |                                          | ||||||
|                                         Text("미리듣기 시간을 직접 설정하지 않으면 콘텐츠 앞부분 30초가 자동으로 설정됩니다. 미리듣기의 시간제한은 없습니다.") |  | ||||||
|                                             .font(.custom(Font.medium.rawValue, size: 13.3)) |  | ||||||
|                                             .foregroundColor(Color(hex: "777777")) |  | ||||||
|                                             .frame(maxWidth: .infinity, alignment: .leading) |  | ||||||
|                                          |  | ||||||
|                                         HStack(spacing: 13.3) { |                                         HStack(spacing: 13.3) { | ||||||
|                                             VStack(spacing: 5.3) { |                                             SelectButtonView(title: "생성", isChecked: viewModel.isGeneratePreview) { | ||||||
|                                                 Text("시작 시간") |                                                 if !viewModel.isGeneratePreview { | ||||||
|                                                     .font(.custom(Font.medium.rawValue, size: 13.3)) |                                                     viewModel.isGeneratePreview = true | ||||||
|                                                     .foregroundColor(Color(hex: "d2d2d2")) |                                                 } | ||||||
|                                                     .frame(maxWidth: .infinity, alignment: .leading) |  | ||||||
|                                                  |  | ||||||
|                                                 TextField("00:00:00", text: $viewModel.previewStartTime) |  | ||||||
|                                                     .autocapitalization(.none) |  | ||||||
|                                                     .disableAutocorrection(true) |  | ||||||
|                                                     .font(.custom(Font.bold.rawValue, size: 14.6)) |  | ||||||
|                                                     .foregroundColor(Color(hex: "777777")) |  | ||||||
|                                                     .padding(.vertical, 16.7) |  | ||||||
|                                                     .padding(.horizontal, 13.3) |  | ||||||
|                                                     .background(Color(hex: "222222")) |  | ||||||
|                                                     .cornerRadius(6.7) |  | ||||||
|                                                     .keyboardType(.default) |  | ||||||
|                                                     .multilineTextAlignment(.center) |  | ||||||
|                                             } |                                             } | ||||||
|                                              |                                              | ||||||
|                                             VStack(spacing: 5.3) { |                                             SelectButtonView(title: "생성 안 함", isChecked: !viewModel.isGeneratePreview) { | ||||||
|                                                 Text("종료 시간") |                                                 if viewModel.isGeneratePreview { | ||||||
|                                                     .font(.custom(Font.medium.rawValue, size: 13.3)) |                                                     viewModel.isGeneratePreview = false | ||||||
|                                                     .foregroundColor(Color(hex: "d2d2d2")) |                                                 } | ||||||
|                                                     .frame(maxWidth: .infinity, alignment: .leading) |  | ||||||
|                                                  |  | ||||||
|                                                 TextField("00:00:30", text: $viewModel.previewEndTime) |  | ||||||
|                                                     .autocapitalization(.none) |  | ||||||
|                                                     .disableAutocorrection(true) |  | ||||||
|                                                     .font(.custom(Font.bold.rawValue, size: 14.6)) |  | ||||||
|                                                     .foregroundColor(Color(hex: "777777")) |  | ||||||
|                                                     .padding(.vertical, 16.7) |  | ||||||
|                                                     .padding(.horizontal, 13.3) |  | ||||||
|                                                     .background(Color(hex: "222222")) |  | ||||||
|                                                     .cornerRadius(6.7) |  | ||||||
|                                                     .keyboardType(.default) |  | ||||||
|                                                     .multilineTextAlignment(.center) |  | ||||||
|                                             } |                                             } | ||||||
|                                         } |                                         } | ||||||
|                                         .padding(.top, 3.3) |  | ||||||
|                                     } |                                     } | ||||||
|                                     .padding(.top, 26.7) |                                     .padding(.top, 26.7) | ||||||
|  |                                      | ||||||
|  |                                     if viewModel.isGeneratePreview { | ||||||
|  |                                         VStack(spacing: 10) { | ||||||
|  |                                             Text("미리듣기 시간 설정") | ||||||
|  |                                                 .font(.custom(Font.bold.rawValue, size: 16.7)) | ||||||
|  |                                                 .foregroundColor(Color(hex: "eeeeee")) | ||||||
|  |                                                 .frame(maxWidth: .infinity, alignment: .leading) | ||||||
|  |                                              | ||||||
|  |                                             Text("미리듣기 시간을 직접 설정하지 않으면 콘텐츠 앞부분 30초가 자동으로 설정됩니다. 미리듣기의 시간제한은 없습니다.") | ||||||
|  |                                                 .font(.custom(Font.medium.rawValue, size: 13.3)) | ||||||
|  |                                                 .foregroundColor(Color(hex: "777777")) | ||||||
|  |                                                 .frame(maxWidth: .infinity, alignment: .leading) | ||||||
|  |                                              | ||||||
|  |                                             HStack(spacing: 13.3) { | ||||||
|  |                                                 VStack(spacing: 5.3) { | ||||||
|  |                                                     Text("시작 시간") | ||||||
|  |                                                         .font(.custom(Font.medium.rawValue, size: 13.3)) | ||||||
|  |                                                         .foregroundColor(Color(hex: "d2d2d2")) | ||||||
|  |                                                         .frame(maxWidth: .infinity, alignment: .leading) | ||||||
|  |                                                      | ||||||
|  |                                                     TextField("00:00:00", text: $viewModel.previewStartTime) | ||||||
|  |                                                         .autocapitalization(.none) | ||||||
|  |                                                         .disableAutocorrection(true) | ||||||
|  |                                                         .font(.custom(Font.bold.rawValue, size: 14.6)) | ||||||
|  |                                                         .foregroundColor(Color(hex: "777777")) | ||||||
|  |                                                         .padding(.vertical, 16.7) | ||||||
|  |                                                         .padding(.horizontal, 13.3) | ||||||
|  |                                                         .background(Color(hex: "222222")) | ||||||
|  |                                                         .cornerRadius(6.7) | ||||||
|  |                                                         .keyboardType(.default) | ||||||
|  |                                                         .multilineTextAlignment(.center) | ||||||
|  |                                                 } | ||||||
|  |                                                  | ||||||
|  |                                                 VStack(spacing: 5.3) { | ||||||
|  |                                                     Text("종료 시간") | ||||||
|  |                                                         .font(.custom(Font.medium.rawValue, size: 13.3)) | ||||||
|  |                                                         .foregroundColor(Color(hex: "d2d2d2")) | ||||||
|  |                                                         .frame(maxWidth: .infinity, alignment: .leading) | ||||||
|  |                                                      | ||||||
|  |                                                     TextField("00:00:30", text: $viewModel.previewEndTime) | ||||||
|  |                                                         .autocapitalization(.none) | ||||||
|  |                                                         .disableAutocorrection(true) | ||||||
|  |                                                         .font(.custom(Font.bold.rawValue, size: 14.6)) | ||||||
|  |                                                         .foregroundColor(Color(hex: "777777")) | ||||||
|  |                                                         .padding(.vertical, 16.7) | ||||||
|  |                                                         .padding(.horizontal, 13.3) | ||||||
|  |                                                         .background(Color(hex: "222222")) | ||||||
|  |                                                         .cornerRadius(6.7) | ||||||
|  |                                                         .keyboardType(.default) | ||||||
|  |                                                         .multilineTextAlignment(.center) | ||||||
|  |                                                 } | ||||||
|  |                                             } | ||||||
|  |                                             .padding(.top, 3.3) | ||||||
|  |                                         } | ||||||
|  |                                         .padding(.top, 26.7) | ||||||
|  |                                     } | ||||||
|                                 } |                                 } | ||||||
|                             } |                             } | ||||||
|                             .padding(.top, 26.7) |                             .padding(.top, 26.7) | ||||||
|   | |||||||
| @@ -56,11 +56,13 @@ final class ContentCreateViewModel: ObservableObject { | |||||||
|             if isFree { |             if isFree { | ||||||
|                 priceString = "0" |                 priceString = "0" | ||||||
|                 isOnlyRental = false |                 isOnlyRental = false | ||||||
|  |                 isGeneratePreview = true | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|      |      | ||||||
|     @Published var isOnlyRental = false |     @Published var isOnlyRental = false | ||||||
|  |     @Published var isGeneratePreview = true | ||||||
|      |      | ||||||
|     @Published var previewStartTime: String = "" |     @Published var previewStartTime: String = "" | ||||||
|     @Published var previewEndTime: String = "" |     @Published var previewEndTime: String = "" | ||||||
| @@ -94,10 +96,11 @@ final class ContentCreateViewModel: ObservableObject { | |||||||
|                 timezone: TimeZone.current.identifier, |                 timezone: TimeZone.current.identifier, | ||||||
|                 themeId: theme!.id, |                 themeId: theme!.id, | ||||||
|                 isAdult: isAdult, |                 isAdult: isAdult, | ||||||
|                 isOnlyRental: isOnlyRental, |                 isOnlyRental: isOnlyRental,  | ||||||
|  |                 isGeneratePreview: isGeneratePreview, | ||||||
|                 isCommentAvailable: isAvailableComment, |                 isCommentAvailable: isAvailableComment, | ||||||
|                 previewStartTime: previewStartTime.trimmingCharacters(in: .whitespacesAndNewlines).count > 0 ? previewStartTime : nil, |                 previewStartTime: isGeneratePreview && previewStartTime.trimmingCharacters(in: .whitespacesAndNewlines).count > 0 ? previewStartTime : nil, | ||||||
|                 previewEndTime: previewEndTime.trimmingCharacters(in: .whitespacesAndNewlines).count > 0 ? previewEndTime : nil |                 previewEndTime: isGeneratePreview && previewEndTime.trimmingCharacters(in: .whitespacesAndNewlines).count > 0 ? previewEndTime : nil | ||||||
|             ) |             ) | ||||||
|              |              | ||||||
|             var multipartData = [MultipartFormData]() |             var multipartData = [MultipartFormData]() | ||||||
|   | |||||||
| @@ -17,6 +17,7 @@ struct CreateAudioContentRequest: Encodable { | |||||||
|     let themeId: Int |     let themeId: Int | ||||||
|     let isAdult: Bool |     let isAdult: Bool | ||||||
|     let isOnlyRental: Bool |     let isOnlyRental: Bool | ||||||
|  |     let isGeneratePreview: Bool | ||||||
|     let isCommentAvailable: Bool |     let isCommentAvailable: Bool | ||||||
|     let previewStartTime: String? |     let previewStartTime: String? | ||||||
|     let previewEndTime: String? |     let previewEndTime: String? | ||||||
|   | |||||||
| @@ -18,6 +18,7 @@ struct GetAudioContentDetailResponse: Decodable { | |||||||
|     let price: Int |     let price: Int | ||||||
|     let duration: String |     let duration: String | ||||||
|     let releaseDate: String? |     let releaseDate: String? | ||||||
|  |     let isActivePreview: Bool | ||||||
|     let isAdult: Bool |     let isAdult: Bool | ||||||
|     let isMosaic: Bool |     let isMosaic: Bool | ||||||
|     let isOnlyRental: Bool |     let isOnlyRental: Bool | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Yu Sung
					Yu Sung