| | |
| | | |
| | | struct BaseResponseList<T :HandyJSON>: HandyJSON { |
| | | var list: [T] = [] |
| | | var totalSession:Int = 0 |
| | | var pages:Int = 0 |
| | | var total:Int = 0 |
| | | } |
| | | |
| | | struct BaseData<T: HandyJSON>: HandyJSON { |
| | |
| | | if encoding != nil { |
| | | newEncoding = encoding! |
| | | } else { |
| | | #if DEBUG |
| | | newEncoding = URLEncoding.queryString |
| | | #else |
| | | newEncoding = method == .post ? URLEncoding.httpBody : URLEncoding.queryString |
| | | #endif |
| | | } |
| | | |
| | | sharedSessionManager.request(params.url.absoluteString, method: method, parameters:params.done(), encoding: newEncoding, headers:headers).validate().responseData{response in |