feat:完善信息
This commit is contained in:
@ -2,9 +2,13 @@ package manage
|
||||
|
||||
import (
|
||||
"SciencesServer/app/api/website/model"
|
||||
"SciencesServer/app/basic/config"
|
||||
"SciencesServer/app/basic/controller"
|
||||
model2 "SciencesServer/app/common/model"
|
||||
"SciencesServer/app/session"
|
||||
config2 "SciencesServer/config"
|
||||
"SciencesServer/utils"
|
||||
"fmt"
|
||||
"strings"
|
||||
)
|
||||
|
||||
@ -20,6 +24,7 @@ type (
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
School string `json:"school"`
|
||||
Image string `json:"image"`
|
||||
Major string `json:"major"`
|
||||
Industrys []string `json:"industrys"`
|
||||
Keywords []string `json:"keywords"`
|
||||
@ -51,15 +56,32 @@ func (c *Expert) Instance(id uint64) (*ExpertInstanceInfo, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
mSysPatent := model.NewSysPatent()
|
||||
|
||||
patentTitles := make([]string, 0)
|
||||
|
||||
if out.PatentTitle != "" {
|
||||
for _, val := range strings.Split(out.PatentTitle, "&&") {
|
||||
objs := strings.Split(val, "$$")
|
||||
mSysPatent.Kind = model2.SysParentKind(utils.StringToInt(objs[0]))
|
||||
patentTitles = append(patentTitles, fmt.Sprintf("【%s】%s", mSysPatent.KindTitle(), objs[1]))
|
||||
}
|
||||
}
|
||||
_industrys := make([]string, 0)
|
||||
|
||||
for _, v := range out.GetIndustryAttribute() {
|
||||
_industrys = append(_industrys, config.GetIndustryInfo(v, "-", "/").Value)
|
||||
}
|
||||
return &ExpertInstanceInfo{
|
||||
ExpertBasicInfo: ExpertBasicInfo{
|
||||
ID: out.GetEncodeID(),
|
||||
Name: out.Name,
|
||||
Image: out.Image.Analysis(config2.SystemConfig[config2.SysImageDomain]),
|
||||
School: out.School,
|
||||
Major: out.Major,
|
||||
Industrys: out.GetIndustryAttribute(),
|
||||
Industrys: _industrys,
|
||||
Keywords: out.GetKeywordAttribute(),
|
||||
PatentTitles: strings.Split(out.PatentTitle, "&&"),
|
||||
PatentTitles: patentTitles,
|
||||
},
|
||||
Researchs: out.GetResearchAttribute(),
|
||||
Introduce: out.Introduce,
|
||||
|
Reference in New Issue
Block a user