Skip to content

Commit

Permalink
[DEV][Added service models]
Browse files Browse the repository at this point in the history
  • Loading branch information
developersancho committed Feb 17, 2022
1 parent 7977300 commit dad2110
Show file tree
Hide file tree
Showing 12 changed files with 260 additions and 16 deletions.
86 changes: 85 additions & 1 deletion SwiftRorty.iOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@
E2555C0F27A872E4007E5266 /* DetailScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = E2555C0E27A872E4007E5266 /* DetailScreen.swift */; };
E2555C1127A872F2007E5266 /* HomeScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = E2555C1027A872F2007E5266 /* HomeScreen.swift */; };
E2555C1327A872FF007E5266 /* SplashScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = E2555C1227A872FF007E5266 /* SplashScreen.swift */; };
E2991AA927AC72ED00BF4B9A /* Status.swift in Sources */ = {isa = PBXBuildFile; fileRef = E2991AA827AC72ED00BF4B9A /* Status.swift */; };
E2991AAF27AC740800BF4B9A /* LocationInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = E2991AAE27AC740800BF4B9A /* LocationInfo.swift */; };
E2991AB127AC760E00BF4B9A /* LocationResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = E2991AB027AC760E00BF4B9A /* LocationResponse.swift */; };
E2991AB327AC766300BF4B9A /* EpisodeInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = E2991AB227AC766300BF4B9A /* EpisodeInfo.swift */; };
E2991AB527AC76A300BF4B9A /* EpisodeResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = E2991AB427AC76A300BF4B9A /* EpisodeResponse.swift */; };
E2991AB727AC76D400BF4B9A /* Origin.swift in Sources */ = {isa = PBXBuildFile; fileRef = E2991AB627AC76D400BF4B9A /* Origin.swift */; };
E2991AB927AC76FA00BF4B9A /* Location.swift in Sources */ = {isa = PBXBuildFile; fileRef = E2991AB827AC76FA00BF4B9A /* Location.swift */; };
E2991ABB27AC771E00BF4B9A /* CharacterInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = E2991ABA27AC771E00BF4B9A /* CharacterInfo.swift */; };
E2991ABD27AC777300BF4B9A /* CharacterResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = E2991ABC27AC777300BF4B9A /* CharacterResponse.swift */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -70,6 +79,15 @@
E2555C0E27A872E4007E5266 /* DetailScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DetailScreen.swift; sourceTree = "<group>"; };
E2555C1027A872F2007E5266 /* HomeScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeScreen.swift; sourceTree = "<group>"; };
E2555C1227A872FF007E5266 /* SplashScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SplashScreen.swift; sourceTree = "<group>"; };
E2991AA827AC72ED00BF4B9A /* Status.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Status.swift; sourceTree = "<group>"; };
E2991AAE27AC740800BF4B9A /* LocationInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocationInfo.swift; sourceTree = "<group>"; };
E2991AB027AC760E00BF4B9A /* LocationResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocationResponse.swift; sourceTree = "<group>"; };
E2991AB227AC766300BF4B9A /* EpisodeInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EpisodeInfo.swift; sourceTree = "<group>"; };
E2991AB427AC76A300BF4B9A /* EpisodeResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EpisodeResponse.swift; sourceTree = "<group>"; };
E2991AB627AC76D400BF4B9A /* Origin.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Origin.swift; sourceTree = "<group>"; };
E2991AB827AC76FA00BF4B9A /* Location.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Location.swift; sourceTree = "<group>"; };
E2991ABA27AC771E00BF4B9A /* CharacterInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CharacterInfo.swift; sourceTree = "<group>"; };
E2991ABC27AC777300BF4B9A /* CharacterResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CharacterResponse.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -187,7 +205,9 @@
E2291D5F27A5E966006D3FD8 /* model */ = {
isa = PBXGroup;
children = (
E2555BFD27A8716A007E5266 /* base */,
E2991AA727AC72A500BF4B9A /* dto */,
E2991AA627AC72A000BF4B9A /* local */,
E2991AA527AC729500BF4B9A /* remote */,
);
path = model;
sourceTree = "<group>";
Expand Down Expand Up @@ -290,10 +310,65 @@
isa = PBXGroup;
children = (
E2555BFE27A87181007E5266 /* PageInfo.swift */,
E2991AA827AC72ED00BF4B9A /* Status.swift */,
);
path = base;
sourceTree = "<group>";
};
E2991AA527AC729500BF4B9A /* remote */ = {
isa = PBXGroup;
children = (
E2991AAC27AC73EF00BF4B9A /* location */,
E2991AAB27AC73E800BF4B9A /* episode */,
E2991AAA27AC73C000BF4B9A /* character */,
E2555BFD27A8716A007E5266 /* base */,
);
path = remote;
sourceTree = "<group>";
};
E2991AA627AC72A000BF4B9A /* local */ = {
isa = PBXGroup;
children = (
);
path = local;
sourceTree = "<group>";
};
E2991AA727AC72A500BF4B9A /* dto */ = {
isa = PBXGroup;
children = (
);
path = dto;
sourceTree = "<group>";
};
E2991AAA27AC73C000BF4B9A /* character */ = {
isa = PBXGroup;
children = (
E2991AB627AC76D400BF4B9A /* Origin.swift */,
E2991AB827AC76FA00BF4B9A /* Location.swift */,
E2991ABA27AC771E00BF4B9A /* CharacterInfo.swift */,
E2991ABC27AC777300BF4B9A /* CharacterResponse.swift */,
);
path = character;
sourceTree = "<group>";
};
E2991AAB27AC73E800BF4B9A /* episode */ = {
isa = PBXGroup;
children = (
E2991AB227AC766300BF4B9A /* EpisodeInfo.swift */,
E2991AB427AC76A300BF4B9A /* EpisodeResponse.swift */,
);
path = episode;
sourceTree = "<group>";
};
E2991AAC27AC73EF00BF4B9A /* location */ = {
isa = PBXGroup;
children = (
E2991AAE27AC740800BF4B9A /* LocationInfo.swift */,
E2991AB027AC760E00BF4B9A /* LocationResponse.swift */,
);
path = location;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
Expand Down Expand Up @@ -424,21 +499,30 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
E2991AB527AC76A300BF4B9A /* EpisodeResponse.swift in Sources */,
E2555C1327A872FF007E5266 /* SplashScreen.swift in Sources */,
E2991AB327AC766300BF4B9A /* EpisodeInfo.swift in Sources */,
E2991AAF27AC740800BF4B9A /* LocationInfo.swift in Sources */,
E2291D6E27A5F362006D3FD8 /* CharactersViewModel.swift in Sources */,
E2555C0B27A872A2007E5266 /* FavoritesViewModel.swift in Sources */,
E2555C1127A872F2007E5266 /* HomeScreen.swift in Sources */,
E2991AB127AC760E00BF4B9A /* LocationResponse.swift in Sources */,
E2555C0527A87238007E5266 /* CharacterRepository.swift in Sources */,
E2291D3527A5E908006D3FD8 /* ContentView.swift in Sources */,
E2555C0D27A872D5007E5266 /* SettingsScreen.swift in Sources */,
E2555C0727A87252007E5266 /* GetCharacters.swift in Sources */,
E2991AB927AC76FA00BF4B9A /* Location.swift in Sources */,
E2555BFF27A87181007E5266 /* PageInfo.swift in Sources */,
E2991ABD27AC777300BF4B9A /* CharacterResponse.swift in Sources */,
E2555C0327A87220007E5266 /* FavoriteDao.swift in Sources */,
E2555C0F27A872E4007E5266 /* DetailScreen.swift in Sources */,
E2991AA927AC72ED00BF4B9A /* Status.swift in Sources */,
E2555C0127A87209007E5266 /* CharacterService.swift in Sources */,
E2555C0927A87292007E5266 /* FavoritesScreen.swift in Sources */,
E2291D6C27A5F33F006D3FD8 /* CharactersScreen.swift in Sources */,
E2991ABB27AC771E00BF4B9A /* CharacterInfo.swift in Sources */,
E2291D3327A5E908006D3FD8 /* SwiftRorty_iOSApp.swift in Sources */,
E2991AB727AC76D400BF4B9A /* Origin.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
15 changes: 0 additions & 15 deletions SwiftRorty.iOS/data/model/base/PageInfo.swift

This file was deleted.

22 changes: 22 additions & 0 deletions SwiftRorty.iOS/data/model/remote/base/PageInfo.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//
// PageInfo.swift
// SwiftRorty.iOS
//
// Created by developersancho on 31.01.2022.
//

import Foundation

struct PageInfo: Codable {
let count: Int?
let next: String?
let pages: Int?
let prev: String?

enum CodingKeys: String, CodingKey {
case count = "count"
case next = "next"
case pages = "pages"
case prev = "prev"
}
}
14 changes: 14 additions & 0 deletions SwiftRorty.iOS/data/model/remote/base/Status.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//
// Status.swift
// SwiftRorty.iOS
//
// Created by developersancho on 3.02.2022.
//

import Foundation

enum Status: String, Codable {
case Alive
case Dead
case Unknown
}
23 changes: 23 additions & 0 deletions SwiftRorty.iOS/data/model/remote/character/CharacterInfo.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//
// CharacterInfo.swift
// SwiftRorty.iOS
//
// Created by developersancho on 3.02.2022.
//

import Foundation

struct CharacterInfo: Codable {
let created: String?
let episode: [String]?
let gender: String?
let id: Int?
let image: String?
let location: Location?
let name: String?
let origin: Origin?
let species: String?
let status: Status?
let type: String?
let url: String?
}
13 changes: 13 additions & 0 deletions SwiftRorty.iOS/data/model/remote/character/CharacterResponse.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// CharacterResponse.swift
// SwiftRorty.iOS
//
// Created by developersancho on 3.02.2022.
//

import Foundation

struct CharacterResponse: Codable {
let pageInfo: PageInfo?
let results: [CharacterInfo]?
}
13 changes: 13 additions & 0 deletions SwiftRorty.iOS/data/model/remote/character/Location.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// Location.swift
// SwiftRorty.iOS
//
// Created by developersancho on 3.02.2022.
//

import Foundation

struct Location: Codable {
let name: String?
let url: String?
}
13 changes: 13 additions & 0 deletions SwiftRorty.iOS/data/model/remote/character/Origin.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// Origin.swift
// SwiftRorty.iOS
//
// Created by developersancho on 3.02.2022.
//

import Foundation

struct Origin: Codable {
let name: String?
let url: String?
}
18 changes: 18 additions & 0 deletions SwiftRorty.iOS/data/model/remote/episode/EpisodeInfo.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//
// EpisodeInfo.swift
// SwiftRorty.iOS
//
// Created by developersancho on 3.02.2022.
//

import Foundation

struct EpisodeInfo: Codable {
let airDate: String?
let characters: [String]?
let created: String?
let episode: String?
let id: Int?
let name: String?
let url: String?
}
13 changes: 13 additions & 0 deletions SwiftRorty.iOS/data/model/remote/episode/EpisodeResponse.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// EpisodeResponse.swift
// SwiftRorty.iOS
//
// Created by developersancho on 3.02.2022.
//

import Foundation

struct EpisodeResponse: Codable {
let pageInfo: PageInfo?
let results: [EpisodeInfo]?
}
28 changes: 28 additions & 0 deletions SwiftRorty.iOS/data/model/remote/location/LocationInfo.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
//
// LocationInfo.swift
// SwiftRorty.iOS
//
// Created by developersancho on 3.02.2022.
//

import Foundation

struct LocationInfo: Codable {
let dimension: String?
let residents: [String]?
let created: String?
let type: String?
let id: Int?
let name: String?
let url: String?

enum CodingKeys: String, CodingKey {
case dimension = "dimension"
case residents = "residents"
case created = "created"
case type = "type"
case id = "id"
case name = "name"
case url = "url"
}
}
18 changes: 18 additions & 0 deletions SwiftRorty.iOS/data/model/remote/location/LocationResponse.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//
// LocationResponse.swift
// SwiftRorty.iOS
//
// Created by developersancho on 3.02.2022.
//

import Foundation

struct LocationResponse: Codable {
let pageInfo: PageInfo?
let location: [LocationInfo]?

enum CodingKeys: String, CodingKey {
case pageInfo = "pageInfo"
case location = "results"
}
}

0 comments on commit dad2110

Please sign in to comment.