Skip to content

Commit bb60629

Browse files
authored
Рефактор (#223)
- Убрал несколько неиспользуемых полей из моделей - Поднял таймаут на ожидание ответа сервера с 15 до 30 секунд - Поднял версию приложения до 3.5.5
1 parent e31789a commit bb60629

File tree

6 files changed

+9
-37
lines changed

6 files changed

+9
-37
lines changed

SwiftUI-WorkoutApp.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,7 +1087,7 @@
10871087
"$(inherited)",
10881088
"@executable_path/Frameworks",
10891089
);
1090-
MARKETING_VERSION = 3.5.4;
1090+
MARKETING_VERSION = 3.5.5;
10911091
PRODUCT_BUNDLE_IDENTIFIER = com.FGU.WorkOut;
10921092
PRODUCT_NAME = WorkoutApp;
10931093
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
@@ -1124,7 +1124,7 @@
11241124
"$(inherited)",
11251125
"@executable_path/Frameworks",
11261126
);
1127-
MARKETING_VERSION = 3.5.4;
1127+
MARKETING_VERSION = 3.5.5;
11281128
PRODUCT_BUNDLE_IDENTIFIER = com.FGU.WorkOut;
11291129
PRODUCT_NAME = WorkoutApp;
11301130
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";

SwiftUI-WorkoutApp/Preview Content/PreviewContent.swift

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,11 @@ extension UserResponse {
5959
6060
imageStringURL: "https://workout.su/uploads/avatars/2019/10/2019-10-07-01-10-08-yow.jpg",
6161
birthDateIsoString: "1990-11-25",
62-
createdIsoDateTimeSec: nil,
6362
cityID: 1,
6463
countryID: 17,
6564
genderCode: 1,
6665
friendsCount: 5,
6766
journalsCount: 2,
68-
friendRequestsCountString: "3",
6967
sportsGroundsCountString: "4",
7068
addedSportsGrounds: nil
7169
)
@@ -79,8 +77,6 @@ extension EventResponse {
7977
title: "Открытая тренировка участников SOTKA и воркаутеров #2 в 2022 году",
8078
eventDescription: "!!! ВРЕМЯ ТРЕНИРОВКИ - 12:00",
8179
fullAddress: nil,
82-
createDate: "2022-10-16T09:00:00+00:00",
83-
modifyDate: "2022-10-16T09:00:00+00:00",
8480
beginDate: "2022-10-16T09:00:00+00:00",
8581
countryID: 17,
8682
cityID: 1,
@@ -113,8 +109,7 @@ extension DialogResponse {
113109
lastMessageText: "Ошибка 500 это про пустые ответы? Я написал серверным.",
114110
lastMessageDate: "2022-05-14T17:35:45+00:00",
115111
anotherUserID: 30,
116-
unreadCountOptional: 5,
117-
createdDate: "2022-04-25T18:47:46+00:00"
112+
unreadCountOptional: 5
118113
)
119114
}
120115
}

