📖 CRM:code review 拼团记录的实现

This commit is contained in:
YunaiV
2024-01-13 19:34:49 +08:00
parent 1b87b8a42f
commit bbee720710
11 changed files with 79 additions and 17 deletions

View File

@@ -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);
/**
* 隐藏用户商品浏览记录

View File

@@ -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