feat:完善信息
This commit is contained in:
27
app/basic/config/memory.go
Normal file
27
app/basic/config/memory.go
Normal 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, "-")
|
||||
}
|
23
app/basic/config/memory_test.go
Normal file
23
app/basic/config/memory_test.go
Normal 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))
|
||||
}
|
@ -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 {
|
||||
|
Reference in New Issue
Block a user