more json structure fixes
Ryan Carver
8 years ago
64 | 64 |
Reactions []ItemReaction
|
65 | 65 |
} `json:"file"`
|
66 | 66 |
FC struct {
|
67 | |
Comment struct {
|
68 | |
Reactions []ItemReaction
|
69 | |
}
|
70 | |
} `json:"file_comment"`
|
|
67 |
Reactions []ItemReaction
|
|
68 |
} `json:"comment"`
|
71 | 69 |
SlackResponse
|
72 | 70 |
}
|
73 | 71 |
|
|
78 | 76 |
case "file":
|
79 | 77 |
return res.F.Reactions
|
80 | 78 |
case "file_comment":
|
81 | |
return res.FC.Comment.Reactions
|
|
79 |
return res.FC.Reactions
|
82 | 80 |
}
|
83 | 81 |
return []ItemReaction{}
|
84 | 82 |
}
|
|
121 | 119 |
Reactions []ItemReaction
|
122 | 120 |
} `json:"file"`
|
123 | 121 |
FC struct {
|
124 | |
C struct {
|
125 | |
*Comment
|
126 | |
Reactions []ItemReaction
|
127 | |
} `json:"comment"`
|
128 | |
} `json:"file_comment"`
|
|
122 |
*Comment
|
|
123 |
Reactions []ItemReaction
|
|
124 |
} `json:"comment"`
|
129 | 125 |
}
|
130 | 126 |
Paging `json:"paging"`
|
131 | 127 |
SlackResponse
|
|
145 | 141 |
item.File = input.F.File
|
146 | 142 |
item.Reactions = input.F.Reactions
|
147 | 143 |
case "file_comment":
|
148 | |
item.Comment = input.FC.C.Comment
|
149 | |
item.Reactions = input.FC.C.Reactions
|
|
144 |
item.Comment = input.FC.Comment
|
|
145 |
item.Reactions = input.FC.Reactions
|
150 | 146 |
}
|
151 | 147 |
items[i] = item
|
152 | 148 |
}
|
201 | 201 |
},
|
202 | 202 |
`{"ok": true,
|
203 | 203 |
"type": "file_comment",
|
204 | |
"file_comment": {
|
205 | |
"comment": {
|
206 | |
"reactions": [
|
207 | |
{
|
208 | |
"name": "astonished",
|
209 | |
"count": 3,
|
210 | |
"users": [ "U1", "U2", "U3" ]
|
211 | |
},
|
212 | |
{
|
213 | |
"name": "clock1",
|
214 | |
"count": 3,
|
215 | |
"users": [ "U1", "U2" ]
|
216 | |
}
|
217 | |
]
|
218 | |
}
|
|
204 |
"file": {},
|
|
205 |
"comment": {
|
|
206 |
"reactions": [
|
|
207 |
{
|
|
208 |
"name": "astonished",
|
|
209 |
"count": 3,
|
|
210 |
"users": [ "U1", "U2", "U3" ]
|
|
211 |
},
|
|
212 |
{
|
|
213 |
"name": "clock1",
|
|
214 |
"count": 3,
|
|
215 |
"users": [ "U1", "U2" ]
|
|
216 |
}
|
|
217 |
]
|
219 | 218 |
}}`,
|
220 | 219 |
[]ItemReaction{
|
221 | 220 |
ItemReaction{Name: "astonished", Count: 3, Users: []string{"U1", "U2", "U3"}},
|
|
282 | 281 |
},
|
283 | 282 |
{
|
284 | 283 |
"type": "file_comment",
|
285 | |
"file_comment": {
|
286 | |
"file": {},
|
287 | |
"comment": {
|
288 | |
"comment": "cool toy",
|
289 | |
"reactions": [
|
290 | |
{
|
291 | |
"name": "astonished",
|
292 | |
"count": 3,
|
293 | |
"users": [ "U1", "U2", "U3" ]
|
294 | |
}
|
295 | |
]
|
296 | |
}
|
|
284 |
"file": {},
|
|
285 |
"comment": {
|
|
286 |
"comment": "cool toy",
|
|
287 |
"reactions": [
|
|
288 |
{
|
|
289 |
"name": "astonished",
|
|
290 |
"count": 3,
|
|
291 |
"users": [ "U1", "U2", "U3" ]
|
|
292 |
}
|
|
293 |
]
|
297 | 294 |
}
|
298 | 295 |
}
|
299 | 296 |
],
|