feat:完善项目
This commit is contained in:
@ -15,8 +15,9 @@ type InstanceHandle func(session *service.Session) *Instance
|
||||
type (
|
||||
// InstanceInfo 列表信息
|
||||
InstanceInfo struct {
|
||||
Workbench []*instanceInfoForWorkbench `json:"workbench"`
|
||||
Notice []*instanceInfoForNotice `json:"notice"`
|
||||
Workbench []*instanceInfoForWorkbench `json:"workbench"`
|
||||
Notice []*instanceInfoForNotice `json:"notice"`
|
||||
Evaluate []*model.ManageSupplierEvaluateInfo `json:"evaluate"`
|
||||
}
|
||||
// instanceInfoForWorkbench 待办事项
|
||||
instanceInfoForWorkbench struct {
|
||||
@ -33,6 +34,9 @@ type (
|
||||
Title string `json:"title"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
}
|
||||
// instanceInfoForEvaluate 好评信息
|
||||
instanceInfoForEvaluate struct {
|
||||
}
|
||||
)
|
||||
|
||||
var defaultDataLimit int = 10
|
||||
@ -97,6 +101,11 @@ func (c *Instance) notice(limit int) ([]*instanceInfoForNotice, error) {
|
||||
return list, nil
|
||||
}
|
||||
|
||||
func (c *Instance) evaluate(limit int) ([]*model.ManageSupplierEvaluateInfo, error) {
|
||||
mManageSupplier := model.NewManageSupplier()
|
||||
return mManageSupplier.Evaluate(model2.ManageSupplierKindForMaterial, limit)
|
||||
}
|
||||
|
||||
// Index 首页信息
|
||||
func (c *Instance) Index() (*InstanceInfo, error) {
|
||||
out := new(InstanceInfo)
|
||||
@ -108,6 +117,9 @@ func (c *Instance) Index() (*InstanceInfo, error) {
|
||||
if out.Notice, err = c.notice(defaultDataLimit); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if out.Evaluate, err = c.evaluate(defaultDataLimit); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,8 @@
|
||||
package dashboard
|
||||
|
||||
import (
|
||||
"ArmedPolice/app/controller/basic"
|
||||
model2 "ArmedPolice/app/common/model"
|
||||
"ArmedPolice/app/model"
|
||||
"ArmedPolice/app/service"
|
||||
)
|
||||
|
||||
@ -9,8 +10,10 @@ type Supplier struct{ *service.Session }
|
||||
|
||||
type SupplierHandle func(session *service.Session) *Supplier
|
||||
|
||||
func (c *Supplier) StaticScore() (*basic.PageDataResponse, error) {
|
||||
return &basic.PageDataResponse{Data: nil, Count: 0}, nil
|
||||
func (c *Supplier) StaticEvaluate() (interface{}, error) {
|
||||
mManageSupplier := model.NewManageSupplier()
|
||||
out, err := mManageSupplier.Evaluate(model2.ManageSupplierKindForMaterial, 10)
|
||||
return out, err
|
||||
}
|
||||
|
||||
func NewSupplier() SupplierHandle {
|
||||
|
Reference in New Issue
Block a user