9. Apikit ?? Decodable apiܤ䤨
class func recommendList(_ filterString: String, pageIndex: String, lat: Double?, lng: Double?) {
var para = Json()
let sportIds = Sport.allFavorited()
if let cityID = City.getCityId() {
para.update(["city_id": cityID])
} else {
if let city = User.me()?.city {
para.update(["city_id": city.id]
}
}
if let lat = lat, let lng = lng {
para.update(["lat": lat, "lng": lng])
}
ꥯȤֱǰ˥ꥯȤ݉䤨Ǥ
10. Apikit ?? Decodable apiܤ䤨
struct EventRecommendGetRequest: APIRequest {
let type: EventRecommendType // ꥯȤ˱Ҫ
let cityId: Int
let sportIds: [Int]
let page: Int
let lat: Double?
let lng: Double?
let apiToken: String?
typealias Response = EventRecommendGetResponse
let method: APIKit.HTTPMethod = .get
var path: String {
return "/v2/me/event/recommend"}
}
var queryParameters: [String : Any] = ["city_id": cityId,"type": type.value,"page": page]
}
ꥯȤȥ쥹ݥä궨xǤ
11. Apikit ?? Decodable apiܤ䤨
struct EventEntity: Decodable {
let title:String <-Ŀ if let ʤʹ䤹
let user:UserEntity //ļ
/// μ ļߤäƤ
let users:[UserEntity]
let id:Int
// ʩO
let facility:FacilityEntity?
// λ
let meetingPlaceLat:Double? <-Ŀ nullжҪ
let meetingPlaceLng:Double?
}
ꥯȤȥ쥹ݥä궨xǤ