We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
struct DSBaseResponse: Mappable { init?(map: Map) { }
var code = 0 private var msg: String? var data: T? /// 适配没有套到data层中 var total = 0 var rows: T? mutating func mapping(map: Map) { msg <- map["message"] total <- map["total"] code <- map["code"] rows <- map["rows"] data <- map["data"] }
}
T maybe is Any,[T], [String, Any],Int ... I cannot let T must confirm protocol Mappable, such as :
struct DSBaseResponse<T: Mappable>: Mappable { }
how can I design this struct? like HandyJSON, HandyJSON can use like this.
// test let res = .... network response string let result = DSBaseResponse(JSONString: res.string)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
struct DSBaseResponse: Mappable {
init?(map: Map) {
}
}
T maybe is Any,[T], [String, Any],Int ... I cannot let T must confirm protocol Mappable, such as :
struct DSBaseResponse<T: Mappable>: Mappable {
}
how can I design this struct? like HandyJSON, HandyJSON can use like this.
// test
let res = .... network response string
let result = DSBaseResponse(JSONString: res.string)
The text was updated successfully, but these errors were encountered: