//
|
// YYModel.swift
|
// OKProject
|
//
|
// Created by alvin_y on 2020/5/28.
|
// Copyright © 2020 yangwang. All rights reserved.
|
//
|
|
import Foundation
|
import HandyJSON
|
|
typealias Mappable = HandyJSON & APIStatus & APIResponse
|
|
protocol APIStatus {
|
|
var code: Int { get set }
|
var msg: String { get set }
|
}
|
|
protocol APIResponse {
|
|
associatedtype ResponseDataType
|
|
var data: ResponseDataType? { get set}
|
}
|
|
struct Nothing: HandyJSON {
|
|
}
|
|
|
|
struct YYModel<T>: Mappable {
|
|
// typealias ResponseDataType = T
|
|
var code: Int = 1
|
var msg: String = "数据解析失败"
|
var data: T? = nil
|
|
}
|
|
//extension Array: HandyJSON {
|
//
|
//}
|