Skip to content

Commit

Permalink
1.0.8 release
Browse files Browse the repository at this point in the history
  • Loading branch information
WangYongJi committed Nov 17, 2017
1 parent c1ea8f9 commit 60724fa
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion WolfNet.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = "WolfNet"
s.version = "1.0.7"
s.version = "1.0.8"
s.summary = "泛型的网络请求与解析"
s.homepage = "https://github.com/xiaozao2008/WolfNet"
s.license = "MIT"
Expand Down
4 changes: 2 additions & 2 deletions WolfNet/Wolf/WolfBaseModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
import ObjectMapper
import Foundation

public class WolfEmpty<T: Mappable>: Mappable {
public class WolfEmpty: Mappable {

required public init?(map: Map) {
public required init?(map: Map) {
}

public func mapping(map: Map) {
Expand Down
8 changes: 4 additions & 4 deletions WolfNet/Wolf/WolfNetwork.swift
Original file line number Diff line number Diff line change
Expand Up @@ -75,21 +75,21 @@ public class WolfNetwork {

struct Model {

static func objectFromJSON<T: Mappable>(_ Json: Data, _ msg: ((String?, Int?) -> Void)) -> WolfBaseModel<T>? {
static func objectFromJSON<T: Mappable>(_ Json: Data, _ msg: ((String?, Int?) -> Void)?) -> WolfBaseModel<T>? {
let mapperModel = Mapper<WolfBaseModel<T>>()
if let json = String.init(data: Json, encoding: .utf8) {
let object = mapperModel.map(JSONString: json)
msg(object?.msg, object?.code)
msg?(object?.msg, object?.code)
return object
}
return nil
}

static func listFromJSON<T: Mappable>(_ Json: Data, _ msg: ((String?, Int?) -> Void)) -> WolfListModel<T>? {
static func listFromJSON<T: Mappable>(_ Json: Data, _ msg: ((String?, Int?) -> Void)?) -> WolfListModel<T>? {
let mapperModel = Mapper<WolfListModel<T>>()
if let json = String.init(data: Json, encoding: .utf8) {
let object = mapperModel.map(JSONString: json)
msg(object?.msg, object?.code)
msg?(object?.msg, object?.code)
return object
}
return nil
Expand Down

0 comments on commit 60724fa

Please sign in to comment.