123456789101112131415161718192021222324252627282930313233 |
- import Foundation
- import RxSwift
- struct UploadResource<Content>: Resource {
- typealias Model = Content
-
- var path: Interfaces
- var parameter: Parameter
- var parseJSON: (JSON) -> Content?
-
- init(path: Interfaces, parameter: Parameter, parseJSON: @escaping (JSON) -> Content?) {
- self.path = path
- self.parameter = parameter
- self.parseJSON = parseJSON
- }
-
- func parse(_ json: JSON) -> Content? {
- return parseJSON(json)
- }
-
- func upload() -> Single<Content> {
- return NetworkApi.share.upload(resource: self)
- }
- }
|