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"
|
||||
)
|
||||
|
||||
@ -26,12 +27,13 @@ type (
|
||||
}
|
||||
// CompanyDetail 公司企业详细信息
|
||||
CompanyDetail struct {
|
||||
ID string `json:"id"`
|
||||
ID string `json:"id"`
|
||||
TenantID string `json:"tenant_id"`
|
||||
*model2.ManageCompany
|
||||
Industrys []string `json:"industrys"`
|
||||
Keywords []string `json:"keywords"`
|
||||
Directions []string `json:"directions"`
|
||||
Area string `json:"area"`
|
||||
Industrys []*config.Industry `json:"industrys"`
|
||||
Keywords []string `json:"keywords"`
|
||||
Directions []string `json:"directions"`
|
||||
Area string `json:"area"`
|
||||
}
|
||||
// CompanyParams 公司企业参数信息
|
||||
CompanyParams struct {
|
||||
@ -72,7 +74,7 @@ func (c *Company) Instance(tenantID uint64, name string, status int, page, pageS
|
||||
_industrys := make([]string, 0)
|
||||
|
||||
for _, v := range mManageCompany.GetIndustryAttribute() {
|
||||
_industrys = append(_industrys, config.GetIndustryInfo(v, "-", "/"))
|
||||
_industrys = append(_industrys, config.GetIndustryInfo(v, "-", "/").Value)
|
||||
}
|
||||
list = append(list, &CompanyInstance{
|
||||
ID: v.GetEncodeID(), ManageCompanyInfo: v, Industrys: _industrys,
|
||||
@ -157,10 +159,19 @@ func (c *Company) Detail(id uint64) (*CompanyDetail, error) {
|
||||
} else if out.ManageCompany == 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 &CompanyDetail{
|
||||
ID: out.GetEncodeID(),
|
||||
TenantID: out.GetEncodeTenantID(),
|
||||
ManageCompany: out.ManageCompany,
|
||||
Industrys: out.GetIndustryAttribute(),
|
||||
Industrys: _industrys,
|
||||
Keywords: out.GetKeywordAttribute(),
|
||||
Area: out.FormatBasic(),
|
||||
}, nil
|
||||
|
@ -16,7 +16,7 @@ func (this *ESParams) Set() {
|
||||
_identitys := make([]string, 0)
|
||||
|
||||
for _, v := range this.Industrys {
|
||||
_identitys = append(_identitys, config.GetIndustryInfo(v, "-", "-"))
|
||||
_identitys = append(_identitys, config.GetIndustryInfo(v, "-", "-").Value)
|
||||
}
|
||||
_ = service.NewESManage(
|
||||
service.WithManageIdentity(this.Identity),
|
||||
|
@ -6,6 +6,7 @@ import (
|
||||
"SciencesServer/app/basic/controller"
|
||||
model2 "SciencesServer/app/common/model"
|
||||
"SciencesServer/app/session"
|
||||
config2 "SciencesServer/config"
|
||||
"SciencesServer/utils"
|
||||
"errors"
|
||||
"time"
|
||||
@ -32,12 +33,13 @@ type (
|
||||
}
|
||||
// ExpertDetail 专家详细信息
|
||||
ExpertDetail struct {
|
||||
ID string `json:"id"`
|
||||
ID string `json:"id"`
|
||||
TenantID string `json:"tenant_id"`
|
||||
*model2.ManageExpert
|
||||
Industrys []string `json:"industrys"`
|
||||
Keywords []string `json:"keywords"`
|
||||
Researchs []string `json:"researchs"`
|
||||
Area string `json:"area"`
|
||||
Industrys []*config.Industry `json:"industrys"`
|
||||
Keywords []string `json:"keywords"`
|
||||
Researchs []string `json:"researchs"`
|
||||
Area string `json:"area"`
|
||||
}
|
||||
)
|
||||
|
||||
@ -72,7 +74,7 @@ func (c *Expert) Instance(tenantID uint64, name string, examineStatus int, page,
|
||||
_industrys := make([]string, 0)
|
||||
|
||||
for _, v := range mManageExpert.GetIndustryAttribute() {
|
||||
_industrys = append(_industrys, config.GetIndustryInfo(v, "-", "/"))
|
||||
_industrys = append(_industrys, config.GetIndustryInfo(v, "-", "/").Value)
|
||||
}
|
||||
// 研究机构,实验室
|
||||
list = append(list, &ExpertInstance{ID: v.GetEncodeID(), Name: v.Name, Industrys: _industrys,
|
||||
@ -97,13 +99,20 @@ func (c *Expert) Detail(id uint64) (*ExpertDetail, error) {
|
||||
} else if out.ManageExpert == 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])
|
||||
|
||||
return &ExpertDetail{
|
||||
ID: out.GetEncodeID(),
|
||||
TenantID: out.GetEncodeTenantID(),
|
||||
ManageExpert: out.ManageExpert,
|
||||
Industrys: out.GetIndustryAttribute(),
|
||||
Industrys: _industrys,
|
||||
Keywords: out.GetKeywordAttribute(),
|
||||
Researchs: out.GetResearchAttribute(),
|
||||
Area: out.FormatBasic(),
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
@ -6,6 +6,7 @@ import (
|
||||
"SciencesServer/app/basic/controller"
|
||||
model2 "SciencesServer/app/common/model"
|
||||
"SciencesServer/app/session"
|
||||
config2 "SciencesServer/config"
|
||||
"errors"
|
||||
)
|
||||
|
||||
@ -33,10 +34,10 @@ type (
|
||||
ID string `json:"id"`
|
||||
TenantID string `json:"tenant_id"`
|
||||
*model2.ManageLaboratory
|
||||
Industrys []string `json:"industrys"`
|
||||
Keywords []string `json:"keywords"`
|
||||
Researchs []string `json:"researchs"`
|
||||
Area string `json:"area"`
|
||||
Industrys []*config.Industry `json:"industrys"`
|
||||
Keywords []string `json:"keywords"`
|
||||
Researchs []string `json:"researchs"`
|
||||
Area string `json:"area"`
|
||||
}
|
||||
)
|
||||
|
||||
@ -186,14 +187,20 @@ func (c *Laboratory) Detail(id uint64) (*LaboratoryDetail, error) {
|
||||
} else if out.ManageLaboratory == 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])
|
||||
|
||||
return &LaboratoryDetail{
|
||||
ID: out.GetEncodeID(),
|
||||
TenantID: out.GetEncodeTenantID(),
|
||||
ManageLaboratory: out.ManageLaboratory,
|
||||
Industrys: out.GetIndustryAttribute(),
|
||||
Industrys: _industrys,
|
||||
Keywords: out.GetKeywordAttribute(),
|
||||
Researchs: out.GetResearchAttribute(),
|
||||
Area: out.FormatBasic(),
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
@ -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