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, "-")
}

View File

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

View File

@ -13,16 +13,16 @@ type (
IdentityForCompany struct{}
// IdentityForExpert 专家附加信息
IdentityForExpert struct {
TenantID uint64 `json:"tenant_id" form:"tenant_id"`
Longitude float64 `json:"longitude" form:"longitude"` // 经度
Latitude float64 `json:"latitude" form:"latitude"` // 纬度
School string `json:"school" form:"school"`
Major string `json:"major" form:"major"`
Job string `json:"job" form:"job"`
Title string `json:"title" form:"title"`
WorkAt string `json:"work_at" form:"work_at"`
Keyword string `json:"keyword" form:"keyword"`
Research map[int]string `json:"research" form:"research"` // 研究方向
TenantID uint64 `json:"tenant_id" form:"tenant_id"`
Longitude float64 `json:"longitude" form:"longitude"` // 经度
Latitude float64 `json:"latitude" form:"latitude"` // 纬度
School string `json:"school" form:"school"`
Major string `json:"major" form:"major"`
Job string `json:"job" form:"job"`
Title string `json:"title" form:"title"`
WorkAt string `json:"work_at" form:"work_at"`
Keyword string `json:"keyword" form:"keyword"`
Research string `json:"research" form:"research"` // 研究方向
}
// IdentityForResearch 研究机构
IdentityForResearch struct {