推进活动系统最小成品闭环与游客体验
This commit is contained in:
25
backend/internal/httpapi/handlers/ops_summary_handler.go
Normal file
25
backend/internal/httpapi/handlers/ops_summary_handler.go
Normal file
@@ -0,0 +1,25 @@
|
||||
package handlers
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"cmr-backend/internal/httpx"
|
||||
"cmr-backend/internal/service"
|
||||
)
|
||||
|
||||
type OpsSummaryHandler struct {
|
||||
service *service.OpsSummaryService
|
||||
}
|
||||
|
||||
func NewOpsSummaryHandler(service *service.OpsSummaryService) *OpsSummaryHandler {
|
||||
return &OpsSummaryHandler{service: service}
|
||||
}
|
||||
|
||||
func (h *OpsSummaryHandler) GetOverview(w http.ResponseWriter, r *http.Request) {
|
||||
result, err := h.service.GetOverview(r.Context())
|
||||
if err != nil {
|
||||
httpx.WriteError(w, err)
|
||||
return
|
||||
}
|
||||
httpx.WriteJSON(w, http.StatusOK, map[string]any{"data": result})
|
||||
}
|
||||
Reference in New Issue
Block a user