21 lines
389 B
Go
21 lines
389 B
Go
package api
|
|
|
|
import (
|
|
"github.com/gin-gonic/gin"
|
|
"level_go/internal/service"
|
|
"net/http"
|
|
)
|
|
|
|
type CommonHandler struct {
|
|
Service *service.CommonService
|
|
}
|
|
|
|
func (h *CommonHandler) GetTradeCalendar(c *gin.Context) {
|
|
resp, err := h.Service.GetTradeCalendar()
|
|
if err != nil {
|
|
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
|
|
return
|
|
}
|
|
c.JSON(http.StatusOK, resp)
|
|
}
|