feat:完善信息

This commit is contained in:
henry
2021-11-01 11:19:49 +08:00
parent 70ba3078b3
commit cf91d55ab2
34 changed files with 519 additions and 114 deletions

View File

@ -0,0 +1,27 @@
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, "-")
}