initial commit

This commit is contained in:
m.zare
2026-04-10 18:25:21 +03:30
commit 77ca6c34a3
263 changed files with 34470 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
package platform
import (
"github.com/gin-gonic/gin"
"base/internal/dto"
)
// ListProfileRoles returns the list of profile roles for setup-profile.
// @Summary list profile roles
// @Description returns all profile roles (id, title) for platform - use role_id when calling setup-profile
// @Tags Platform
// @Produce json
// @Success 200 {array} dto.ProfileRole "list of profile roles"
// @Failure 500 {object} dto.ErrorResponse "internal server error"
// @Router /api/v1/platform/profile-roles [get]
func (ctl *Controller) ListProfileRoles(c *gin.Context) {
lg := ctl.logger.With().
Str("module", "platform").
Str("router", "platform").
Str("handler", "ListProfileRoles").
Logger()
roles, err := ctl.profileRoleService.List(c.Request.Context())
if err != nil {
lg.Error().Err(err).Msg("failed to list profile roles")
r := dto.InternalServerError()
c.JSON(r.Status, r)
return
}
r := dto.OK().WithData(roles)
c.JSON(r.Status, r)
}