From c1bb3dd69c4d68f3f0787b59881ca258707b8cea Mon Sep 17 00:00:00 2001
From: Administrator <15274802129@163.com>
Date: Thu, 14 Aug 2025 10:34:36 +0800
Subject: [PATCH] feat(websocket): 添加 Netty WebSocket 聊天功能基础版本,URL:http://localhost:8085/febs/pages/websocket/chat.html
---
src/main/java/cc/mrbird/febs/mall/controller/CommonController.java | 47 +++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 45 insertions(+), 2 deletions(-)
diff --git a/src/main/java/cc/mrbird/febs/mall/controller/CommonController.java b/src/main/java/cc/mrbird/febs/mall/controller/CommonController.java
index 56f988f..f1d5d50 100644
--- a/src/main/java/cc/mrbird/febs/mall/controller/CommonController.java
+++ b/src/main/java/cc/mrbird/febs/mall/controller/CommonController.java
@@ -11,6 +11,7 @@
import cc.mrbird.febs.mall.service.ICommonService;
import cc.mrbird.febs.mall.vo.ScoreSignVo;
import cc.mrbird.febs.mall.vo.common.ApiCommonSetVo;
+import cc.mrbird.febs.mall.vo.common.ApiIndexSetVo;
import cn.hutool.core.io.file.FileNameUtil;
import cn.hutool.core.lang.UUID;
import cn.hutool.core.util.IdUtil;
@@ -209,6 +210,48 @@
return new FebsResponse().success().data(apiCommonSetVo);
}
+
+ @ApiOperation(value = "小程序首页头部背景")
+ @GetMapping(value = "/indexHeadPng")
+ public FebsResponse indexHeadPng() {
+ String pngUrl = commonService.getDicByTypeAndCode(
+ CommonDictionaryEnum.VIDEO_URL_INDEX.getType(),
+ CommonDictionaryEnum.VIDEO_URL_INDEX.getCode()
+ );
+ if (pngUrl == null) {
+ pngUrl = "";
+ }
+ return new FebsResponse().success().data(pngUrl);
+ }
+
+ @ApiOperation(value = "小程序开屏页设置")
+ @ApiResponses({
+ @ApiResponse(code = 200, message = "success", response = ApiIndexSetVo.class)
+ })
+ @GetMapping(value = "/indexSet")
+ public FebsResponse indexSet() {
+ ApiIndexSetVo apiIndexSetVo = new ApiIndexSetVo();
+
+ String pngUrl = commonService.getDicByTypeAndCode(
+ CommonDictionaryEnum.PNG_URL_INDEX.getType(),
+ CommonDictionaryEnum.PNG_URL_INDEX.getCode()
+ );
+ if (pngUrl == null) {
+ pngUrl = "";
+ }
+ apiIndexSetVo.setPngUrl(pngUrl);
+
+ String timeStop = commonService.getDicByTypeAndCode(
+ CommonDictionaryEnum.TIME_URL_INDEX.getType(),
+ CommonDictionaryEnum.TIME_URL_INDEX.getCode()
+ );
+ if (timeStop == null) {
+ timeStop = "3";
+ }
+ apiIndexSetVo.setTimeStop(timeStop);
+ return new FebsResponse().success().data(apiIndexSetVo);
+ }
+
@ApiOperation(value = "base64FileUpload上传")
@PostMapping(value = "/base64FileUpload")
public Map<String,Object> base64FileUpload(@RequestBody @Validated MultipartFile file) throws IOException {
@@ -221,7 +264,7 @@
String base64Str = java.util.Base64.getEncoder().encodeToString(fileBytes);
String imageSuffix = "." + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".") + 1);
String imageNames = System.currentTimeMillis() + IdUtil.simpleUUID() + imageSuffix;
- String imageName = "hc/" + imageNames;
+ String imageName = "clothes/" + imageNames;
OssUtils.uploadFileWithBase64(base64Str, imageName);
String bucket_name = "https://excoin.oss-cn-hangzhou.aliyuncs.com";
String url = bucket_name + "/" + imageName;
@@ -250,7 +293,7 @@
String imageFuffix = ".jpg";
String imageNames = System.currentTimeMillis() + IdUtil.simpleUUID() + imageFuffix;
- String imageName = "hc/" + imageNames;
+ String imageName = "clothes/" + imageNames;
OssUtils.uploadFileWithBase64(base64Str, imageName);
String bucket_name ="https://excoin.oss-cn-hangzhou.aliyuncs.com";
String url = bucket_name + "/" + imageName;
--
Gitblit v1.9.1