添加订单表
This commit is contained in:
parent
7cd44d430b
commit
e6a0556d9f
@ -78,4 +78,9 @@ public class ItemDTO implements Serializable {
|
||||
* 评论信息信息
|
||||
*/
|
||||
private List<OrderDTO> orderEntityList;
|
||||
|
||||
/**
|
||||
* 是否收藏
|
||||
*/
|
||||
private Boolean IsFavorite;
|
||||
}
|
||||
|
@ -23,6 +23,13 @@ public interface UserBehaviorService extends CrudService<UserBehaviorEntity, Use
|
||||
|
||||
public List<Long> getTopItems();
|
||||
|
||||
|
||||
/**
|
||||
* 查询是否收藏
|
||||
* @param itemId
|
||||
* @param type
|
||||
* @return
|
||||
*/
|
||||
Boolean getIsFavorite(Long itemId,Integer type);
|
||||
|
||||
|
||||
|
@ -43,6 +43,11 @@ public class OrderServiceImpl extends CrudServiceImpl<OrderDao, OrderEntity, Ord
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取评论数据列表
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<OrderDTO> getCommintList(Long id) {
|
||||
LambdaQueryWrapper<OrderEntity> lwq = new LambdaQueryWrapper<>();
|
||||
|
@ -77,18 +77,13 @@ public class UserBehaviorServiceImpl extends CrudServiceImpl<UserBehaviorDao, Us
|
||||
|
||||
@Override
|
||||
public Boolean getIsFavorite(Long itemId, Integer type) {
|
||||
|
||||
LambdaQueryWrapper<UserBehaviorEntity> wrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
wrapper.eq(UserBehaviorEntity::getItemId,itemId);
|
||||
wrapper.eq(UserBehaviorEntity::getType,type);
|
||||
List<UserBehaviorEntity> list = baseDao.selectList(wrapper);
|
||||
|
||||
if (list.isEmpty()){
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -74,7 +74,6 @@ public class ItemController {
|
||||
return new Result<PageData<ItemDTO>>().ok(page);
|
||||
}
|
||||
|
||||
|
||||
@Login
|
||||
@GetMapping("list")
|
||||
@Operation(summary = "查询收藏")
|
||||
@ -105,7 +104,6 @@ public class ItemController {
|
||||
return new Result<List<ItemEntity>>().ok(res);
|
||||
}
|
||||
|
||||
|
||||
// 分析
|
||||
@GetMapping("commit")
|
||||
@Operation(summary = "评论人数排行")
|
||||
@ -123,10 +121,11 @@ public class ItemController {
|
||||
public Result<ItemDTO> get(@PathVariable("id") Long id){
|
||||
ItemDTO data = itemService.get(id);
|
||||
data.setImage(uploadUrl + data.getImage());
|
||||
|
||||
// 添加预览
|
||||
data.setView(data.getView() + 1);
|
||||
itemService.update(data);
|
||||
// data.setIsFavorite(userBehaviorService.getIsFavorite(data.getId(),1));
|
||||
//是否收藏
|
||||
data.setIsFavorite(userBehaviorService.getIsFavorite(data.getId(),1));
|
||||
return new Result<ItemDTO>().ok(data);
|
||||
}
|
||||
|
||||
@ -138,7 +137,6 @@ public class ItemController {
|
||||
itemService.save(dto);
|
||||
return new Result();
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Operation(summary = "修改")
|
||||
public Result update(@RequestBody ItemDTO dto){ //效验数据
|
||||
@ -147,7 +145,6 @@ public class ItemController {
|
||||
itemService.update(dto);
|
||||
return new Result();
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@Operation(summary = "删除")
|
||||
public Result delete(@RequestBody Long[] ids){
|
||||
|
Loading…
Reference in New Issue
Block a user