SwiftUI-WorkoutApp/SWModels/Sources/SWModels/DialogResponse.swift

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ public struct DialogResponse: Codable, Identifiable, Sendable {
1010
public let lastMessageDate: String?
1111
public let anotherUserID: Int?
1212
public var unreadCountOptional: Int?
13-
public let createdDate: String?
1413

1514
public enum CodingKeys: String, CodingKey {
1615
case id = "dialog_id"
@@ -20,7 +19,6 @@ public struct DialogResponse: Codable, Identifiable, Sendable {
2019
case anotherUserName = "name"
2120
case unreadCountOptional = "count"
2221
case anotherUserImageStringURL = "image"
23-
case createdDate = "created"
2422
}
2523

2624
public init(
@@ -30,8 +28,7 @@ public struct DialogResponse: Codable, Identifiable, Sendable {
3028
lastMessageText: String? = nil,
3129
lastMessageDate: String? = nil,
3230
anotherUserID: Int? = nil,
33-
unreadCountOptional: Int? = nil,
34-
createdDate: String? = nil
31+
unreadCountOptional: Int? = nil
3532
) {
3633
self.id = id
3734
self.anotherUserImageStringURL = anotherUserImageStringURL
@@ -40,7 +37,6 @@ public struct DialogResponse: Codable, Identifiable, Sendable {
4037
self.lastMessageDate = lastMessageDate
4138
self.anotherUserID = anotherUserID
4239
self.unreadCountOptional = unreadCountOptional
43-
self.createdDate = createdDate
4440
}
4541
}
4642

@@ -76,8 +72,7 @@ public extension DialogResponse {
7672
anotherUserName: nil,
7773
lastMessageText: nil,
7874
lastMessageDate: nil,
79-
anotherUserID: nil,
80-
createdDate: nil
75+
anotherUserID: nil
8176
)
8277
}
8378
}

SwiftUI-WorkoutApp/SWModels/Sources/SWModels/EventResponse.swift

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ public struct EventResponse: Codable, Identifiable, Equatable, Sendable {
77
/// Название мероприятия
88
public var title: String?
99
public var eventDescription: String?
10-
public let fullAddress, createDate, modifyDate: String?
10+
public let fullAddress: String?
1111
public var beginDate: String?
1212
public var countryID, cityID: Int?
1313
public let commentsCount: Int?
@@ -36,8 +36,6 @@ public struct EventResponse: Codable, Identifiable, Equatable, Sendable {
3636
case fullAddress = "address"
3737
case previewImageStringURL = "preview"
3838
case eventDescription = "description"
39-
case createDate = "create_date"
40-
case modifyDate = "modify_date"
4139
case beginDate = "begin_date"
4240
case countryID = "country_id"
4341
case cityID = "city_id"
@@ -56,8 +54,6 @@ public struct EventResponse: Codable, Identifiable, Equatable, Sendable {
5654
title: String? = nil,
5755
eventDescription: String? = nil,
5856
fullAddress: String? = nil,
59-
createDate: String? = nil,
60-
modifyDate: String? = nil,
6157
beginDate: String? = nil,
6258
countryID: Int? = nil,
6359
cityID: Int? = nil,
@@ -79,8 +75,6 @@ public struct EventResponse: Codable, Identifiable, Equatable, Sendable {
7975
self.title = title
8076
self.eventDescription = eventDescription
8177
self.fullAddress = fullAddress
82-
self.createDate = createDate
83-
self.modifyDate = modifyDate
8478
self.beginDate = beginDate
8579
self.countryID = countryID
8680
self.cityID = cityID
@@ -222,8 +216,6 @@ public extension EventResponse {
222216
title: nil,
223217
eventDescription: nil,
224218
fullAddress: nil,
225-
createDate: nil,
226-
modifyDate: nil,
227219
beginDate: nil,
228220
countryID: nil,
229221
cityID: nil,

SwiftUI-WorkoutApp/SWModels/Sources/SWModels/UserResponse.swift

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ public struct UserResponse: Codable, Identifiable, Hashable, Sendable {
99
public let addedSportsGrounds: [SportsGround]?
1010
/// Пример: "1990-11-25"
1111
let birthDateIsoString: String?
12-
/// Пример: "2013-01-16T03:35:54+04:00"
13-
let createdIsoDateTimeSec: String?
14-
let friendRequestsCountString, sportsGroundsCountString: String? // "0"
12+
let sportsGroundsCountString: String? // "0"
1513

1614
public enum CodingKeys: String, CodingKey {
1715
case id
@@ -21,10 +19,8 @@ public struct UserResponse: Codable, Identifiable, Hashable, Sendable {
2119
case countryID = "country_id"
2220
case genderCode = "gender"
2321
case birthDateIsoString = "birth_date"
24-
case createdIsoDateTimeSec = "create_date"
2522
case fullName = "fullname"
2623
case friendsCount = "friend_count"
27-
case friendRequestsCountString = "friend_request_count"
2824
case sportsGroundsCountString = "area_count"
2925
case journalsCount = "journal_count"
3026
case addedSportsGrounds = "added_areas"
@@ -38,13 +34,11 @@ public struct UserResponse: Codable, Identifiable, Hashable, Sendable {
3834
email: String? = nil,
3935
imageStringURL: String? = nil,
4036
birthDateIsoString: String? = nil,
41-
createdIsoDateTimeSec: String? = nil,
4237
cityID: Int? = nil,
4338
countryID: Int? = nil,
4439
genderCode: Int? = nil,
4540
friendsCount: Int? = nil,
4641
journalsCount: Int? = nil,
47-
friendRequestsCountString: String? = nil,
4842
sportsGroundsCountString: String? = nil,
4943
addedSportsGrounds: [SportsGround]? = nil
5044
) {
@@ -54,13 +48,11 @@ public struct UserResponse: Codable, Identifiable, Hashable, Sendable {
5448
self.email = email
5549
self.imageStringURL = imageStringURL
5650
self.birthDateIsoString = birthDateIsoString
57-
self.createdIsoDateTimeSec = createdIsoDateTimeSec
5851
self.cityID = cityID
5952
self.countryID = countryID
6053
self.genderCode = genderCode
6154
self.friendsCount = friendsCount
6255
self.journalsCount = journalsCount
63-
self.friendRequestsCountString = friendRequestsCountString
6456
self.sportsGroundsCountString = sportsGroundsCountString
6557
self.addedSportsGrounds = addedSportsGrounds
6658
}
@@ -182,13 +174,11 @@ public extension UserResponse {
182174
email: nil,
183175
imageStringURL: nil,
184176
birthDateIsoString: nil,
185-
createdIsoDateTimeSec: nil,
186177
cityID: nil,
187178
countryID: nil,
188179
genderCode: nil,
189180
friendsCount: nil,
190181
journalsCount: nil,
191-
friendRequestsCountString: nil,
192182
sportsGroundsCountString: nil,
193183
addedSportsGrounds: nil
194184
)

SwiftUI-WorkoutApp/SWNetworkClient/Sources/SWNetworkClient/SWClient.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ public struct SWClient: Sendable {
2828
/// - Parameters:
2929
/// - defaults: Сервис, отвечающий за обновление `UserDefaults`
3030
/// - baseUrlString: Базовый `url` сервера. По умолчанию `https://workout.su/api/v3`
31-
/// - timeoutInterval: Время таймаута для `URLSession`. По умолчанию `15`
31+
/// - timeoutInterval: Время таймаута для `URLSession`. По умолчанию `30`
3232
/// - needAuth: Необходимость базовой аутентификации. По умолчанию `true`
3333
/// - canForceLogout: Доступность принудительной деавторизации. По умолчанию `true`
3434
public init(
3535
with defaults: DefaultsProtocol,
3636
baseUrlString: String = "https://workout.su/api/v3",
37-
timeoutInterval: TimeInterval = 15,
37+
timeoutInterval: TimeInterval = 30,
3838
needAuth: Bool = true,
3939
canForceLogout: Bool = true
4040
) {

0 commit comments

Comments
 (0)