feat:完善项目信息

This commit is contained in:
henry
2022-01-13 10:14:02 +08:00
parent a15f0fff2b
commit e3909112ce
9 changed files with 40 additions and 36 deletions

View File

@ -24,7 +24,12 @@ func GetIndustryInfo(industry, mark string) string {
out := make([]string, 0)
for _, v := range obj {
out = append(out, MemoryForIndustryInfo[v])
data, has := MemoryForIndustryInfo[v]
if !has {
data = "未知"
}
out = append(out, data)
}
return strings.Join(out, "-")
}

View File

@ -1,23 +1,9 @@
package config
import (
"SciencesServer/utils"
"testing"
)
func TestMemory(t *testing.T) {
MemoryForIndustryInfo["01"] = &MemoryForIndustry{
Name: "01",
Children: map[string]*MemoryForIndustry{
"001": &MemoryForIndustry{
Name: "001",
Children: nil,
},
"002": &MemoryForIndustry{
Name: "002",
Children: nil,
},
},
}
t.Logf(utils.AnyToJSON(MemoryForIndustryInfo))
}