Files
2022-01-13 15:23:27 +08:00

36 lines
811 B
Go

package config
import "strings"
type (
// MemoryForIndustry 行业
MemoryForIndustry struct {
Code string `json:"code"`
Name string `json:"name"`
Children []*MemoryForIndustry `json:"children"`
}
)
var (
// MemoryForAreaInfo 区域信息
MemoryForAreaInfo map[string]map[string]string = make(map[string]map[string]string, 0)
// MemoryForIndustryInfo 行业信息
MemoryForIndustryInfo map[string]string = make(map[string]string, 0)
)
// GetIndustryInfo 获取行业信息
func GetIndustryInfo(industry, mark, sep string) string {
obj := strings.Split(industry, mark)
out := make([]string, 0)
for _, v := range obj {
data, has := MemoryForIndustryInfo[v]
if !has {
data = "未知"
}
out = append(out, data)
}
return strings.Join(out, sep)
}