From 561205000c49dcbcab980c82bae780ae86602702 Mon Sep 17 00:00:00 2001 From: huangyawei Date: Sat, 7 Sep 2024 11:35:12 +0800 Subject: [PATCH] =?UTF-8?q?release-=20=E5=A4=B4=E5=83=8F=E6=8B=BC=E6=8E=A5?= =?UTF-8?q?=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/luoo/user/service/StoreService.java | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/luoo_user/src/main/java/com/luoo/user/service/StoreService.java b/luoo_user/src/main/java/com/luoo/user/service/StoreService.java index eea280d..ebaa594 100644 --- a/luoo_user/src/main/java/com/luoo/user/service/StoreService.java +++ b/luoo_user/src/main/java/com/luoo/user/service/StoreService.java @@ -12,14 +12,12 @@ import com.luoo.user.vo.store.StorePCVO; import com.querydsl.core.BooleanBuilder; import com.querydsl.core.types.Projections; import com.querydsl.jpa.impl.JPAQueryFactory; +import constants.Constants; import enums.StoreEnums; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang.StringUtils; import org.springframework.amqp.rabbit.core.RabbitTemplate; import org.springframework.beans.BeanUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.geo.Distance; -import org.springframework.data.geo.Point; import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Pageable; import org.springframework.data.redis.connection.RedisGeoCommands; @@ -102,7 +100,7 @@ public class StoreService { public StorePCVO getOne(String id) { QStore qStore = QStore.store; QUserInfo qUserInfo = QUserInfo.userInfo; - return jpaQueryFactory.select(Projections.constructor(StorePCVO.class, + StorePCVO storePCVO = jpaQueryFactory.select(Projections.constructor(StorePCVO.class, qStore.id, qStore.name, qStore.regionId, @@ -129,6 +127,9 @@ public class StoreService { .on(qStore.contact.eq(qUserInfo.id)) .where((qStore.id.eq(id))) .fetchOne(); + assert storePCVO != null; + storePCVO.setContactAvatar(Constants.RESOURCE_PREFIX + storePCVO.getContactAvatar()); + return storePCVO; } public StoreAppVO getStoreForApp(String id) { @@ -167,6 +168,8 @@ public class StoreService { (qStore.id.eq(id)) .and(qStore.status.eq(StoreEnums.STORE_STATUS_COOPERATION.getCode()))) .fetchOne(); + assert storeAppVO != null; + storeAppVO.setContactAvatar(Constants.RESOURCE_PREFIX + storeAppVO.getContactAvatar()); return storeAppVO; } @@ -224,6 +227,8 @@ public class StoreService { Region regionById = regionService.getRegionById(store.getRegionId()); store.setRegion(regionById); } + + store.setContactAvatar(Constants.RESOURCE_PREFIX + store.getContactAvatar()); }); return new PageResult<>(total, storeList); } @@ -232,7 +237,9 @@ public class StoreService { storeSearchDto.setStatus(StoreEnums.STORE_STATUS_COOPERATION.getCode()); List storeList = storeMapper.getListForApp(storeSearchDto); - + storeList.forEach(store -> { + store.setContactAvatar(Constants.RESOURCE_PREFIX + store.getContactAvatar()); + }); // BooleanBuilder booleanBuilder = new BooleanBuilder(); // QStore qStore = QStore.store;