创建 CartService.java
parent
05460ae359
commit
a7b92e1331
|
|
@ -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();
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue