33 lines
570 B
Go
33 lines
570 B
Go
package model
|
|
|
|
import (
|
|
"ArmedPolice/app/common/model"
|
|
"ArmedPolice/config"
|
|
"ArmedPolice/utils"
|
|
"strings"
|
|
)
|
|
|
|
type SysBreakdown struct {
|
|
*model.SysBreakdown
|
|
}
|
|
|
|
// BreakdownTitle 故障信息
|
|
func (m *SysBreakdown) BreakdownTitle(breakdown string) string {
|
|
src := strings.Split(breakdown, ",")
|
|
out := make([]string, 0)
|
|
|
|
for _, v := range src {
|
|
data, has := config.SystemBreakdown[utils.StringToUnit64(v)]
|
|
|
|
if !has {
|
|
continue
|
|
}
|
|
out = append(out, data)
|
|
}
|
|
return strings.Join(out, ",")
|
|
}
|
|
|
|
func NewSysBreakdown() *SysBreakdown {
|
|
return &SysBreakdown{}
|
|
}
|