-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
286 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
iOSClientForPerfect/iOSClientForPerfect/Assets.xcassets/AppIcon.appiconset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
iOSClientForPerfect/iOSClientForPerfect/Assets.xcassets/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
iOSClientForPerfect/iOSClientForPerfect/Assets.xcassets/book_icon.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "book_icon.png", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
} | ||
} |
Binary file added
BIN
+28.2 KB
...ForPerfect/iOSClientForPerfect/Assets.xcassets/book_icon.imageset/book_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
iOSClientForPerfect/iOSClientForPerfect/Model/ContentModel.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// | ||
// ContentModel.swift | ||
// iOSClientForPerfect | ||
// | ||
// Created by Mr.LuDashi on 2016/12/6. | ||
// Copyright © 2016年 ZeluLi. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
class ContentModel { | ||
var title = "" | ||
var content = "" | ||
var createTime = "" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
86 changes: 86 additions & 0 deletions
86
iOSClientForPerfect/iOSClientForPerfect/NewWorking/ContentReqest.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
// | ||
// ContentReqest.swift | ||
// iOSClientForPerfect | ||
// | ||
// Created by Mr.LuDashi on 2016/12/6. | ||
// Copyright © 2016年 ZeluLi. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
class ContentRequest: BaseRequest { | ||
func fetchContentList(userId: String){ | ||
let requestPath = "\(RequestHome)\(RequestContentList)" | ||
let request = Request(start: { | ||
self.start() | ||
}, success: { (json) in | ||
guard let list = json as? [String: Any] else { | ||
return | ||
} | ||
|
||
|
||
var contents: Array<ContentModel> = [] | ||
|
||
if list["list"] != nil { | ||
guard let contentList = list["list"]! as? [[String:String]] else { | ||
return | ||
} | ||
|
||
for item in contentList { | ||
let contentModels = ContentModel() | ||
guard let title = item["title"] else { | ||
continue | ||
} | ||
contentModels.title = title | ||
|
||
guard let time = item["time"] else { | ||
continue | ||
} | ||
contentModels.createTime = time | ||
|
||
contents.append(contentModels) | ||
} | ||
} | ||
|
||
self.success(contents) | ||
|
||
}) { (errorMessage) in | ||
self.faile(errorMessage) | ||
} | ||
let params: [String:String] = ["userId": userId] | ||
request.postRequest(path: "\(requestPath)", parameters: params) | ||
} | ||
|
||
func fetchContentDetail(contentId: String){ | ||
let requestPath = "\(RequestHome)\(RequestContentDetail)" | ||
let request = Request(start: { | ||
self.start() | ||
}, success: { (json) in | ||
guard let contentDetail = json as? [String: Any] else { | ||
return | ||
} | ||
|
||
let contentModel = ContentModel() | ||
|
||
if contentDetail["list"] != nil { | ||
guard let content = contentDetail["list"]! as? [String:String] else { | ||
return | ||
} | ||
|
||
contentModel.title = content["title"] ?? "" | ||
contentModel.content = content["content"] ?? "" | ||
contentModel.createTime = content["createTime"] ?? "" | ||
|
||
} | ||
|
||
self.success(contentModel) | ||
|
||
}) { (errorMessage) in | ||
self.faile(errorMessage) | ||
} | ||
|
||
let params: [String:String] = ["contentId": contentId] | ||
request.postRequest(path: "\(requestPath)", parameters: params) | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.