refactor: remove company management APIs
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
package controllers
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
|
||||
"git.beifan.cn/trace-system/backend-go/services"
|
||||
)
|
||||
|
||||
// DashboardController 控制台统计控制器
|
||||
type DashboardController struct {
|
||||
dashboardService services.DashboardService
|
||||
}
|
||||
|
||||
// NewDashboardController 创建控制台统计控制器实例
|
||||
func NewDashboardController() *DashboardController {
|
||||
return &DashboardController{
|
||||
dashboardService: services.DashboardService{},
|
||||
}
|
||||
}
|
||||
|
||||
// Stats 获取控制台统计
|
||||
func (c *DashboardController) Stats(ctx *gin.Context) {
|
||||
stats, err := c.dashboardService.GetStats()
|
||||
if err != nil {
|
||||
ErrorResponse(ctx, http.StatusInternalServerError, err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
SuccessResponse(ctx, "获取统计数据成功", stats)
|
||||
}
|
||||
Reference in New Issue
Block a user