質問編集履歴
2
内容編集
test
CHANGED
File without changes
|
test
CHANGED
@@ -96,6 +96,8 @@
|
|
96
96
|
|
97
97
|
|
98
98
|
|
99
|
+
JsonModel.swift
|
100
|
+
|
99
101
|
|
100
102
|
|
101
103
|
|
@@ -104,10 +106,190 @@
|
|
104
106
|
|
105
107
|
|
106
108
|
|
109
|
+
API仕様
|
110
|
+
|
111
|
+
/api/info/
|
112
|
+
|
113
|
+
```ここに言語を入力
|
114
|
+
|
115
|
+
[
|
116
|
+
|
117
|
+
{
|
118
|
+
|
119
|
+
"id": 116,
|
120
|
+
|
121
|
+
"start_date": "2020-11-07",
|
122
|
+
|
123
|
+
"user": 126
|
124
|
+
|
125
|
+
},
|
126
|
+
|
127
|
+
{
|
128
|
+
|
129
|
+
"id": 117,
|
130
|
+
|
131
|
+
"start_date": "2020-10-29",
|
132
|
+
|
133
|
+
"user": 126
|
134
|
+
|
135
|
+
}
|
136
|
+
|
137
|
+
]
|
138
|
+
|
139
|
+
```
|
140
|
+
|
141
|
+
/api/weather_ave/?start_date=2020-11-07
|
142
|
+
|
143
|
+
```ここに言語を入力
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
[
|
148
|
+
|
149
|
+
{
|
150
|
+
|
151
|
+
"id": 511039,
|
152
|
+
|
153
|
+
"ave_temp": 25.7
|
154
|
+
|
155
|
+
},
|
156
|
+
|
157
|
+
{
|
158
|
+
|
159
|
+
"id": 511186,
|
160
|
+
|
161
|
+
"ave_temp": 24.9
|
162
|
+
|
163
|
+
},
|
164
|
+
|
165
|
+
{
|
166
|
+
|
167
|
+
"id": 511333,
|
168
|
+
|
169
|
+
"ave_temp": 23.4
|
170
|
+
|
171
|
+
}
|
172
|
+
|
173
|
+
]
|
174
|
+
|
175
|
+
```
|
176
|
+
|
177
|
+
/api/weather_ave/?start_date=2020-10-29
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
```ここに言語を入力
|
182
|
+
|
183
|
+
[
|
184
|
+
|
185
|
+
{
|
186
|
+
|
187
|
+
"id": 509716,
|
188
|
+
|
189
|
+
"ave_temp": 25.6
|
190
|
+
|
191
|
+
},
|
192
|
+
|
193
|
+
{
|
194
|
+
|
195
|
+
"id": 509863,
|
196
|
+
|
197
|
+
"ave_temp": 24.1
|
198
|
+
|
199
|
+
},
|
200
|
+
|
201
|
+
{
|
202
|
+
|
203
|
+
"id": 510010,
|
204
|
+
|
205
|
+
"ave_temp": 23.5
|
206
|
+
|
207
|
+
},
|
208
|
+
|
209
|
+
{
|
210
|
+
|
211
|
+
"id": 510157,
|
212
|
+
|
213
|
+
"ave_temp": 25.7
|
214
|
+
|
215
|
+
},
|
216
|
+
|
217
|
+
{
|
218
|
+
|
219
|
+
"id": 510304,
|
220
|
+
|
221
|
+
"ave_temp": 26.4
|
222
|
+
|
223
|
+
},
|
224
|
+
|
225
|
+
{
|
226
|
+
|
227
|
+
"id": 510451,
|
228
|
+
|
229
|
+
"ave_temp": 23.7
|
230
|
+
|
231
|
+
},
|
232
|
+
|
233
|
+
{
|
234
|
+
|
235
|
+
"id": 510598,
|
236
|
+
|
237
|
+
"ave_temp": 23.0
|
238
|
+
|
239
|
+
},
|
240
|
+
|
241
|
+
{
|
242
|
+
|
243
|
+
"id": 510745,
|
244
|
+
|
245
|
+
"ave_temp": 24.4
|
246
|
+
|
247
|
+
},
|
248
|
+
|
249
|
+
{
|
250
|
+
|
251
|
+
"id": 510892,
|
252
|
+
|
253
|
+
"ave_temp": 26.1
|
254
|
+
|
255
|
+
},
|
256
|
+
|
257
|
+
{
|
258
|
+
|
259
|
+
"id": 511039,
|
260
|
+
|
261
|
+
"ave_temp": 25.7
|
262
|
+
|
263
|
+
},
|
264
|
+
|
265
|
+
{
|
266
|
+
|
267
|
+
"id": 511186,
|
268
|
+
|
269
|
+
"ave_temp": 24.9
|
270
|
+
|
271
|
+
},
|
272
|
+
|
273
|
+
{
|
274
|
+
|
275
|
+
"id": 511333,
|
276
|
+
|
277
|
+
"ave_temp": 23.4
|
278
|
+
|
279
|
+
}
|
280
|
+
|
281
|
+
]
|
282
|
+
|
283
|
+
```
|
284
|
+
|
285
|
+
|
286
|
+
|
107
|
-
|
287
|
+
AppState.swift
|
108
288
|
|
109
289
|
```swift
|
110
290
|
|
291
|
+
|
292
|
+
|
111
293
|
import Foundation
|
112
294
|
|
113
295
|
|
@@ -130,9 +312,9 @@
|
|
130
312
|
|
131
313
|
}
|
132
314
|
|
315
|
+
|
316
|
+
|
133
|
-
```
|
317
|
+
```
|
134
|
-
|
135
|
-
|
136
318
|
|
137
319
|
AppState.swift
|
138
320
|
|
1
内容編集
test
CHANGED
File without changes
|
test
CHANGED
@@ -112,7 +112,7 @@
|
|
112
112
|
|
113
113
|
|
114
114
|
|
115
|
-
struct D
|
115
|
+
struct DateInfos: Codable,Identifiable {
|
116
116
|
|
117
117
|
var id: Int
|
118
118
|
|
@@ -152,7 +152,7 @@
|
|
152
152
|
|
153
153
|
|
154
154
|
|
155
|
-
@Published var arrayD
|
155
|
+
@Published var arrayDateInfos:[DateInfos]?
|
156
156
|
|
157
157
|
@Published var weatherAveInfos:[WeatherAveInfos]?
|
158
158
|
|
@@ -220,7 +220,7 @@
|
|
220
220
|
|
221
221
|
DispatchQueue.main.async {
|
222
222
|
|
223
|
-
do{ self.arrayD
|
223
|
+
do{ self.arrayDateInfos = try JSONDecoder().decode([DateInfos].self, from: responseData)
|
224
224
|
|
225
225
|
}catch{
|
226
226
|
|
@@ -358,7 +358,7 @@
|
|
358
358
|
|
359
359
|
VStack{
|
360
360
|
|
361
|
-
ForEach(appState.arrayD
|
361
|
+
ForEach(appState.arrayDateInfos ?? []){ info in
|
362
362
|
|
363
363
|
VStack{
|
364
364
|
|
@@ -406,7 +406,7 @@
|
|
406
406
|
|
407
407
|
@EnvironmentObject var appState: AppState
|
408
408
|
|
409
|
-
var info:D
|
409
|
+
var info:DateInfos
|
410
410
|
|
411
411
|
|
412
412
|
|