diff --git a/api/openapitools.json b/api/openapitools.json deleted file mode 100644 index 15fef60..0000000 --- a/api/openapitools.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json", - "spaces": 2, - "generator-cli": { - "version": "7.1.0" - } -} diff --git a/api/swagger.json b/api/swagger.json deleted file mode 100644 index 8a7fc24..0000000 --- a/api/swagger.json +++ /dev/null @@ -1,745 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "description": "This is a sample server celler server.", - "title": "Swagger Example API", - "contact": {}, - "version": "1.0" - }, - "paths": { - "/libraries": { - "get": { - "security": [ - { - "BearerToken": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Libraries" - ], - "summary": "获取资料库列表", - "parameters": [ - { - "type": "integer", - "description": "页码", - "name": "Page", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/pkg.ResponsePaginated" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/pkg.ResponseError" - } - }, - "403": { - "description": "Forbidden", - "schema": { - "$ref": "#/definitions/pkg.ResponseError" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/pkg.ResponseError" - } - } - } - }, - "post": { - "security": [ - { - "BearerToken": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Libraries" - ], - "summary": "新建资料库", - "parameters": [ - { - "type": "string", - "description": "资料库名称", - "name": "Name", - "in": "query", - "required": true - } - ], - "responses": { - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/model.Library" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/pkg.ResponseError" - } - }, - "403": { - "description": "Forbidden", - "schema": { - "$ref": "#/definitions/pkg.ResponseError" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/pkg.ResponseError" - } - } - } - } - }, - "/library/{LibraryId}": { - "get": { - "security": [ - { - "BearerToken": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Libraries" - ], - "summary": "显示资料库", - "parameters": [ - { - "type": "integer", - "description": "资料库 ID", - "name": "LibraryId", - "in": "path", - "required": true - } - ], - "responses": { - "204": { - "description": "No Content" - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/pkg.ResponseError" - } - }, - "403": { - "description": "Forbidden", - "schema": { - "$ref": "#/definitions/pkg.ResponseError" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/pkg.ResponseError" - } - } - } - }, - "delete": { - "security": [ - { - "BearerToken": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Libraries" - ], - "summary": "删除资料库", - "parameters": [ - { - "type": "integer", - "description": "资料库 ID", - "name": "LibraryId", - "in": "path", - "required": true - } - ], - "responses": { - "204": { - "description": "No Content" - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/pkg.ResponseError" - } - }, - "403": { - "description": "Forbidden", - "schema": { - "$ref": "#/definitions/pkg.ResponseError" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/pkg.ResponseError" - } - } - } - } - }, - "/library/{LibraryId}/document/{DocumentId}": { - "get": { - "security": [ - { - "BearerToken": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Documents" - ], - "summary": "显示文档", - "parameters": [ - { - "type": "string", - "description": "资料库 ID", - "name": "LibraryId", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "文档 ID", - "name": "DocumentId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/model.Document" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/pkg.ResponseError" - } - }, - "403": { - "description": "Forbidden", - "schema": { - "$ref": "#/definitions/pkg.ResponseError" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/pkg.ResponseError" - } - } - } - }, - "put": { - "security": [ - { - "BearerToken": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Documents" - ], - "summary": "更新文档", - "parameters": [ - { - "type": "string", - "description": "资料库 ID", - "name": "LibraryId", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "文档 ID", - "name": "DocumentId", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "标题", - "name": "Title", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "内容", - "name": "Content", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/model.Document" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/pkg.ResponseError" - } - }, - "403": { - "description": "Forbidden", - "schema": { - "$ref": "#/definitions/pkg.ResponseError" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/pkg.ResponseError" - } - } - } - }, - "delete": { - "security": [ - { - "BearerToken": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Documents" - ], - "summary": "删除文档", - "parameters": [ - { - "type": "integer", - "description": "文档 ID", - "name": "DocumentId", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "资料库 ID", - "name": "LibraryId", - "in": "path", - "required": true - } - ], - "responses": { - "204": { - "description": "No Content" - } - } - } - }, - "/library/{LibraryId}/document/{DocumentId}/chunks": { - "get": { - "security": [ - { - "BearerToken": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Documents" - ], - "summary": "查看处理状态", - "parameters": [ - { - "type": "string", - "description": "资料库 ID", - "name": "LibraryId", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "文档 ID", - "name": "DocumentId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/controller.chunkStatusResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/pkg.ResponseError" - } - }, - "403": { - "description": "Forbidden", - "schema": { - "$ref": "#/definitions/pkg.ResponseError" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/pkg.ResponseError" - } - } - } - } - }, - "/library/{LibraryId}/documents": { - "get": { - "security": [ - { - "BearerToken": [] - } - ], - "description": "获取当前账号的文档列表", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Documents" - ], - "summary": "获取文档列表", - "parameters": [ - { - "type": "integer", - "description": "页码", - "name": "Page", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "资料库 ID", - "name": "LibraryId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/pkg.ResponsePaginated" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/pkg.ResponseError" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/pkg.ResponseError" - } - } - } - }, - "post": { - "security": [ - { - "BearerToken": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Documents" - ], - "summary": "新建文档", - "parameters": [ - { - "type": "string", - "description": "标题", - "name": "LibraryId", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "标题", - "name": "Title", - "in": "formData", - "required": true - }, - { - "type": "string", - "description": "描述", - "name": "Description", - "in": "formData" - }, - { - "type": "string", - "description": "文档内容", - "name": "Content", - "in": "formData" - } - ], - "responses": { - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/model.Document" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/pkg.ResponseError" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/pkg.ResponseError" - } - } - } - } - }, - "/library/{LibraryId}/query": { - "get": { - "security": [ - { - "BearerToken": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Documents" - ], - "summary": "Server Sent Events 查询文档", - "parameters": [ - { - "type": "string", - "description": "资料库 ID", - "name": "LibraryId", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "问题", - "name": "Question", - "in": "query", - "required": true - } - ], - "responses": { - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/pkg.ResponseError" - } - }, - "403": { - "description": "Forbidden", - "schema": { - "$ref": "#/definitions/pkg.ResponseError" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/pkg.ResponseError" - } - } - } - } - } - }, - "definitions": { - "controller.chunkStatusResponse": { - "type": "object", - "properties": { - "chunked": { - "type": "integer" - }, - "completed": { - "type": "boolean" - }, - "total": { - "type": "integer" - } - } - }, - "gorm.DeletedAt": { - "type": "object", - "properties": { - "time": { - "type": "string" - }, - "valid": { - "description": "Valid is true if Time is not NULL", - "type": "boolean" - } - } - }, - "model.Document": { - "type": "object", - "properties": { - "chunked": { - "type": "boolean" - }, - "content": { - "type": "string" - }, - "createdAt": { - "type": "string" - }, - "deletedAt": { - "$ref": "#/definitions/gorm.DeletedAt" - }, - "description": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "libraryId": { - "type": "integer" - }, - "title": { - "type": "string" - }, - "updatedAt": { - "type": "string" - }, - "userId": { - "type": "integer" - } - } - }, - "model.Library": { - "type": "object", - "properties": { - "createdAt": { - "type": "string" - }, - "deletedAt": { - "$ref": "#/definitions/gorm.DeletedAt" - }, - "id": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "password": { - "type": "string" - }, - "updatedAt": { - "type": "string" - }, - "userId": { - "type": "integer" - } - } - }, - "pkg.ResponseError": { - "type": "object", - "properties": { - "message": { - "type": "string" - } - } - }, - "pkg.ResponsePaginated": { - "type": "object", - "properties": { - "Data": {}, - "Limit": { - "type": "integer" - }, - "Page": { - "type": "integer" - }, - "Total": { - "type": "integer" - } - } - } - }, - "securityDefinitions": { - "BearerToken": { - "type": "apiKey", - "name": "Authorization", - "in": "header" - } - } -} \ No newline at end of file diff --git a/package.json b/package.json index 8cbdead..15f47a9 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "event-source-polyfill": "^1.0.31", "google-protobuf": "^3.21.2", "grpc-web": "^1.5.0", + "keycloak-js": "^24.0.4", "mammoth": "^1.6.0", "md-editor-v3": "^4.8.3", "pdfjs-dist": "^4.0.269", diff --git a/src/components/HelloWorld.vue b/src/components/HelloWorld.vue index 58bac73..5727ac3 100644 --- a/src/components/HelloWorld.vue +++ b/src/components/HelloWorld.vue @@ -5,60 +5,5 @@ diff --git a/src/layouts/default/AppBar.vue b/src/layouts/default/AppBar.vue index 448c093..e13cc46 100644 --- a/src/layouts/default/AppBar.vue +++ b/src/layouts/default/AppBar.vue @@ -2,25 +2,50 @@ - + + + + + + - + + + + + - - - - - - {{ docu.Title }} - - - - - diff --git a/src/views/libraries/Create.vue b/src/views/libraries/Create.vue new file mode 100644 index 0000000..4ff5e5a --- /dev/null +++ b/src/views/libraries/Create.vue @@ -0,0 +1,44 @@ + + + 创建资料库 + + + + + + + + 新建 + + + + + diff --git a/src/views/libraries/List.vue b/src/views/libraries/List.vue index 609a39c..2209e3a 100644 --- a/src/views/libraries/List.vue +++ b/src/views/libraries/List.vue @@ -1,125 +1,30 @@ - - - 资料库 - - 全选 - - 删除所选 - - - - - - 确认删除 - 取消 - - - - - - 新建资料库 - - - - - - - 取消 - - 新建 - - - - - - - - - - - - - - - - - - mdi-check - - - - - {{ item.Name }} - - - - - - - - - - - - - - - - + 资料库 - diff --git a/tsconfig.json b/tsconfig.json index 1fc1d2a..969f0df 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,7 +4,6 @@ "target": "esnext", "useDefineForClassFields": true, "allowSyntheticDefaultImports": true, - "allowImportingTsExtensions": true, "composite": true, "module": "esnext", "moduleResolution": "node", diff --git a/yarn.lock b/yarn.lock index da8b2c2..7524810 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1855,6 +1855,11 @@ isexe@^2.0.0: resolved "https://registry.npmmirror.com/isexe/-/isexe-2.0.0.tgz" integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== +js-sha256@^0.11.0: + version "0.11.0" + resolved "https://mirrors.cloud.tencent.com/npm/js-sha256/-/js-sha256-0.11.0.tgz#256a921d9292f7fe98905face82e367abaca9576" + integrity sha512-6xNlKayMZvds9h1Y1VWc0fQHQ82BxTXizWPEtEeGvmOUYpBRy4gbWroHLpzowe6xiQhHpelCQiE7HEdznyBL9Q== + js-yaml@^4.1.0: version "4.1.0" resolved "https://registry.npmmirror.com/js-yaml/-/js-yaml-4.1.0.tgz" @@ -1887,6 +1892,19 @@ jszip@^3.7.1: readable-stream "~2.3.6" setimmediate "^1.0.5" +jwt-decode@^4.0.0: + version "4.0.0" + resolved "https://mirrors.cloud.tencent.com/npm/jwt-decode/-/jwt-decode-4.0.0.tgz#2270352425fd413785b2faf11f6e755c5151bd4b" + integrity sha512-+KJGIyHgkGuIq3IEBNftfhW/LfWhXUIY6OmyVWjliu5KH1y0fw7VQ8YndE2O4qZdMSd9SqbnC8GOcZEy0Om7sA== + +keycloak-js@^24.0.4: + version "24.0.4" + resolved "https://mirrors.cloud.tencent.com/npm/keycloak-js/-/keycloak-js-24.0.4.tgz#bfd78af853f0a45bb2f0b4dd24c135aef22cbab6" + integrity sha512-eLjG7CzGGgAXh78M76QUJy1R8+QDQvIJXJf6T3bq9VJZ6RXBGZXMsXvII66b83ueYDFa1gi2JojmA31Z23HO0g== + dependencies: + js-sha256 "^0.11.0" + jwt-decode "^4.0.0" + keyv@^4.5.3: version "4.5.4" resolved "https://registry.npmmirror.com/keyv/-/keyv-4.5.4.tgz"
资料库