37 lines
946 B
Go
37 lines
946 B
Go
package platform
|
|
|
|
import (
|
|
"github.com/gin-gonic/gin"
|
|
|
|
"base/internal/dto"
|
|
)
|
|
|
|
|
|
// GetLanding returns the landing page data.
|
|
// @Summary get landing page
|
|
// @Description returns landing page with categories, specialist roles, assets by category, specialists, and blogs
|
|
// @Tags Landing
|
|
// @Accept json
|
|
// @Produce json
|
|
// @Success 200 {object} dto.Landing "landing page data"
|
|
// @Failure 500 {object} dto.ErrorResponse "internal server error"
|
|
// @Router /api/v1/landing [get]
|
|
func (ctl *Controller) GetLanding(c *gin.Context) {
|
|
lg := ctl.logger.With().
|
|
Str("module", "platform").
|
|
Str("router", "landing").
|
|
Str("handler", "GetLanding").
|
|
Logger()
|
|
|
|
resp, err := ctl.landingService.GetLanding(c.Request.Context())
|
|
if err != nil {
|
|
lg.Error().Err(err).Msg("failed to get landing page")
|
|
r := dto.InternalServerError()
|
|
c.JSON(r.Status, r)
|
|
return
|
|
}
|
|
|
|
r := dto.OK().WithData(resp.Data).WithMessage(resp.Message)
|
|
c.JSON(r.Status, r)
|
|
}
|