feat:完善项目

This commit is contained in:
henry
2021-11-16 11:46:44 +08:00
parent 78128277ff
commit 978918e5aa
14 changed files with 193 additions and 19 deletions

View File

@ -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
}