feat:完善信息
This commit is contained in:
@ -7,15 +7,23 @@ import (
|
||||
model2 "SciencesServer/app/common/model"
|
||||
"SciencesServer/app/service"
|
||||
config2 "SciencesServer/config"
|
||||
"SciencesServer/utils"
|
||||
"fmt"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type (
|
||||
// ExpertInfo 专家信息
|
||||
ExpertInfo struct {
|
||||
ID string `json:"id"`
|
||||
*model.ManageExpertInfo
|
||||
Industrys []string `json:"industrys"`
|
||||
Keywords []string `json:"keywords"`
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Image string `json:"image"`
|
||||
School string `json:"school"`
|
||||
Major string `json:"major"`
|
||||
ResearchName string `json:"research_name"`
|
||||
PatentTitle []string `json:"patent_title"`
|
||||
Industrys []string `json:"industrys"`
|
||||
Keywords []string `json:"keywords"`
|
||||
}
|
||||
)
|
||||
|
||||
@ -53,17 +61,26 @@ func searchExpert(page, pageSize int, keyword, industry string, params map[strin
|
||||
}
|
||||
list := make([]*ExpertInfo, 0)
|
||||
|
||||
mSysPatent := model.NewSysPatent()
|
||||
|
||||
for _, v := range experts {
|
||||
_industrys := make([]string, 0)
|
||||
|
||||
for _, v := range v.GetIndustryAttribute() {
|
||||
_industrys = append(_industrys, config.GetIndustryInfo(v, "-", "/").Value)
|
||||
}
|
||||
patentTitles := make([]string, 0)
|
||||
|
||||
v.Image.Image = v.Image.Analysis(config2.SystemConfig[config2.SysImageDomain])
|
||||
|
||||
if v.PatentTitle != "" {
|
||||
for _, val := range strings.Split(v.PatentTitle, "&&") {
|
||||
objs := strings.Split(val, "$$")
|
||||
mSysPatent.Kind = model2.SysParentKind(utils.StringToInt(objs[0]))
|
||||
patentTitles = append(patentTitles, fmt.Sprintf("【%s】%s", mSysPatent.KindTitle(), objs[1]))
|
||||
}
|
||||
}
|
||||
list = append(list, &ExpertInfo{
|
||||
ID: v.GetEncodeID(), ManageExpertInfo: v,
|
||||
ID: v.GetEncodeID(), Name: v.Name, Image: v.Image.Analysis(config2.SystemConfig[config2.SysImageDomain]),
|
||||
School: v.School, Major: v.Major, ResearchName: v.ResearchName, PatentTitle: patentTitles,
|
||||
Industrys: _industrys, Keywords: v.GetKeywordAttribute(),
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user