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

@@ -52,6 +52,7 @@ func (h *handler) Register(router *gin.RouterGroup) {
// @Security BearerAuth
// @Param from query string false "Start date YYYY-MM-DD (inclusive)" default(Jan 1 of current year)
// @Param to query string false "End date YYYY-MM-DD (inclusive)" default(today)
// @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
@@ -86,6 +87,7 @@ func (h *handler) finance(c *gin.Context) {
// @Security BearerAuth
// @Param from query string false "Start date YYYY-MM-DD (inclusive)" default(Jan 1 of current year)
// @Param to query string false "End date YYYY-MM-DD (inclusive)" default(today)
// @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
@@ -111,6 +113,7 @@ func (h *handler) backlog(c *gin.Context) {
// @Security BearerAuth
// @Param from query string false "Start date YYYY-MM-DD (inclusive)" default(Jan 1 of current year)
// @Param to query string false "End date YYYY-MM-DD (inclusive)" default(today)
// @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
@@ -136,6 +139,7 @@ func (h *handler) branches(c *gin.Context) {
// @Security BearerAuth
// @Param from query string false "Start date YYYY-MM-DD (inclusive)" default(Jan 1 of current year)
// @Param to query string false "End date YYYY-MM-DD (inclusive)" default(today)
// @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
@@ -161,6 +165,7 @@ func (h *handler) products(c *gin.Context) {
// @Security BearerAuth
// @Param from query string false "Start date YYYY-MM-DD (inclusive)" default(Jan 1 of current year)
// @Param to query string false "End date YYYY-MM-DD (inclusive)" default(today)
// @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
@@ -187,6 +192,7 @@ func (h *handler) customers(c *gin.Context) {
// @Param from query string false "Start date YYYY-MM-DD (inclusive)" default(Jan 1 of current year)
// @Param to query string false "End date YYYY-MM-DD (inclusive)" default(today)
// @Param operator_limit query int false "Number of operators to return" 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