From 996b2f16afaa271ce8aad6abf6858aa5db503eb3 Mon Sep 17 00:00:00 2001
From: rk <94314517@qq.com>
Date: 星期六, 25 四月 2026 14:07:34 +0800
Subject: [PATCH] 代码生成

---
 server/services/src/main/java/com/doumee/service/business/impl/ShopInfoServiceImpl.java |   42 ++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 40 insertions(+), 2 deletions(-)

diff --git a/server/services/src/main/java/com/doumee/service/business/impl/ShopInfoServiceImpl.java b/server/services/src/main/java/com/doumee/service/business/impl/ShopInfoServiceImpl.java
index 14b7636..ff79a7e 100644
--- a/server/services/src/main/java/com/doumee/service/business/impl/ShopInfoServiceImpl.java
+++ b/server/services/src/main/java/com/doumee/service/business/impl/ShopInfoServiceImpl.java
@@ -757,6 +757,13 @@
             }
         }
 
+        // 闂ㄥ簵澶村儚锛氫紭鍏堜娇鐢� coverImg锛屼负绌哄垯鍙栭棬澶寸収绗竴寮�
+        if (StringUtils.isNotBlank(shopInfo.getCoverImg())) {
+            vo.setShopAvatar(imgPrefix + shopInfo.getCoverImg());
+        } else if (!CollectionUtils.isEmpty(vo.getStoreFrontImgUrls())) {
+            vo.setShopAvatar(vo.getStoreFrontImgUrls().get(0));
+        }
+
         return vo;
     }
 
@@ -906,8 +913,8 @@
     }
 
     @Override
-    public ShopInfoMaintainDTO getShopMaintainInfo(Integer memberId) {
-        ShopInfo shop = shopInfoMapper.selectById(memberId);
+    public ShopInfoMaintainDTO getShopMaintainInfo(Integer shopId) {
+        ShopInfo shop = shopInfoMapper.selectById(shopId);
         if (Objects.isNull(shop) || Constants.equalsInteger(shop.getDeleted(), Constants.ONE)) {
             return null;
         }
@@ -919,6 +926,10 @@
         dto.setDeliveryArea(shop.getDeliveryArea());
         dto.setShopHours(shop.getShopHours());
         dto.setBusinessType(shop.getBusinessType());
+        // 澶村儚鍏ㄨ矾寰�
+        if (StringUtils.isNotBlank(shop.getCoverImg())) {
+            dto.setCoverImgUrl(getShopPrefix() + shop.getCoverImg());
+        }
         return dto;
     }
 
@@ -1351,4 +1362,31 @@
         }
     }
 
+    @Override
+    public void changePassword(Integer shopId, String newPassword, String token) {
+        if (StringUtils.isBlank(newPassword)) {
+            throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "瀵嗙爜涓嶈兘涓虹┖");
+        }
+        // 鏍¢獙瀵嗙爜蹇呴』鍚屾椂鍖呭惈瀛楁瘝鍜屾暟瀛�
+        boolean hasLetter = newPassword.chars().anyMatch(Character::isLetter);
+        boolean hasDigit = newPassword.chars().anyMatch(Character::isDigit);
+        if (!hasLetter || !hasDigit) {
+            throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "瀵嗙爜蹇呴』鍚屾椂鍖呭惈瀛楁瘝鍜屾暟瀛�");
+        }
+        // 鏌ヨ闂ㄥ簵
+        ShopInfo shopInfo = shopInfoMapper.selectById(shopId);
+        if (shopInfo == null || Constants.equalsInteger(shopInfo.getDeleted(), Constants.ONE)) {
+            throw new BusinessException(ResponseStatus.DATA_EMPTY);
+        }
+        // 閲嶆柊鐢熸垚salt锛屽姞瀵嗘柊瀵嗙爜骞舵洿鏂�
+        String salt = RandomStringUtils.randomAlphabetic(6);
+        shopInfo.setPassword(Utils.Secure.encryptPassword(newPassword, salt));
+        shopInfo.setSalt(salt);
+        shopInfoMapper.updateById(shopInfo);
+        // 娓呴櫎token锛屽己鍒堕噸鏂扮櫥褰�
+        if (StringUtils.isNotBlank(token)) {
+            redisTemplate.delete(token);
+        }
+    }
+
 }

--
Gitblit v1.9.3