콘텐츠 업로드
- 미리듣기 여부 선택 버튼 추가
This commit is contained in:
		| @@ -288,62 +288,84 @@ struct ContentCreateView: View { | ||||
|                                             .frame(maxWidth: .infinity, alignment: .leading) | ||||
|                                     } | ||||
|                                     .padding(.top, 26.7) | ||||
|                                 } | ||||
|                                  | ||||
|                                 if !viewModel.isFree { | ||||
|                                     VStack(spacing: 10) { | ||||
|                                         Text("미리듣기 시간 설정") | ||||
|                                      | ||||
|                                     VStack(spacing: 13.3) { | ||||
|                                         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) | ||||
|                                             SelectButtonView(title: "생성", isChecked: viewModel.isGeneratePreview) { | ||||
|                                                 if !viewModel.isGeneratePreview { | ||||
|                                                     viewModel.isGeneratePreview = true | ||||
|                                                 } | ||||
|                                             } | ||||
|                                              | ||||
|                                             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) | ||||
|                                             SelectButtonView(title: "생성 안 함", isChecked: !viewModel.isGeneratePreview) { | ||||
|                                                 if viewModel.isGeneratePreview { | ||||
|                                                     viewModel.isGeneratePreview = false | ||||
|                                                 } | ||||
|                                             } | ||||
|                                         } | ||||
|                                         .padding(.top, 3.3) | ||||
|                                     } | ||||
|                                     .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) | ||||
|   | ||||
| @@ -56,11 +56,13 @@ final class ContentCreateViewModel: ObservableObject { | ||||
|             if isFree { | ||||
|                 priceString = "0" | ||||
|                 isOnlyRental = false | ||||
|                 isGeneratePreview = true | ||||
|             } | ||||
|         } | ||||
|     } | ||||
|      | ||||
|     @Published var isOnlyRental = false | ||||
|     @Published var isGeneratePreview = true | ||||
|      | ||||
|     @Published var previewStartTime: String = "" | ||||
|     @Published var previewEndTime: String = "" | ||||
| @@ -94,10 +96,11 @@ final class ContentCreateViewModel: ObservableObject { | ||||
|                 timezone: TimeZone.current.identifier, | ||||
|                 themeId: theme!.id, | ||||
|                 isAdult: isAdult, | ||||
|                 isOnlyRental: isOnlyRental, | ||||
|                 isOnlyRental: isOnlyRental,  | ||||
|                 isGeneratePreview: isGeneratePreview, | ||||
|                 isCommentAvailable: isAvailableComment, | ||||
|                 previewStartTime: previewStartTime.trimmingCharacters(in: .whitespacesAndNewlines).count > 0 ? previewStartTime : nil, | ||||
|                 previewEndTime: previewEndTime.trimmingCharacters(in: .whitespacesAndNewlines).count > 0 ? previewEndTime : nil | ||||
|                 previewStartTime: isGeneratePreview && previewStartTime.trimmingCharacters(in: .whitespacesAndNewlines).count > 0 ? previewStartTime : nil, | ||||
|                 previewEndTime: isGeneratePreview && previewEndTime.trimmingCharacters(in: .whitespacesAndNewlines).count > 0 ? previewEndTime : nil | ||||
|             ) | ||||
|              | ||||
|             var multipartData = [MultipartFormData]() | ||||
|   | ||||
| @@ -17,6 +17,7 @@ struct CreateAudioContentRequest: Encodable { | ||||
|     let themeId: Int | ||||
|     let isAdult: Bool | ||||
|     let isOnlyRental: Bool | ||||
|     let isGeneratePreview: Bool | ||||
|     let isCommentAvailable: Bool | ||||
|     let previewStartTime: String? | ||||
|     let previewEndTime: String? | ||||
|   | ||||
| @@ -18,6 +18,7 @@ struct GetAudioContentDetailResponse: Decodable { | ||||
|     let price: Int | ||||
|     let duration: String | ||||
|     let releaseDate: String? | ||||
|     let isActivePreview: Bool | ||||
|     let isAdult: Bool | ||||
|     let isMosaic: Bool | ||||
|     let isOnlyRental: Bool | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Yu Sung
					Yu Sung