From 71fca447b76d88b45ef5c24b47a9428a517c4499 Mon Sep 17 00:00:00 2001
From: mitao <2763622819@qq.com>
Date: 星期四, 03 四月 2025 14:33:31 +0800
Subject: [PATCH] 管理后台-门店管理

---
 cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/HomeModuleController.java |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/HomeModuleController.java b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/HomeModuleController.java
index 5b3f135..700baed 100644
--- a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/HomeModuleController.java
+++ b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/HomeModuleController.java
@@ -1,17 +1,22 @@
 package com.dsh.guns.modular.system.controller.code;
 
 
-import com.dsh.course.feignClient.other.model.Banner;
 import com.dsh.guns.config.UserExt;
+import com.dsh.guns.core.util.ToolUtil;
 import com.dsh.guns.modular.system.model.HomeModule;
 import com.dsh.guns.modular.system.service.IHomeModuleService;
 import com.dsh.guns.modular.system.service.IStoreService;
+import com.dsh.guns.modular.system.util.ImageUtils;
 import com.dsh.guns.modular.system.util.ResultUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
 
+import java.io.IOException;
 import java.util.List;
 import java.util.Map;
 
@@ -51,6 +56,13 @@
         if (homeModule.getPage().equals("请选择")){
             homeModule.setPage(null);
         }
+        if (ToolUtil.isNotEmpty(homeModule.getBackgroundImage())) {
+            try {
+                homeModule.setDisplayType(ImageUtils.getImageDimensions(homeModule.getBackgroundImage()).getDisplayType());
+            } catch (IOException e) {
+                throw new RuntimeException(e);
+            }
+        }
         return ResultUtil.success(homeModuleService.updateById(homeModule));
     }
 

--
Gitblit v1.7.1