| | |
| | | |
| | | "basic.com/pubsub/protomsg.git" |
| | | "github.com/gin-gonic/gin" |
| | | "github.com/golang/glog" |
| | | "github.com/pierrec/lz4" |
| | | "gocv.io/x/gocv" |
| | | |
| | |
| | | // ResponseFormat 返回数据格式化 |
| | | func ResponseFormat(c *gin.Context, respStatus *code.Code, data interface{}) { |
| | | if respStatus == nil { |
| | | glog.Error("response status param not found!") |
| | | respStatus = code.RequestParamError |
| | | } |
| | | c.JSON(respStatus.Status, gin.H{ |
| | |
| | | return float32(f) |
| | | } |
| | | |
| | | func ParseScore64(compareScore float64) float64 { |
| | | if compareScore < 1 { |
| | | compareScore = compareScore * 100 |
| | | } |
| | | f, _ := strconv.ParseFloat(fmt.Sprintf("%2.2f", compareScore), 64) |
| | | return f |
| | | } |
| | | |
| | | // UnCompress uncompress |
| | | func UnCompress(in []byte) ([]byte, error) { |
| | | out := make([]byte, 10*len(in)) |