swagger: document the ?lang= query parameter on every admin endpoint
Some checks failed
CI/CD / Vet, test, build (push) Has been cancelled
CI/CD / Docker image (push) Has been cancelled
CI/CD / Deploy binary to server (push) Has been cancelled

appresult.Localize applies to all /api/admin routes, so each handler's
godoc now declares lang (tm, ru, en, all; default tm) and Swagger UI
offers it as a dropdown.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-24 22:08:32 +05:00
parent 72a5ac52b0
commit f1337706f0
32 changed files with 5534 additions and 0 deletions

View File

@@ -73,6 +73,7 @@ func (h *handler) RegisterPublic(engine *gin.Engine) {
// @Param username query string false "Alias for search"
// @Param page query int false "Page number" default(1)
// @Param limit query int false "Items per page" default(10)
// @Param lang query string false "Language of localized fields; all returns the full {en, ru, tm} objects" Enums(tm, ru, en, all) default(tm)
// @Success 200 {object} appresult.AppSuccess
// @Failure 400 {object} appresult.AppError
// @Failure 500 {object} appresult.AppError
@@ -106,6 +107,7 @@ func (h *handler) list(c *gin.Context) {
// @Param username query string false "Alias for search"
// @Param page query int false "Page number" default(1)
// @Param limit query int false "Items per page" default(10)
// @Param lang query string false "Language of localized fields; all returns the full {en, ru, tm} objects" Enums(tm, ru, en, all) default(tm)
// @Success 200 {object} appresult.AppSuccess
// @Failure 400 {object} appresult.AppError
// @Failure 500 {object} appresult.AppError
@@ -137,6 +139,7 @@ func (h *handler) listClients(c *gin.Context) {
// @Param username query string false "Alias for search"
// @Param page query int false "Page number" default(1)
// @Param limit query int false "Items per page" default(10)
// @Param lang query string false "Language of localized fields; all returns the full {en, ru, tm} objects" Enums(tm, ru, en, all) default(tm)
// @Success 200 {object} appresult.AppSuccess
// @Failure 400 {object} appresult.AppError
// @Failure 500 {object} appresult.AppError
@@ -166,6 +169,7 @@ func (h *handler) listStaff(c *gin.Context) {
// @Produce json
// @Security BearerAuth
// @Param id path int true "User ID"
// @Param lang query string false "Language of localized fields; all returns the full {en, ru, tm} objects" Enums(tm, ru, en, all) default(tm)
// @Success 200 {object} appresult.AppSuccess
// @Failure 400 {object} appresult.AppError
// @Failure 404 {object} appresult.AppError
@@ -203,6 +207,7 @@ func (h *handler) getByID(c *gin.Context) {
// @Produce json
// @Security BearerAuth
// @Param body body CreateUserDTO true "User payload"
// @Param lang query string false "Language of localized fields; all returns the full {en, ru, tm} objects" Enums(tm, ru, en, all) default(tm)
// @Success 201 {object} appresult.AppSuccess
// @Failure 400 {object} appresult.AppError
// @Failure 403 {object} appresult.AppError
@@ -242,6 +247,7 @@ func (h *handler) create(c *gin.Context) {
// @Security BearerAuth
// @Param id path int true "User ID"
// @Param body body UpdateUserDTO true "User payload"
// @Param lang query string false "Language of localized fields; all returns the full {en, ru, tm} objects" Enums(tm, ru, en, all) default(tm)
// @Success 200 {object} appresult.AppSuccess
// @Failure 400 {object} appresult.AppError
// @Failure 403 {object} appresult.AppError
@@ -303,6 +309,7 @@ func (h *handler) update(c *gin.Context) {
// @Security BearerAuth
// @Param id path int true "User ID"
// @Param body body SetUserRoleDTO true "Role"
// @Param lang query string false "Language of localized fields; all returns the full {en, ru, tm} objects" Enums(tm, ru, en, all) default(tm)
// @Success 200 {object} appresult.AppSuccess
// @Failure 400 {object} appresult.AppError
// @Failure 403 {object} appresult.AppError
@@ -364,6 +371,7 @@ func (h *handler) setRole(c *gin.Context) {
// @Produce json
// @Security BearerAuth
// @Param id path int true "User ID"
// @Param lang query string false "Language of localized fields; all returns the full {en, ru, tm} objects" Enums(tm, ru, en, all) default(tm)
// @Success 200 {object} appresult.AppSuccess
// @Failure 400 {object} appresult.AppError
// @Failure 403 {object} appresult.AppError
@@ -547,6 +555,7 @@ func parseListFilter(c *gin.Context) (ListFilter, bool) {
// @Param file formData file true "this is a test file"
//
// @Security BearerAuth
// @Param lang query string false "Language of localized fields; all returns the full {en, ru, tm} objects" Enums(tm, ru, en, all) default(tm)
// @Success 200 {object} appresult.AppSuccess
// @Failure 400 {object} appresult.AppError
// @Failure 500 {object} appresult.AppError
@@ -589,6 +598,7 @@ func (h *handler) fileUpload(c *gin.Context) {
// @Tags file-upload
// @Produce octet-stream
// @Param file_name path string true "object name"
// @Param lang query string false "Language of localized fields; all returns the full {en, ru, tm} objects" Enums(tm, ru, en, all) default(tm)
// @Success 200 {file} binary
// @Failure 400 {object} appresult.AppError
// @Failure 404 {object} appresult.AppError
@@ -631,6 +641,7 @@ func (h *handler) getFile(c *gin.Context) {
// @Produce json
// @Param id path string true "object name"
// @Security BearerAuth
// @Param lang query string false "Language of localized fields; all returns the full {en, ru, tm} objects" Enums(tm, ru, en, all) default(tm)
// @Success 200 {object} appresult.AppSuccess
// @Failure 500 {object} appresult.AppError
// @Router /file/{id} [delete]