parent
04aa8d8d49
commit
e6e900be10
@ -0,0 +1,60 @@
|
||||
package com.example.flower.service;
|
||||
|
||||
import com.example.flower.entity.Cart;
|
||||
import com.example.flower.mapper.CartMapper;
|
||||
import com.example.flower.service.impl.CartServiceImpl;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class CartService implements CartServiceImpl {
|
||||
@Resource
|
||||
private CartMapper cartMapper;
|
||||
|
||||
@Override
|
||||
public PageInfo<Cart> cartList(int page, int page_size,int user_id) {
|
||||
PageHelper.startPage(page,page_size);
|
||||
return new PageInfo<>(cartMapper.cartList(user_id));
|
||||
}
|
||||
@Override
|
||||
public PageInfo<Cart> cartListByQuery(int page,int page_size,int user_id,String flower_name){
|
||||
PageHelper.startPage(page,page_size);
|
||||
return new PageInfo<>(cartMapper.cartListByQuery(user_id,flower_name));
|
||||
}
|
||||
@Override
|
||||
public void cartAdd(Cart cart){
|
||||
cartMapper.cartAdd(cart);
|
||||
}
|
||||
@Override
|
||||
public int cartDeletePer(int cart_id){
|
||||
return cartMapper.cartDeletePer(cart_id);
|
||||
}
|
||||
@Override
|
||||
public int cartDeleteMul(int[] cart_ids){
|
||||
return cartMapper.cartDeleteMul(cart_ids);
|
||||
}
|
||||
@Override
|
||||
public Cart cartInfo(int cart_id){
|
||||
return cartMapper.cartInfo(cart_id);
|
||||
}
|
||||
@Override
|
||||
public int cartModify(Cart cart){
|
||||
return cartMapper.cartModify(cart);
|
||||
}
|
||||
@Override
|
||||
public int cartModify_num(Cart cart){
|
||||
return cartMapper.cartModify_num(cart);
|
||||
}
|
||||
@Override
|
||||
public List<Cart> cartRepeat(int user_id, int flower_id){
|
||||
return cartMapper.cartRepeat(user_id,flower_id);
|
||||
}
|
||||
@Override
|
||||
public int cartNum(int user_id){
|
||||
return cartMapper.cartNum(user_id);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in new issue