ferry/apis/dashboard/dashboard.go

30 lines
436 B
Go
Raw Normal View History

2020-07-23 00:42:46 +08:00
package dashboard
import (
"ferry/pkg/service"
"ferry/tools/app"
"github.com/gin-gonic/gin"
)
/*
@Author : lanyulei
*/
func InitData(c *gin.Context) {
var (
2021-03-10 23:14:28 +08:00
err error
workOrderCount map[string]int // 工单数量统计
2020-07-23 00:42:46 +08:00
)
2021-03-10 23:14:28 +08:00
workOrderCount, err = service.WorkOrderCount(c)
2020-07-23 00:42:46 +08:00
if err != nil {
app.Error(c, -1, err, "")
return
}
2020-08-01 16:15:40 +08:00
app.OK(c, map[string]interface{}{
2021-03-10 23:14:28 +08:00
"workOrderCount": workOrderCount,
2020-08-01 16:15:40 +08:00
}, "")
2020-07-23 00:42:46 +08:00
}