Add mini-slider API and wire the homepage projects carousel.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-18 15:11:15 +05:00
parent 86b51059f3
commit b33fea4cd7
19 changed files with 563 additions and 28 deletions

View File

@@ -17,6 +17,7 @@ const (
getOneSubCategoryURL = "/sub-categories/:id"
getBannersURL = "/banners"
getOneBannerURL = "/banners/:id"
getMiniSlidersURL = "/mini-sliders"
getStaticsURL = "/static"
getOneStaticURL = "/static/:id"
getCurrencyURL = "/currency"
@@ -42,6 +43,7 @@ func (h *handler) Register(router *gin.RouterGroup) {
router.GET(getOneSubCategoryURL, h.GetSubCategory)
router.GET(getBannersURL, h.GetBanners)
router.GET(getOneBannerURL, h.GetOneBanner)
router.GET(getMiniSlidersURL, h.GetMiniSliders)
router.GET(getStaticsURL, h.GetStatics)
router.GET(getOneStaticURL, h.GetOneStatic)
router.GET(getCurrencyURL, h.GetCurrency)
@@ -163,6 +165,26 @@ func (h *handler) GetBanners(c *gin.Context) {
c.JSON(http.StatusOK, successResult)
}
// GetMiniSliders godoc
// @Description homepage mini sliders (image + overlay title)
// @Tags mini-sliders
// @Accept json
// @Produce json
// @Param lang query string false "tm|ru|en (default tm)"
// @Success 200 {object} DataMiniSliderDTO
// @Router /client/users/mini-sliders [get]
func (h *handler) GetMiniSliders(c *gin.Context) {
result, err := h.repository.GetMiniSliders(c.Request.Context(), queryLang(c))
if err != nil {
c.JSON(http.StatusInternalServerError, appresult.ErrInternalServer)
return
}
successResult := appresult.Success
successResult.Data = result
c.JSON(http.StatusOK, successResult)
}
// GetOneBanner godoc
// @Description banner by id
// @Tags banners