1333 lines
No EOL
27 KiB
JSON
1333 lines
No EOL
27 KiB
JSON
{
|
|
"components": {
|
|
"examples": {},
|
|
"headers": {},
|
|
"parameters": {},
|
|
"requestBodies": {},
|
|
"responses": {},
|
|
"schemas": {
|
|
"Record_string.unknown_": {
|
|
"properties": {},
|
|
"type": "object",
|
|
"description": "Construct a type with a set of properties K of type T"
|
|
},
|
|
"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"
|
|
},
|
|
"author": {
|
|
"type": "string"
|
|
},
|
|
"metadata": {
|
|
"$ref": "#/components/schemas/Record_string.unknown_"
|
|
},
|
|
"path": {
|
|
"type": "string"
|
|
},
|
|
"upload": {
|
|
"type": "boolean"
|
|
},
|
|
"hidden": {
|
|
"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",
|
|
"author",
|
|
"metadata",
|
|
"path",
|
|
"upload",
|
|
"hidden",
|
|
"updatedAt",
|
|
"updatedBy",
|
|
"createdAt",
|
|
"createdBy"
|
|
],
|
|
"type": "object",
|
|
"additionalProperties": false
|
|
},
|
|
"Search": {
|
|
"properties": {
|
|
"AND": {
|
|
"items": {
|
|
"properties": {
|
|
"exact": {
|
|
"type": "boolean"
|
|
},
|
|
"value": {
|
|
"type": "string"
|
|
},
|
|
"field": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"value",
|
|
"field"
|
|
],
|
|
"type": "object"
|
|
},
|
|
"type": "array"
|
|
},
|
|
"OR": {
|
|
"items": {
|
|
"properties": {
|
|
"exact": {
|
|
"type": "boolean"
|
|
},
|
|
"value": {
|
|
"type": "string"
|
|
},
|
|
"field": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"value",
|
|
"field"
|
|
],
|
|
"type": "object"
|
|
},
|
|
"type": "array"
|
|
},
|
|
"exact": {
|
|
"type": "boolean"
|
|
},
|
|
"recursive": {
|
|
"type": "boolean"
|
|
},
|
|
"path": {
|
|
"items": {
|
|
"type": "string"
|
|
},
|
|
"type": "array"
|
|
}
|
|
},
|
|
"type": "object",
|
|
"additionalProperties": false
|
|
},
|
|
"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
|
|
},
|
|
"ListRequestBody": {
|
|
"properties": {
|
|
"operation": {
|
|
"type": "string",
|
|
"enum": [
|
|
"folder",
|
|
"file"
|
|
]
|
|
},
|
|
"path": {
|
|
"items": {
|
|
"type": "string"
|
|
},
|
|
"type": "array"
|
|
},
|
|
"hidden": {
|
|
"type": "boolean"
|
|
}
|
|
},
|
|
"required": [
|
|
"operation",
|
|
"path"
|
|
],
|
|
"type": "object",
|
|
"additionalProperties": false
|
|
},
|
|
"FolderBody": {
|
|
"properties": {
|
|
"path": {
|
|
"items": {
|
|
"type": "string"
|
|
},
|
|
"type": "array",
|
|
"example": [
|
|
"แฟ้ม 1",
|
|
"แฟ้ม 2"
|
|
]
|
|
},
|
|
"name": {
|
|
"type": "string",
|
|
"example": "แฟ้ม 3"
|
|
}
|
|
},
|
|
"required": [
|
|
"path",
|
|
"name"
|
|
],
|
|
"type": "object",
|
|
"additionalProperties": false
|
|
},
|
|
"PutFolderBody": {
|
|
"properties": {
|
|
"from": {
|
|
"properties": {
|
|
"name": {
|
|
"type": "string",
|
|
"example": "แฟ้ม 3"
|
|
},
|
|
"path": {
|
|
"items": {
|
|
"type": "string"
|
|
},
|
|
"type": "array",
|
|
"example": [
|
|
"แฟ้ม 1",
|
|
"แฟ้ม 2"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"name",
|
|
"path"
|
|
],
|
|
"type": "object"
|
|
},
|
|
"to": {
|
|
"properties": {
|
|
"name": {
|
|
"type": "string",
|
|
"example": "แฟ้ม 3 แก้ไข"
|
|
},
|
|
"path": {
|
|
"items": {
|
|
"type": "string"
|
|
},
|
|
"type": "array",
|
|
"example": [
|
|
"แฟ้ม 1",
|
|
"แฟ้ม 2"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"name",
|
|
"path"
|
|
],
|
|
"type": "object"
|
|
}
|
|
},
|
|
"required": [
|
|
"from",
|
|
"to"
|
|
],
|
|
"type": "object",
|
|
"additionalProperties": false
|
|
},
|
|
"DeleteFolderBody": {
|
|
"properties": {
|
|
"path": {
|
|
"items": {
|
|
"type": "string"
|
|
},
|
|
"type": "array",
|
|
"example": [
|
|
"แฟ้ม 1",
|
|
"แฟ้ม 2",
|
|
"แฟ้ม 3 แก้ไข"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"path"
|
|
],
|
|
"type": "object",
|
|
"additionalProperties": false
|
|
},
|
|
"Record_string.any_": {
|
|
"properties": {},
|
|
"type": "object",
|
|
"description": "Construct a type with a set of properties K of type T"
|
|
},
|
|
"FileBody": {
|
|
"properties": {
|
|
"path": {
|
|
"items": {
|
|
"type": "string"
|
|
},
|
|
"type": "array",
|
|
"example": [
|
|
"แฟ้ม 1",
|
|
"แฟ้ม 2",
|
|
"แฟ้ม 3"
|
|
]
|
|
},
|
|
"file": {
|
|
"type": "string",
|
|
"example": "ไฟล์ 1.xlsx"
|
|
},
|
|
"title": {
|
|
"type": "string",
|
|
"example": "การเงิน"
|
|
},
|
|
"description": {
|
|
"type": "string",
|
|
"example": "การเงิน"
|
|
},
|
|
"author": {
|
|
"type": "string",
|
|
"example": "นายก"
|
|
},
|
|
"category": {
|
|
"items": {
|
|
"type": "string"
|
|
},
|
|
"type": "array",
|
|
"example": [
|
|
"การเงิน",
|
|
"รายงาน"
|
|
]
|
|
},
|
|
"keyword": {
|
|
"items": {
|
|
"type": "string"
|
|
},
|
|
"type": "array",
|
|
"example": [
|
|
"การเงิน",
|
|
"รายรับ",
|
|
"รายจ่าย"
|
|
]
|
|
},
|
|
"metadata": {
|
|
"properties": {},
|
|
"additionalProperties": {},
|
|
"type": "object",
|
|
"example": {}
|
|
},
|
|
"hidden": {
|
|
"type": "boolean",
|
|
"example": false
|
|
}
|
|
},
|
|
"required": [
|
|
"path",
|
|
"file"
|
|
],
|
|
"type": "object",
|
|
"additionalProperties": false
|
|
},
|
|
"PutFileBody": {
|
|
"properties": {
|
|
"hidden": {
|
|
"type": "boolean",
|
|
"example": false
|
|
},
|
|
"keyword": {
|
|
"items": {
|
|
"type": "string"
|
|
},
|
|
"type": "array",
|
|
"example": [
|
|
"การเงิน",
|
|
"รายรับ",
|
|
"รายจ่าย"
|
|
]
|
|
},
|
|
"title": {
|
|
"type": "string",
|
|
"example": "การเงิน"
|
|
},
|
|
"description": {
|
|
"type": "string",
|
|
"example": "การเงิน"
|
|
},
|
|
"category": {
|
|
"items": {
|
|
"type": "string"
|
|
},
|
|
"type": "array",
|
|
"example": [
|
|
"การเงิน",
|
|
"รายงาน"
|
|
]
|
|
},
|
|
"author": {
|
|
"type": "string",
|
|
"example": "นายก"
|
|
},
|
|
"metadata": {
|
|
"properties": {},
|
|
"additionalProperties": {},
|
|
"type": "object",
|
|
"example": {}
|
|
},
|
|
"from": {
|
|
"properties": {
|
|
"file": {
|
|
"type": "string",
|
|
"example": "ไฟล์ 1.xlsx"
|
|
},
|
|
"path": {
|
|
"items": {
|
|
"type": "string"
|
|
},
|
|
"type": "array",
|
|
"example": [
|
|
"แฟ้ม 1",
|
|
"แฟ้ม 2",
|
|
"แฟ้ม 3"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"file",
|
|
"path"
|
|
],
|
|
"type": "object",
|
|
"description": "หากต้องการอัพโหลดไฟล์ด้วยให้ส่งค่าเป็นจริง"
|
|
},
|
|
"to": {
|
|
"properties": {
|
|
"file": {
|
|
"type": "string",
|
|
"example": "ไฟล์ 1 แก้ไข.xlsx"
|
|
},
|
|
"path": {
|
|
"items": {
|
|
"type": "string"
|
|
},
|
|
"type": "array",
|
|
"example": [
|
|
"แฟ้ม 1",
|
|
"แฟ้ม 2",
|
|
"แฟ้ม 3"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"file",
|
|
"path"
|
|
],
|
|
"type": "object"
|
|
},
|
|
"upload": {
|
|
"type": "boolean",
|
|
"example": false
|
|
}
|
|
},
|
|
"required": [
|
|
"from"
|
|
],
|
|
"type": "object",
|
|
"additionalProperties": false
|
|
},
|
|
"DeleteFileBody": {
|
|
"properties": {
|
|
"path": {
|
|
"items": {
|
|
"type": "string"
|
|
},
|
|
"type": "array",
|
|
"example": [
|
|
"แฟ้ม 1",
|
|
"แฟ้ม 2",
|
|
"แฟ้ม 3"
|
|
]
|
|
},
|
|
"file": {
|
|
"type": "string",
|
|
"example": "ไฟล์ 1 แก้ไข.xlsx"
|
|
}
|
|
},
|
|
"required": [
|
|
"path",
|
|
"file"
|
|
],
|
|
"type": "object",
|
|
"additionalProperties": false
|
|
},
|
|
"DownloadFileBody": {
|
|
"properties": {
|
|
"path": {
|
|
"items": {
|
|
"type": "string"
|
|
},
|
|
"type": "array",
|
|
"example": [
|
|
"แฟ้ม 1",
|
|
"แฟ้ม 2",
|
|
"แฟ้ม 3"
|
|
]
|
|
},
|
|
"file": {
|
|
"type": "string",
|
|
"example": "ไฟล์ 1 แก้ไข.xlsx"
|
|
}
|
|
},
|
|
"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": {
|
|
"/search": {
|
|
"post": {
|
|
"operationId": "SearchFile",
|
|
"responses": {
|
|
"200": {
|
|
"description": "สำเร็จ",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"items": {
|
|
"$ref": "#/components/schemas/StorageFile"
|
|
},
|
|
"type": "array"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"tags": [
|
|
"Search"
|
|
],
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
],
|
|
"parameters": [],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/Search"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/storage/list": {
|
|
"post": {
|
|
"operationId": "GetList",
|
|
"responses": {
|
|
"200": {
|
|
"description": "สำเร็จ",
|
|
"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": "เอกสารการเงิน",
|
|
"author": "นายก",
|
|
"category": [
|
|
"บัญชี"
|
|
],
|
|
"keyword": [
|
|
"เงิน",
|
|
"บัญชี",
|
|
"รายจ่าย",
|
|
"รายรับ"
|
|
],
|
|
"upload": false,
|
|
"hidden": 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"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"summary": "แสดงรายการแฟ้มหรือไฟล์",
|
|
"tags": [
|
|
"Storage Folder",
|
|
"Storage File"
|
|
],
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
],
|
|
"parameters": [],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ListRequestBody"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/storage/folder": {
|
|
"post": {
|
|
"operationId": "PostFolder",
|
|
"responses": {
|
|
"204": {
|
|
"description": "สำเร็จ"
|
|
}
|
|
},
|
|
"summary": "สร้างแฟ้ม",
|
|
"tags": [
|
|
"Storage Folder"
|
|
],
|
|
"security": [
|
|
{
|
|
"bearerAuth": [
|
|
"management-role",
|
|
"admin"
|
|
]
|
|
}
|
|
],
|
|
"parameters": [],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/FolderBody"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"put": {
|
|
"operationId": "MoveFolder",
|
|
"responses": {
|
|
"204": {
|
|
"description": "สำเร็จ"
|
|
}
|
|
},
|
|
"description": "ย้ายแฟ้มภายในตำแหน่งหนึ่งไปภายในอีกแฟ้มหนึ่ง\nหรือเปลี่ยนชื่อได้",
|
|
"summary": "ย้ายแฟ้ม",
|
|
"tags": [
|
|
"Storage Folder"
|
|
],
|
|
"security": [
|
|
{
|
|
"bearerAuth": [
|
|
"management-role",
|
|
"admin"
|
|
]
|
|
}
|
|
],
|
|
"parameters": [],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/PutFolderBody"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"operationId": "DeleteStorage",
|
|
"responses": {
|
|
"204": {
|
|
"description": "สำเร็จ"
|
|
}
|
|
},
|
|
"description": "ลบแฟ้มออกจากระบบ",
|
|
"summary": "ลบแฟ้มออกจากระบบ",
|
|
"tags": [
|
|
"Storage Folder"
|
|
],
|
|
"security": [
|
|
{
|
|
"bearerAuth": [
|
|
"management-role",
|
|
"admin"
|
|
]
|
|
}
|
|
],
|
|
"parameters": [],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/DeleteFolderBody"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/storage/folder/size": {
|
|
"post": {
|
|
"operationId": "FolderSize",
|
|
"responses": {
|
|
"200": {
|
|
"description": "สำเร็จ",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"properties": {
|
|
"size": {
|
|
"type": "number",
|
|
"format": "double"
|
|
}
|
|
},
|
|
"required": [
|
|
"size"
|
|
],
|
|
"type": "object"
|
|
},
|
|
"examples": {
|
|
"Example 1": {
|
|
"value": {
|
|
"size": 10240
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"summary": "ร้องขอขนาดของแฟ้ม มีหน่อยเป็นไบต์",
|
|
"tags": [
|
|
"Storage Folder"
|
|
],
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
],
|
|
"parameters": [],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/FolderBody"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/storage/file": {
|
|
"post": {
|
|
"operationId": "PostFile",
|
|
"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"
|
|
}
|
|
]
|
|
},
|
|
"hidden": {
|
|
"type": "boolean"
|
|
},
|
|
"upload": {
|
|
"type": "boolean"
|
|
},
|
|
"path": {
|
|
"type": "string"
|
|
},
|
|
"metadata": {
|
|
"$ref": "#/components/schemas/Record_string.any_"
|
|
},
|
|
"author": {
|
|
"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",
|
|
"hidden",
|
|
"upload",
|
|
"path",
|
|
"metadata",
|
|
"author",
|
|
"keyword",
|
|
"category",
|
|
"description",
|
|
"title",
|
|
"fileType",
|
|
"fileSize",
|
|
"fileName",
|
|
"pathname",
|
|
"uploadUrl"
|
|
],
|
|
"type": "object"
|
|
},
|
|
"examples": {
|
|
"Example 1": {
|
|
"value": {
|
|
"pathname": "ตู้เอกสาร 1/ลิ้นชัก 1/แฟ้ม 1/เอกสาร 1.pdf",
|
|
"path": "ตู้เอกสาร 1/ลิ้นชัก 1/แฟ้ม 1/",
|
|
"title": "เอกสาร",
|
|
"description": "เอกสารการเงิน",
|
|
"author": "นายก",
|
|
"category": [
|
|
"บัญชี"
|
|
],
|
|
"keyword": [
|
|
"เงิน",
|
|
"บัญชี",
|
|
"รายจ่าย",
|
|
"รายรับ"
|
|
],
|
|
"upload": false,
|
|
"hidden": 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",
|
|
"uploadUrl": "s3.storage.upload"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"description": "ร้องขอการอัปโหลดไฟล์ โดยเมื่อร้องขอจะได้ URL สำหรับอัพโหลดไฟล์มาพร้อมข้อมูลของไฟล์ที่จะทำการอัพโหลด",
|
|
"summary": "ร้องขอการอัปโหลดไฟล์",
|
|
"tags": [
|
|
"Storage File"
|
|
],
|
|
"security": [
|
|
{
|
|
"bearerAuth": [
|
|
"management-role",
|
|
"admin"
|
|
]
|
|
}
|
|
],
|
|
"parameters": [],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/FileBody"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"put": {
|
|
"operationId": "MoveFile",
|
|
"responses": {
|
|
"200": {
|
|
"description": "สำเร็จ",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"anyOf": [
|
|
{},
|
|
{
|
|
"properties": {
|
|
"uploadUrl": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"uploadUrl"
|
|
],
|
|
"type": "object"
|
|
}
|
|
]
|
|
},
|
|
"examples": {
|
|
"Example 1": {
|
|
"value": {
|
|
"uploadUrl": "s3.storage.upload"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"204": {
|
|
"description": "สำเร็จ"
|
|
}
|
|
},
|
|
"summary": "ย้ายไฟล์หรือเปลี่ยนชื่อไฟล์",
|
|
"tags": [
|
|
"Storage File"
|
|
],
|
|
"security": [
|
|
{
|
|
"bearerAuth": [
|
|
"management-role",
|
|
"admin"
|
|
]
|
|
}
|
|
],
|
|
"parameters": [],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/PutFileBody"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"operationId": "DeleteFile",
|
|
"responses": {
|
|
"204": {
|
|
"description": "สำเร็จ"
|
|
}
|
|
},
|
|
"summary": "ลบไฟล์ออกจากระบบ",
|
|
"tags": [
|
|
"Storage File"
|
|
],
|
|
"security": [
|
|
{
|
|
"bearerAuth": [
|
|
"management-role",
|
|
"admin"
|
|
]
|
|
}
|
|
],
|
|
"parameters": [],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/DeleteFileBody"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/storage/file/download": {
|
|
"post": {
|
|
"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"
|
|
}
|
|
]
|
|
},
|
|
"hidden": {
|
|
"type": "boolean"
|
|
},
|
|
"upload": {
|
|
"type": "boolean"
|
|
},
|
|
"path": {
|
|
"type": "string"
|
|
},
|
|
"metadata": {
|
|
"$ref": "#/components/schemas/Record_string.any_"
|
|
},
|
|
"author": {
|
|
"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"
|
|
},
|
|
"downloadUrl": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"createdBy",
|
|
"createdAt",
|
|
"updatedBy",
|
|
"updatedAt",
|
|
"hidden",
|
|
"upload",
|
|
"path",
|
|
"metadata",
|
|
"author",
|
|
"keyword",
|
|
"category",
|
|
"description",
|
|
"title",
|
|
"fileType",
|
|
"fileSize",
|
|
"fileName",
|
|
"pathname",
|
|
"downloadUrl"
|
|
],
|
|
"type": "object"
|
|
},
|
|
"examples": {
|
|
"Example 1": {
|
|
"value": {
|
|
"pathname": "ตู้เอกสาร 1/ลิ้นชัก 1/แฟ้ม 1/เอกสาร 1.pdf",
|
|
"path": "ตู้เอกสาร 1/ลิ้นชัก 1/แฟ้ม 1/",
|
|
"title": "เอกสาร",
|
|
"description": "เอกสารการเงิน",
|
|
"category": [
|
|
"บัญชี"
|
|
],
|
|
"keyword": [
|
|
"เงิน",
|
|
"บัญชี",
|
|
"รายจ่าย",
|
|
"รายรับ"
|
|
],
|
|
"author": "นายก",
|
|
"upload": false,
|
|
"hidden": 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",
|
|
"downloadUrl": "s3.storage.download"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"summary": "ขอข้อมูลการโหลดไฟล์",
|
|
"tags": [
|
|
"Download"
|
|
],
|
|
"security": [
|
|
{
|
|
"bearerAuth": [
|
|
"management-role",
|
|
"admin"
|
|
]
|
|
}
|
|
],
|
|
"parameters": [],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/DownloadFileBody"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/version": {
|
|
"get": {
|
|
"operationId": "GetVersion",
|
|
"responses": {
|
|
"200": {
|
|
"description": "Ok",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"tags": [
|
|
"Version"
|
|
],
|
|
"security": [],
|
|
"parameters": []
|
|
}
|
|
}
|
|
},
|
|
"servers": [
|
|
{
|
|
"url": "/api"
|
|
}
|
|
],
|
|
"basePath": "/api"
|
|
} |