feat: live module and jenkins pipeline to harbor deploy
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
package handler
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
service "kra/internal/service/analytics"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
type Analytics struct{ s *service.Service }
|
||||
|
||||
func NewAnalytics(s *service.Service) *Analytics { return &Analytics{s: s} }
|
||||
func (h *Analytics) Dashboard(c *gin.Context) {
|
||||
days, _ := strconv.Atoi(c.DefaultQuery("days", "1"))
|
||||
v, e := h.s.Get(c.Request.Context(), days)
|
||||
if e != nil {
|
||||
businessFail(c, e)
|
||||
return
|
||||
}
|
||||
OKWithData(c, v)
|
||||
}
|
||||
Reference in New Issue
Block a user