-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* discover 상단 터치 이슈 수정 * Like 관련 API, Model 추가 * like 버튼 동작 추가 (터치이슈 있음) * message cell subview들 contentview에 추가하도록 변경 * Like 모델 임시수정.
- Loading branch information
Showing
5 changed files
with
178 additions
and
82 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
26 changes: 26 additions & 0 deletions
26
Dear-World/Dear-World/Source/Domain/Message/API/Message.API.Like.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,26 @@ | ||
// | ||
// Message.API.Like.swift | ||
// Dear-World | ||
// | ||
// Created by rookie.w on 2021/01/04. | ||
// | ||
|
||
import Alamofire | ||
import Foundation | ||
|
||
extension Message.API { | ||
struct Like: ServiceAPI { | ||
typealias Response = Message.Model.Like | ||
|
||
// MARK: Parameters | ||
private let messageId: Int | ||
|
||
var method: HTTPMethod { .post } | ||
var path: String { "api/v1/messages/\(messageId)/like" } | ||
var parameters: [String: Any?]? { nil } | ||
|
||
init(messageId: Int) { | ||
self.messageId = messageId | ||
} | ||
} | ||
} |
48 changes: 48 additions & 0 deletions
48
Dear-World/Dear-World/Source/Domain/Message/Model/Message.Model.Like.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,48 @@ | ||
// | ||
// Message.Model.Like.swift | ||
// Dear-World | ||
// | ||
// Created by rookie.w on 2021/01/04. | ||
// | ||
|
||
import Foundation | ||
|
||
extension Message.Model { | ||
struct Like: Decodable { | ||
let like: Bool | ||
//FIXME :왜 평범한 메세지랑 이모지부분이 다른지 확인 후 수정할 것 | ||
let data: TmpMessage | ||
} | ||
} | ||
extension Message.Model { | ||
struct TmpMessage: Decodable { | ||
let id: Int | ||
// let TmpUser: User | ||
let isLiked: Bool | ||
let likeCount: Int | ||
let content: String | ||
let createdAt: String | ||
|
||
enum CodingKeys: String, CodingKey { | ||
case id | ||
// case TmpUser = "anonymousUser" | ||
case isLiked = "like" | ||
case likeCount | ||
case content | ||
case createdAt | ||
} | ||
} | ||
|
||
struct TmpUUser: Decodable { | ||
let id: Int | ||
let country: TmpCountry | ||
let nickname: String | ||
let emojiId: Int | ||
} | ||
|
||
struct TmpCountry: Decodable { | ||
let code: String? | ||
let fullName: String | ||
let emojiUnicode: String | ||
} | ||
} |
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.