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

@@ -46,6 +46,7 @@ func (h *handler) Register(router *gin.RouterGroup) {
// @Param status query string false "Filter by status (pending, completed, failed)"
// @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
@@ -74,6 +75,7 @@ func (h *handler) list(c *gin.Context) {
// @Produce json
// @Security BearerAuth
// @Param id path int true "Backup 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
@@ -106,6 +108,7 @@ func (h *handler) getByID(c *gin.Context) {
// @Tags backups
// @Produce json
// @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 201 {object} appresult.AppSuccess
// @Failure 500 {object} appresult.AppError
// @Router /backups [post]
@@ -127,6 +130,7 @@ func (h *handler) create(c *gin.Context) {
// @Produce application/sql
// @Security BearerAuth
// @Param id path int true "Backup 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 {file} file
// @Failure 400 {object} appresult.AppError
// @Failure 404 {object} appresult.AppError
@@ -168,6 +172,7 @@ func (h *handler) download(c *gin.Context) {
// @Produce json
// @Security BearerAuth
// @Param id path int true "Backup 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