+
+
+
+
+
+
+
+
+
+
+
+ {{ ws && ws.readyState === 1 ? "已连接" : "连接" }}
+
+ 断开
+
+
+
+
+
+
+
+ 发送消息
+
+
+
+
+
+ 清空消息
+
+
+
+
+
+
From b77a52a4a87bb3a08c1af628270058a69705a7ca Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=92=B1=E5=93=A5=E4=B8=B6?=
<7753810+zan_ge@user.noreply.gitee.com>
Date: Mon, 2 Jan 2023 22:55:48 +0800
Subject: [PATCH 2/7] =?UTF-8?q?commit=20=20=E5=A2=9E=E5=8A=A0webSocket?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../iocoder/yudao/module/infra/websocket/WebSocketConfig.java | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/websocket/WebSocketConfig.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/websocket/WebSocketConfig.java
index 1e73b32ed..af2744fb5 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/websocket/WebSocketConfig.java
+++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/websocket/WebSocketConfig.java
@@ -6,8 +6,7 @@ import org.springframework.web.socket.server.standard.ServerEndpointExporter;
/**
* websocket 配置
- *
- * @author ruoyi
+ *
*/
@Configuration
public class WebSocketConfig
From a9aaac39e886332319690aab7dc6df340850d9a1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=92=B1=E5=93=A5=E4=B8=B6?=
<7753810+zan_ge@user.noreply.gitee.com>
Date: Mon, 2 Jan 2023 23:09:10 +0800
Subject: [PATCH 3/7] =?UTF-8?q?commit=20=20=E5=A2=9E=E5=8A=A0webSocket?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../yudao/module/infra/websocket/WebSocketConfig.java | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/websocket/WebSocketConfig.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/websocket/WebSocketConfig.java
index af2744fb5..380bc9317 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/websocket/WebSocketConfig.java
+++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/websocket/WebSocketConfig.java
@@ -6,14 +6,11 @@ import org.springframework.web.socket.server.standard.ServerEndpointExporter;
/**
* websocket 配置
- *
*/
@Configuration
-public class WebSocketConfig
-{
+public class WebSocketConfig {
@Bean
- public ServerEndpointExporter serverEndpointExporter()
- {
+ public ServerEndpointExporter serverEndpointExporter() {
return new ServerEndpointExporter();
}
}
From 7879632cf5ec447236b43a8e1aab664f73af5cb5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=92=B1=E5=93=A5=E4=B8=B6?=
<7753810+zan_ge@user.noreply.gitee.com>
Date: Mon, 2 Jan 2023 23:13:50 +0800
Subject: [PATCH 4/7] =?UTF-8?q?commit=20=20=E5=A2=9E=E5=8A=A0webSocket=20?=
=?UTF-8?q?=E8=8F=9C=E5=8D=95sql?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
sql/mysql/ruoyi-vue-pro.sql | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sql/mysql/ruoyi-vue-pro.sql b/sql/mysql/ruoyi-vue-pro.sql
index 39cb52afe..ccc61887d 100644
--- a/sql/mysql/ruoyi-vue-pro.sql
+++ b/sql/mysql/ruoyi-vue-pro.sql
@@ -1710,6 +1710,8 @@ INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_i
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`, `visible`, `keep_alive`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1267, '客户端删除', 'system:oauth2-client:delete', 3, 4, 1263, '', '', '', 0, b'1', b'1', '', '2022-05-10 16:26:33', '1', '2022-05-11 00:31:33', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`, `visible`, `keep_alive`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1281, '可视化报表', '', 1, 12, 0, '/visualization', 'chart', NULL, 0, b'1', b'1', '1', '2022-07-10 20:22:15', '1', '2022-07-10 20:33:30', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`, `visible`, `keep_alive`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1282, '积木报表', '', 2, 1, 1281, 'jimu-report', 'example', 'visualization/jmreport/index', 0, b'1', b'1', '1', '2022-07-10 20:26:36', '1', '2022-07-28 21:17:34', b'0');
+INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`, `visible`, `keep_alive`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1283, 'webSocket连接', '', 2, 14, 2, 'webSocket', '#', 'infra/webSocket/index', 0, b'1', b'1', '1', '2023-01-01 11:43:04', '1', '2023-01-01 11:43:04', b'0');
+
COMMIT;
-- ----------------------------
From c04ad317cfba990dde689e66d36f3a46bc562064 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=92=B1=E5=93=A5=E4=B8=B6?=
<7753810+zan_ge@user.noreply.gitee.com>
Date: Mon, 2 Jan 2023 23:39:01 +0800
Subject: [PATCH 5/7] =?UTF-8?q?=E6=94=AF=E6=8C=81=E6=96=87=E4=BB=B6?=
=?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=97=B6=E5=8F=AF=E5=A2=9E=E5=8A=A0=E8=BF=BD?=
=?UTF-8?q?=E5=8A=A0=E8=87=AA=E5=AE=9A=E4=B9=89=E8=B7=AF=E5=BE=84=20?=
=?UTF-8?q?=E5=A6=82aaa/=20,aaa/bbb/=20=E4=B8=8B=E8=BD=BD=E6=96=87?=
=?UTF-8?q?=E4=BB=B6=E6=97=B6=E5=8F=AF=E4=BB=A5=E9=87=8D=E6=96=B0=E5=91=BD?=
=?UTF-8?q?=E5=90=8D=E6=96=87=E4=BB=B6=E7=9C=9F=E5=AE=9E=E5=90=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../infra/controller/admin/file/FileController.java | 12 ++++++++++--
.../module/infra/service/file/FileServiceImpl.java | 6 ++----
2 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/FileController.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/FileController.java
index 3719bc31b..a93e3367d 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/FileController.java
+++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/FileController.java
@@ -14,6 +14,7 @@ import cn.iocoder.yudao.module.infra.dal.dataobject.file.FileDO;
import cn.iocoder.yudao.module.infra.service.file.FileService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpStatus;
@@ -61,9 +62,13 @@ public class FileController {
@GetMapping("/{configId}/get/**")
@PermitAll
@ApiOperation("下载文件")
- @ApiImplicitParam(name = "configId", value = "配置编号", required = true, dataTypeClass = Long.class)
+ @ApiImplicitParams({
+ @ApiImplicitParam(name = "configId", value = "配置编号", required = true, dataTypeClass = Long.class),
+ @ApiImplicitParam(name = "fileName", value = "文件实际名称", dataTypeClass = String.class)
+ })
public void getFileContent(HttpServletRequest request,
HttpServletResponse response,
+ String fileName,
@PathVariable("configId") Long configId) throws Exception {
// 获取请求的路径
String path = StrUtil.subAfter(request.getRequestURI(), "/get/", false);
@@ -78,7 +83,10 @@ public class FileController {
response.setStatus(HttpStatus.NOT_FOUND.value());
return;
}
- ServletUtils.writeAttachment(response, path, content);
+ if (StrUtil.isBlank(fileName)) {
+ fileName = StrUtil.subAfter(path, "/", true);
+ }
+ ServletUtils.writeAttachment(response, fileName, content);
}
@GetMapping("/page")
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileServiceImpl.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileServiceImpl.java
index 2226e7bae..dd0e339e0 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileServiceImpl.java
+++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileServiceImpl.java
@@ -39,11 +39,9 @@ public class FileServiceImpl implements FileService {
@Override
@SneakyThrows
public String createFile(String name, String path, byte[] content) {
- // 计算默认的 path 名
+ // 计算默认的 path 名,path可增加自定义路径如 aaa/,aaa/bbb/
String type = FileTypeUtils.getMineType(content, name);
- if (StrUtil.isEmpty(path)) {
- path = FileUtils.generatePath(content, name);
- }
+ path = StrUtil.isEmpty(path) ? FileUtils.generatePath(content, name) : path + FileUtils.generatePath(content, name);
// 如果 name 为空,则使用 path 填充
if (StrUtil.isEmpty(name)) {
name = path;
From ccc4cad1c8d6575f452d17e8bc28af306b62f8e5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=92=B1=E5=93=A5=E4=B8=B6?= <385454831@qq.com>
Date: Wed, 4 Jan 2023 12:02:26 +0000
Subject: [PATCH 6/7] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20yuda?=
=?UTF-8?q?o-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/?=
=?UTF-8?q?yudao/module/infra/controller/admin/file/FileController.java?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../controller/admin/file/FileController.java | 100 ------------------
1 file changed, 100 deletions(-)
delete mode 100644 yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/FileController.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/FileController.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/FileController.java
deleted file mode 100644
index a93e3367d..000000000
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/FileController.java
+++ /dev/null
@@ -1,100 +0,0 @@
-package cn.iocoder.yudao.module.infra.controller.admin.file;
-
-import cn.hutool.core.io.IoUtil;
-import cn.hutool.core.util.StrUtil;
-import cn.iocoder.yudao.framework.common.pojo.CommonResult;
-import cn.iocoder.yudao.framework.common.pojo.PageResult;
-import cn.iocoder.yudao.framework.common.util.servlet.ServletUtils;
-import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
-import cn.iocoder.yudao.module.infra.controller.admin.file.vo.file.FilePageReqVO;
-import cn.iocoder.yudao.module.infra.controller.admin.file.vo.file.FileRespVO;
-import cn.iocoder.yudao.module.infra.controller.admin.file.vo.file.FileUploadReqVO;
-import cn.iocoder.yudao.module.infra.convert.file.FileConvert;
-import cn.iocoder.yudao.module.infra.dal.dataobject.file.FileDO;
-import cn.iocoder.yudao.module.infra.service.file.FileService;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiImplicitParam;
-import io.swagger.annotations.ApiImplicitParams;
-import io.swagger.annotations.ApiOperation;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.http.HttpStatus;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.web.multipart.MultipartFile;
-
-import javax.annotation.Resource;
-import javax.annotation.security.PermitAll;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.validation.Valid;
-
-import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
-
-@Api(tags = "管理后台 - 文件存储")
-@RestController
-@RequestMapping("/infra/file")
-@Validated
-@Slf4j
-public class FileController {
-
- @Resource
- private FileService fileService;
-
- @PostMapping("/upload")
- @ApiOperation("上传文件")
- @OperateLog(logArgs = false) // 上传文件,没有记录操作日志的必要
- public CommonResult