| | |
| | | import RxCocoa |
| | | |
| | | class EnterpriseViewModel:YYViewModel{ |
| | | func queryEnterpriseInfo(_ clouse:@escaping (ResponseStatus<EnterpriseInfoModel>)->Void){ |
| | | show() |
| | | func queryEnterpriseInfo(needShow:Bool = true,clouse:@escaping (ResponseStatus<EnterpriseInfoModel>)->Void){ |
| | | if needShow{ |
| | | show() |
| | | } |
| | | APIManager.shared.provider.rx.request(.queryCompany).mapTravelThenValidate(EnterpriseInfoModel.self).subscribe { result in |
| | | self.hidden() |
| | | switch result { |
| | |
| | | }.disposed(by: disposeBag) |
| | | } |
| | | |
| | | func submitEnterprise(id:Int? = nil,name:String,mailbox:String,legalName:String,legalPhone:String,identifier:String,contactAddress:String,businessLicense:String,clouse: @escaping (ResponseStatus<Nothing>)->Void){ |
| | | func submitEnterprise(id:Int? = nil,name:String,mailbox:String,legalName:String,legalPhone:String,identifier:String,contactAddress:String,businessLicense:String,pwd:String,clouse: @escaping (ResponseStatus<Nothing>)->Void){ |
| | | show() |
| | | APIManager.shared.provider.rx.request(.submitCompany(name: name, mailbox: mailbox, legalName: legalName, legalPhone: legalPhone, identifier: identifier, contactAddress: contactAddress, businessLicense: businessLicense)).mapTravelThenValidate(Nothing.self).subscribe { result in |
| | | APIManager.shared.provider.rx.request(.submitCompany(name: name, mailbox: mailbox, legalName: legalName, legalPhone: legalPhone, identifier: identifier, contactAddress: contactAddress, businessLicense: businessLicense,pwd: pwd)).mapTravelThenValidate(Nothing.self).subscribe { result in |
| | | self.hidden() |
| | | switch result { |
| | | case .success(_): |