mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-08-17 03:31:54 +08:00
📖 CRM:code review 拼团记录的实现
This commit is contained in:
@@ -19,10 +19,9 @@ public interface ProductBrowseHistoryService {
|
||||
*
|
||||
* @param userId 用户编号
|
||||
* @param spuId SPU 编号
|
||||
* @return 编号
|
||||
*/
|
||||
@Async
|
||||
Long createBrowseHistory(Long userId, Long spuId);
|
||||
void createBrowseHistory(Long userId, Long spuId);
|
||||
|
||||
/**
|
||||
* 隐藏用户商品浏览记录
|
||||
|
@@ -26,10 +26,10 @@ public class ProductBrowseHistoryServiceImpl implements ProductBrowseHistoryServ
|
||||
private ProductBrowseHistoryMapper browseHistoryMapper;
|
||||
|
||||
@Override
|
||||
public Long createBrowseHistory(Long userId, Long spuId) {
|
||||
public void createBrowseHistory(Long userId, Long spuId) {
|
||||
// 用户未登录时不记录
|
||||
if (userId == null) {
|
||||
return null;
|
||||
return;
|
||||
}
|
||||
|
||||
// 情况一:同一个商品,只保留最新的一条记录
|
||||
@@ -50,7 +50,6 @@ public class ProductBrowseHistoryServiceImpl implements ProductBrowseHistoryServ
|
||||
.setUserId(userId)
|
||||
.setSpuId(spuId);
|
||||
browseHistoryMapper.insert(browseHistory);
|
||||
return browseHistory.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user