feat:完善项目信息
This commit is contained in:
@ -12,10 +12,9 @@ import (
|
||||
|
||||
type Index struct {
|
||||
*service.Session
|
||||
local string
|
||||
}
|
||||
|
||||
type IndexHandle func(session *service.Session, local string) *Index
|
||||
type IndexHandle func(session *service.Session) *Index
|
||||
|
||||
type (
|
||||
// InstanceInfo 首页信息
|
||||
@ -152,10 +151,10 @@ func (c *Index) static() (*InstanceStaticInfo, error) {
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// distributionExpert 专家分布
|
||||
func (c *Index) distributionExpert() (map[string]*InstanceDistributionDetailInfo, error) {
|
||||
// DistributionExpert 专家分布
|
||||
func (c *Index) DistributionExpert(province, city string) (map[string]*InstanceDistributionDetailInfo, error) {
|
||||
mManageExpert := model.NewManageExpert()
|
||||
out, err := mManageExpert.Distribution()
|
||||
out, err := mManageExpert.Distribution(province, city)
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@ -163,8 +162,8 @@ func (c *Index) distributionExpert() (map[string]*InstanceDistributionDetailInfo
|
||||
return c.distribution(out), nil
|
||||
}
|
||||
|
||||
// distributionLaboratory 实验室分布
|
||||
func (c *Index) distributionLaboratory() (map[string]*InstanceDistributionDetailInfo, error) {
|
||||
// DistributionLaboratory 实验室分布
|
||||
func (c *Index) DistributionLaboratory(province, city string) (map[string]*InstanceDistributionDetailInfo, error) {
|
||||
mManageLaboratory := model.NewManageLaboratory()
|
||||
out, err := mManageLaboratory.Distribution()
|
||||
|
||||
@ -174,8 +173,8 @@ func (c *Index) distributionLaboratory() (map[string]*InstanceDistributionDetail
|
||||
return c.distribution(out), nil
|
||||
}
|
||||
|
||||
// distributionDemand 需求信息
|
||||
func (c *Index) distributionDemand() (map[string]*InstanceDistributionDetailInfo, error) {
|
||||
// DistributionDemand 需求信息
|
||||
func (c *Index) DistributionDemand(province, city string) (map[string]*InstanceDistributionDetailInfo, error) {
|
||||
mTechnologyDemand := model.NewTechnologyDemand()
|
||||
out, err := mTechnologyDemand.Distribution()
|
||||
|
||||
@ -185,8 +184,8 @@ func (c *Index) distributionDemand() (map[string]*InstanceDistributionDetailInfo
|
||||
return c.distribution(out), nil
|
||||
}
|
||||
|
||||
// distributionPatent 专利信息
|
||||
func (c *Index) distributionPatent() (map[string]*InstanceDistributionDetailInfo, error) {
|
||||
// DistributionPatent 专利信息
|
||||
func (c *Index) DistributionPatent(province, city string) (map[string]*InstanceDistributionDetailInfo, error) {
|
||||
mSysPatent := model.NewSysPatent()
|
||||
out, err := mSysPatent.Distribution()
|
||||
|
||||
@ -196,8 +195,8 @@ func (c *Index) distributionPatent() (map[string]*InstanceDistributionDetailInfo
|
||||
return c.distribution(out), nil
|
||||
}
|
||||
|
||||
// distributionAchievement 技术成果信息
|
||||
func (c *Index) distributionAchievement() (map[string]*InstanceDistributionDetailInfo, error) {
|
||||
// DistributionAchievement 技术成果信息
|
||||
func (c *Index) DistributionAchievement(province, city string) (map[string]*InstanceDistributionDetailInfo, error) {
|
||||
mSysPatent := model.NewSysPatent()
|
||||
out, err := mSysPatent.Distribution()
|
||||
|
||||
@ -218,34 +217,13 @@ func (c *Index) Instance() (*InstanceInfo, error) {
|
||||
if out.InstanceStaticInfo, err = c.static(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// 专家区域分布信息
|
||||
if out.Distribution.Expert, err = c.distributionExpert(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// 实验室区域分布信息
|
||||
if out.Distribution.Laboratory, err = c.distributionLaboratory(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// 需求信息区域分布信息
|
||||
if out.Distribution.Demand, err = c.distributionDemand(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// 专利信息区域分布信息
|
||||
if out.Distribution.Patent, err = c.distributionPatent(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// 成果信息区域分布信息
|
||||
if out.Distribution.Achievement, err = c.distributionAchievement(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func NewIndex() IndexHandle {
|
||||
return func(session *service.Session, local string) *Index {
|
||||
return func(session *service.Session) *Index {
|
||||
return &Index{
|
||||
Session: session,
|
||||
local: local,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user