upda/server/api_handler_info.go

25 lines
488 B
Go
Raw Permalink Normal View History

2023-12-21 16:04:04 +00:00
package server
import (
"git.myservermanager.com/varakh/upda/api"
"git.myservermanager.com/varakh/upda/commons"
2023-12-21 16:04:04 +00:00
"github.com/gin-gonic/gin"
"net/http"
)
type infoHandler struct {
appConfig appConfig
}
func newInfoHandler(a *appConfig) *infoHandler {
return &infoHandler{appConfig: *a}
}
2024-01-24 23:08:26 +00:00
func (h *infoHandler) show(c *gin.Context) {
2023-12-21 16:04:04 +00:00
c.JSON(http.StatusOK, api.DataResponse{Data: gin.H{
"name": name,
"Version": commons.Version,
2023-12-21 16:04:04 +00:00
"timeZone": h.appConfig.timeZone,
}})
}