29 lines
627 B
Go
29 lines
627 B
Go
package config
|
|
|
|
import "strings"
|
|
|
|
type (
|
|
// MemoryForIndustry 行业
|
|
MemoryForIndustry struct {
|
|
Code string `json:"code"`
|
|
Name string `json:"name"`
|
|
Children []*MemoryForIndustry `json:"children"`
|
|
}
|
|
)
|
|
|
|
var (
|
|
// MemoryForIndustryInfo 行业信息
|
|
MemoryForIndustryInfo map[string]string = make(map[string]string, 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])
|
|
}
|
|
return strings.Join(out, "-")
|
|
}
|