Skip to content
New issue

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

merge :: Points API #124

Merged
merged 47 commits into from
Nov 17, 2022
Merged

merge :: Points API #124

merged 47 commits into from
Nov 17, 2022

Conversation

sian7563
Copy link
Member

개요

Points API

작업사항

Points API

@sian7563 sian7563 added the ✨feat 새로운 기능을 추가 할 경우 label Nov 12, 2022
@sian7563 sian7563 self-assigned this Nov 12, 2022
import Moya

public enum PointsAPI {
case fetchPointsList(String)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

type 이거 enum으로 만들어서 쓰는거 어때유

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enum을 만들어놓고 안쓰고 있어요

Comment on lines 9 to 13
public enum PointsType: String {
case all = "ALL"
case bonus = "BONUS"
case minus = "MINUS"
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DataMapping 안에 넣는거 어때요?

import Moya

public enum PointsAPI {
case fetchPointsList(String)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enum을 만들어놓고 안쓰고 있어요

Comment on lines 3 to 17
public struct SinglePointResponseDTO: Decodable {
public init(id: String, date: Date, type: String, name: String, score: Int) {
self.id = id
self.date = date
self.type = type
self.name = name
self.score = score
}

public let id: String
public let date: Date
public let type: String
public let name: String
public let score: Int
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

id가 key 이름이랑 달라요 CodingKeys가 있는거도 아닌데

}

public let id: String
public let date: Date
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Date타입이 자동으로 Decode될지 모르겠는데 String으로 받고 Entity로 변환할때 String을 Date로 변환하는게 더 좋을거같아요

Comment on lines 12 to 19
public init(schoolName: String,
name: String,
gcn: String,
profileImageURL: URL,
bonusPoint: Int,
minusPoint: Int,
phrase: String) {
self.schoolName = schoolName
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

혼돈의 init 스타일..

Comment on lines 3 to 20
public struct PointEntity: Equatable, Hashable {
public init(id: String,
date: Date,
type: String,
name: String,
score: Int) {
self.id = id
self.date = date
self.type = type
self.name = name
self.score = score
}

public let id: String
public let date: Date
public let type: String
public let name: String
public let score: Int
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

엔티티가 좀 다른거 같기도 하고요..?

import Foundation

public struct SinglePointResponseDTO: Decodable {
public init(id: String, date: Date, type: String, name: String, score: Int) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LINT 지켜주세요

Comment on lines 4 to 8
public init(id: String,
date: Date,
type: String,
name: String,
score: Int) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이것도 Lint 지켜주세요


public var task: Moya.Task {
switch self {
case .fetchPointsList(let type):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

스타일 가이드 맞춰주세요!

@@ -4,6 +4,7 @@ public struct FetchMyProfileResponseDTO: Decodable {
public let schoolName: String
public let name: String
public let gcn: String
public let profileImageURL: URL
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

url을 decode로 넣으려면 직접 decode를 구현해줘야하는거로 아는데, dto에서 String으로 받고 Entity에서 URL?로 받는방법 어떠신가요?
옵셔널인 이유는 사이드 이펙트를 ViewModel에서 처리하기 위함입니다 🤖

@sian7563 sian7563 merged commit 3d3d571 into develop Nov 17, 2022
@sian7563 sian7563 deleted the feat/123_Points-API branch November 17, 2022 13:51
@sian7563 sian7563 linked an issue Nov 17, 2022 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨feat 새로운 기능을 추가 할 경우
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Points API
3 participants