| | |
| | | // |
| | | // Services.swift |
| | | // YixiuShop |
| | | // |
| | | // Created by Sweet on 2019/9/30. |
| | | // Copyright © 2019 jackLove. All rights reserved. |
| | | // |
| | | // |
| | | // Services.swift |
| | | // YixiuShop |
| | | // |
| | | // Created by Sweet on 2019/9/30. |
| | | // Copyright © 2019 jackLove. All rights reserved. |
| | | // |
| | | |
| | | import UIKit |
| | | import RxSwift |
| | |
| | | |
| | | #if DEBUG |
| | | //let All_Url = "http://192.168.110.27:56666" //罗易胜 |
| | | let All_Url = "http://192.168.110.85:56666" //正式地址 |
| | | //let All_Url = "http://192.168.110.85:56666" //正式地址 |
| | | let All_Url = "http://192.168.110.80:56666" //正式地址 |
| | | let Game_Url = "https://try.daowepark.com" |
| | | //let Socket_Url = "192.168.110.22" |
| | | //let Socket_Url = "192.168.110.22" |
| | | #else |
| | | let All_Url = "http://8.137.22.229:56666" //正式地址 |
| | | let Game_Url = "https://port.daowepark.com"//正式地址 |
| | | //let Game_Url = "https://try.daowepark.com" //测试地址 |
| | | |
| | | //let Socket_Url = "192.168.110.22" |
| | | //let Socket_Url = "192.168.110.22" |
| | | #endif |
| | | |
| | | class Services: NSObject { |
| | |
| | | // MARK: -- 游戏 |
| | | extension Services{ |
| | | |
| | | class func updateInfo(birthday:String?,gender:Int?,name:String?)->Observable<BaseResponse<SimpleModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/appUser/updateInfo") |
| | | .append(key: "birthday", value: birthday) |
| | | .append(key: "gender", value: gender) |
| | | .append(key: "name", value: name) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | class func updateInfo(birthday:String?,gender:Int?,name:String?)->Observable<BaseResponse<SimpleModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/appUser/updateInfo") |
| | | .append(key: "birthday", value: birthday) |
| | | .append(key: "gender", value: gender) |
| | | .append(key: "name", value: name) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | |
| | | /// 本地离线游戏 |
| | | class func game_gameList(spaceId:Int,storeId:Int)->Observable<BaseResponse<[GameListModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/other/api/game/queryGameList") |
| | | .append(key: "siteId", value: spaceId) |
| | | .append(key: "storeId", value: storeId) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | /// 本地离线游戏 |
| | | class func game_gameList(spaceId:Int,storeId:Int)->Observable<BaseResponse<[GameListModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/other/api/game/queryGameList") |
| | | .append(key: "siteId", value: spaceId) |
| | | .append(key: "storeId", value: storeId) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | |
| | | class func game_intro()->Observable<BaseResponse<String>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/other/api/game/getIntro") |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | class func game_intro()->Observable<BaseResponse<String>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/other/api/game/getIntro") |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | //支付游戏 |
| | | class func payGame(configId:Int,gameId:Int,spaceId:Int,sutuId:Int,type:PayType)->Observable<BaseResponse<PaymentModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/other/api/game/payGame") |
| | | .append(key: "configId", value: configId) |
| | | .append(key: "gameId", value: gameId) |
| | | .append(key: "spaceId", value: spaceId) |
| | | .append(key: "sutuId", value: sutuId) |
| | | .append(key: "type", value: type.rawValue) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | //支付游戏 |
| | | class func payGame(configId:Int,gameId:Int,spaceId:Int,sutuId:Int,type:PayType)->Observable<BaseResponse<PaymentModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/other/api/game/payGame") |
| | | .append(key: "configId", value: configId) |
| | | .append(key: "gameId", value: gameId) |
| | | .append(key: "spaceId", value: spaceId) |
| | | .append(key: "sutuId", value: sutuId) |
| | | .append(key: "type", value: type.rawValue) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | |
| | | /// 启动本地游戏 |
| | | class func game_gameStart(gameId:Int,spaceId:Int,sutuId:Int,userID:Int)->Observable<BaseResponse<SimpleModel>>{ |
| | | let params = ParamsAppender.build(url: Game_Url) |
| | | .interface(url: "/v7/user_api/general/gameStart") |
| | | .append(key: "space_id", value: spaceId) |
| | | .append(key: "sutu_id", value: sutuId) |
| | | .append(key: "game_id", value: gameId) |
| | | .append(key: "app_user_id", value: userID) |
| | | .append(key: "sign", value: "0DB011836143EEE2C2E072967C9F4E4B") |
| | | return NetworkRequest.request(params: params, method: .post, encoding: JSONEncoding.default, progress: false) |
| | | } |
| | | /// 启动本地游戏 |
| | | class func game_gameStart(gameId:Int,spaceId:Int,sutuId:Int,userID:Int)->Observable<BaseResponse<SimpleModel>>{ |
| | | let params = ParamsAppender.build(url: Game_Url) |
| | | .interface(url: "/v7/user_api/general/gameStart") |
| | | .append(key: "space_id", value: spaceId) |
| | | .append(key: "sutu_id", value: sutuId) |
| | | .append(key: "game_id", value: gameId) |
| | | .append(key: "app_user_id", value: userID) |
| | | .append(key: "sign", value: "0DB011836143EEE2C2E072967C9F4E4B") |
| | | return NetworkRequest.request(params: params, method: .post, encoding: JSONEncoding.default, progress: false) |
| | | } |
| | | |
| | | /// 开门 |
| | | class func game_OpenDoorCode(userID:Int)->Observable<BaseResponse<DoorModel>>{ |
| | | let params = ParamsAppender.build(url: Game_Url) |
| | | .interface(url: "/v7/user_api/general/getOpenDoorCode") |
| | | .append(key: "app_user_id", value: userID) |
| | | .append(key: "sign", value: "") |
| | | return NetworkRequest.request(params: params, method: .get, progress: false) |
| | | } |
| | | /// 开门 |
| | | class func game_OpenDoorCode(userID:Int)->Observable<BaseResponse<DoorModel>>{ |
| | | let params = ParamsAppender.build(url: Game_Url) |
| | | .interface(url: "/v7/user_api/general/getOpenDoorCode") |
| | | .append(key: "app_user_id", value: userID) |
| | | .append(key: "sign", value: "") |
| | | return NetworkRequest.request(params: params, method: .get, progress: false) |
| | | } |
| | | |
| | | /// 用户单机游戏记录 |
| | | class func game_generalGameRecord(userId:Int,page:Int,limit:Int = 20)->Observable<BaseResponse<[GamesRecordModel]>>{ |
| | | let params = ParamsAppender.build(url: Game_Url) |
| | | .interface(url: "/v7/user_api/general/gameRecord") |
| | | .append(key: "uid", value: userId) |
| | | .append(key: "sign", value: "0DB011836143EEE2C2E072967C9F4E4B") |
| | | .append(key: "page", value: page) |
| | | .append(key: "limit", value: 20) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | /// 用户单机游戏记录 |
| | | class func game_generalGameRecord(userId:Int,page:Int,limit:Int = 20)->Observable<BaseResponse<[GamesRecordModel]>>{ |
| | | let params = ParamsAppender.build(url: Game_Url) |
| | | .interface(url: "/v7/user_api/general/gameRecord") |
| | | .append(key: "uid", value: userId) |
| | | .append(key: "sign", value: "0DB011836143EEE2C2E072967C9F4E4B") |
| | | .append(key: "page", value: page) |
| | | .append(key: "limit", value: 20) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | |
| | | /// 用户跨城游戏记录 |
| | | class func game_generalGameCrossRecord(userId:Int,page:Int,limit:Int = 20)->Observable<BaseResponse<[GamesRecordModel]>>{ |
| | | let params = ParamsAppender.build(url: Game_Url) |
| | | .interface(url: "/v7/user_api/general/cityGameRecord") |
| | | .append(key: "uid", value: userId) |
| | | .append(key: "sign", value: "0DB011836143EEE2C2E072967C9F4E4B") |
| | | .append(key: "page", value: page) |
| | | .append(key: "limit", value: 20) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | /// 用户跨城游戏记录 |
| | | class func game_generalGameCrossRecord(userId:Int,page:Int,limit:Int = 20)->Observable<BaseResponse<[GamesRecordModel]>>{ |
| | | let params = ParamsAppender.build(url: Game_Url) |
| | | .interface(url: "/v7/user_api/general/cityGameRecord") |
| | | .append(key: "uid", value: userId) |
| | | .append(key: "sign", value: "0DB011836143EEE2C2E072967C9F4E4B") |
| | | .append(key: "page", value: page) |
| | | .append(key: "limit", value: 20) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | |
| | | /// 用户跨城游戏记录 |
| | | class func game_generalGameAccuracyRecord(userId:Int,page:Int,limit:Int = 20)->Observable<BaseResponse<[GamesRecordModel]>>{ |
| | | let params = ParamsAppender.build(url: Game_Url) |
| | | .interface(url: "/v7/user_api/general/accuracyGameRecord") |
| | | .append(key: "uid", value: userId) |
| | | .append(key: "sign", value: "0DB011836143EEE2C2E072967C9F4E4B") |
| | | .append(key: "page", value: page) |
| | | .append(key: "limit", value: 20) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | /// 用户跨城游戏记录 |
| | | class func game_generalGameAccuracyRecord(userId:Int,page:Int,limit:Int = 20)->Observable<BaseResponse<[GamesRecordModel]>>{ |
| | | let params = ParamsAppender.build(url: Game_Url) |
| | | .interface(url: "/v7/user_api/general/accuracyGameRecord") |
| | | .append(key: "uid", value: userId) |
| | | .append(key: "sign", value: "0DB011836143EEE2C2E072967C9F4E4B") |
| | | .append(key: "page", value: page) |
| | | .append(key: "limit", value: 20) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | } |
| | | |
| | | // MARK: -- 登录部分 |
| | | // MARK: -- 登录部分 |
| | | extension Services{ |
| | | static let pageSize: Int = 20 |
| | | class func login(phone:String,verity:String,type:LoginType)->Observable<BaseResponse<String>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | if type == .pwd{ |
| | | params.interface(url: "/account/base/appUser/loginPassword") |
| | | params.append(key: "password", value: verity.jq_md5String().lowercased()) |
| | | }else{ |
| | | params.interface(url: "/account/base/appUser/loginSMSCode") |
| | | params.append(key: "code", value: verity) |
| | | } |
| | | params.append(key: "phone", value: phone) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | static let pageSize: Int = 20 |
| | | class func login(phone:String,verity:String,type:LoginType)->Observable<BaseResponse<String>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | if type == .pwd{ |
| | | params.interface(url: "/account/base/appUser/loginPassword") |
| | | params.append(key: "password", value: verity.jq_md5String().lowercased()) |
| | | }else{ |
| | | params.interface(url: "/account/base/appUser/loginSMSCode") |
| | | params.append(key: "code", value: verity) |
| | | } |
| | | params.append(key: "phone", value: phone) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | class func logOff()->Observable<BaseResponse<SimpleModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | params.interface(url: "/account/base/appUser/logOff") |
| | | .append(key: "appId", value: UserInfoModel.get()!.userId) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | class func logOff()->Observable<BaseResponse<SimpleModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | params.interface(url: "/account/base/appUser/logOff") |
| | | .append(key: "appId", value: UserInfoModel.get()!.userId) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | class func wxLogin(openId:String,nickname:String,headimgurl:String,sex:Int)->Observable<BaseResponse<LoginModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/base/appUser/loginWeChat") |
| | | .append(key: "openId", value: openId) |
| | | .append(key: "nickname", value: nickname) |
| | | .append(key: "headimgurl", value: headimgurl) |
| | | .append(key: "sex", value: sex) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | class func wxLogin(openId:String,nickname:String,headimgurl:String,sex:Int)->Observable<BaseResponse<LoginModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/base/appUser/loginWeChat") |
| | | .append(key: "openId", value: openId) |
| | | .append(key: "nickname", value: nickname) |
| | | .append(key: "headimgurl", value: headimgurl) |
| | | .append(key: "sex", value: sex) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | class func wxPhoneBind(phone:String,code:String,openId:String,invitePhone:String? = nil)->Observable<BaseResponse<LoginModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/base/appUser/bind") |
| | | .append(key: "phone", value: phone) |
| | | .append(key: "openId", value: openId) |
| | | .append(key: "code", value: code) |
| | | .append(key: "invitePhone", value: invitePhone) |
| | | .append(key: "lat", value: locationTool.currentLocation?.coordinate.latitude.string) |
| | | .append(key: "lon", value: locationTool.currentLocation?.coordinate.longitude.string) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | class func wxPhoneBind(phone:String,code:String,openId:String,invitePhone:String? = nil)->Observable<BaseResponse<LoginModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/base/appUser/bind") |
| | | .append(key: "phone", value: phone) |
| | | .append(key: "openId", value: openId) |
| | | .append(key: "code", value: code) |
| | | .append(key: "invitePhone", value: invitePhone) |
| | | .append(key: "lat", value: locationTool.currentLocation?.coordinate.latitude.string) |
| | | .append(key: "lon", value: locationTool.currentLocation?.coordinate.longitude.string) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | class func getSMSCode(phone:String,type:GetSMSCodeType)->Observable<BaseResponse<SimpleModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/base/appUser/getSMSCode") |
| | | .append(key: "phone", value: phone) |
| | | .append(key: "type", value: type.rawValue) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | class func getSMSCode(phone:String,type:GetSMSCodeType)->Observable<BaseResponse<SimpleModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/base/appUser/getSMSCode") |
| | | .append(key: "phone", value: phone) |
| | | .append(key: "type", value: type.rawValue) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | class func register(phone:String,password:String,code:String,invitePhone:String? = nil)->Observable<BaseResponse<SimpleModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/base/appUser/addAppUser") |
| | | .append(key: "phone", value: phone) |
| | | .append(key: "password", value: password.jq_md5String().lowercased()) |
| | | .append(key: "code", value: code) |
| | | .append(key: "invitePhone", value: invitePhone) |
| | | .append(key: "lat", value: locationTool.currentLocation?.coordinate.latitude.string) |
| | | .append(key: "lon", value: locationTool.currentLocation?.coordinate.longitude.string) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | class func register(phone:String,password:String,code:String,invitePhone:String? = nil)->Observable<BaseResponse<SimpleModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/base/appUser/addAppUser") |
| | | .append(key: "phone", value: phone) |
| | | .append(key: "password", value: password.jq_md5String().lowercased()) |
| | | .append(key: "code", value: code) |
| | | .append(key: "invitePhone", value: invitePhone) |
| | | .append(key: "lat", value: locationTool.currentLocation?.coordinate.latitude.string) |
| | | .append(key: "lon", value: locationTool.currentLocation?.coordinate.longitude.string) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | class func updatePwd(phone:String,password:String,code:String)->Observable<BaseResponse<SimpleModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/base/appUser/updatePassword") |
| | | .append(key: "phone", value: phone) |
| | | .append(key: "password", value: password.jq_md5String().lowercased()) |
| | | .append(key: "code", value: code) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | class func updatePwd(phone:String,password:String,code:String)->Observable<BaseResponse<SimpleModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/base/appUser/updatePassword") |
| | | .append(key: "phone", value: phone) |
| | | .append(key: "password", value: password.jq_md5String().lowercased()) |
| | | .append(key: "code", value: code) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | class func forgetPwd(phone:String,password:String,code:String)->Observable<BaseResponse<SimpleModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/base/appUser/forgetPassword") |
| | | .append(key: "phone", value: phone) |
| | | .append(key: "password", value: password.jq_md5String().lowercased()) |
| | | .append(key: "code", value: code) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | class func forgetPwd(phone:String,password:String,code:String)->Observable<BaseResponse<SimpleModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/base/appUser/forgetPassword") |
| | | .append(key: "phone", value: phone) |
| | | .append(key: "password", value: password.jq_md5String().lowercased()) |
| | | .append(key: "code", value: code) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | /// 用户详情 |
| | | class func userDetails()->Observable<BaseResponse<UserInfoModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/useBenefit/userDetails") |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | /// 用户详情 |
| | | class func userDetails()->Observable<BaseResponse<UserInfoModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/useBenefit/userDetails") |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | class func updateUserProfile(_ imgUrl:String)->Observable<BaseResponse<SimpleModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/useBenefit/uploadImage") |
| | | .append(key: "userImage", value: imgUrl) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | class func updateUserProfile(_ imgUrl:String)->Observable<BaseResponse<SimpleModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/useBenefit/uploadImage") |
| | | .append(key: "userImage", value: imgUrl) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | /// 勋章 |
| | | static func studMedalList(studentId:Int)->Observable<BaseResponse<[StudentMedalModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/startCource/stuGoog") |
| | | .append(key: "stuId", value: studentId) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | /// 勋章 |
| | | static func studMedalList(studentId:Int)->Observable<BaseResponse<[StudentMedalModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/startCource/stuGoog") |
| | | .append(key: "stuId", value: studentId) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | /// 成为会员获取优惠券 |
| | | /// - Parameter menthod: 1=积分购买,2=注册赠送 |
| | | static func queryMemberCoupon(menthod:Int)->Observable<BaseResponse<[CouponInfo_1_Model]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/activity/api/coupon/queryCouponList") |
| | | .append(key: "distributionMethod", value: menthod) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | /// 成为会员获取优惠券 |
| | | /// - Parameter menthod: 1=积分购买,2=注册赠送 |
| | | static func queryMemberCoupon(menthod:Int)->Observable<BaseResponse<[CouponInfo_1_Model]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/activity/api/coupon/queryCouponList") |
| | | .append(key: "distributionMethod", value: menthod) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | } |
| | | |
| | | // MARK: -- 首页部分 |
| | | // MARK: -- 首页部分 |
| | | |
| | | extension Services{ |
| | | class func homeInfo()->Observable<BaseResponse<HomeStoreModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/appUser/queryJoinPlayPai") |
| | | .append(key: "lat", value: locationTool.currentLocation?.coordinate.latitude.string) |
| | | .append(key: "lon", value: locationTool.currentLocation?.coordinate.longitude.string) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | class func homeInfo()->Observable<BaseResponse<HomeStoreModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/appUser/queryJoinPlayPai") |
| | | .append(key: "lat", value: locationTool.currentLocation?.coordinate.latitude.string) |
| | | .append(key: "lon", value: locationTool.currentLocation?.coordinate.longitude.string) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | |
| | | class func homeStoreConfig2(storeId:Int)->Observable<BaseResponse<[HomeStoreTopBannerModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/other/base/store/queryIndexSet") |
| | | .append(key: "id", value: storeId) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | class func homeStoreConfig2(storeId:Int)->Observable<BaseResponse<[HomeStoreTopBannerModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/other/base/store/queryIndexSet") |
| | | .append(key: "id", value: storeId) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | /// 主页配置 |
| | | class func homeStoreConfig(storeId:Int)->Observable<BaseResponse<[HomeStoreConfigModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/other/base/store/queryStoreConfig") |
| | | .append(key: "storeId", value: storeId) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | /// 主页配置 |
| | | class func homeStoreConfig(storeId:Int)->Observable<BaseResponse<[HomeStoreConfigModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/other/base/store/queryStoreConfig") |
| | | .append(key: "storeId", value: storeId) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | |
| | | /// 获取banner图 |
| | | /// - Parameter position: 位置(1=首页,2=线上课得积分,3=看视频得奖励,4=常见问题) |
| | | class func bannerList(position:BannerPositionType)->Observable<BaseResponse<[BannerModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/other/base/banner/queryBannerList") |
| | | .append(key: "position", value: position.rawValue) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | /// 获取banner图 |
| | | /// - Parameter position: 位置(1=首页,2=线上课得积分,3=看视频得奖励,4=常见问题) |
| | | class func bannerList(position:BannerPositionType)->Observable<BaseResponse<[BannerModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/other/base/banner/queryBannerList") |
| | | .append(key: "position", value: position.rawValue) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | } |
| | | |
| | | // MARK: -- 福利相关 |
| | | extension Services{ |
| | | class func benefitHome()->Observable<BaseResponse<BenefitHomeModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/useBenefit/indexOfAppUser") |
| | | .append(key: "lat", value: locationTool.currentLocation?.coordinate.latitude.string) |
| | | .append(key: "lon", value: locationTool.currentLocation?.coordinate.longitude.string) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | class func benefitHome()->Observable<BaseResponse<BenefitHomeModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/useBenefit/indexOfAppUser") |
| | | .append(key: "lat", value: locationTool.currentLocation?.coordinate.latitude.string) |
| | | .append(key: "lon", value: locationTool.currentLocation?.coordinate.longitude.string) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | |
| | | |
| | | /// 账单 |
| | | /// - Parameters: |
| | | /// - recordType: 记录(1充值 2扣除) |
| | | class func billingList(recordType:Int?,yearMonth:String)->Observable<BaseResponse<[BillingModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/useBenefit/userBilling") |
| | | .append(key: "recordId", value: recordType) |
| | | .append(key: "yearMonth", value: yearMonth) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | /// 账单 |
| | | /// - Parameters: |
| | | /// - recordType: 记录(1充值 2扣除) |
| | | class func billingList(recordType:Int?,yearMonth:String)->Observable<BaseResponse<[BillingModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/useBenefit/userBilling") |
| | | .append(key: "recordId", value: recordType) |
| | | .append(key: "yearMonth", value: yearMonth) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | |
| | | /// 优惠券 |
| | | class func myCouponList(type:Int?,useStatus:Int?)->Observable<BaseResponse<[CouponModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/activity/api/coupon/queryCouponPackage") |
| | | .append(key: "couponType", value: type) |
| | | .append(key: "useStatus", value: useStatus) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | /// 优惠券 |
| | | class func myCouponList(type:Int?,useStatus:Int?)->Observable<BaseResponse<[CouponModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/activity/api/coupon/queryCouponPackage") |
| | | .append(key: "couponType", value: type) |
| | | .append(key: "useStatus", value: useStatus) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | |
| | | /// 充值明细 |
| | | /// - Parameters: |
| | | /// - yearMonth: 记录(1充值 2扣除) |
| | | class func voucherDetail(recordType:Int?,yearMonth:String,page:Int,pageSize:Int = 20,subType:RechargeRecordVC.RechargeRecordType)->Observable<BaseResponse<[BillingModel]>>{ |
| | | /// 充值明细 |
| | | /// - Parameters: |
| | | /// - yearMonth: 记录(1充值 2扣除) |
| | | class func voucherDetail(recordType:Int?,yearMonth:String,page:Int,pageSize:Int = 20,subType:RechargeRecordVC.RechargeRecordType)->Observable<BaseResponse<[BillingModel]>>{ |
| | | |
| | | let params:ParamsAppender! |
| | | if subType == .coin{ |
| | | params = ParamsAppender.build(url: All_Url).interface(url: "/account/api/useBenefit/voucherDetail") |
| | | }else{ |
| | | params = ParamsAppender.build(url: All_Url).interface(url: "/account/api/useBenefit/integralDetails") |
| | | } |
| | | let params:ParamsAppender! |
| | | if subType == .coin{ |
| | | params = ParamsAppender.build(url: All_Url).interface(url: "/account/api/useBenefit/voucherDetail") |
| | | }else{ |
| | | params = ParamsAppender.build(url: All_Url).interface(url: "/account/api/useBenefit/integralDetails") |
| | | } |
| | | |
| | | params.append(key: "recordId", value: recordType) |
| | | params.append(key: "yearMonth", value: yearMonth) |
| | | params.append(key: "pageNum", value: page) |
| | | params.append(key: "pageSize", value: pageSize) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | params.append(key: "recordId", value: recordType) |
| | | params.append(key: "yearMonth", value: yearMonth) |
| | | params.append(key: "pageNum", value: page) |
| | | params.append(key: "pageSize", value: pageSize) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | |
| | | |
| | | /// 充值列表 |
| | | class func voucherCenter()->Observable<BaseResponse<[CoinExchangeModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/useBenefit/voucherCenter") |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | /// 充值列表 |
| | | class func voucherCenter()->Observable<BaseResponse<[CoinExchangeModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/useBenefit/voucherCenter") |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | /// 支付 |
| | | class func useBenefitPayment(amount:Double,payType:PayType)->Observable<BaseResponse<PaymentModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/useBenefit/payment") |
| | | .append(key: "amount", value: amount) |
| | | .append(key: "payType", value: payType.rawValue) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | /// 支付 |
| | | class func useBenefitPayment(amount:Double,payType:PayType)->Observable<BaseResponse<PaymentModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/useBenefit/payment") |
| | | .append(key: "amount", value: amount) |
| | | .append(key: "payType", value: payType.rawValue) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | |
| | | /// 充值说明 |
| | | class func rechargeDescription()->Observable<BaseResponse<String>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/other/base/stored/rechargeDescription") |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | /// 充值说明 |
| | | class func rechargeDescription()->Observable<BaseResponse<String>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/other/base/stored/rechargeDescription") |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | |
| | | } |
| | | } |
| | | } |
| | | |
| | | // MARK: -- 运动营相关 |
| | | // MARK: -- 运动营相关 |
| | | extension Services { |
| | | |
| | | /// 获取优惠券 |
| | | class func paymentCourseCouponList(id:Int)->Observable<BaseResponse<[CourseCouponModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/course/api/course/paymentCourseCouponList") |
| | | .append(key: "coursePackagePaymentConfigId", value: id) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | /// 获取优惠券 |
| | | class func paymentCourseCouponList(id:Int)->Observable<BaseResponse<[CourseCouponModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/course/api/course/paymentCourseCouponList") |
| | | .append(key: "coursePackagePaymentConfigId", value: id) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | |
| | | class func queryCourseList(typeId:Int? = nil,distanceSort:SortType? = nil,salesRanking:SortType? = nil,search:String? = nil,storeId:Int? = nil)->Observable<BaseResponse<[CourseItemModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/course/api/course/queryCourseList") |
| | | .append(key: "lat", value: locationTool.currentLocation?.coordinate.latitude.string) |
| | | .append(key: "lon", value: locationTool.currentLocation?.coordinate.longitude.string) |
| | | .append(key: "coursePackageTypeId", value: typeId) |
| | | .append(key: "distanceSort", value: distanceSort?.rawValue) |
| | | .append(key: "salesRanking", value: salesRanking?.rawValue) |
| | | .append(key: "search", value: search) |
| | | .append(key: "storeId", value: storeId) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | class func queryCourseList(typeId:Int? = nil,distanceSort:SortType? = nil,salesRanking:SortType? = nil,search:String? = nil,storeId:Int? = nil)->Observable<BaseResponse<[CourseItemModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/course/api/course/queryCourseList") |
| | | .append(key: "lat", value: locationTool.currentLocation?.coordinate.latitude.string) |
| | | .append(key: "lon", value: locationTool.currentLocation?.coordinate.longitude.string) |
| | | .append(key: "coursePackageTypeId", value: typeId) |
| | | .append(key: "distanceSort", value: distanceSort?.rawValue) |
| | | .append(key: "salesRanking", value: salesRanking?.rawValue) |
| | | .append(key: "search", value: search) |
| | | .append(key: "storeId", value: storeId) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | |
| | | class func querypaymentCompetitionCourseList(id:Int)->Observable<BaseResponse<[CourseListSubModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/competition/api/competition/paymentCompetitionCourseList") |
| | | .append(key: "id", value: id) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | class func querypaymentCompetitionCourseList(id:Int)->Observable<BaseResponse<[CourseListSubModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/competition/api/competition/paymentCompetitionCourseList") |
| | | .append(key: "id", value: id) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | |
| | | class func getMyCourseList(storeId:Int)->Observable<BaseResponse<[CourseListSubModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/course/api/startCource/getMyCourseList") |
| | | .append(key: "storeId", value: storeId) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | class func getMyCourseList(storeId:Int)->Observable<BaseResponse<[CourseListSubModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/course/api/startCource/getMyCourseList") |
| | | .append(key: "storeId", value: storeId) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | |
| | | class func coursePackageType()->Observable<BaseResponse<[NormalSimpleModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/course/api/course/queryCoursePackageType") |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | class func coursePackageType()->Observable<BaseResponse<[NormalSimpleModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/course/api/course/queryCoursePackageType") |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | |
| | | class func queryStoreList(cityCode:Int? = nil)->Observable<BaseResponse<[NormalSimpleModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/other/base/store/queryStoreLists") |
| | | .append(key: "lat", value: locationTool.currentLocation?.coordinate.latitude.string) |
| | | .append(key: "lon", value: locationTool.currentLocation?.coordinate.longitude.string) |
| | | .append(key: "cityCode", value: cityCode) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | class func queryStoreList(cityCode:Int? = nil)->Observable<BaseResponse<[NormalSimpleModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/other/base/store/queryStoreLists") |
| | | .append(key: "lat", value: locationTool.currentLocation?.coordinate.latitude.string) |
| | | .append(key: "lon", value: locationTool.currentLocation?.coordinate.longitude.string) |
| | | .append(key: "cityCode", value: cityCode) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | |
| | | class func queryCourseInfo(id:Int,payId:Int? = nil)->Observable<BaseResponse<CourseDetailModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/course/api/course/queryCourseInfo") |
| | | .append(key: "id", value: id) |
| | | .append(key: "lat", value: locationTool.currentLocation?.coordinate.latitude.string) |
| | | .append(key: "lon", value: locationTool.currentLocation?.coordinate.longitude.string) |
| | | .append(key: "payId", value: payId) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | class func queryCourseInfo(id:Int,payId:Int? = nil)->Observable<BaseResponse<CourseDetailModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/course/api/course/queryCourseInfo") |
| | | .append(key: "id", value: id) |
| | | .append(key: "lat", value: locationTool.currentLocation?.coordinate.latitude.string) |
| | | .append(key: "lon", value: locationTool.currentLocation?.coordinate.longitude.string) |
| | | .append(key: "payId", value: payId) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | |
| | | /// 查询可用优惠券 |
| | | class func queryAvaiableCopons(id:Int,price:Double)->Observable<BaseResponse<[CouponInfoModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/activity/api/coupon/queryAvailableCouponList") |
| | | .append(key: "coursePackageId", value: id) |
| | | .append(key: "lat", value: locationTool.currentLocation?.coordinate.latitude.string) |
| | | .append(key: "lon", value: locationTool.currentLocation?.coordinate.longitude.string) |
| | | .append(key: "price", value: "\(price)") |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | /// 查询可用优惠券 |
| | | class func queryAvaiableCopons(id:Int,price:Double)->Observable<BaseResponse<[CouponInfoModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/activity/api/coupon/queryAvailableCouponList") |
| | | .append(key: "coursePackageId", value: id) |
| | | .append(key: "lat", value: locationTool.currentLocation?.coordinate.latitude.string) |
| | | .append(key: "lon", value: locationTool.currentLocation?.coordinate.longitude.string) |
| | | .append(key: "price", value: "\(price)") |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | /// 获取学员列表 |
| | | class func queryStudentList()->Observable<BaseResponse<[CourseDetailStudentModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/student/queryStudentList") |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | /// 获取学员列表 |
| | | class func queryStudentList()->Observable<BaseResponse<[CourseDetailStudentModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/student/queryStudentList") |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | |
| | | class func editStu(_ model:StudentProfileModel)->Observable<BaseResponse<SimpleModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/startCource/commitEditStu") |
| | | .append(key: "birthday", value: model.birthday) |
| | | .append(key: "headImg", value: model.headImg) |
| | | .append(key: "height", value: model.height.string) |
| | | .append(key: "idCard", value: model.idCard) |
| | | .append(key: "name", value: model.name) |
| | | .append(key: "phone", value: model.phone) |
| | | .append(key: "sex", value: model.sex.rawValue) |
| | | .append(key: "weight", value: model.weight.string) |
| | | .append(key: "stuId", value: model.stuId) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | class func editStu(_ model:StudentProfileModel)->Observable<BaseResponse<SimpleModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/startCource/commitEditStu") |
| | | .append(key: "birthday", value: model.birthday) |
| | | .append(key: "headImg", value: model.headImg) |
| | | .append(key: "height", value: model.height.string) |
| | | .append(key: "idCard", value: model.idCard) |
| | | .append(key: "name", value: model.name) |
| | | .append(key: "phone", value: model.phone) |
| | | .append(key: "sex", value: model.sex.rawValue) |
| | | .append(key: "weight", value: model.weight.string) |
| | | .append(key: "stuId", value: model.stuId) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | /// 添加学员 |
| | | class func addStudent(_ model:StudentProfileModel)->Observable<BaseResponse<SimpleModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/startCource/addData") |
| | | .append(key: "birthday", value: model.birthday) |
| | | .append(key: "headImg", value: model.headImg) |
| | | .append(key: "height", value: model.height.string) |
| | | .append(key: "idCard", value: model.idCard) |
| | | .append(key: "name", value: model.name) |
| | | .append(key: "phone", value: model.phone) |
| | | .append(key: "sex", value: model.sex.rawValue) |
| | | .append(key: "weight", value: model.weight.string) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | /// 添加学员 |
| | | class func addStudent(_ model:StudentProfileModel)->Observable<BaseResponse<SimpleModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/startCource/addData") |
| | | .append(key: "birthday", value: model.birthday) |
| | | .append(key: "headImg", value: model.headImg) |
| | | .append(key: "height", value: model.height.string) |
| | | .append(key: "idCard", value: model.idCard) |
| | | .append(key: "name", value: model.name) |
| | | .append(key: "phone", value: model.phone) |
| | | .append(key: "sex", value: model.sex.rawValue) |
| | | .append(key: "weight", value: model.weight.string) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | |
| | | |
| | | /// 购买运动营 |
| | | class func courcePayment(conponId:Int? = nil,courseConfigId:Int,id:Int,price:Double,payType:PayType,stuId:[Int],orderId:Int? = nil)->Observable<BaseResponse<PaymentModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/course/api/course/paymentCourse") |
| | | .append(key: "couponId", value: conponId) |
| | | .append(key: "coursePackagePaymentConfigId", value: courseConfigId) |
| | | .append(key: "id", value: id) |
| | | .append(key: "payType", value: payType.rawValue) |
| | | .append(key: "price", value: price.string) |
| | | .append(key: "studentIds", value: stuId.map({"\($0)"}).joined(separator: ";")) |
| | | .append(key: "orderId", value: orderId) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | /// 购买运动营 |
| | | class func courcePayment(conponId:Int? = nil,courseConfigId:Int,id:Int,price:Double,payType:PayType,stuId:[Int],orderId:Int? = nil)->Observable<BaseResponse<PaymentModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/course/api/course/paymentCourse") |
| | | .append(key: "couponId", value: conponId) |
| | | .append(key: "coursePackagePaymentConfigId", value: courseConfigId) |
| | | .append(key: "id", value: id) |
| | | .append(key: "payType", value: payType.rawValue) |
| | | .append(key: "price", value: price.string) |
| | | .append(key: "studentIds", value: stuId.map({"\($0)"}).joined(separator: ";")) |
| | | .append(key: "orderId", value: orderId) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | /// 查询店的免费福利 |
| | | class func queryStoreFreeBenefit(id:Int)->Observable<BaseResponse<StoreWalfareModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "other/base/store/queryStoreFreeBenefit") |
| | | .append(key: "id", value: id) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | /// 查询店的免费福利 |
| | | class func queryStoreFreeBenefit(id:Int)->Observable<BaseResponse<StoreWalfareModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "other/base/store/queryStoreFreeBenefit") |
| | | .append(key: "id", value: id) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | /// 本周福利 |
| | | class func weekLimitedBenefit(discountType:Int)->Observable<BaseResponse<[WeeklyItemModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/course/api/useBenefit/weekLimitedBenefit") |
| | | .append(key: "discountType", value: discountType) |
| | | .append(key: "lat", value: locationTool.currentLocation?.coordinate.latitude.string) |
| | | .append(key: "lon", value: locationTool.currentLocation?.coordinate.longitude.string) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | /// 本周福利 |
| | | class func weekLimitedBenefit(discountType:Int)->Observable<BaseResponse<[WeeklyItemModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/course/api/useBenefit/weekLimitedBenefit") |
| | | .append(key: "discountType", value: discountType) |
| | | .append(key: "lat", value: locationTool.currentLocation?.coordinate.latitude.string) |
| | | .append(key: "lon", value: locationTool.currentLocation?.coordinate.longitude.string) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | |
| | | |
| | | /// 本周福利详情 |
| | | class func weekBenefitDetail(id:Int)->Observable<BaseResponse<WeeklyItemDetailModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/course/api/useBenefit/discountCourseDatas") |
| | | .append(key: "coursePackageDiscountId", value: id) |
| | | .append(key: "lat", value: locationTool.currentLocation?.coordinate.latitude.string) |
| | | .append(key: "lon", value: locationTool.currentLocation?.coordinate.longitude.string) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | /// 本周福利详情 |
| | | class func weekBenefitDetail(id:Int)->Observable<BaseResponse<WeeklyItemDetailModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/course/api/useBenefit/discountCourseDatas") |
| | | .append(key: "coursePackageDiscountId", value: id) |
| | | .append(key: "lat", value: locationTool.currentLocation?.coordinate.latitude.string) |
| | | .append(key: "lon", value: locationTool.currentLocation?.coordinate.longitude.string) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | } |
| | | |
| | | extension Services{ |
| | | |
| | | /// 已报名运动营-运动营列表 |
| | | static func registeredCourse(courseTypeId:Int? = nil,search:String? = nil)->Observable<BaseResponse<[SignUpCourseItemModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/course/api/startCource/registeredCourses") |
| | | .append(key: "courseTypeId", value: courseTypeId) |
| | | .append(key: "search", value: search) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | /// 已报名运动营-运动营列表 |
| | | static func registeredCourse(courseTypeId:Int? = nil,search:String? = nil)->Observable<BaseResponse<[SignUpCourseItemModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/course/api/startCource/registeredCourses") |
| | | .append(key: "courseTypeId", value: courseTypeId) |
| | | .append(key: "search", value: search) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | |
| | | static func registeredData(coursePayId:Int,orderId:Int? = nil)->Observable<BaseResponse<SignUpCourseItemDetailModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/course/api/startCource/RegisteredData") |
| | | .append(key: "coursePayId", value: coursePayId) |
| | | .append(key: "orderId", value: orderId) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | static func registeredData(coursePayId:Int,orderId:Int? = nil)->Observable<BaseResponse<SignUpCourseItemDetailModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/course/api/startCource/RegisteredData") |
| | | .append(key: "coursePayId", value: coursePayId) |
| | | .append(key: "orderId", value: orderId) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | /// 开始上课:学员列表 |
| | | static func startCourceStudentList()->Observable<BaseResponse<[StudentProfile1Model]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/startCource/listOfStu") |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | /// 开始上课:学员列表 |
| | | static func startCourceStudentList()->Observable<BaseResponse<[StudentProfile1Model]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/startCource/listOfStu") |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | |
| | | /// 切换学员 |
| | | static func startCourseSwitch(id:Int)->Observable<BaseResponse<SimpleModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/startCource/switchStu") |
| | | .append(key: "stuId", value: id) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | /// 切换学员 |
| | | static func startCourseSwitch(id:Int)->Observable<BaseResponse<SimpleModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/startCource/switchStu") |
| | | .append(key: "stuId", value: id) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | /// 设置默认 |
| | | static func courseDefaultSet(id:Int)->Observable<BaseResponse<SimpleModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/startCource/editDefault") |
| | | .append(key: "stuId", value: id) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | /// 设置默认 |
| | | static func courseDefaultSet(id:Int)->Observable<BaseResponse<SimpleModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/startCource/editDefault") |
| | | .append(key: "stuId", value: id) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | /// 上课首页 |
| | | static func startCourseHome()->Observable<BaseResponse<StartClouseHomeModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/startCource/queryStudentData") |
| | | .append(key: "lat", value: locationTool.currentLocation?.coordinate.latitude.string) |
| | | .append(key: "lon", value: locationTool.currentLocation?.coordinate.longitude.string) |
| | | .append(key: "stuId", value: UserDefaults.standard.value(forKey: "currentStuId") as? Int) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | /// 上课首页 |
| | | static func startCourseHome()->Observable<BaseResponse<StartClouseHomeModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/startCource/queryStudentData") |
| | | .append(key: "lat", value: locationTool.currentLocation?.coordinate.latitude.string) |
| | | .append(key: "lon", value: locationTool.currentLocation?.coordinate.longitude.string) |
| | | .append(key: "stuId", value: UserDefaults.standard.value(forKey: "currentStuId") as? Int) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | |
| | | |
| | | /// 获取学员测试报告 |
| | | static func queryPhysical(stuId:Int)->Observable<BaseResponse<StartClouseReportModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/startCource/queryPhysical") |
| | | .append(key: "stuID", value: stuId) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | /// 获取学员测试报告 |
| | | static func queryPhysical(stuId:Int)->Observable<BaseResponse<StartClouseReportModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/startCource/queryPhysical") |
| | | .append(key: "stuID", value: stuId) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | |
| | | /// 学员预约运动营列表 |
| | | static func studentAppointList(page:Int,stuId:Int,status:StudentAppointTypeList?,search:String,timeType:StudentAppointDateType)->Observable<BaseResponse<[StudentAppointModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/startCource/stuAppointList") |
| | | .append(key: "appointStatus", value: status?.rawValue) |
| | | .append(key: "timeType", value: timeType.rawValue) |
| | | .append(key: "search", value: search) |
| | | .append(key: "stuId", value: stuId) |
| | | .append(key: "pageNum", value: page) |
| | | .append(key: "size", value: 20) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | /// 学员预约运动营列表 |
| | | static func studentAppointList(page:Int,stuId:Int,status:StudentAppointTypeList?,search:String,timeType:StudentAppointDateType)->Observable<BaseResponse<[StudentAppointModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/startCource/stuAppointList") |
| | | .append(key: "appointStatus", value: status?.rawValue) |
| | | .append(key: "timeType", value: timeType.rawValue) |
| | | .append(key: "search", value: search) |
| | | .append(key: "stuId", value: stuId) |
| | | .append(key: "pageNum", value: page) |
| | | .append(key: "size", value: 20) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | |
| | | /// 课后练习-获取布置运动营列表 |
| | | static func queryArrangeCourseList()->Observable<BaseResponse<[CityProfileModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/course/api/course/queryArrangeCourseList") |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | /// 课后练习-获取布置运动营列表 |
| | | static func queryArrangeCourseList()->Observable<BaseResponse<[CityProfileModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/course/api/course/queryArrangeCourseList") |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | /// 课后练习-课后视频列表 |
| | | static func exerciseCourseList(courseTypeId:Int?,search:String? = nil)->Observable<BaseResponse<[ExerciseVideoModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/course/api/startCource/afterSourceList") |
| | | .append(key: "courseTypeId", value: courseTypeId) |
| | | .append(key: "search", value: search) |
| | | .append(key: "stuId", value: UserDefaults.standard.value(forKey: "currentStuId") as? Int) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | /// 课后练习-课后视频列表 |
| | | static func exerciseCourseList(courseTypeId:Int?,search:String? = nil)->Observable<BaseResponse<[ExerciseVideoModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/course/api/startCource/afterSourceList") |
| | | .append(key: "courseTypeId", value: courseTypeId) |
| | | .append(key: "search", value: search) |
| | | .append(key: "stuId", value: UserDefaults.standard.value(forKey: "currentStuId") as? Int) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | |
| | | /// 课后练习-课后视频详情 |
| | | static func exerciseCourseDetail(coursePackageId:Int,videoId:Int,scId:Int? = nil)->Observable<BaseResponse<ExerciseVideoDetailModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/course/api/startCource/afterSourceDetail") |
| | | .append(key: "coursePackageId", value: coursePackageId) |
| | | .append(key: "videoId", value: videoId) |
| | | .append(key: "scId", value: scId) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | /// 课后练习-课后视频详情 |
| | | static func exerciseCourseDetail(coursePackageId:Int,videoId:Int,scId:Int? = nil)->Observable<BaseResponse<ExerciseVideoDetailModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/course/api/startCource/afterSourceDetail") |
| | | .append(key: "coursePackageId", value: coursePackageId) |
| | | .append(key: "videoId", value: videoId) |
| | | .append(key: "scId", value: scId) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | |
| | | /// 取消预约 |
| | | static func cancelCourse(courseStuRecordId:Int)->Observable<BaseResponse<SimpleModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/startCource/cancelCourse") |
| | | .append(key: "courseStuRecordId", value: courseStuRecordId) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | /// 取消预约 |
| | | static func cancelCourse(courseStuRecordId:Int)->Observable<BaseResponse<SimpleModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/startCource/cancelCourse") |
| | | .append(key: "courseStuRecordId", value: courseStuRecordId) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | /// 学员评语 |
| | | static func stuComment(stuId:Int)->Observable<BaseResponse<[StudentCommentModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/startCource/stuComment") |
| | | .append(key: "stuId", value: stuId) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | /// 学员评语 |
| | | static func stuComment(stuId:Int)->Observable<BaseResponse<[StudentCommentModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/startCource/stuComment") |
| | | .append(key: "stuId", value: stuId) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | |
| | | /// 课时详情-记录列表 |
| | | static func recordDetails(stuId:Int,lessionId:Int,startTime:String?,type:Int?)->Observable<BaseResponse<[CourseRecordModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/startCource/recordDetails") |
| | | .append(key: "stuId", value: stuId) |
| | | .append(key: "lessionId", value: lessionId) |
| | | .append(key: "time", value: startTime) |
| | | .append(key: "type", value: type) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | /// 课时详情-记录列表 |
| | | static func recordDetails(stuId:Int,lessionId:Int,startTime:String?,type:Int?)->Observable<BaseResponse<[CourseRecordModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/startCource/recordDetails") |
| | | .append(key: "stuId", value: stuId) |
| | | .append(key: "lessionId", value: lessionId) |
| | | .append(key: "time", value: startTime) |
| | | .append(key: "type", value: type) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | |
| | | static func lessonDetails(lessonId:Int,stuId:Int)->Observable<BaseResponse<SimpleModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/startCource/lessonDetails") |
| | | .append(key: "stuId", value: stuId) |
| | | .append(key: "lessonId", value: lessonId) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | static func lessonDetails(lessonId:Int,stuId:Int)->Observable<BaseResponse<SimpleModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/startCource/lessonDetails") |
| | | .append(key: "stuId", value: stuId) |
| | | .append(key: "lessonId", value: lessonId) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | |
| | | /// 上课首页-运动营列表 |
| | | static func weeksOfCourseDetails(stuId:Int,time:Date,storeId:Int)->Observable<BaseResponse<WeeklyCourseModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/startCource/weeksOfCourseDetailsList") |
| | | .append(key: "stuId", value: stuId) |
| | | .append(key: "time", value: time.jq_format("yyyy-MM-dd")) |
| | | .append(key: "storeId", value: storeId) |
| | | .append(key: "latitude", value: locationTool.currentLocation?.coordinate.latitude.string) |
| | | .append(key: "longitude", value: locationTool.currentLocation?.coordinate.longitude.string) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | /// 上课首页-运动营列表 |
| | | static func weeksOfCourseDetails(stuId:Int,time:Date,storeId:Int)->Observable<BaseResponse<WeeklyCourseModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/startCource/weeksOfCourseDetailsList") |
| | | .append(key: "stuId", value: stuId) |
| | | .append(key: "time", value: time.jq_format("yyyy-MM-dd")) |
| | | .append(key: "storeId", value: storeId) |
| | | .append(key: "latitude", value: locationTool.currentLocation?.coordinate.latitude.string) |
| | | .append(key: "longitude", value: locationTool.currentLocation?.coordinate.longitude.string) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | |
| | | /// 更新课后视频学习状态 |
| | | static func updateVideoStatus(coursePackageId:Int,videoId:Int?,scId:Int? = nil)->Observable<BaseResponse<SimpleModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/course/api/startCource/updateVideoStatus") |
| | | .append(key: "coursePackageId", value: coursePackageId) |
| | | .append(key: "videoId", value: videoId) |
| | | .append(key: "isOver", value: 1) |
| | | .append(key: "scId", value: scId) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | /// 更新课后视频学习状态 |
| | | static func updateVideoStatus(coursePackageId:Int,videoId:Int?,scId:Int? = nil)->Observable<BaseResponse<SimpleModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/course/api/startCource/updateVideoStatus") |
| | | .append(key: "coursePackageId", value: coursePackageId) |
| | | .append(key: "videoId", value: videoId) |
| | | .append(key: "isOver", value: 1) |
| | | .append(key: "scId", value: scId) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | |
| | | /// 观看视频结束后领取奖励 |
| | | static func receiveAward(id:Int)->Observable<BaseResponse<SimpleModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/activity/api/benefitsVideo/receiveAward") |
| | | .append(key: "id", value: id) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | /// 观看视频结束后领取奖励 |
| | | static func receiveAward(id:Int)->Observable<BaseResponse<SimpleModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/activity/api/benefitsVideo/receiveAward") |
| | | .append(key: "id", value: id) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | |
| | | /// 上课主页-请假操作 |
| | | static func startCourceRreverse(courseId:Int,time:String,stuId:Int)->Observable<BaseResponse<SimpleModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/course/api/startCource/reverse") |
| | | .append(key: "courseID", value: courseId) |
| | | .append(key: "time", value: time) |
| | | .append(key: "stuId", value: stuId) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | /// 上课主页-请假操作 |
| | | static func startCourceRreverse(courseId:Int,time:String,stuId:Int)->Observable<BaseResponse<SimpleModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/course/api/startCource/reverse") |
| | | .append(key: "courseID", value: courseId) |
| | | .append(key: "time", value: time) |
| | | .append(key: "stuId", value: stuId) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | /// 体验购课 |
| | | static func payCourseInfo(courseId:Int)->Observable<BaseResponse<ExperienceCourseModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/course/api/startCource/payCourseInfo") |
| | | .append(key: "courseId", value: courseId) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | /// 体验购课 |
| | | static func payCourseInfo(courseId:Int)->Observable<BaseResponse<ExperienceCourseModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/course/api/startCource/payCourseInfo") |
| | | .append(key: "courseId", value: courseId) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | /// 确认购课 |
| | | static func payCourse(courseId:Int,num:Int,oldCourseId:Int,time:[String])->Observable<BaseResponse<SimpleModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/course/api/startCource/payCourse") |
| | | .append(key: "courseId", value: courseId) |
| | | .append(key: "num", value: num) |
| | | .append(key: "oldCourseId", value: oldCourseId) |
| | | .append(key: "time", value: time.joined(separator: ",").replacingOccurrences(of: ".", with: "-")) |
| | | .append(key: "stuId", value: UserDefaults.standard.value(forKey: "currentStuId") as? Int) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | /// 确认购课 |
| | | static func payCourse(courseId:Int,num:Int,oldCourseId:Int,time:[String])->Observable<BaseResponse<SimpleModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/course/api/startCource/payCourse") |
| | | .append(key: "courseId", value: courseId) |
| | | .append(key: "num", value: num) |
| | | .append(key: "oldCourseId", value: oldCourseId) |
| | | .append(key: "time", value: time.joined(separator: ",").replacingOccurrences(of: ".", with: "-")) |
| | | .append(key: "stuId", value: UserDefaults.standard.value(forKey: "currentStuId") as? Int) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | /// 学员勋章详情 |
| | | static func courseStuMedal(stuId:Int)->Observable<BaseResponse<[StudentMedalInfoModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/startCource/stuMedal") |
| | | .append(key: "stuId", value: stuId) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | /// 学员勋章详情 |
| | | static func courseStuMedal(stuId:Int)->Observable<BaseResponse<[StudentMedalInfoModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/startCource/stuMedal") |
| | | .append(key: "stuId", value: stuId) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | /// 有未分配课时 |
| | | static func weeksOfGetHours()->Observable<BaseResponse<Int>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/startCource/weeksOfGetHours") |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | /// 有未分配课时 |
| | | static func weeksOfGetHours()->Observable<BaseResponse<Int>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/startCource/weeksOfGetHours") |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | |
| | | /// 分配课时 |
| | | static func weeksOfAddHours(packetId:Int)->Observable<BaseResponse<SimpleModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/startCource/weeksOfAddHours") |
| | | .append(key: "packetId", value: packetId) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | /// 分配课时 |
| | | static func weeksOfAddHours(packetId:Int)->Observable<BaseResponse<SimpleModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/startCource/weeksOfAddHours") |
| | | .append(key: "packetId", value: packetId) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | } |
| | | |
| | | // MARK: -- 探索玩湃 |
| | | extension Services{ |
| | | |
| | | static func exploreStoreList(search:String? = nil,space:Int? = nil,cityCode:Int? = nil)->Observable<BaseResponse<[SearchStoreListModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/base/exploreWP/storeList") |
| | | .append(key: "latitude", value: locationTool.currentLocation?.coordinate.latitude.string) |
| | | .append(key: "longitude", value: locationTool.currentLocation?.coordinate.longitude.string) |
| | | .append(key: "search", value: search) |
| | | .append(key: "space", value: space) |
| | | .append(key: "cityCode", value: cityCode) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | static func exploreStoreList(search:String? = nil,space:Int? = nil,cityCode:Int? = nil)->Observable<BaseResponse<[SearchStoreListModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/base/exploreWP/storeList") |
| | | .append(key: "latitude", value: locationTool.currentLocation?.coordinate.latitude.string) |
| | | .append(key: "longitude", value: locationTool.currentLocation?.coordinate.longitude.string) |
| | | .append(key: "search", value: search) |
| | | .append(key: "space", value: space) |
| | | .append(key: "cityCode", value: cityCode) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | |
| | | /// 探索玩湃首页数据 |
| | | static func exploreHome()->Observable<BaseResponse<[StartClouseExploreModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/exploreWP/indexOfEx") |
| | | .append(key: "latitude", value: locationTool.currentLocation?.coordinate.latitude.string) |
| | | .append(key: "longitude", value: locationTool.currentLocation?.coordinate.longitude.string) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | /// 探索玩湃首页数据 |
| | | static func exploreHome()->Observable<BaseResponse<[StartClouseExploreModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/exploreWP/indexOfEx") |
| | | .append(key: "latitude", value: locationTool.currentLocation?.coordinate.latitude.string) |
| | | .append(key: "longitude", value: locationTool.currentLocation?.coordinate.longitude.string) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | |
| | | /// 获取公告列表/常见问题列表 |
| | | static func exploreNoticeList(type:CustomerSubListVC.CustomerSubType)->Observable<BaseResponse<[NoticeItemModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | if type == .notice{ |
| | | params.interface(url: "/account/base/exploreWP/noticeList") |
| | | }else{ |
| | | params.interface(url: "/account/base/exploreWP/exceptionList") |
| | | } |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | /// 获取公告列表/常见问题列表 |
| | | static func exploreNoticeList(type:CustomerSubListVC.CustomerSubType)->Observable<BaseResponse<[NoticeItemModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | if type == .notice{ |
| | | params.interface(url: "/account/base/exploreWP/noticeList") |
| | | }else{ |
| | | params.interface(url: "/account/base/exploreWP/exceptionList") |
| | | } |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | |
| | | |
| | | /// 查看详情 |
| | | static func exploreNoticeDetail(id:Int,type:CustomerSubListVC.CustomerSubType)->Observable<BaseResponse<NoticeItemModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | if type == .notice{ |
| | | params.interface(url: "/account/base/exploreWP/noticeDetail") |
| | | params.append(key: "noId", value: id) |
| | | }else{ |
| | | params.interface(url: "/account/base/exploreWP/exceptionDetail") |
| | | params.append(key: "quesId", value: id) |
| | | } |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | /// 查看详情 |
| | | static func exploreNoticeDetail(id:Int,type:CustomerSubListVC.CustomerSubType)->Observable<BaseResponse<NoticeItemModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | if type == .notice{ |
| | | params.interface(url: "/account/base/exploreWP/noticeDetail") |
| | | params.append(key: "noId", value: id) |
| | | }else{ |
| | | params.interface(url: "/account/base/exploreWP/exceptionDetail") |
| | | params.append(key: "quesId", value: id) |
| | | } |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | |
| | | /// 客服电话 |
| | | static func customerPhone()->Observable<BaseResponse<[String]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | params.interface(url: "/account/base/exploreWP/customerList") |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | /// 客服电话 |
| | | static func customerPhone()->Observable<BaseResponse<[String]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | params.interface(url: "/account/base/exploreWP/customerList") |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | /// 获取门店详情 |
| | | static func exploreStoreDetail(storeId:Int)->Observable<BaseResponse<SearchStoreDetailModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/base/exploreWP/storeDetail") |
| | | .append(key: "storeId", value: storeId) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | /// 获取门店详情 |
| | | static func exploreStoreDetail(storeId:Int)->Observable<BaseResponse<SearchStoreDetailModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/base/exploreWP/storeDetail") |
| | | .append(key: "storeId", value: storeId) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | /// 评价门店 |
| | | static func evaluationStore(id:Int,content:String,imgs:String,score:Double)->Observable<BaseResponse<SimpleModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/other/base/storeEvaluation/saveEvaluation") |
| | | .append(key: "storeId", value: id) |
| | | .append(key: "content", value: content) |
| | | .append(key: "imgs", value: imgs) |
| | | .append(key: "score", value: score) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | /// 评价门店 |
| | | static func evaluationStore(id:Int,content:String,imgs:String,score:Double)->Observable<BaseResponse<SimpleModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/other/base/storeEvaluation/saveEvaluation") |
| | | .append(key: "storeId", value: id) |
| | | .append(key: "content", value: content) |
| | | .append(key: "imgs", value: imgs) |
| | | .append(key: "score", value: score) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | } |
| | | |
| | | // MARK: -- 商城部分 |
| | | extension Services{ |
| | | |
| | | /// 积分商城-商品详情 |
| | | static func UseBenefitDetail(goodsId:Int,goodsType:ExchangeType)->Observable<BaseResponse<ExchangeGoodsModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/useBenefit/goodsDetails") |
| | | .append(key: "goodId", value: goodsId) |
| | | .append(key: "goodsType", value: goodsType.rawValue) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | /// 积分商城-商品详情 |
| | | static func UseBenefitDetail(goodsId:Int,goodsType:ExchangeType)->Observable<BaseResponse<ExchangeGoodsModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/useBenefit/goodsDetails") |
| | | .append(key: "goodId", value: goodsId) |
| | | .append(key: "goodsType", value: goodsType.rawValue) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | /// 积分商城-商品详情 |
| | | static func UseBenefitDetailOne(goodsId:Int)->Observable<BaseResponse<ExchangeGoodsModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/useBenefit/goodsDetailsOne") |
| | | .append(key: "goodId", value: goodsId) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | /// 积分商城-商品详情 |
| | | static func UseBenefitDetailOne(goodsId:Int)->Observable<BaseResponse<ExchangeGoodsModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/useBenefit/goodsDetailsOne") |
| | | .append(key: "goodId", value: goodsId) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | /// 兑换门店 |
| | | static func exchangeStoreIds(id:Int,type:ExchangeType)->Observable<BaseResponse<[StoreSimpleModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/useBenefit/exchangeStoreIds") |
| | | .append(key: "pointsMerId", value: id) |
| | | .append(key: "goodsType", value: type.rawValue) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | /// 兑换门店 |
| | | static func exchangeStoreIds(id:Int,type:ExchangeType)->Observable<BaseResponse<[StoreSimpleModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/useBenefit/exchangeStoreIds") |
| | | .append(key: "pointsMerId", value: id) |
| | | .append(key: "goodsType", value: type.rawValue) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | |
| | | |
| | | /// 兑换商品 |
| | | static func exchangeOperation(exchangeType:ExchangePaymentType,goodsId:Int,goodsType:ExchangeType,num:Int,payType:PayType?,stuIds:String,storeId:Int?)->Observable<BaseResponse<PaymentModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/useBenefit/productRedemptionOperation") |
| | | .append(key: "exchangeType", value: exchangeType.rawValue) |
| | | .append(key: "goodId", value: goodsId) |
| | | .append(key: "goodsType", value: goodsType.rawValue) |
| | | .append(key: "nums", value: num) |
| | | .append(key: "payType", value: payType?.rawValue) |
| | | .append(key: "stuIds", value: stuIds) |
| | | .append(key: "storeId", value: storeId) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true,ignoreAlert: true) |
| | | } |
| | | /// 兑换商品 |
| | | static func exchangeOperation(exchangeType:ExchangePaymentType,goodsId:Int,goodsType:ExchangeType,num:Int,payType:PayType?,stuIds:String,storeId:Int?)->Observable<BaseResponse<PaymentModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/useBenefit/productRedemptionOperation") |
| | | .append(key: "exchangeType", value: exchangeType.rawValue) |
| | | .append(key: "goodId", value: goodsId) |
| | | .append(key: "goodsType", value: goodsType.rawValue) |
| | | .append(key: "nums", value: num) |
| | | .append(key: "payType", value: payType?.rawValue) |
| | | .append(key: "stuIds", value: stuIds) |
| | | .append(key: "storeId", value: storeId) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true,ignoreAlert: true) |
| | | } |
| | | |
| | | /// 积分商城-实体、门票、优惠券为默认门店|课包为默认学员 |
| | | static func goodsOfCourseStore(isCourse:Bool,pointsMerId:Int)->Observable<BaseResponse<StudentProfile2Model>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/useBenefit/goodsOfCourseStore") |
| | | .append(key: "isCourse", value: isCourse) |
| | | .append(key: "pointsMerId", value: pointsMerId) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | /// 积分商城-实体、门票、优惠券为默认门店|课包为默认学员 |
| | | static func goodsOfCourseStore(isCourse:Bool,pointsMerId:Int)->Observable<BaseResponse<StudentProfile2Model>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/useBenefit/goodsOfCourseStore") |
| | | .append(key: "isCourse", value: isCourse) |
| | | .append(key: "pointsMerId", value: pointsMerId) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | |
| | | |
| | | /// 商城中心 |
| | | class func mallList(page:Int,goodsType:ExchangeType?,rank:Sort2Type?,search:String?,shopId:Int?)->Observable<BaseResponse<[MarketMdoel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/useBenefit/integralMallList") |
| | | .append(key: "goodsType", value: goodsType?.rawValue) |
| | | .append(key: "rank", value: rank?.rawValue) |
| | | .append(key: "lat", value: locationTool.currentLocation?.coordinate.latitude.string) |
| | | .append(key: "lon", value: locationTool.currentLocation?.coordinate.longitude.string) |
| | | .append(key: "pageNum", value: page) |
| | | .append(key: "pageSize", value: 20) |
| | | .append(key: "search", value: search) |
| | | .append(key: "shopId", value: shopId) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | /// 商城中心 |
| | | class func mallList(page:Int,goodsType:ExchangeType?,rank:Sort2Type?,search:String?,shopId:Int?)->Observable<BaseResponse<[MarketMdoel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/useBenefit/integralMallList") |
| | | .append(key: "goodsType", value: goodsType?.rawValue) |
| | | .append(key: "rank", value: rank?.rawValue) |
| | | .append(key: "lat", value: locationTool.currentLocation?.coordinate.latitude.string) |
| | | .append(key: "lon", value: locationTool.currentLocation?.coordinate.longitude.string) |
| | | .append(key: "pageNum", value: page) |
| | | .append(key: "pageSize", value: 20) |
| | | .append(key: "search", value: search) |
| | | .append(key: "shopId", value: shopId) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | |
| | | |
| | | /// 积分商城-兑换记录 |
| | | class func exchangeRecords(page:Int,goodType:ExchangeType? = nil,useType:UseStateType? = nil)->Observable<BaseResponse<[RecordsModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/useBenefit/exchangeRecords") |
| | | .append(key: "goodType", value: goodType?.rawValue) |
| | | .append(key: "useType", value: useType?.rawValue) |
| | | .append(key: "page", value:page) |
| | | .append(key: "size", value: 20) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | /// 积分商城-兑换记录 |
| | | class func exchangeRecords(page:Int,goodType:ExchangeType? = nil,useType:UseStateType? = nil)->Observable<BaseResponse<[RecordsModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/useBenefit/exchangeRecords") |
| | | .append(key: "goodType", value: goodType?.rawValue) |
| | | .append(key: "useType", value: useType?.rawValue) |
| | | .append(key: "page", value:page) |
| | | .append(key: "size", value: 20) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | |
| | | /// 兑换记录-详情 |
| | | class func exchangeRecordDetail(id:Int,goodType:ExchangeType)->Observable<BaseResponse<RecordsDetailModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/useBenefit/redemptionDetails") |
| | | .append(key: "detailsId", value: id) |
| | | // .append(key: "goodType", value: goodType.rawValue) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | /// 兑换记录-详情 |
| | | class func exchangeRecordDetail(id:Int,goodType:ExchangeType)->Observable<BaseResponse<RecordsDetailModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/useBenefit/redemptionDetails") |
| | | .append(key: "detailsId", value: id) |
| | | // .append(key: "goodType", value: goodType.rawValue) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | } |
| | | |
| | | // MARK: -- 预约场地 |
| | | extension Services{ |
| | | |
| | | /// 场地预约详情 |
| | | static func siteDetail(id:Int)->Observable<BaseResponse<YardBookingDetailModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/other/api/site/queryMySiteById") |
| | | .append(key: "id", value: id) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | |
| | | /// 获取场地类型 |
| | | static func querySiteType()->Observable<BaseResponse<[NormalSimpleModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/other/base/site/querySiteType") |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | /// 场地预约详情 |
| | | static func siteDetail(id:Int)->Observable<BaseResponse<YardBookingDetailModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/other/api/site/queryMySiteById") |
| | | .append(key: "id", value: id) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | |
| | | /// 获取场地列表 |
| | | static func querySiteList(pageNum:Int,pageSize:Int,siteTypeId:Int?,cityCode:Int?,storeId:Int?,startTime:String?,endTime:String?,search:String?)->Observable<BaseResponse<[SiteItemModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/other/base/site/querySiteList") |
| | | .append(key: "pageNum", value: pageNum) |
| | | .append(key: "pageSize", value: pageSize) |
| | | .append(key: "siteTypeId", value: siteTypeId) |
| | | .append(key: "cityCode", value: cityCode) |
| | | .append(key: "storeId", value: storeId) |
| | | .append(key: "startTime", value: startTime) |
| | | .append(key: "endTime", value: endTime) |
| | | .append(key: "search", value: search) |
| | | .append(key: "lat", value: locationTool.currentLocation?.coordinate.latitude.string) |
| | | .append(key: "lon", value: locationTool.currentLocation?.coordinate.longitude.string) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | /// 获取场地类型 |
| | | static func querySiteType()->Observable<BaseResponse<[NormalSimpleModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/other/base/site/querySiteType") |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | |
| | | /// 获取场地详情 |
| | | static func querySiteDetail(id:Int)->Observable<BaseResponse<SiteDetailModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/other/base/site/querySiteInfo") |
| | | .append(key: "id", value: id) |
| | | .append(key: "lat", value: locationTool.currentLocation?.coordinate.latitude.string) |
| | | .append(key: "lon", value: locationTool.currentLocation?.coordinate.longitude.string) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | /// 获取场地列表 |
| | | static func querySiteList(pageNum:Int,pageSize:Int,siteTypeId:Int?,cityCode:Int?,storeId:Int?,startTime:String?,endTime:String?,search:String?)->Observable<BaseResponse<[SiteItemModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/other/base/site/querySiteList") |
| | | .append(key: "pageNum", value: pageNum) |
| | | .append(key: "pageSize", value: pageSize) |
| | | .append(key: "siteTypeId", value: siteTypeId) |
| | | .append(key: "cityCode", value: cityCode) |
| | | .append(key: "storeId", value: storeId) |
| | | .append(key: "startTime", value: startTime) |
| | | .append(key: "endTime", value: endTime) |
| | | .append(key: "search", value: search) |
| | | .append(key: "lat", value: locationTool.currentLocation?.coordinate.latitude.string) |
| | | .append(key: "lon", value: locationTool.currentLocation?.coordinate.longitude.string) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | |
| | | /// 获取场地详情-时间表 |
| | | /// - Parameters: |
| | | /// - day: YYYY-MM-dd |
| | | static func querySiteTimes(id:Int,day:String,halfName:String?,siteName:String?)->Observable<BaseResponse<[SiteDetailDateTimeModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/other/base/site/querySiteTimes") |
| | | .append(key: "id", value: id) |
| | | .append(key: "day", value: day) |
| | | .append(key: "halfName", value: halfName) |
| | | .append(key: "siteName", value: siteName) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | /// 获取场地详情 |
| | | static func querySiteDetail(id:Int)->Observable<BaseResponse<SiteDetailModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/other/base/site/querySiteInfo") |
| | | .append(key: "id", value: id) |
| | | .append(key: "lat", value: locationTool.currentLocation?.coordinate.latitude.string) |
| | | .append(key: "lon", value: locationTool.currentLocation?.coordinate.longitude.string) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | /// 预约场地支付 |
| | | static func reservationSite(booker:String,couponId:Int?,id:Int,payType:PayType,phone:String,times:String,halfName:String? = nil,isHalf:Int,nextName:String? = nil)->Observable<BaseResponse<PaymentModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/other/api/site/reservationSite") |
| | | .append(key: "booker", value: booker) |
| | | .append(key: "couponId", value: couponId) |
| | | .append(key: "id", value: id) |
| | | .append(key: "payType", value: payType.rawValue) |
| | | .append(key: "phone", value: phone) |
| | | .append(key: "times", value: times) |
| | | .append(key: "halfName", value: halfName) |
| | | .append(key: "isHalf", value: isHalf) |
| | | .append(key: "nextName", value: nextName) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true,ignoreAlert: true) |
| | | } |
| | | /// 获取场地详情-时间表 |
| | | /// - Parameters: |
| | | /// - day: YYYY-MM-dd |
| | | static func querySiteTimes(id:Int,day:String,halfName:String?,siteName:String?)->Observable<BaseResponse<[SiteDetailDateTimeModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/other/base/site/querySiteTimes") |
| | | .append(key: "id", value: id) |
| | | .append(key: "day", value: day) |
| | | .append(key: "halfName", value: halfName) |
| | | .append(key: "siteName", value: siteName) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | /// 获取优惠券列表 |
| | | static func querySiteCouponList(price:Double,siteId:Int)->Observable<BaseResponse<[CouponInfoModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/activity/api/coupon/querySiteCouponList") |
| | | .append(key: "price", value: price.string) |
| | | .append(key: "siteId", value: siteId) |
| | | .append(key: "lat", value: locationTool.currentLocation?.coordinate.latitude.string) |
| | | .append(key: "lon", value: locationTool.currentLocation?.coordinate.longitude.string) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | /// 预约场地支付 |
| | | static func reservationSite(booker:String,couponId:Int?,id:Int,payType:PayType,phone:String,times:String,halfName:String? = nil,isHalf:Int,nextName:String? = nil)->Observable<BaseResponse<PaymentModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/other/api/site/reservationSite") |
| | | .append(key: "booker", value: booker) |
| | | .append(key: "couponId", value: couponId) |
| | | .append(key: "id", value: id) |
| | | .append(key: "payType", value: payType.rawValue) |
| | | .append(key: "phone", value: phone) |
| | | .append(key: "times", value: times) |
| | | .append(key: "halfName", value: halfName) |
| | | .append(key: "isHalf", value: isHalf) |
| | | .append(key: "nextName", value: nextName) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true,ignoreAlert: true) |
| | | } |
| | | |
| | | /// 获取优惠券列表 |
| | | static func querySiteCouponList(price:Double,siteId:Int)->Observable<BaseResponse<[CouponInfoModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/activity/api/coupon/querySiteCouponList") |
| | | .append(key: "price", value: price.string) |
| | | .append(key: "siteId", value: siteId) |
| | | .append(key: "lat", value: locationTool.currentLocation?.coordinate.latitude.string) |
| | | .append(key: "lon", value: locationTool.currentLocation?.coordinate.longitude.string) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | |
| | | |
| | | /// 获取我的预约场地列表 |
| | | class func queryMySite(page:Int,pageSize:Int = 20,status:YardBookingType?)->Observable<BaseResponse<[YardBookingModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/other/api/site/queryMySite") |
| | | .append(key: "pageNo", value: page) |
| | | .append(key: "pageSize", value: pageSize) |
| | | .append(key: "status", value: status?.rawValue) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | /// 获取我的预约场地列表 |
| | | class func queryMySite(page:Int,pageSize:Int = 20,status:YardBookingType?)->Observable<BaseResponse<[YardBookingModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/other/api/site/queryMySite") |
| | | .append(key: "pageNo", value: page) |
| | | .append(key: "pageSize", value: pageSize) |
| | | .append(key: "status", value: status?.rawValue) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | |
| | | |
| | | /// 获取继续支付场地金额 |
| | | class func continuePaymentPrice(id:Int)->Observable<BaseResponse<YardBookingContinuePriceModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/other/api/site/queryContinuePaymentMySitePrice") |
| | | .append(key: "id", value: id) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | /// 获取继续支付场地金额 |
| | | class func continuePaymentPrice(id:Int)->Observable<BaseResponse<YardBookingContinuePriceModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/other/api/site/queryContinuePaymentMySitePrice") |
| | | .append(key: "id", value: id) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | /// 继续支付 |
| | | class func continuePayment(id:Int,payType:PayType)->Observable<BaseResponse<PaymentModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/other/api/site/continuePaymentMySite") |
| | | .append(key: "id", value: id) |
| | | .append(key: "payType", value: payType.rawValue) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | /// 继续支付 |
| | | class func continuePayment(id:Int,payType:PayType)->Observable<BaseResponse<PaymentModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/other/api/site/continuePaymentMySite") |
| | | .append(key: "id", value: id) |
| | | .append(key: "payType", value: payType.rawValue) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | |
| | | } |
| | | } |
| | | |
| | | /// 取消我的预约 |
| | | class func cancelMySite(id:Int)->Observable<BaseResponse<PaymentModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/other/api/site/cancelMySite") |
| | | .append(key: "id", value: id) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | /// 取消我的预约 |
| | | class func cancelMySite(id:Int)->Observable<BaseResponse<PaymentModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/other/api/site/cancelMySite") |
| | | .append(key: "id", value: id) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | // MARK: -- Activity |
| | | // MARK: -- Activity |
| | | extension Services{ |
| | | |
| | | /// 获取视频列表 |
| | | /// - Parameter position: 位置(1=线上课得积分,2=看视频得奖励) |
| | | class func benefitsVideoList(position:Int,search:String)->Observable<BaseResponse<[VideosModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/activity/api/benefitsVideo/queryClassificationBenefitsVideosList") |
| | | .append(key: "position", value: position) |
| | | .append(key: "search", value: search) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | /// 获取视频列表 |
| | | /// - Parameter position: 位置(1=线上课得积分,2=看视频得奖励) |
| | | class func benefitsVideoList(position:Int,search:String)->Observable<BaseResponse<[VideosModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/activity/api/benefitsVideo/queryClassificationBenefitsVideosList") |
| | | .append(key: "position", value: position) |
| | | .append(key: "search", value: search) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | |
| | | |
| | | /// 获取视频列表 |
| | | class func benefitsVideoSubList(classificationId:Int,pageNo:Int,pageSize:Int,search:String)->Observable<BaseResponse<[VideoDetailModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/activity/api/benefitsVideo/queryBenefitsVideosList") |
| | | .append(key: "classificationId", value: classificationId) |
| | | .append(key: "pageNo", value: pageNo) |
| | | .append(key: "pageSize", value: pageSize) |
| | | .append(key: "search", value: search) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | /// 获取视频列表 |
| | | class func benefitsVideoSubList(classificationId:Int,pageNo:Int,pageSize:Int,search:String)->Observable<BaseResponse<[VideoDetailModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/activity/api/benefitsVideo/queryBenefitsVideosList") |
| | | .append(key: "classificationId", value: classificationId) |
| | | .append(key: "pageNo", value: pageNo) |
| | | .append(key: "pageSize", value: pageSize) |
| | | .append(key: "search", value: search) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | |
| | | |
| | | /// 获取视频详情 |
| | | class func benefitsVideoDetail(id:Int)->Observable<BaseResponse<VideoDetailModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/activity/api/benefitsVideo/queryBenefitsVideosInfo") |
| | | .append(key: "id", value: id) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | /// 获取视频详情 |
| | | class func benefitsVideoDetail(id:Int)->Observable<BaseResponse<VideoDetailModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/activity/api/benefitsVideo/queryBenefitsVideosInfo") |
| | | .append(key: "id", value: id) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | } |
| | | |
| | | // MARK: -- 活动赛事相关 |
| | | extension Services{ |
| | | |
| | | /// 获取赛事列表 |
| | | class func queryCompetitionList(cityCode:Int?,content:String?,heat:SortType?,registerCondition:Int?)->Observable<BaseResponse<[ActivityListModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/competition/base/competition/queryCompetitionList") |
| | | .append(key: "cityCode", value: cityCode) |
| | | .append(key: "content", value: content) |
| | | .append(key: "heat", value: heat?.rawValue) |
| | | .append(key: "registerCondition", value: registerCondition) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | /// 获取赛事列表 |
| | | class func queryCompetitionList(cityCode:Int?,content:String?,heat:SortType?,registerCondition:Int?)->Observable<BaseResponse<[ActivityListModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/competition/base/competition/queryCompetitionList") |
| | | .append(key: "cityCode", value: cityCode) |
| | | .append(key: "content", value: content) |
| | | .append(key: "heat", value: heat?.rawValue) |
| | | .append(key: "registerCondition", value: registerCondition) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | |
| | | /// 获取赛事详情 |
| | | class func queryCompetitionDetail(id:Int)->Observable<BaseResponse<ActivityDetailModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/competition/base/competition/queryCompetitionInfo") |
| | | .append(key: "id", value: id) |
| | | .append(key: "lat", value: locationTool.currentLocation?.coordinate.latitude.string) |
| | | .append(key: "lon", value: locationTool.currentLocation?.coordinate.longitude.string) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | /// 获取赛事详情 |
| | | class func queryCompetitionDetail(id:Int)->Observable<BaseResponse<ActivityDetailModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/competition/base/competition/queryCompetitionInfo") |
| | | .append(key: "id", value: id) |
| | | .append(key: "lat", value: locationTool.currentLocation?.coordinate.latitude.string) |
| | | .append(key: "lon", value: locationTool.currentLocation?.coordinate.longitude.string) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | /// 获取已报名赛事列表 |
| | | class func queryMyCompetitionList(page:Int,pageSize:Int = 20,type:SignupType)->Observable<BaseResponse<[ActivityListModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/competition/api/competition/queryMyCompetitionList") |
| | | .append(key: "pageNo", value: page) |
| | | .append(key: "pageSize", value: pageSize) |
| | | .append(key: "type", value: type.rawValue) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | /// 获取已报名赛事列表 |
| | | class func queryMyCompetitionList(page:Int,pageSize:Int = 20,type:SignupType)->Observable<BaseResponse<[ActivityListModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/competition/api/competition/queryMyCompetitionList") |
| | | .append(key: "pageNo", value: page) |
| | | .append(key: "pageSize", value: pageSize) |
| | | .append(key: "type", value: type.rawValue) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | |
| | | /// 获取参赛人员列表 |
| | | class func queryParticipantList(isAuth:Int? = nil)->Observable<BaseResponse<[ActivityDetailPartModel]>>{ |
| | | var params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "competition/api/participant/queryParticipantList") |
| | | if isAuth == 1{ |
| | | params.append(key: "isPre", value: isAuth) |
| | | } |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | /// 获取参赛人员列表 |
| | | class func queryParticipantList(isAuth:Int? = nil)->Observable<BaseResponse<[ActivityDetailPartModel]>>{ |
| | | var params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "competition/api/participant/queryParticipantList") |
| | | if isAuth == 1{ |
| | | params.append(key: "isPre", value: isAuth) |
| | | } |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | |
| | | /// 编辑参赛人员信息 |
| | | class func editParticipant(id:Int,height:Int,weight:Int,phone:String?,isStudent:Int)->Observable<BaseResponse<SimpleModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "competition/api/participant/editParticipant") |
| | | .append(key: "id", value: id) |
| | | .append(key: "height", value: height) |
| | | .append(key: "weight", value: weight) |
| | | .append(key: "phone", value: phone) |
| | | .append(key: "isStudent", value: isStudent) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | /// 编辑参赛人员信息 |
| | | class func editParticipant(id:Int,height:Int,weight:Int,phone:String?,isStudent:Int)->Observable<BaseResponse<SimpleModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "competition/api/participant/editParticipant") |
| | | .append(key: "id", value: id) |
| | | .append(key: "height", value: height) |
| | | .append(key: "weight", value: weight) |
| | | .append(key: "phone", value: phone) |
| | | .append(key: "isStudent", value: isStudent) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | /// 添加参赛人员 |
| | | class func addParticipant(_ model:StudentProfileModel)->Observable<BaseResponse<SimpleModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "competition/api/participant/addParticipant") |
| | | .append(key: "birthday", value: model.birthday) |
| | | .append(key: "headImg", value: model.headImg) |
| | | .append(key: "height", value: model.height.string) |
| | | .append(key: "idcard", value: model.idCard) |
| | | .append(key: "name", value: model.name) |
| | | .append(key: "phone", value: model.phone) |
| | | .append(key: "gender", value: model.sex.rawValue) |
| | | .append(key: "weight", value: model.weight.string) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | /// 添加参赛人员 |
| | | class func addParticipant(_ model:StudentProfileModel)->Observable<BaseResponse<SimpleModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "competition/api/participant/addParticipant") |
| | | .append(key: "birthday", value: model.birthday) |
| | | .append(key: "headImg", value: model.headImg) |
| | | .append(key: "height", value: model.height.string) |
| | | .append(key: "idcard", value: model.idCard) |
| | | .append(key: "name", value: model.name) |
| | | .append(key: "phone", value: model.phone) |
| | | .append(key: "gender", value: model.sex.rawValue) |
| | | .append(key: "weight", value: model.weight.string) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | /// 编辑参赛人员 |
| | | class func editParticipant(_ model:ActivityDetailPartModel)->Observable<BaseResponse<SimpleModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/competition/api/participant/editParticipant") |
| | | .append(key: "id", value: model.id) |
| | | .append(key: "idcard", value: model.idcard) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | /// 编辑参赛人员 |
| | | class func editParticipant(_ model:ActivityDetailPartModel)->Observable<BaseResponse<SimpleModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/competition/api/participant/editParticipant") |
| | | .append(key: "id", value: model.id) |
| | | .append(key: "idcard", value: model.idcard) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | /// 删除参赛人员 |
| | | class func deleParticipant(id:Int)->Observable<BaseResponse<SimpleModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "competition/api/participant/delParticipant") |
| | | .append(key: "id", value: id) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | /// 删除参赛人员 |
| | | class func deleParticipant(id:Int)->Observable<BaseResponse<SimpleModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "competition/api/participant/delParticipant") |
| | | .append(key: "id", value: id) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | /// 赛事报名 |
| | | class func paymentCompetition(id:Int,userIds:String,payType:PayType,coursePaymentId:Int? = nil)->Observable<BaseResponse<PaymentModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "competition/api/competition/paymentCompetition") |
| | | .append(key: "id", value: id) |
| | | .append(key: "ids", value: userIds) |
| | | .append(key: "payType", value: payType.rawValue) |
| | | .append(key: "coursePaymentId", value: coursePaymentId) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true,ignoreAlert: true) |
| | | } |
| | | /// 赛事报名 |
| | | class func paymentCompetition(id:Int,userIds:String,payType:PayType,coursePaymentId:Int? = nil)->Observable<BaseResponse<PaymentModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "competition/api/competition/paymentCompetition") |
| | | .append(key: "id", value: id) |
| | | .append(key: "ids", value: userIds) |
| | | .append(key: "payType", value: payType.rawValue) |
| | | .append(key: "coursePaymentId", value: coursePaymentId) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true,ignoreAlert: true) |
| | | } |
| | | |
| | | /// 查询已报名赛事详情 |
| | | class func queryMyCompetitionInfo(id:Int)->Observable<BaseResponse<ActivityDetailModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "competition/api/competition/queryMyCompetitionInfo") |
| | | .append(key: "id", value: id) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | /// 查询已报名赛事详情 |
| | | class func queryMyCompetitionInfo(id:Int)->Observable<BaseResponse<ActivityDetailModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "competition/api/competition/queryMyCompetitionInfo") |
| | | .append(key: "id", value: id) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | |
| | | /// 取消当前报名 |
| | | class func cancelMyCOmpetition(id:Int)->Observable<BaseResponse<SimpleModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "competition/api/competition/cancelMyCompetition") |
| | | .append(key: "id", value: id) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | /// 取消当前报名 |
| | | class func cancelMyCOmpetition(id:Int)->Observable<BaseResponse<SimpleModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "competition/api/competition/cancelMyCompetition") |
| | | .append(key: "id", value: id) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | } |
| | | |
| | | // MARK: -- 其他 |
| | | // MARK: -- 其他 |
| | | extension Services{ |
| | | class func queryProtocol(_ type:AgreentType,progress:Bool = true)->Observable<BaseResponse<String>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/other/base/protocol/queryProtocol") |
| | | .append(key: "type", value: type.rawValue) |
| | | return NetworkRequest.request(params: params, method: .post, progress: progress) |
| | | } |
| | | class func queryProtocol(_ type:AgreentType,progress:Bool = true)->Observable<BaseResponse<String>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/other/base/protocol/queryProtocol") |
| | | .append(key: "type", value: type.rawValue) |
| | | return NetworkRequest.request(params: params, method: .post, progress: progress) |
| | | } |
| | | |
| | | class func querySystemImg(type:SystemImgType)->Observable<BaseResponse<String>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/other/base/systemImg/querySystemImg") |
| | | .append(key: "position", value: type.rawValue) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | class func querySystemImg(type:SystemImgType)->Observable<BaseResponse<String>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/other/base/systemImg/querySystemImg") |
| | | .append(key: "position", value: type.rawValue) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | |
| | | class func enrollMember(paytype:PayType)->Observable<BaseResponse<PaymentModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/appUser/addVipPayment") |
| | | .append(key: "payType", value: paytype.rawValue) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | class func enrollMember(paytype:PayType)->Observable<BaseResponse<PaymentModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/account/api/appUser/addVipPayment") |
| | | .append(key: "payType", value: paytype.rawValue) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | /// 获取省市数据 |
| | | class func queryProvinceAndCity(pcode:Int? = nil)->Observable<BaseResponse<[CityProfileModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/other/base/store/queryProvinceAndCity") |
| | | .append(key: "pcode", value: pcode) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | /// 获取省市数据 |
| | | class func queryProvinceAndCity(pcode:Int? = nil)->Observable<BaseResponse<[CityProfileModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/other/base/store/queryProvinceAndCity") |
| | | .append(key: "pcode", value: pcode) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | /// 获取城市code获取门店 |
| | | class func queryStoreAtCity(cityCode:Int?,provinceCode:Int)->Observable<BaseResponse<[CityProfileModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/other/base/store/queryStoreByCityCode") |
| | | .append(key: "cityCode", value: cityCode) |
| | | .append(key: "provinceCode", value: provinceCode) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | /// 获取城市code获取门店 |
| | | class func queryStoreAtCity(cityCode:Int?,provinceCode:Int)->Observable<BaseResponse<[CityProfileModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/other/base/store/queryStoreByCityCode") |
| | | .append(key: "cityCode", value: cityCode) |
| | | .append(key: "provinceCode", value: provinceCode) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | /// 获取全部城市 |
| | | class func queryAllCity()->Observable<BaseResponse<[CityProfileModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/other/base/store/queryAllCity") |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | } |
| | | |
| | | //2.0 |
| | | extension Services{ |
| | | /// 获取平台配置模块详情 |
| | | class func getHomeModule()->Observable<BaseResponse<BannerModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/other/base/homeModule/getHomeModule") |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | |
| | | /// 获取全部城市 |
| | | class func queryAllCity()->Observable<BaseResponse<[CityProfileModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/other/base/store/queryAllCity") |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | /// 获取世界杯列表 |
| | | /// - Parameters: |
| | | /// - id: 当前门店id |
| | | /// - content: 当前内容 |
| | | /// - gender:报名条件(0=全部,1=男,2=女 |
| | | /// - sort: 热度排序(1=正序,2=降序) |
| | | /// - storeId: 所在赛点 |
| | | class func worldCupList(id:Int,content:String?,gender:Int?,sort:Int?,storeId:Int?)->Observable<BaseResponse<[WorldCupListModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/communityWorldCup/api/worldCup/getWorldCupList") |
| | | .append(key: "id", value: id) |
| | | .append(key: "content", value: content) |
| | | .append(key: "gender", value: gender) |
| | | .append(key: "storeId", value: storeId) |
| | | .append(key: "sort", value: sort) |
| | | .append(key: "lat", value: locationTool.currentLocation?.coordinate.latitude.string) |
| | | .append(key: "lon", value: locationTool.currentLocation?.coordinate.longitude.string) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | } |
| | | |
| | | extension Services{ |
| | | static func startNetworkMonitor(){ |
| | | let manager = NetworkReachabilityManager(host: All_Url) |
| | | manager?.startListening(onUpdatePerforming: { status in |
| | | switch status { |
| | | case .notReachable:alertError(msg: "当前网络不可用") |
| | | case .reachable(let type): |
| | | switch type{ |
| | | case .ethernetOrWiFi:alert(msg: "当前为Wi-Fi网络") |
| | | case .cellular:alert(msg: "当前为移动网络") |
| | | } |
| | | default:break |
| | | } |
| | | }) |
| | | |
| | | } |
| | | static func startNetworkMonitor(){ |
| | | let manager = NetworkReachabilityManager(host: All_Url) |
| | | manager?.startListening(onUpdatePerforming: { status in |
| | | switch status { |
| | | case .notReachable:alertError(msg: "当前网络不可用") |
| | | case .reachable(let type): |
| | | switch type{ |
| | | case .ethernetOrWiFi:alert(msg: "当前为Wi-Fi网络") |
| | | case .cellular:alert(msg: "当前为移动网络") |
| | | } |
| | | default:break |
| | | } |
| | | }) |
| | | } |
| | | } |