feat:完善项目管理,增加技术成果数据
This commit is contained in:
13
app/api/website/controller/activity.go
Normal file
13
app/api/website/controller/activity.go
Normal file
@ -0,0 +1,13 @@
|
||||
package controller
|
||||
|
||||
type Activity struct{}
|
||||
|
||||
type ActivityHandle func() *Activity
|
||||
|
||||
func (c *Activity) Instance(title, page, pageSize int) {
|
||||
|
||||
}
|
||||
|
||||
func NewActivity() ActivityHandle {
|
||||
return nil
|
||||
}
|
@ -1,6 +1,10 @@
|
||||
package controller
|
||||
|
||||
import "SciencesServer/app/service"
|
||||
import (
|
||||
"SciencesServer/app/api/website/model"
|
||||
model2 "SciencesServer/app/common/model"
|
||||
"SciencesServer/app/service"
|
||||
)
|
||||
|
||||
type Index struct {
|
||||
*service.Session
|
||||
@ -9,6 +13,59 @@ type Index struct {
|
||||
|
||||
type IndexHandle func(session *service.Session, local string) *Index
|
||||
|
||||
type (
|
||||
// InstanceInfo 首页信息
|
||||
InstanceInfo struct {
|
||||
*InstanceStaticInfo
|
||||
Distribution map[string]*InstanceDistributionInfo `json:"distribution"`
|
||||
}
|
||||
// InstanceStaticInfo 统计信息
|
||||
InstanceStaticInfo struct {
|
||||
ExpertCount int64 `json:"expert_count"`
|
||||
CompanyCount int64 `json:"company_count"`
|
||||
}
|
||||
// InstanceDistributionInfo 分布信息
|
||||
InstanceDistributionInfo struct {
|
||||
}
|
||||
)
|
||||
|
||||
// static 数量统计
|
||||
func (c *Index) static() (*InstanceStaticInfo, error) {
|
||||
out := new(InstanceStaticInfo)
|
||||
var err error
|
||||
// 专家信息
|
||||
mManageExpert := model.NewManageExpert()
|
||||
|
||||
if err = model2.Count(mManageExpert.ManageExpert, &out.ExpertCount, model2.NewWhere("examine_status", model2.ExamineStatusForAgree)); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// 专利信息
|
||||
|
||||
//成果信息
|
||||
// 公司信息
|
||||
mManageCompany := model.NewManageCompany()
|
||||
|
||||
if err = model2.Count(mManageCompany.ManageCompany, &out.CompanyCount, model2.NewWhere("examine_status", model2.ExamineStatusForAgree)); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *Index) distributionExpert() {
|
||||
|
||||
}
|
||||
|
||||
// Instance 首页信息
|
||||
func (c *Index) Instance() (*InstanceInfo, error) {
|
||||
out := new(InstanceInfo)
|
||||
var err error
|
||||
|
||||
if out.InstanceStaticInfo, err = c.static(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func NewIndex() IndexHandle {
|
||||
return func(session *service.Session, local string) *Index {
|
||||
return &Index{
|
||||
|
Reference in New Issue
Block a user