28 lines
628 B
Go
28 lines
628 B
Go
package config
|
|
|
|
import "strings"
|
|
|
|
type (
|
|
// MemoryForIndustry 行业
|
|
MemoryForIndustry struct {
|
|
Name string `json:"name"`
|
|
Children map[string]*MemoryForIndustry `json:"children"`
|
|
}
|
|
)
|
|
|
|
var (
|
|
// MemoryForIndustryInfo 行业信息
|
|
MemoryForIndustryInfo map[string]*MemoryForIndustry = make(map[string]*MemoryForIndustry, 0)
|
|
)
|
|
|
|
// GetIndustryInfo 获取行业信息
|
|
func GetIndustryInfo(industry, mark string) string {
|
|
obj := strings.Split(industry, mark)
|
|
out := make([]string, 0)
|
|
|
|
for _, v := range obj {
|
|
out = append(out, MemoryForIndustryInfo[v].Name)
|
|
}
|
|
return strings.Join(out, "-")
|
|
}
|