From 459c23a257c264bab1d3e8fc22e0cfb16054ff4f Mon Sep 17 00:00:00 2001 From: zegezy <1098696801@qq.com> Date: Fri, 31 Mar 2023 14:04:24 +0800 Subject: [PATCH] =?UTF-8?q?oss=20=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/magic-api/api/OSS/group.json | 14 +++ data/magic-api/api/系统管理/group.json | 4 + .../api/系统管理/文件管理/group.json | 4 + .../api/系统管理/文件管理/获取文件上传目录.ms | 105 ++++++++++++++++++ magic-boot/pom.xml | 6 + magic-boot/src/main/resources/application.yml | 7 ++ 6 files changed, 140 insertions(+) create mode 100644 data/magic-api/api/OSS/group.json create mode 100644 data/magic-api/api/系统管理/文件管理/获取文件上传目录.ms diff --git a/data/magic-api/api/OSS/group.json b/data/magic-api/api/OSS/group.json new file mode 100644 index 0000000..9cf90c7 --- /dev/null +++ b/data/magic-api/api/OSS/group.json @@ -0,0 +1,14 @@ +{ + "properties" : { }, + "id" : "a73658de49cc4c1683e807418e6a88ab", + "name" : "OSS", + "type" : "api", + "parentId" : "0", + "path" : "/oss", + "createTime" : 1680236107242, + "updateTime" : null, + "createBy" : null, + "updateBy" : null, + "paths" : [ ], + "options" : [ ] +} \ No newline at end of file diff --git a/data/magic-api/api/系统管理/group.json b/data/magic-api/api/系统管理/group.json index bda425a..e8f8dd5 100644 --- a/data/magic-api/api/系统管理/group.json +++ b/data/magic-api/api/系统管理/group.json @@ -5,6 +5,10 @@ "type" : "api", "parentId" : "0", "path" : "/system", + "createTime" : null, + "updateTime" : 1680235019988, + "createBy" : null, + "updateBy" : null, "paths" : [ ], "options" : [ ] } \ No newline at end of file diff --git a/data/magic-api/api/系统管理/文件管理/group.json b/data/magic-api/api/系统管理/文件管理/group.json index 6e658be..6f5d05c 100644 --- a/data/magic-api/api/系统管理/文件管理/group.json +++ b/data/magic-api/api/系统管理/文件管理/group.json @@ -5,6 +5,10 @@ "type" : "api", "parentId" : "acff5ad7aae64de2acb03e1d16a58ce2", "path" : "/file", + "createTime" : null, + "updateTime" : 1680235020046, + "createBy" : null, + "updateBy" : null, "paths" : [ ], "options" : [ ] } \ No newline at end of file diff --git a/data/magic-api/api/系统管理/文件管理/获取文件上传目录.ms b/data/magic-api/api/系统管理/文件管理/获取文件上传目录.ms new file mode 100644 index 0000000..2ea197f --- /dev/null +++ b/data/magic-api/api/系统管理/文件管理/获取文件上传目录.ms @@ -0,0 +1,105 @@ +{ + "properties" : { }, + "id" : "ffa5c180f92a4dfbb066633c36a30716", + "script" : null, + "groupId" : "fd3d225a1cf141bf9998c4ec4bf4a6ab", + "name" : "获取文件上传目录", + "createTime" : null, + "updateTime" : 1680235255154, + "lock" : null, + "createBy" : null, + "updateBy" : null, + "path" : "/getFileUploadDirectory", + "method" : "GET", + "parameters" : [ ], + "options" : [ ], + "requestBody" : "", + "headers" : [ ], + "paths" : [ ], + "responseBody" : "{\n \"code\": 200,\n \"message\": \"success\",\n \"data\": \"dev\",\n \"timestamp\": 1680235202425,\n \"executeTime\": 25\n}", + "description" : null, + "requestBodyDefinition" : null, + "responseBodyDefinition" : { + "name" : "", + "value" : "", + "description" : "", + "required" : false, + "dataType" : "Object", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ { + "name" : "code", + "value" : "200", + "description" : "", + "required" : false, + "dataType" : "Integer", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ ] + }, { + "name" : "message", + "value" : "success", + "description" : "", + "required" : false, + "dataType" : "String", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ ] + }, { + "name" : "data", + "value" : "dev", + "description" : "", + "required" : false, + "dataType" : "String", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ ] + }, { + "name" : "timestamp", + "value" : "1680235202425", + "description" : "", + "required" : false, + "dataType" : "Long", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ ] + }, { + "name" : "executeTime", + "value" : "25", + "description" : "", + "required" : false, + "dataType" : "Integer", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ ] + } ] + } +} +================================ +import env +import cn.hutool.core.util.IdUtil +import cn.hutool.core.date.DateUtil +var count = length ? length.asInt() : 1; +var urls = [] +for(i in range(1, count)){ + urls.push(env.get('spring.profiles.active') + "/userfiles/" + DateUtil.today() + "/" + IdUtil.simpleUUID() + "/") +} +return urls diff --git a/magic-boot/pom.xml b/magic-boot/pom.xml index c1dc6b7..81e3d0e 100644 --- a/magic-boot/pom.xml +++ b/magic-boot/pom.xml @@ -19,6 +19,7 @@ 5.7.22 1.26.0 4.1.2 + 4.6.0 @@ -68,6 +69,11 @@ poi-ooxml ${poi.version} + + com.aliyun + aliyun-java-sdk-core + ${aliyun-core.version} + diff --git a/magic-boot/src/main/resources/application.yml b/magic-boot/src/main/resources/application.yml index b057bd4..260c7d1 100644 --- a/magic-boot/src/main/resources/application.yml +++ b/magic-boot/src/main/resources/application.yml @@ -106,3 +106,10 @@ sa-token: token-style: uuid # 是否输出操作日志 is-log: false + +oss: + endpoint: "" + accessKeyId: "" + accessKeySecret: "" + roleArn: "" + roleSessionName: "" \ No newline at end of file