From bb8c6763c2c9bfccd210d998e17eaa66aa20e593 Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@123.com>
Date: 星期二, 08 八月 2023 10:49:29 +0800
Subject: [PATCH] 增加文件下载和预览接口,并统计下载和预览次数

---
 docs/swagger.yaml |  129 ++++++++++++++++--------------------------
 1 files changed, 49 insertions(+), 80 deletions(-)

diff --git a/docs/swagger.yaml b/docs/swagger.yaml
index f8a7c7f..0a744e3 100644
--- a/docs/swagger.yaml
+++ b/docs/swagger.yaml
@@ -46,18 +46,6 @@
     type: string
     x-enum-varnames:
     - FaqQueryClassExpireLessThen60Days
-  constvar.FileKeywordType:
-    enum:
-    - ""
-    type: string
-    x-enum-varnames:
-    - FileKeywordCustomerName
-  constvar.FileQueryClass:
-    enum:
-    - ""
-    type: string
-    x-enum-varnames:
-    - FileQueryClassExpireLessThen60Days
   constvar.InvoiceKeywordType:
     enum:
     - ""
@@ -599,38 +587,6 @@
       id:
         type: integer
       name:
-        type: string
-    type: object
-  model.File:
-    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
     type: object
   model.FollowRecord:
@@ -2784,6 +2740,26 @@
         items:
           type: integer
         type: array
+    type: object
+  request.DownloadFile:
+    properties:
+      id:
+        description: 闄勪欢id
+        type: integer
+      key:
+        description: 闄勪欢瀛樺偍key
+        type: string
+      sourceId:
+        description: 鏉ユ簮id
+        type: integer
+      sourceType:
+        description: 闄勪欢鏉ユ簮
+        type: string
+    required:
+    - id
+    - key
+    - sourceId
+    - sourceType
     type: object
   request.FollowRecord:
     properties:
@@ -6938,49 +6914,42 @@
       summary: 鍒犻櫎闄勪欢
       tags:
       - 闄勪欢绠$悊
-  /api/file/list:
-    get:
+  /api/file/download:
+    post:
       parameters:
-      - in: query
-        name: keyword
-        type: string
-      - enum:
-        - ""
-        in: query
-        name: keywordType
-        type: string
-        x-enum-varnames:
-        - FileKeywordCustomerName
-      - description: 椤电爜
-        in: query
-        name: page
-        type: integer
-      - description: 姣忛〉澶у皬
-        in: query
-        name: pageSize
-        type: integer
-      - enum:
-        - ""
-        in: query
-        name: queryClass
-        type: string
-        x-enum-varnames:
-        - FileQueryClassExpireLessThen60Days
+      - description: 鍙傛暟
+        in: body
+        name: object
+        required: true
+        schema:
+          $ref: '#/definitions/request.DownloadFile'
       produces:
       - application/json
       responses:
         "200":
           description: OK
           schema:
-            allOf:
-            - $ref: '#/definitions/response.ListResponse'
-            - properties:
-                data:
-                  items:
-                    $ref: '#/definitions/model.File'
-                  type: array
-              type: object
-      summary: 鑾峰彇闄勪欢鍒楄〃
+            $ref: '#/definitions/contextx.Response'
+      summary: 闄勪欢涓嬭浇
+      tags:
+      - 闄勪欢绠$悊
+  /api/file/preview:
+    post:
+      parameters:
+      - description: 鍙傛暟
+        in: body
+        name: object
+        required: true
+        schema:
+          $ref: '#/definitions/request.DownloadFile'
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            $ref: '#/definitions/contextx.Response'
+      summary: 闄勪欢棰勮
       tags:
       - 闄勪欢绠$悊
   /api/followRecord/add:

--
Gitblit v1.8.0