You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1017 B

package convert
import (
"encoding/json"
"matchmaking-system/internal/biz/structure"
)
// ConvertAggregates
//
// @Description:
// @param body
// @return *structure.Aggregates
// @return error
func ConvertAggregates(body string) (*structure.Aggregates, error) {
var aggregates structure.Aggregates
if err := json.Unmarshal([]byte(body), &aggregates); err != nil {
return nil, err
}
return &aggregates, nil
}
// ConvertInTraDay
//
// @Description:
// @param body
// @return []*structure.InTraDay
// @return error
func ConvertInTraDay(body string) ([]*structure.InTraDay, error) {
var inTraDay []*structure.InTraDay
if err := json.Unmarshal([]byte(body), &inTraDay); err != nil {
return nil, err
}
return inTraDay, nil
}
// ConvertEod
//
// @Description:
// @param body
// @return []*structure.Eod
// @return error
func ConvertEod(body string) ([]*structure.Eod, error) {
var eod []*structure.Eod
if err := json.Unmarshal([]byte(body), &eod); err != nil {
return nil, err
}
return eod, nil
}