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) {
// @Param order query string false "Sort direction" Enums(asc, desc) default(desc)
// @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} ListPaymentHistoryDTO
// @Failure 400 {object} appresult.AppError
// @Failure 500 {object} appresult.AppError
@@ -80,6 +81,7 @@ func (h *handler) list(c *gin.Context) {
// @Produce json
// @Security BearerAuth
// @Param id path int true "Payment 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} PaymentHistoryDetailDTO
// @Failure 400 {object} appresult.AppError
// @Failure 403 {object} appresult.AppError
@@ -117,6 +119,7 @@ func (h *handler) get(c *gin.Context) {
// @Produce json
// @Security BearerAuth
// @Param id path int true "Order 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 {array} PaymentGatewayDTO
// @Failure 400 {object} appresult.AppError
// @Failure 403 {object} appresult.AppError
@@ -156,6 +159,7 @@ func (h *handler) gateway(c *gin.Context) {
// @Produce json
// @Security BearerAuth
// @Param id path int true "Order 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 {array} PaymentHistoryItemDTO
// @Failure 400 {object} appresult.AppError
// @Failure 403 {object} appresult.AppError
@@ -190,6 +194,7 @@ func (h *handler) orderPayments(c *gin.Context) {
// @Produce json
// @Security BearerAuth
// @Param id path int true "Order 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 {array} PaymentLogDTO
// @Failure 400 {object} appresult.AppError
// @Failure 403 {object} appresult.AppError

View File

@@ -36,6 +36,7 @@ func (h *handler) Register(router *gin.RouterGroup) {
// @Tags payment-settings
// @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 200 {object} PaymentSettingsDTO
// @Failure 500 {object} appresult.AppError
// @Router /payment-settings [get]
@@ -58,6 +59,7 @@ func (h *handler) get(c *gin.Context) {
// @Produce json
// @Security BearerAuth
// @Param body body UpdatePaymentSettingsDTO true "Payment settings 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} PaymentSettingsDTO
// @Failure 400 {object} appresult.AppError
// @Failure 500 {object} appresult.AppError

View File

@@ -46,6 +46,7 @@ func (h *handler) Register(router *gin.RouterGroup) {
// @Produce json
// @Security BearerAuth
// @Param search query string false "Filter by code, name or text"
// @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} ListPaymentTextDTO
// @Failure 500 {object} appresult.AppError
// @Router /payment-texts [get]
@@ -77,6 +78,7 @@ func (h *handler) list(c *gin.Context) {
// @Produce json
// @Security BearerAuth
// @Param code path string true "Text code"
// @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} PaymentTextDTO
// @Failure 404 {object} appresult.AppError
// @Failure 500 {object} appresult.AppError
@@ -119,6 +121,7 @@ func (h *handler) getByCode(c *gin.Context) {
// @Security BearerAuth
// @Param code path string true "Text code"
// @Param body body UpdatePaymentTextDTO true "Payment text 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} PaymentTextDTO
// @Failure 400 {object} appresult.AppError
// @Failure 404 {object} appresult.AppError
@@ -156,6 +159,7 @@ func (h *handler) update(c *gin.Context) {
// @Produce json
// @Security BearerAuth
// @Param code path string true "Text code"
// @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 403 {object} appresult.AppError
// @Failure 404 {object} appresult.AppError

View File

@@ -44,6 +44,7 @@ func (h *handler) Register(router *gin.RouterGroup) {
// @Produce json
// @Security BearerAuth
// @Param id path int true "Visa/master payment order 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} PaymentQuoteDTO
// @Failure 400 {object} appresult.AppError
// @Failure 404 {object} appresult.AppError
@@ -77,6 +78,7 @@ func (h *handler) quote(c *gin.Context) {
// @Security BearerAuth
// @Param id path int true "Visa/master payment order ID"
// @Param body body PayOrderDTO true "Payment 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} PaymentInitResultDTO
// @Failure 400 {object} appresult.AppError
// @Failure 404 {object} appresult.AppError
@@ -117,6 +119,7 @@ func (h *handler) pay(c *gin.Context) {
// @Produce json
// @Security BearerAuth
// @Param id path int true "Visa/master payment order 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} PaymentResultDTO
// @Failure 400 {object} appresult.AppError
// @Failure 404 {object} appresult.AppError
@@ -152,6 +155,7 @@ func (h *handler) status(c *gin.Context) {
// @Tags visa-master-payment-orders
// @Produce json
// @Param paymentId query int true "Payment attempt 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} CallbackResultDTO
// @Router /visa-master-payment-orders/callback [get]
func (h *handler) callback(c *gin.Context) {