创建 CartService.java

master
wangsiyuan 2024-01-18 21:20:26 +08:00
parent 05460ae359
commit a7b92e1331
1 changed files with 17 additions and 0 deletions

View File

@ -0,0 +1,17 @@
package com.gao.finalhw.service;
import com.gao.finalhw.mapper.ShoppingCartMapper;
import com.gao.finalhw.model.ShoppingCart;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class CartService {
@Autowired
ShoppingCartMapper shoppingCartMapper;
public int getCartCount(int id){
ShoppingCart result = shoppingCartMapper.selectById(id);
return result.getCartId();
}
}