From 2853bed2ec59ea93234edddb3acbb484622c6e75 Mon Sep 17 00:00:00 2001 From: GuwandykA Date: Tue, 18 Aug 2026 14:29:52 +0500 Subject: [PATCH] Regenerate Swagger for public file GET and user branches. Co-authored-by: Cursor --- docs/docs.go | 29 ++++++++++++++++-------- docs/swagger.json | 29 ++++++++++++++++-------- docs/swagger.yaml | 58 +++++++++++++++++++++++++++-------------------- 3 files changed, 71 insertions(+), 45 deletions(-) diff --git a/docs/docs.go b/docs/docs.go index 0d07cd9..5d8a850 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -1597,14 +1597,9 @@ const docTemplate = `{ } } }, - "/file/{id}": { + "/file/{file_name}": { "get": { - "security": [ - { - "BearerAuth": [] - } - ], - "description": "download file", + "description": "download file by object name (public; not under /api/admin)", "produces": [ "application/octet-stream" ], @@ -1615,7 +1610,7 @@ const docTemplate = `{ { "type": "string", "description": "object name", - "name": "id", + "name": "file_name", "in": "path", "required": true } @@ -1627,6 +1622,18 @@ const docTemplate = `{ "type": "file" } }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/appresult.AppError" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/appresult.AppError" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -1634,7 +1641,9 @@ const docTemplate = `{ } } } - }, + } + }, + "/file/{id}": { "delete": { "security": [ { @@ -5557,7 +5566,7 @@ const docTemplate = `{ "BearerAuth": [] } ], - "description": "Returns a single user", + "description": "Returns a single user with assigned branches", "produces": [ "application/json" ], diff --git a/docs/swagger.json b/docs/swagger.json index 2427031..e52d084 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -1591,14 +1591,9 @@ } } }, - "/file/{id}": { + "/file/{file_name}": { "get": { - "security": [ - { - "BearerAuth": [] - } - ], - "description": "download file", + "description": "download file by object name (public; not under /api/admin)", "produces": [ "application/octet-stream" ], @@ -1609,7 +1604,7 @@ { "type": "string", "description": "object name", - "name": "id", + "name": "file_name", "in": "path", "required": true } @@ -1621,6 +1616,18 @@ "type": "file" } }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/appresult.AppError" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/appresult.AppError" + } + }, "500": { "description": "Internal Server Error", "schema": { @@ -1628,7 +1635,9 @@ } } } - }, + } + }, + "/file/{id}": { "delete": { "security": [ { @@ -5551,7 +5560,7 @@ "BearerAuth": [] } ], - "description": "Returns a single user", + "description": "Returns a single user with assigned branches", "produces": [ "application/json" ], diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 54ec512..6253a1a 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -2274,6 +2274,36 @@ paths: - BearerAuth: [] tags: - file-upload + /file/{file_name}: + get: + description: download file by object name (public; not under /api/admin) + parameters: + - description: object name + in: path + name: file_name + required: true + type: string + produces: + - application/octet-stream + responses: + "200": + description: OK + schema: + type: file + "400": + description: Bad Request + schema: + $ref: '#/definitions/appresult.AppError' + "404": + description: Not Found + schema: + $ref: '#/definitions/appresult.AppError' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/appresult.AppError' + tags: + - file-upload /file/{id}: delete: description: remove file @@ -2298,29 +2328,6 @@ paths: - BearerAuth: [] tags: - file-upload - get: - description: download file - parameters: - - description: object name - in: path - name: id - required: true - type: string - produces: - - application/octet-stream - responses: - "200": - description: OK - schema: - type: file - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/appresult.AppError' - security: - - BearerAuth: [] - tags: - - file-upload /forgot-password: post: consumes: @@ -4758,7 +4765,7 @@ paths: tags: - user get: - description: Returns a single user + description: Returns a single user with assigned branches parameters: - description: User ID in: path @@ -4831,7 +4838,8 @@ paths: - user /users/clients: get: - description: Returns paginated client users (role user, not assigned to any branch) + description: Returns paginated client users (role user, not assigned to any + branch) parameters: - description: Search by username, first name, or last name in: query