update:
1.fix
This commit is contained in:
@@ -33,6 +33,7 @@ import org.springblade.core.log.exception.ServiceException;
|
|||||||
import org.springblade.core.mp.base.BaseServiceImpl;
|
import org.springblade.core.mp.base.BaseServiceImpl;
|
||||||
import org.springblade.core.redis.ratelimiter.RateLimiter;
|
import org.springblade.core.redis.ratelimiter.RateLimiter;
|
||||||
import org.springblade.core.tool.sensitive.SensitiveUtil;
|
import org.springblade.core.tool.sensitive.SensitiveUtil;
|
||||||
|
import org.springblade.core.tool.utils.StringUtil;
|
||||||
import org.springblade.modules.api.vo.*;
|
import org.springblade.modules.api.vo.*;
|
||||||
import org.springblade.modules.market.eums.*;
|
import org.springblade.modules.market.eums.*;
|
||||||
import org.springblade.modules.market.mapper.MerchantInventoryMapper;
|
import org.springblade.modules.market.mapper.MerchantInventoryMapper;
|
||||||
@@ -377,22 +378,26 @@ public class MerchantInventoryServiceImpl extends BaseServiceImpl<MerchantInvent
|
|||||||
}
|
}
|
||||||
List<MerchantStoreFavoriteApiVO> list = favoriteService.selectStoreFavoriteApiVOList(userId);
|
List<MerchantStoreFavoriteApiVO> list = favoriteService.selectStoreFavoriteApiVOList(userId);
|
||||||
list.forEach(v -> {
|
list.forEach(v -> {
|
||||||
|
if (StringUtil.isNotBlank(v.getMerchantAccount())) {
|
||||||
v.setMerchantAccount(SensitiveUtil.process(v.getMerchantAccount()));
|
v.setMerchantAccount(SensitiveUtil.process(v.getMerchantAccount()));
|
||||||
|
}
|
||||||
|
if (StringUtil.isNotBlank(v.getMerchantName())) {
|
||||||
v.setMerchantName(desensitizationByName(v.getMerchantName()));
|
v.setMerchantName(desensitizationByName(v.getMerchantName()));
|
||||||
|
}
|
||||||
});
|
});
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean addFavorite(Long userId, Long inventoryId) {
|
public boolean addFavorite(Long userId, Long inventoryId) {
|
||||||
if(Objects.isNull(userId) || Objects.isNull(inventoryId)){
|
if (Objects.isNull(userId) || Objects.isNull(inventoryId)) {
|
||||||
throw new ServiceException("无效参数");
|
throw new ServiceException("无效参数");
|
||||||
}
|
}
|
||||||
MerchantInventoryEntity inventory = getById(inventoryId);
|
MerchantInventoryEntity inventory = getById(inventoryId);
|
||||||
if (Objects.isNull(inventory)){
|
if (Objects.isNull(inventory)) {
|
||||||
throw new ServiceException("无效商品");
|
throw new ServiceException("无效商品");
|
||||||
}
|
}
|
||||||
if (favoriteService.hasFavorite(userId, inventory.getUserId())){
|
if (favoriteService.hasFavorite(userId, inventory.getUserId())) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
MerchantStoreFavoriteEntity favorite = new MerchantStoreFavoriteEntity();
|
MerchantStoreFavoriteEntity favorite = new MerchantStoreFavoriteEntity();
|
||||||
|
|||||||
Reference in New Issue
Block a user