...
|
...
|
@@ -79,7 +79,8 @@ func (c *OpenApiController) GetChangeMedia() { |
|
|
chanceSource []protocol.InputElement
|
|
|
)
|
|
|
chanceData, err = models.GetChanceDataByChanceId(chanceId)
|
|
|
rsp := []map[string]interface{}{}
|
|
|
rsp := map[string]interface{}{}
|
|
|
rspOrther := []map[string]interface{}{}
|
|
|
if err != nil {
|
|
|
msg = protocol.NewReturnResponse(rsp, nil)
|
|
|
return
|
...
|
...
|
@@ -103,7 +104,7 @@ func (c *OpenApiController) GetChangeMedia() { |
|
|
}
|
|
|
videoMapData = append(videoMapData, m)
|
|
|
}
|
|
|
rsp = append(rsp, map[string]interface{}{
|
|
|
rspOrther = append(rspOrther, map[string]interface{}{
|
|
|
"type": 1, "data": videoMapData,
|
|
|
})
|
|
|
|
...
|
...
|
@@ -114,7 +115,7 @@ func (c *OpenApiController) GetChangeMedia() { |
|
|
}
|
|
|
imgMapData = append(imgMapData, m)
|
|
|
}
|
|
|
rsp = append(rsp, map[string]interface{}{
|
|
|
rspOrther = append(rspOrther, map[string]interface{}{
|
|
|
"type": 2, "data": imgMapData,
|
|
|
})
|
|
|
speedchMapData := []map[string]interface{}{}
|
...
|
...
|
@@ -124,14 +125,14 @@ func (c *OpenApiController) GetChangeMedia() { |
|
|
}
|
|
|
speedchMapData = append(speedchMapData, m)
|
|
|
}
|
|
|
rsp = append(rsp, map[string]interface{}{
|
|
|
rspOrther = append(rspOrther, map[string]interface{}{
|
|
|
"type": 3, "data": speedchMapData,
|
|
|
})
|
|
|
rspChanceData := []map[string]interface{}{}
|
|
|
for i := range chanceSource {
|
|
|
if chanceSource[i].InputType != models.InputTypeImageVedio {
|
|
|
continue
|
|
|
}
|
|
|
|
|
|
imageVideo := []map[string]interface{}{}
|
|
|
for ii := range chanceSource[i].Data {
|
|
|
m := map[string]interface{}{
|
...
|
...
|
@@ -142,12 +143,13 @@ func (c *OpenApiController) GetChangeMedia() { |
|
|
imageVideo = append(imageVideo, m)
|
|
|
}
|
|
|
chanceData := map[string]interface{}{
|
|
|
"type": 4,
|
|
|
"lable": chanceSource[i].Label,
|
|
|
"data": imageVideo,
|
|
|
}
|
|
|
rsp = append(rsp, chanceData)
|
|
|
rspChanceData = append(rspChanceData, chanceData)
|
|
|
}
|
|
|
rsp["orther"] = rspOrther
|
|
|
rsp["chance_data"] = rspChanceData
|
|
|
msg = protocol.NewReturnResponse(rsp, nil)
|
|
|
return
|
|
|
|
...
|
...
|
|