feat:完善项目信息
This commit is contained in:
@ -6,6 +6,7 @@ import (
|
||||
"SciencesServer/app/basic/controller"
|
||||
model2 "SciencesServer/app/common/model"
|
||||
"SciencesServer/app/session"
|
||||
config2 "SciencesServer/config"
|
||||
"errors"
|
||||
)
|
||||
|
||||
@ -34,7 +35,9 @@ type (
|
||||
ID string `json:"id"`
|
||||
TenantID string `json:"tenant_id"`
|
||||
*model2.ManageResearch
|
||||
Area string `json:"area"`
|
||||
Industrys []*config.Industry `json:"industrys"`
|
||||
Keywords []string `json:"keywords"`
|
||||
Researchs []string `json:"researchs"`
|
||||
}
|
||||
)
|
||||
|
||||
@ -172,9 +175,18 @@ func (c *Research) Detail(id uint64) (*ResearchDetail, error) {
|
||||
} else if out.ManageResearch == nil {
|
||||
return nil, errors.New("操作错误,科研机构信息不存在或已被删除")
|
||||
}
|
||||
_industrys := make([]*config.Industry, 0)
|
||||
|
||||
for _, v := range out.GetIndustryAttribute() {
|
||||
_industrys = append(_industrys, config.GetIndustryInfo(v, "-", ">"))
|
||||
}
|
||||
out.Image.Image = out.Image.Analysis(config2.SystemConfig[config2.SysImageDomain])
|
||||
out.License = (&model2.Image{Image: out.License}).Analysis(config2.SystemConfig[config2.SysImageDomain])
|
||||
|
||||
return &ResearchDetail{
|
||||
ID: out.GetEncodeID(), TenantID: out.GetEncodeTenantID(),
|
||||
ManageResearch: out.ManageResearch, Area: out.FormatBasic(),
|
||||
ManageResearch: out.ManageResearch, Industrys: _industrys,
|
||||
Keywords: out.GetKeywordAttribute(), Researchs: out.GetResearchAttribute(),
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user