Skip to content

Commit

Permalink
[카테고리] 토용 추가 (#74)
Browse files Browse the repository at this point in the history
* ✨ [feat] 카테고리 > '토용' 추가

* ♻️ [refactor] 카탈로그를 네트워크로 가져오는 로직 부분 중복코드 개선
  • Loading branch information
leeari95 authored Nov 15, 2024
1 parent 88ff895 commit cf39b62
Show file tree
Hide file tree
Showing 40 changed files with 331 additions and 439 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "icon-gyroids.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ Find the villagers you have visited and tap the home icon on the villager's page
"Wet Suit" = "Wet Suit";
"Reactions" = "Reactions";
"Fencing" = "Fencing";
"Gyroids" = "Gyroids";

// MARK: - ItemsViewController
"To catch now" = "To catch now";
Expand Down Expand Up @@ -621,6 +622,7 @@ Find the villagers you have visited and tap the home icon on the villager's page
"Requires a high level of friendship" = "Requires a high level of friendship";
"Received after doing your 50th group stretch" = "Received after doing your 50th group stretch";
"50 fences are given by Tom Nook after completing the three house plots during the main storyline" = "50 fences are given by Tom Nook after completing the three house plots during the main storyline";
"Sit down for coffee on 50 different days" = "Sit down for coffee on 50 different days";

// MARK: - Housewares - tag
"museum" = "Museum";
Expand Down Expand Up @@ -676,6 +678,7 @@ Find the villagers you have visited and tap the home icon on the villager's page
"kitchen" = "Kitchen";
"japanese style" = "Japanese Style";
"animal" = "Animal";
"haniwa" = "Haniwa";

// MARK: - Housewares - Concept
"ancient" = "ancient";
Expand Down Expand Up @@ -1174,3 +1177,11 @@ Find the villagers you have visited and tap the home icon on the villager's page
"trash" = "Trash";
"tv" = "TV";
"food" = "Food";

// MARK: - Gyroids SoundType
"crash" = "Crash";
"drum set" = "Drum set";
"hi-hat" = "Hi-hat";
"kick" = "Kick";
"melody" = "Melody";
"snare" = "Snare";
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@
"Wet Suit" = "잠수복";
"Reactions" = "리액션";
"Fencing" = "울타리";
"Gyroids" = "토용";

// MARK: - ItemsViewController
"To catch now" = "아직 늦지 않았어요!";
Expand Down Expand Up @@ -620,6 +621,7 @@
"Requires a high level of friendship" = "높은 수준의 우정이 필요";
"Received after doing your 50th group stretch" = "50번째 그룹 스트레칭 후 획득";
"50 fences are given by Tom Nook after completing the three house plots during the main storyline" = "스토리 진행 중에 세 개의 집터를 완성한 후 너굴에게서 50개의 울타리를 획득";
"Sit down for coffee on 50 different days" = "50일 동안 앉아서 커피 마시기";

// MARK: - Housewares - tag
"museum" = "박물관";
Expand Down Expand Up @@ -675,6 +677,7 @@
"kitchen" = "주방";
"japanese style" = "동양풍";
"animal" = "동물";
"haniwa" = "토용";

// MARK: - Housewares - Concept
"ancient" = "유물";
Expand Down Expand Up @@ -1176,3 +1179,12 @@
"trash" = "쓰레기";
"tv" = "TV";
"food" = "음식";

// MARK: - Gyroids SoundType
"crash" = "심벌";
"drum set" = "드럼 세트";
"hi-hat" = "하이햇";
"kick" = "킥 드럼";
"melody" = "멜로디";
"snare" = "작은 북";

Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ enum Category: String, CaseIterable {
case umbrellas = "Umbrellas"
case wetSuit = "Wet Suit"
case reactions = "Reactions"
case gyroids = "Gyroids"

var iconName: String {
switch self {
Expand Down Expand Up @@ -67,6 +68,7 @@ enum Category: String, CaseIterable {
case .umbrellas: return "icon-umbrella"
case .wetSuit: return "icon-wetsuit"
case .reactions: return "icon-reactions"
case .gyroids: return "icon-gyroids"
}
}

Expand Down Expand Up @@ -100,6 +102,7 @@ enum Category: String, CaseIterable {
case .umbrellas: return "icon-umbrella"
case .wetSuit: return "icon-wetsuit"
case .reactions: return "icon-reactions"
case .gyroids: return "icon-gyroids"
}
}

Expand All @@ -111,7 +114,7 @@ enum Category: String, CaseIterable {
.wallpaper, .floors, .rugs,
.other, .recipes, .songs, .photos, .fencing,
.tops, .bottoms, .dressUp, .headwear, .accessories, .socks, .shoes, .bags, .umbrellas, .wetSuit,
.reactions
.reactions, .gyroids
]
}

Expand All @@ -129,7 +132,7 @@ enum Category: String, CaseIterable {
.ceilingDecor, .wallpaper, .floors,
.rugs, .other, .songs, .photos, .fencing,
.tops, .bottoms, .dressUp, .headwear, .accessories, .socks, .shoes, .bags, .umbrellas, .wetSuit,
.reactions
.reactions, .gyroids
]
}
}
Expand Down Expand Up @@ -166,6 +169,7 @@ extension Category: Comparable {
case .umbrellas: return 25
case .wetSuit: return 26
case .reactions: return 27
case .gyroids: return 28
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//
// GyroidsRequst.swift
// ACNH-wiki
//
// Created by Ari on 11/15/24.
//

import Foundation
import Alamofire

struct GyroidsRequst: APIRequest {
typealias Response = [GyroidsResponseDTO]
let method: HTTPMethod = HTTPMethod.get
let baseURL: URL? = URL(string: EnvironmentsVariable.repoURL)
let path: String = "Gyroids.json"
var headers: [String: String]? = [:]
var parameters: [String: String] {
return [:]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ struct AccessoriesResponseDTO: Codable {
let colors: [Color]?
}

extension AccessoriesResponseDTO {
extension AccessoriesResponseDTO: DomainConvertible {
func toDomain() -> Item {
return Item(
name: name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ struct BagsResponseDTO: Codable {
let colors: [Color]?
}

extension BagsResponseDTO {
extension BagsResponseDTO: DomainConvertible {
func toDomain() -> Item {
return Item(
name: name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ struct BottomsResponseDTO: Codable {
let colors: [Color]?
}

extension BottomsResponseDTO {
extension BottomsResponseDTO: DomainConvertible {
func toDomain() -> Item {
return Item(
name: name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ struct DressUpResponseDTO: Codable {
let colors: [Color]?
}

extension DressUpResponseDTO {
extension DressUpResponseDTO: DomainConvertible {
func toDomain() -> Item {
return Item(
name: name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ struct HeadwearResponseDTO: Codable {
let colors: [Color]?
}

extension HeadwearResponseDTO {
extension HeadwearResponseDTO: DomainConvertible {
func toDomain() -> Item {
return Item(
name: name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ struct ShoesResponseDTO: Codable {
let variations: [WardrobeVariat]?
}

extension ShoesResponseDTO {
extension ShoesResponseDTO: DomainConvertible {
func toDomain() -> Item {
return Item(
name: name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ struct SocksResponseDTO: Codable {
let colors: [Color]?
}

extension SocksResponseDTO {
extension SocksResponseDTO: DomainConvertible {
func toDomain() -> Item {
return Item(
name: name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ struct WardrobeVariat: Codable {
}
}

extension TopsResponseDTO {
extension TopsResponseDTO: DomainConvertible {
func toDomain() -> Item {
return Item(
name: name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ struct UmbrellasResponseDTO: Codable {
let recipe: RecipeResponseDTO?
}

extension UmbrellasResponseDTO {
extension UmbrellasResponseDTO: DomainConvertible {
func toDomain() -> Item {
return Item(
name: name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ struct WetSuitResponseDTO: Codable {
let variations: [WardrobeVariat]?
}

extension WetSuitResponseDTO {
extension WetSuitResponseDTO: DomainConvertible {
func toDomain() -> Item {
return Item(
name: name,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//
// DomainConvertible.swift
// ACNH-wiki
//
// Created by Ari on 11/15/24.
//

import Foundation

protocol DomainConvertible: Decodable {
func toDomain() -> Item
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ struct CeilingDecorResponseDTO: Codable {
let recipe: RecipeResponseDTO?
}

extension CeilingDecorResponseDTO {
extension CeilingDecorResponseDTO: DomainConvertible {
func toDomain() -> Item {
let image = variations.first?.image
return Item(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ extension Item {
}
}

extension FencingResponseDTO {
extension FencingResponseDTO: DomainConvertible {
func toDomain() -> Item {
return Item(
name: name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ struct FloorsResponseDTO: Codable {

}

extension FloorsResponseDTO {
extension FloorsResponseDTO: DomainConvertible {
func toDomain() -> Item {
return Item(
name: name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ enum Kit: String, Codable {
case rainbowFeather = "Rainbow feather"
}

extension HousewaresResponseDTO {
extension HousewaresResponseDTO: DomainConvertible {
func toDomain() -> Item {
let image = image ?? variations?.first?.image
return Item(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ struct MiscellaneousResponseDTO: Codable {

}

extension MiscellaneousResponseDTO {
extension MiscellaneousResponseDTO: DomainConvertible {
func toDomain() -> Item {
let image = image ?? variations?.first?.image
return Item(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ struct OtherResponseDTO: Codable {

}

extension OtherResponseDTO {
extension OtherResponseDTO : DomainConvertible {
func toDomain() -> Item {
return Item(
name: name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ struct PhotosResponseDTO: Codable {
let variations: [Variant]
}

extension PhotosResponseDTO {
extension PhotosResponseDTO: DomainConvertible {

func toDomain() -> Item {
return Item(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ struct RecipeResponseDTO: Codable {
let materialsTranslations: [String: Translations?]
}

extension RecipeResponseDTO {
extension RecipeResponseDTO: DomainConvertible {
func toDomain() -> Item {
return Item(
name: name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ struct RugsResponseDTO: Codable {
let seriesTranslations: Translations?
}

extension RugsResponseDTO {
extension RugsResponseDTO: DomainConvertible {
func toDomain() -> Item {
return Item(
name: name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ struct SongResponseDTO: Codable {
let musicURL: String?
}

extension SongResponseDTO {
extension SongResponseDTO: DomainConvertible {
func toDomain() -> Item {
var sources = ["K.K. concert"]
var sourceNotes: [String]?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ struct WallMountedResponseDTO: Codable {

}

extension WallMountedResponseDTO {
extension WallMountedResponseDTO: DomainConvertible {
func toDomain() -> Item {
let image = image ?? variations?.first?.image
return Item(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ struct WallpaperResponseDTO: Codable {
let recipe: RecipeResponseDTO?
}

extension WallpaperResponseDTO {
extension WallpaperResponseDTO: DomainConvertible {
func toDomain() -> Item {
return Item(
name: name,
Expand Down
Loading

0 comments on commit cf39b62

Please sign in to comment.