From bb8c6763c2c9bfccd210d998e17eaa66aa20e593 Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期二, 08 八月 2023 10:49:29 +0800 Subject: [PATCH] 增加文件下载和预览接口,并统计下载和预览次数 --- docs/docs.go | 186 +++++++++++++++++----------------------------- 1 files changed, 68 insertions(+), 118 deletions(-) diff --git a/docs/docs.go b/docs/docs.go index 54c4026..7b8fec7 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -2727,76 +2727,61 @@ } } }, - "/api/file/list": { - "get": { + "/api/file/download": { + "post": { "produces": [ "application/json" ], "tags": [ "闄勪欢绠$悊" ], - "summary": "鑾峰彇闄勪欢鍒楄〃", + "summary": "闄勪欢涓嬭浇", "parameters": [ { - "type": "string", - "name": "keyword", - "in": "query" - }, - { - "enum": [ - "" - ], - "type": "string", - "x-enum-varnames": [ - "FileKeywordCustomerName" - ], - "name": "keywordType", - "in": "query" - }, - { - "type": "integer", - "description": "椤电爜", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "description": "姣忛〉澶у皬", - "name": "pageSize", - "in": "query" - }, - { - "enum": [ - "" - ], - "type": "string", - "x-enum-varnames": [ - "FileQueryClassExpireLessThen60Days" - ], - "name": "queryClass", - "in": "query" + "description": "鍙傛暟", + "name": "object", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.DownloadFile" + } } ], "responses": { "200": { "description": "OK", "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.ListResponse" - }, - { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/model.File" - } - } - } - } - ] + "$ref": "#/definitions/contextx.Response" + } + } + } + } + }, + "/api/file/preview": { + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "闄勪欢绠$悊" + ], + "summary": "闄勪欢棰勮", + "parameters": [ + { + "description": "鍙傛暟", + "name": "object", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.DownloadFile" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/contextx.Response" } } } @@ -9440,24 +9425,6 @@ "FaqQueryClassExpireLessThen60Days" ] }, - "constvar.FileKeywordType": { - "type": "string", - "enum": [ - "" - ], - "x-enum-varnames": [ - "FileKeywordCustomerName" - ] - }, - "constvar.FileQueryClass": { - "type": "string", - "enum": [ - "" - ], - "x-enum-varnames": [ - "FileQueryClassExpireLessThen60Days" - ] - }, "constvar.InvoiceKeywordType": { "type": "string", "enum": [ @@ -10236,50 +10203,6 @@ "type": "integer" }, "name": { - "type": "string" - } - } - }, - "model.File": { - "type": "object", - "properties": { - "bucket": { - "description": "瀵硅薄瀛樺偍bucket", - "type": "string" - }, - "downloadCount": { - "description": "涓嬫娆℃暟", - "type": "integer" - }, - "filePath": { - "description": "鏂囦欢璺緞", - "type": "string" - }, - "fileType": { - "description": "鏂囦欢绫诲瀷", - "type": "string" - }, - "key": { - "description": "瀵硅薄瀛樺偍key", - "type": "string" - }, - "name": { - "type": "string" - }, - "previewCount": { - "description": "棰勮娆℃暟", - "type": "integer" - }, - "size": { - "description": "鏂囦欢澶у皬", - "type": "integer" - }, - "sourceId": { - "description": "鏉ユ簮id", - "type": "integer" - }, - "sourceType": { - "description": "闄勪欢鏉ユ簮", "type": "string" } } @@ -13480,6 +13403,33 @@ } } }, + "request.DownloadFile": { + "type": "object", + "required": [ + "id", + "key", + "sourceId", + "sourceType" + ], + "properties": { + "id": { + "description": "闄勪欢id", + "type": "integer" + }, + "key": { + "description": "闄勪欢瀛樺偍key", + "type": "string" + }, + "sourceId": { + "description": "鏉ユ簮id", + "type": "integer" + }, + "sourceType": { + "description": "闄勪欢鏉ユ簮", + "type": "string" + } + } + }, "request.FollowRecord": { "type": "object", "properties": { -- Gitblit v1.8.0