{ "components": { "examples": {}, "headers": {}, "parameters": {}, "requestBodies": {}, "responses": {}, "schemas": { "StorageFolder": { "properties": { "pathname": { "type": "string" }, "name": { "type": "string" }, "createdAt": { "anyOf": [ { "type": "string" }, { "type": "string", "format": "date-time" } ] }, "createdBy": { "anyOf": [ { "type": "string" }, { "type": "string", "format": "date-time" } ] } }, "required": [ "pathname", "name", "createdAt", "createdBy" ], "type": "object", "additionalProperties": false }, "StorageFile": { "properties": { "pathname": { "type": "string" }, "fileName": { "type": "string" }, "fileSize": { "type": "number", "format": "double" }, "fileType": { "type": "string" }, "title": { "type": "string" }, "description": { "type": "string" }, "category": { "items": { "type": "string" }, "type": "array" }, "keyword": { "items": { "type": "string" }, "type": "array" }, "path": { "type": "string" }, "upload": { "type": "boolean" }, "updatedAt": { "anyOf": [ { "type": "string" }, { "type": "string", "format": "date-time" } ] }, "updatedBy": { "type": "string" }, "createdAt": { "anyOf": [ { "type": "string" }, { "type": "string", "format": "date-time" } ] }, "createdBy": { "type": "string" } }, "required": [ "pathname", "fileName", "fileSize", "fileType", "title", "description", "category", "keyword", "path", "upload", "updatedAt", "updatedBy", "createdAt", "createdBy" ], "type": "object", "additionalProperties": false }, "Search": { "properties": { "AND": { "items": { "properties": { "value": { "type": "string" }, "field": { "type": "string" } }, "required": [ "value", "field" ], "type": "object" }, "type": "array" }, "OR": { "items": { "properties": { "value": { "type": "string" }, "field": { "type": "string" } }, "required": [ "value", "field" ], "type": "object" }, "type": "array" } }, "type": "object", "additionalProperties": false }, "ListRequestBody": { "properties": { "operation": { "type": "string", "enum": [ "folder", "file" ] }, "path": { "items": { "type": "string" }, "type": "array" } }, "required": [ "operation", "path" ], "type": "object", "additionalProperties": false }, "CreateFolderBody": { "properties": { "path": { "items": { "type": "string" }, "type": "array" }, "name": { "type": "string" } }, "required": [ "path", "name" ], "type": "object", "additionalProperties": false }, "PutFolderBody": { "properties": { "from": { "properties": { "name": { "type": "string" }, "path": { "items": { "type": "string" }, "type": "array" } }, "required": [ "name", "path" ], "type": "object" }, "to": { "properties": { "name": { "type": "string" }, "path": { "items": { "type": "string" }, "type": "array" } }, "required": [ "name", "path" ], "type": "object" } }, "required": [ "from", "to" ], "type": "object", "additionalProperties": false }, "DeleteFolderBody": { "properties": { "path": { "items": { "type": "string" }, "type": "array" } }, "required": [ "path" ], "type": "object", "additionalProperties": false }, "CreateFileBody": { "properties": { "path": { "items": { "type": "string" }, "type": "array" }, "file": { "type": "string" }, "title": { "type": "string" }, "description": { "type": "string" }, "category": { "items": { "type": "string" }, "type": "array" }, "keyword": { "items": { "type": "string" }, "type": "array" } }, "required": [ "path", "file" ], "type": "object", "additionalProperties": false } }, "securitySchemes": { "bearerAuth": { "type": "apiKey", "name": "Authorization", "description": "Keycloak Bearer Token", "in": "header" } } }, "info": { "title": "Enterprise Document Management(EDM) - API", "version": "0.0.2", "description": "Open API Specfication for Enterprise Document Management ", "license": { "name": "by Frappet", "url": "https://frappet.com" } }, "openapi": "3.0.0", "paths": { "/cabinet": { "get": { "operationId": "ListCabinet", "responses": { "200": { "description": "สำเร็จ", "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/StorageFolder" }, "type": "array" }, "examples": { "Example 1": { "value": [ { "path": "ตู้เอกสาร 1/", "name": "ตู้เอกสาร 1", "createdAt": "2021-07-20T12:33:13.018Z", "createdBy": "admin" }, { "path": "ตู้เอกสาร 2/", "name": "ตู้เอกสาร 2", "createdAt": "2022-01-23T16:05:02.114Z", "createdBy": "admin" } ] } } } } }, "500": { "description": "เกิดข้อผิดพลาด ไม่สามารถแสดงรายการตู้เอกสารได้ กรุณาลองใหม่ในภายหลัง" } }, "tags": [ "ตู้เอกสาร" ], "security": [ { "bearerAuth": [] } ], "parameters": [] }, "post": { "operationId": "CreateCabinet", "responses": { "201": { "description": "สำเร็จ" }, "500": { "description": "เกิดข้อผิดพลาดกับระบบจัดการไฟล์" } }, "tags": [ "ตู้เอกสาร" ], "security": [ { "bearerAuth": [ "admin", "management-role" ] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "properties": { "name": { "type": "string", "example": "ตู้เอกสาร 1" } }, "required": [ "name" ], "type": "object" } } } } } }, "/cabinet/{cabinetName}": { "put": { "operationId": "EditCabinet", "responses": { "204": { "description": "สำเร็จ" }, "500": { "description": "เกิดข้อผิดพลาดไม่สามารถย้ายไฟล์ได้" } }, "tags": [ "ตู้เอกสาร" ], "security": [ { "bearerAuth": [ "admin", "management-role" ] } ], "parameters": [ { "in": "path", "name": "cabinetName", "required": true, "schema": { "type": "string" }, "example": "ตู้เอกสาร 1" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "properties": { "name": { "type": "string", "example": "ตู้เอกสารใหม่" } }, "required": [ "name" ], "type": "object" } } } } }, "delete": { "operationId": "DeleteCabinet", "responses": { "204": { "description": "สำเร็จ" }, "500": { "description": "เกิดข้อผิดพลาด ไม่สามารถลบไฟล์ได้" } }, "tags": [ "ตู้เอกสาร" ], "security": [ { "bearerAuth": [ "admin", "management-role" ] } ], "parameters": [ { "in": "path", "name": "cabinetName", "required": true, "schema": { "type": "string" }, "example": "ตู้เอกสาร 1" } ] } }, "/cabinet/{cabinetName}/size": { "get": { "operationId": "Calc", "responses": { "200": { "description": "สำเร็จ", "content": { "application/json": { "schema": { "properties": { "size": { "type": "number", "format": "double" } }, "required": [ "size" ], "type": "object" } } } } }, "tags": [ "ตู้เอกสาร" ], "security": [ { "bearerAuth": [] } ], "parameters": [ { "in": "path", "name": "cabinetName", "required": true, "schema": { "type": "string" }, "example": "ตู้เอกสาร 1" } ] } }, "/cabinet/{cabinetName}/drawer": { "get": { "operationId": "ListDrawer", "responses": { "200": { "description": "สำเร็จ", "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/StorageFolder" }, "type": "array" }, "examples": { "Example 1": { "value": [ { "path": "ตู้เอกสาร 1/ลิ้นชัก 1/", "name": "ลิ้นชัก 1", "createdAt": "2021-07-20T12:33:13.018Z", "createdBy": "admin" }, { "path": "ตู้เอกสาร 1/ลิ้นชัก 2/", "name": "ลิ้นชัก 2", "createdAt": "2022-01-23T16:05:02.114Z", "createdBy": "admin" } ] } } } } }, "500": { "description": "เกิดข้อผิดพลาด ไม่สามารถแสดงรายการลิ้นชักได้ กรุณาลองใหม่ในภายหลัง" } }, "tags": [ "ลิ้นชัก" ], "security": [ { "bearerAuth": [] } ], "parameters": [ { "in": "path", "name": "cabinetName", "required": true, "schema": { "type": "string" }, "example": "ตู้เอกสาร 1" } ] }, "post": { "operationId": "CreateDrawer", "responses": { "201": { "description": "สำเร็จ" }, "404": { "description": "ไม่พบลิ้นชัก" }, "500": { "description": "เกิดข้อผิดพลาดกับระบบจัดการไฟล์" } }, "tags": [ "ลิ้นชัก" ], "security": [ { "bearerAuth": [ "admin", "management-role" ] } ], "parameters": [ { "in": "path", "name": "cabinetName", "required": true, "schema": { "type": "string" }, "example": "ตู้เอกสาร 1" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "properties": { "name": { "type": "string", "example": "ลิ้นชัก 1" } }, "required": [ "name" ], "type": "object" } } } } } }, "/cabinet/{cabinetName}/drawer/{drawerName}": { "put": { "operationId": "EditDrawer", "responses": { "204": { "description": "สำเร็จ" }, "500": { "description": "เกิดข้อผิดพลาดไม่สามารถย้ายไฟล์ได้" } }, "tags": [ "ลิ้นชัก" ], "security": [ { "bearerAuth": [ "admin", "management-role" ] } ], "parameters": [ { "in": "path", "name": "cabinetName", "required": true, "schema": { "type": "string" }, "example": "ตู้เอกสาร 1" }, { "in": "path", "name": "drawerName", "required": true, "schema": { "type": "string" }, "example": "ลิ้นชัก 1" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "properties": { "name": { "type": "string", "example": "ลิ้นชักใหม่" } }, "required": [ "name" ], "type": "object" } } } } }, "delete": { "operationId": "DeleteDrawer", "responses": { "204": { "description": "สำเร็จ" } }, "tags": [ "ลิ้นชัก" ], "security": [ { "bearerAuth": [ "admin", "management-role" ] } ], "parameters": [ { "in": "path", "name": "cabinetName", "required": true, "schema": { "type": "string" }, "example": "ตู้เอกสาร 1" }, { "in": "path", "name": "drawerName", "required": true, "schema": { "type": "string" }, "example": "ลิ้นชัก 1" } ] } }, "/cabinet/{cabinetName}/drawer/{drawerName}/size": { "get": { "operationId": "Calc", "responses": { "200": { "description": "สำเร็จ", "content": { "application/json": { "schema": { "properties": { "size": { "type": "number", "format": "double" } }, "required": [ "size" ], "type": "object" } } } } }, "tags": [ "ลิ้นชัก" ], "security": [ { "bearerAuth": [] } ], "parameters": [ { "in": "path", "name": "cabinetName", "required": true, "schema": { "type": "string" }, "example": "ตู้เอกสาร 1" }, { "in": "path", "name": "drawerName", "required": true, "schema": { "type": "string" }, "example": "ลิ้นชัก 1" } ] } }, "/cabinet/{cabinetName}/drawer/{drawerName}/folder/{folderName}/file": { "get": { "operationId": "GetFile", "responses": { "200": { "description": "สำเร็จ", "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/StorageFile" }, "type": "array" }, "examples": { "Example 1": { "value": [ { "pathname": "ตู้เอกสาร 1/ลิ้นชัก 1/แฟ้ม 1/เอกสาร 1", "path": "ตู้เอกสาร 1/ลิ้นชัก 1/แฟ้ม 1/", "title": "เอกสาร", "description": "เอกสารการเงิน", "category": [ "บัญชี" ], "keyword": [ "เงิน", "บัญชี", "รายจ่าย", "รายรับ" ], "upload": false, "fileName": "เอกสาร 1", "fileSize": 10240, "fileType": "application/pdf", "createdAt": "2021-07-20T12:33:13.018Z", "createdBy": "admin", "updatedAt": "2021-07-20T12:33:13.018Z", "updatedBy": "admin" } ] } } } } } }, "tags": [ "ไฟล์" ], "security": [ { "bearerAuth": [] } ], "parameters": [ { "in": "path", "name": "cabinetName", "required": true, "schema": { "type": "string" }, "example": "ตู้เอกสาร 1" }, { "in": "path", "name": "drawerName", "required": true, "schema": { "type": "string" }, "example": "ลิ้นชัก 1" }, { "in": "path", "name": "folderName", "required": true, "schema": { "type": "string" }, "example": "แฟ้ม 1" } ] }, "post": { "operationId": "UploadFile", "responses": { "201": { "description": "สำเร็จ", "content": { "application/json": { "schema": { "properties": { "keyword": { "items": { "type": "string" }, "type": "array" }, "category": { "items": { "type": "string" }, "type": "array" }, "description": { "type": "string" }, "title": { "type": "string" }, "file": { "type": "string" }, "upload": { "type": "string" }, "updatedBy": { "type": "string" }, "updatedAt": { "anyOf": [ { "type": "string" }, { "type": "string", "format": "date-time" } ] }, "createdBy": { "type": "string" }, "createdAt": { "anyOf": [ { "type": "string" }, { "type": "string", "format": "date-time" } ] } }, "required": [ "file", "upload", "updatedBy", "updatedAt", "createdBy", "createdAt" ], "type": "object" }, "examples": { "Example 1": { "value": { "pathname": "ตู้เอกสาร 1/ลิ้นชัก 1/แฟ้ม 1/เอกสาร 1", "path": "ตู้เอกสาร 1/ลิ้นชัก 1/แฟ้ม 1/", "title": "เอกสาร", "description": "เอกสารการเงิน", "category": [ "บัญชี" ], "keyword": [ "เงิน", "บัญชี", "รายจ่าย", "รายรับ" ], "upload": false, "fileName": "เอกสาร 1", "fileSize": 10240, "fileType": "application/pdf", "createdAt": "2021-07-20T12:33:13.018Z", "createdBy": "admin", "updatedAt": "2021-07-20T12:33:13.018Z", "updatedBy": "admin" } } } } } }, "404": { "description": "ตำแหน่งที่ระบุไม่พบ กรุณาเตรียมตำแหน่งที่ต้องการก่อนดำเนินการ" } }, "tags": [ "ไฟล์" ], "security": [ { "bearerAuth": [ "admin", "management-role" ] } ], "parameters": [ { "in": "path", "name": "cabinetName", "required": true, "schema": { "type": "string" }, "example": "ตู้เอกสาร 1" }, { "in": "path", "name": "drawerName", "required": true, "schema": { "type": "string" }, "example": "ลิ้นชัก 1" }, { "in": "path", "name": "folderName", "required": true, "schema": { "type": "string" }, "example": "แฟ้ม 1" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "properties": { "keyword": { "items": { "type": "string" }, "type": "array", "example": [ "เงิน", "บัญชี", "รายจ่าย", "รายรับ" ] }, "category": { "items": { "type": "string" }, "type": "array", "example": [ "บัญชี" ] }, "description": { "type": "string", "example": "เอกสารการเงิน" }, "title": { "type": "string", "example": "เอกสาร" }, "file": { "type": "string", "example": "เอกสาร 1" } }, "required": [ "file" ], "type": "object" } } } } } }, "/cabinet/{cabinetName}/drawer/{drawerName}/folder/{folderName}/file/{fileName}": { "patch": { "operationId": "UpdateFile", "responses": { "200": { "description": "สำเร็จ", "content": { "application/json": { "schema": { "anyOf": [ {}, { "properties": { "upload": { "type": "string" } }, "required": [ "upload" ], "type": "object" } ] } } } }, "204": { "description": "สำเร็จ" }, "404": { "description": "ไม่พบตำแหน่งที่ต้องการสร้างแฟ้ม" } }, "tags": [ "ไฟล์" ], "security": [ { "bearerAuth": [ "admin", "management-role" ] } ], "parameters": [ { "in": "path", "name": "cabinetName", "required": true, "schema": { "type": "string" }, "example": "ตู้เอกสาร 1" }, { "in": "path", "name": "drawerName", "required": true, "schema": { "type": "string" }, "example": "ลิ้นชัก 1" }, { "in": "path", "name": "folderName", "required": true, "schema": { "type": "string" }, "example": "แฟ้ม 1" }, { "in": "path", "name": "fileName", "required": true, "schema": { "type": "string" }, "example": "เอกสาร 1" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "properties": { "keyword": { "items": { "type": "string" }, "type": "array", "example": [ "เงิน", "บัญชี", "รายจ่าย", "รายรับ" ] }, "category": { "items": { "type": "string" }, "type": "array", "example": [ "บัญชี" ] }, "description": { "type": "string", "example": "เอกสารการเงินฉบับใหม่" }, "title": { "type": "string", "example": "เอกสารการเงิน" }, "file": { "type": "string", "example": "เอกสารใหม่" } }, "type": "object" } } } } }, "delete": { "operationId": "DeleteFile", "responses": { "200": { "description": "สำเร็จ" } }, "tags": [ "ไฟล์" ], "security": [ { "bearerAuth": [ "admin", "management-role" ] } ], "parameters": [ { "in": "path", "name": "cabinetName", "required": true, "schema": { "type": "string" }, "example": "ตู้เอกสาร 1" }, { "in": "path", "name": "drawerName", "required": true, "schema": { "type": "string" }, "example": "ลิ้นชัก 1" }, { "in": "path", "name": "folderName", "required": true, "schema": { "type": "string" }, "example": "แฟ้ม 1" }, { "in": "path", "name": "fileName", "required": true, "schema": { "type": "string" }, "example": "เอกสารใหม่" } ] }, "get": { "operationId": "DownloadFile", "responses": { "200": { "description": "สำเร็จ", "content": { "application/json": { "schema": { "properties": { "createdBy": { "type": "string" }, "createdAt": { "anyOf": [ { "type": "string" }, { "type": "string", "format": "date-time" } ] }, "updatedBy": { "type": "string" }, "updatedAt": { "anyOf": [ { "type": "string" }, { "type": "string", "format": "date-time" } ] }, "upload": { "type": "boolean" }, "path": { "type": "string" }, "keyword": { "items": { "type": "string" }, "type": "array" }, "category": { "items": { "type": "string" }, "type": "array" }, "description": { "type": "string" }, "title": { "type": "string" }, "fileType": { "type": "string" }, "fileSize": { "type": "number", "format": "double" }, "fileName": { "type": "string" }, "pathname": { "type": "string" }, "download": { "type": "string" } }, "required": [ "createdBy", "createdAt", "updatedBy", "updatedAt", "upload", "path", "keyword", "category", "description", "title", "fileType", "fileSize", "fileName", "pathname", "download" ], "type": "object" } } } } }, "tags": [ "ดาวน์โหลด" ], "security": [ { "bearerAuth": [] } ], "parameters": [ { "in": "path", "name": "cabinetName", "required": true, "schema": { "type": "string" }, "example": "ตู้เอกสาร 1" }, { "in": "path", "name": "drawerName", "required": true, "schema": { "type": "string" }, "example": "ลิ้นชัก 1" }, { "in": "path", "name": "folderName", "required": true, "schema": { "type": "string" }, "example": "แฟ้ม 1" }, { "in": "path", "name": "fileName", "required": true, "schema": { "type": "string" }, "example": "เอกสารใหม่" } ] } }, "/cabinet/{cabinetName}/drawer/{drawerName}/folder": { "get": { "operationId": "ListFolder", "responses": { "200": { "description": "สำเร็จ", "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/StorageFolder" }, "type": "array" }, "examples": { "Example 1": { "value": [ { "path": "ตู้เอกสาร 1/ลิ้นชัก 1/แฟ้ม 1", "name": "แฟ้ม 1", "createdAt": "2021-07-20T12:33:13.018Z", "createdBy": "admin" }, { "path": "ตู้เอกสาร 1/ลิ้นชัก 1/แฟ้ม 2", "name": "แฟ้ม 2", "createdAt": "2022-01-23T16:05:02.114Z", "createdBy": "admin" } ] } } } } }, "500": { "description": "เกิดข้อผิดพลาด ไม่สามารถแสดงรายการแฟ้มได้ กรุณาลองใหม่ในภายหลัง" } }, "tags": [ "แฟ้ม" ], "security": [ { "bearerAuth": [] } ], "parameters": [ { "in": "path", "name": "cabinetName", "required": true, "schema": { "type": "string" }, "example": "ตู้เอกสาร 1" }, { "in": "path", "name": "drawerName", "required": true, "schema": { "type": "string" }, "example": "ลิ้นชัก 1" } ] }, "post": { "operationId": "CreateFolder", "responses": { "201": { "description": "สำเร็จ" }, "404": { "description": "ไม่พบตำแหน่งที่ต้องการสร้างแฟ้ม" }, "500": { "description": "เกิดข้อผิดพลาดกับระบบจัดการไฟล์" } }, "tags": [ "แฟ้ม" ], "security": [ { "bearerAuth": [ "admin", "management-role" ] } ], "parameters": [ { "in": "path", "name": "cabinetName", "required": true, "schema": { "type": "string" }, "example": "ตู้เอกสาร 1" }, { "in": "path", "name": "drawerName", "required": true, "schema": { "type": "string" }, "example": "ลิ้นชัก 1" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "properties": { "name": { "type": "string", "example": "แฟ้ม 1" } }, "required": [ "name" ], "type": "object" } } } } } }, "/cabinet/{cabinetName}/drawer/{drawerName}/folder/{folderName}": { "put": { "operationId": "EditFolder", "responses": { "204": { "description": "สำเร็จ" }, "500": { "description": "เกิดข้อผิดพลาดไม่สามารถย้ายไฟล์ได้" } }, "tags": [ "แฟ้ม" ], "security": [ { "bearerAuth": [ "admin", "management-role" ] } ], "parameters": [ { "in": "path", "name": "cabinetName", "required": true, "schema": { "type": "string" }, "example": "ตู้เอกสาร 1" }, { "in": "path", "name": "drawerName", "required": true, "schema": { "type": "string" }, "example": "ลิ้นชัก 1" }, { "in": "path", "name": "folderName", "required": true, "schema": { "type": "string" }, "example": "แฟ้ม 1" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "properties": { "name": { "type": "string", "example": "แฟ้มใหม่" } }, "required": [ "name" ], "type": "object" } } } } }, "delete": { "operationId": "DeleteFolder", "responses": { "204": { "description": "สำเร็จ" } }, "tags": [ "แฟ้ม" ], "security": [ { "bearerAuth": [ "admin", "management-role" ] } ], "parameters": [ { "in": "path", "name": "cabinetName", "required": true, "schema": { "type": "string" }, "example": "ตู้เอกสาร 1" }, { "in": "path", "name": "drawerName", "required": true, "schema": { "type": "string" }, "example": "ลิ้นชัก 1" }, { "in": "path", "name": "folderName", "required": true, "schema": { "type": "string" }, "example": "แฟ้ม 1" } ] } }, "/cabinet/{cabinetName}/drawer/{drawerName}/folder/{folderName}/size": { "get": { "operationId": "Calc", "responses": { "200": { "description": "สำเร็จ", "content": { "application/json": { "schema": { "properties": { "size": { "type": "number", "format": "double" } }, "required": [ "size" ], "type": "object" } } } } }, "tags": [ "แฟ้ม" ], "security": [ { "bearerAuth": [] } ], "parameters": [ { "in": "path", "name": "cabinetName", "required": true, "schema": { "type": "string" }, "example": "ตู้เอกสาร 1" }, { "in": "path", "name": "drawerName", "required": true, "schema": { "type": "string" }, "example": "ลิ้นชัก 1" }, { "in": "path", "name": "folderName", "required": true, "schema": { "type": "string" }, "example": "แฟ้ม 1" } ] } }, "/search": { "post": { "operationId": "SearchFile", "responses": { "200": { "description": "สำเร็จ", "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/StorageFile" }, "type": "array" } } } } }, "tags": [ "ค้นหา" ], "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Search" } } } } } }, "/storage/list": { "post": { "operationId": "GetList", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "anyOf": [ { "items": { "$ref": "#/components/schemas/StorageFolder" }, "type": "array" }, { "items": { "$ref": "#/components/schemas/StorageFile" }, "type": "array" } ] }, "examples": { "Example 1": { "value": [ { "path": "ตู้เอกสาร 1/ลิ้นชัก 1/แฟ้ม 1", "name": "แฟ้ม 1", "createdAt": "2021-07-20T12:33:13.018Z", "createdBy": "admin" }, { "path": "ตู้เอกสาร 1/ลิ้นชัก 1/แฟ้ม 2", "name": "แฟ้ม 2", "createdAt": "2022-01-23T16:05:02.114Z", "createdBy": "admin" } ] }, "Example 2": { "value": [ { "pathname": "ตู้เอกสาร 1/ลิ้นชัก 1/แฟ้ม 1/เอกสาร 1.pdf", "path": "ตู้เอกสาร 1/ลิ้นชัก 1/แฟ้ม 1/", "title": "เอกสาร", "description": "เอกสารการเงิน", "category": [ "บัญชี" ], "keyword": [ "เงิน", "บัญชี", "รายจ่าย", "รายรับ" ], "upload": false, "fileName": "เอกสาร 1.pdf", "fileSize": 10240, "fileType": "application/pdf", "createdAt": "2021-07-20T12:33:13.018Z", "createdBy": "admin", "updatedAt": "2021-07-20T12:33:13.018Z", "updatedBy": "admin" } ] } } } } } }, "security": [], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListRequestBody" } } } } } }, "/storage/folder": { "post": { "operationId": "PostFolder", "responses": { "204": { "description": "สำเร็จ" } }, "security": [], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateFolderBody" } } } } }, "put": { "operationId": "MoveFolder", "responses": { "204": { "description": "No content" } }, "description": "ยา้ย Folder ภายใต้ Folder (Path) หนึ่ง ไปภายใน Folder (Path) หนึ่งและสามารถเปลี่ยนชื่อได้", "security": [], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PutFolderBody" } } } } }, "delete": { "operationId": "DeleteStorage", "responses": { "204": { "description": "สำเร็จ" } }, "description": "ลบ Folder หรือ File ออกจากระบบ", "security": [], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DeleteFolderBody" } } } } } }, "/storage/file": { "post": { "operationId": "PostFile", "responses": { "204": { "description": "สำเร็จ", "content": { "application/json": { "schema": { "properties": { "createdBy": { "type": "string" }, "createdAt": { "anyOf": [ { "type": "string" }, { "type": "string", "format": "date-time" } ] }, "updatedBy": { "type": "string" }, "updatedAt": { "anyOf": [ { "type": "string" }, { "type": "string", "format": "date-time" } ] }, "upload": { "type": "boolean" }, "path": { "type": "string" }, "keyword": { "items": { "type": "string" }, "type": "array" }, "category": { "items": { "type": "string" }, "type": "array" }, "description": { "type": "string" }, "title": { "type": "string" }, "fileType": { "type": "string" }, "fileSize": { "type": "number", "format": "double" }, "fileName": { "type": "string" }, "pathname": { "type": "string" }, "uploadUrl": { "type": "string" } }, "required": [ "createdBy", "createdAt", "updatedBy", "updatedAt", "upload", "path", "keyword", "category", "description", "title", "fileType", "fileSize", "fileName", "pathname", "uploadUrl" ], "type": "object" } } } } }, "description": "ร้องขอการอัพโหลดไฟล์ โดยเมื่อร้องขอจะได้ URL สำหรับอัพโหลดไฟล์มาพร้อมข้อมูลของไฟล์ที่จะทำการอัพโหลด", "security": [], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateFileBody" } } } } } }, "/cabinet/{cabinetName}/drawer/{drawerName}/folder/{folderName}/subfolder": { "get": { "operationId": "ListFolder", "responses": { "200": { "description": "สำเร็จ", "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/StorageFolder" }, "type": "array" }, "examples": { "Example 1": { "value": [ { "path": "ตู้เอกสาร 1/ลิ้นชัก 1/แฟ้ม 1/แฟ้มย่อย 1", "name": "แฟ้มย่อย 1", "createdAt": "2021-07-20T12:33:13.018Z", "createdBy": "admin" }, { "path": "ตู้เอกสาร 1/ลิ้นชัก 1/แฟ้ม 1/แฟ้มย่อย 2", "name": "แฟ้มย่อย 2", "createdAt": "2022-01-23T16:05:02.114Z", "createdBy": "admin" } ] } } } } }, "500": { "description": "เกิดข้อผิดพลาด ไม่สามารถแสดงรายการแฟ้มได้ กรุณาลองใหม่ในภายหลัง" } }, "tags": [ "แฟ้มย่อย" ], "security": [ { "bearerAuth": [] } ], "parameters": [ { "in": "path", "name": "cabinetName", "required": true, "schema": { "type": "string" }, "example": "ตู้เอกสาร 1" }, { "in": "path", "name": "drawerName", "required": true, "schema": { "type": "string" }, "example": "ลิ้นชัก 1" }, { "in": "path", "name": "folderName", "required": true, "schema": { "type": "string" }, "example": "แฟ้ม 1" } ] }, "post": { "operationId": "CreateFolder", "responses": { "201": { "description": "สำเร็จ" }, "404": { "description": "ไม่พบของแฟ้ม" }, "500": { "description": "เกิดข้อผิดพลาดกับระบบจัดการไฟล์" } }, "tags": [ "แฟ้มย่อย" ], "security": [ { "bearerAuth": [ "admin", "management-role" ] } ], "parameters": [ { "in": "path", "name": "cabinetName", "required": true, "schema": { "type": "string" }, "example": "ตู้เอกสาร 1" }, { "in": "path", "name": "drawerName", "required": true, "schema": { "type": "string" }, "example": "ลิ้นชัก 1" }, { "in": "path", "name": "folderName", "required": true, "schema": { "type": "string" }, "example": "แฟ้ม 1" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "properties": { "name": { "type": "string" } }, "required": [ "name" ], "type": "object" } } } } } }, "/cabinet/{cabinetName}/drawer/{drawerName}/folder/{folderName}/subfolder/{subFolderName}": { "put": { "operationId": "EditFolder", "responses": { "204": { "description": "สำเร็จ" }, "500": { "description": "เกิดข้อผิดพลาดไม่สามารถย้ายไฟล์ได้" } }, "tags": [ "แฟ้มย่อย" ], "security": [ { "bearerAuth": [ "admin", "management-role" ] } ], "parameters": [ { "in": "path", "name": "cabinetName", "required": true, "schema": { "type": "string" }, "example": "ตู้เอกสาร 1" }, { "in": "path", "name": "drawerName", "required": true, "schema": { "type": "string" }, "example": "ลิ้นชัก 1" }, { "in": "path", "name": "folderName", "required": true, "schema": { "type": "string" }, "example": "แฟ้ม 1" }, { "in": "path", "name": "subFolderName", "required": true, "schema": { "type": "string" }, "example": "แฟ้มย่อย 1" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "properties": { "name": { "type": "string", "example": "แฟ้มใหม่" } }, "required": [ "name" ], "type": "object" } } } } }, "delete": { "operationId": "DeleteFolder", "responses": { "204": { "description": "สำเร็จ" } }, "tags": [ "แฟ้มย่อย" ], "security": [ { "bearerAuth": [ "admin", "management-role" ] } ], "parameters": [ { "in": "path", "name": "cabinetName", "required": true, "schema": { "type": "string" }, "example": "ตู้เอกสาร 1" }, { "in": "path", "name": "drawerName", "required": true, "schema": { "type": "string" }, "example": "ลิ้นชัก 1" }, { "in": "path", "name": "folderName", "required": true, "schema": { "type": "string" }, "example": "แฟ้ม 1" }, { "in": "path", "name": "subFolderName", "required": true, "schema": { "type": "string" }, "example": "แฟ้มย่อย 1" } ] } }, "/cabinet/{cabinetName}/drawer/{drawerName}/folder/{folderName}/subfolder/{subFolderName}/size": { "get": { "operationId": "Calc", "responses": { "200": { "description": "สำเร็จ", "content": { "application/json": { "schema": { "properties": { "size": { "type": "number", "format": "double" } }, "required": [ "size" ], "type": "object" } } } } }, "tags": [ "แฟ้มย่อย" ], "security": [ { "bearerAuth": [] } ], "parameters": [ { "in": "path", "name": "cabinetName", "required": true, "schema": { "type": "string" }, "example": "ตู้เอกสาร 1" }, { "in": "path", "name": "drawerName", "required": true, "schema": { "type": "string" }, "example": "ลิ้นชัก 1" }, { "in": "path", "name": "folderName", "required": true, "schema": { "type": "string" }, "example": "แฟ้ม 1" }, { "in": "path", "name": "subFolderName", "required": true, "schema": { "type": "string" }, "example": "แฟ้มย่อย 1" } ] } }, "/cabinet/{cabinetName}/drawer/{drawerName}/folder/{folderName}/subfolder/{subFolderName}/file": { "get": { "operationId": "GetFile", "responses": { "200": { "description": "สำเร็จ", "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/StorageFile" }, "type": "array" }, "examples": { "Example 1": { "value": [ { "pathname": "ตู้เอกสาร 1/ลิ้นชัก 1/แฟ้ม 1/แฟ้มย่อย 1/เอกสาร 1", "path": "ตู้เอกสาร 1/ลิ้นชัก 1/แฟ้ม 1/แฟ้มย่อย 1/", "title": "เอกสาร", "description": "เอกสารการเงิน", "category": [ "บัญชี" ], "keyword": [ "เงิน", "บัญชี", "รายจ่าย", "รายรับ" ], "upload": false, "fileName": "เอกสาร 1", "fileSize": 10240, "fileType": "application/pdf", "createdAt": "2021-07-20T12:33:13.018Z", "createdBy": "admin", "updatedAt": "2021-07-20T12:33:13.018Z", "updatedBy": "admin" } ] } } } } } }, "tags": [ "ไฟล์" ], "security": [ { "bearerAuth": [] } ], "parameters": [ { "in": "path", "name": "cabinetName", "required": true, "schema": { "type": "string" }, "example": "ตู้เอกสาร 1" }, { "in": "path", "name": "drawerName", "required": true, "schema": { "type": "string" }, "example": "ลิ้นชัก 1" }, { "in": "path", "name": "folderName", "required": true, "schema": { "type": "string" }, "example": "แฟ้ม 1" }, { "in": "path", "name": "subFolderName", "required": true, "schema": { "type": "string" }, "example": "แฟ้มย่อย 1" } ] }, "post": { "operationId": "UploadFile", "responses": { "201": { "description": "สำเร็จ", "content": { "application/json": { "schema": { "properties": { "keyword": { "items": { "type": "string" }, "type": "array" }, "category": { "items": { "type": "string" }, "type": "array" }, "description": { "type": "string" }, "title": { "type": "string" }, "file": { "type": "string" }, "upload": { "type": "string" }, "updatedBy": { "type": "string" }, "updatedAt": { "anyOf": [ { "type": "string" }, { "type": "string", "format": "date-time" } ] }, "createdBy": { "type": "string" }, "createdAt": { "anyOf": [ { "type": "string" }, { "type": "string", "format": "date-time" } ] } }, "required": [ "file", "upload", "updatedBy", "updatedAt", "createdBy", "createdAt" ], "type": "object" }, "examples": { "Example 1": { "value": { "pathname": "ตู้เอกสาร 1/ลิ้นชัก 1/แฟ้ม 1/แฟ้มย่อย 1/เอกสาร 1", "path": "ตู้เอกสาร 1/ลิ้นชัก 1/แฟ้ม 1/แฟ้มย่อย 1/", "title": "เอกสาร", "description": "เอกสารการเงิน", "category": [ "บัญชี" ], "keyword": [ "เงิน", "บัญชี", "รายจ่าย", "รายรับ" ], "upload": false, "fileName": "เอกสาร 1", "fileSize": 10240, "fileType": "application/pdf", "createdAt": "2021-07-20T12:33:13.018Z", "createdBy": "admin", "updatedAt": "2021-07-20T12:33:13.018Z", "updatedBy": "admin" } } } } } }, "404": { "description": "ตำแหน่งที่ระบุไม่พบ กรุณาเตรียมตำแหน่งที่ต้องการก่อนดำเนินการ" } }, "tags": [ "ไฟล์" ], "security": [ { "bearerAuth": [ "admin", "management-role" ] } ], "parameters": [ { "in": "path", "name": "cabinetName", "required": true, "schema": { "type": "string" }, "example": "ตู้เอกสาร 1" }, { "in": "path", "name": "drawerName", "required": true, "schema": { "type": "string" }, "example": "ลิ้นชัก 1" }, { "in": "path", "name": "folderName", "required": true, "schema": { "type": "string" }, "example": "แฟ้ม 1" }, { "in": "path", "name": "subFolderName", "required": true, "schema": { "type": "string" }, "example": "แฟ้มย่อย 1" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "properties": { "keyword": { "items": { "type": "string" }, "type": "array", "example": [ "เงิน", "บัญชี", "รายจ่าย", "รายรับ" ] }, "category": { "items": { "type": "string" }, "type": "array", "example": [ "บัญชี" ] }, "description": { "type": "string", "example": "เอกสารการเงิน" }, "title": { "type": "string", "example": "เอกสาร" }, "file": { "type": "string", "example": "เอกสาร 1" } }, "required": [ "file" ], "type": "object" } } } } } }, "/cabinet/{cabinetName}/drawer/{drawerName}/folder/{folderName}/subfolder/{subFolderName}/file/{fileName}": { "patch": { "operationId": "UpdateFile", "responses": { "200": { "description": "สำเร็จ", "content": { "application/json": { "schema": { "anyOf": [ {}, { "properties": { "upload": { "type": "string" } }, "required": [ "upload" ], "type": "object" } ] } } } }, "404": { "description": "ไม่พบตำแหน่งที่ต้องการสร้างแฟ้ม" } }, "tags": [ "ไฟล์" ], "security": [ { "bearerAuth": [ "admin", "management-role" ] } ], "parameters": [ { "in": "path", "name": "cabinetName", "required": true, "schema": { "type": "string" }, "example": "ตู้เอกสาร 1" }, { "in": "path", "name": "drawerName", "required": true, "schema": { "type": "string" }, "example": "ลิ้นชัก 1" }, { "in": "path", "name": "folderName", "required": true, "schema": { "type": "string" }, "example": "แฟ้ม 1" }, { "in": "path", "name": "subFolderName", "required": true, "schema": { "type": "string" }, "example": "แฟ้มย่อย 1" }, { "in": "path", "name": "fileName", "required": true, "schema": { "type": "string" }, "example": "เอกสาร 1" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "properties": { "keyword": { "items": { "type": "string" }, "type": "array", "example": [ "เงิน", "บัญชี", "รายจ่าย", "รายรับ" ] }, "category": { "items": { "type": "string" }, "type": "array", "example": [ "บัญชี" ] }, "description": { "type": "string", "example": "เอกสารการเงินฉบับใหม่" }, "title": { "type": "string", "example": "เอกสารการเงิน" }, "file": { "type": "string", "example": "เอกสารใหม่" } }, "type": "object" } } } } }, "delete": { "operationId": "DeleteFile", "responses": { "200": { "description": "สำเร็จ" } }, "tags": [ "ไฟล์" ], "security": [ { "bearerAuth": [ "admin", "management-role" ] } ], "parameters": [ { "in": "path", "name": "cabinetName", "required": true, "schema": { "type": "string" }, "example": "ตู้เอกสาร 1" }, { "in": "path", "name": "drawerName", "required": true, "schema": { "type": "string" }, "example": "ลิ้นชัก 1" }, { "in": "path", "name": "folderName", "required": true, "schema": { "type": "string" }, "example": "แฟ้ม 1" }, { "in": "path", "name": "subFolderName", "required": true, "schema": { "type": "string" }, "example": "แฟ้มย่อย 1" }, { "in": "path", "name": "fileName", "required": true, "schema": { "type": "string" }, "example": "เอกสาร 1" } ] }, "get": { "operationId": "DownloadFile", "responses": { "200": { "description": "", "content": { "application/json": { "schema": { "properties": { "createdBy": { "type": "string" }, "createdAt": { "anyOf": [ { "type": "string" }, { "type": "string", "format": "date-time" } ] }, "updatedBy": { "type": "string" }, "updatedAt": { "anyOf": [ { "type": "string" }, { "type": "string", "format": "date-time" } ] }, "upload": { "type": "boolean" }, "path": { "type": "string" }, "keyword": { "items": { "type": "string" }, "type": "array" }, "category": { "items": { "type": "string" }, "type": "array" }, "description": { "type": "string" }, "title": { "type": "string" }, "fileType": { "type": "string" }, "fileSize": { "type": "number", "format": "double" }, "fileName": { "type": "string" }, "pathname": { "type": "string" }, "download": { "type": "string" } }, "required": [ "createdBy", "createdAt", "updatedBy", "updatedAt", "upload", "path", "keyword", "category", "description", "title", "fileType", "fileSize", "fileName", "pathname", "download" ], "type": "object" } } } } }, "tags": [ "ดาวน์โหลด" ], "security": [ { "bearerAuth": [] } ], "parameters": [ { "in": "path", "name": "cabinetName", "required": true, "schema": { "type": "string" }, "example": "ตู้เอกสาร 1" }, { "in": "path", "name": "drawerName", "required": true, "schema": { "type": "string" }, "example": "ลิ้นชัก 1" }, { "in": "path", "name": "folderName", "required": true, "schema": { "type": "string" }, "examples": { "Example 1": { "value": "แฟ้ม 1" }, "Example 2": { "value": "แฟ้มย่อย 1" } } }, { "in": "path", "name": "subFolderName", "required": true, "schema": { "type": "string" } }, { "in": "path", "name": "fileName", "required": true, "schema": { "type": "string" }, "example": "เอกสาร 1" } ] } } }, "servers": [ { "url": "/api" } ], "tags": [ { "name": "ตู้เอกสาร" }, { "name": "ลิ้นชัก" }, { "name": "แฟ้ม" }, { "name": "แฟ้มย่อย" }, { "name": "ไฟล์" }, { "name": "ดาวน์โหลด" }, { "name": "ค้นหา" } ], "basePath": "/api" }