Documentation
¶
Index ¶
- func AddBook(b *model.Book) error
- func AddCart(cart *model.Cart) error
- func AddCartItem(cartItem *model.CartItem) error
- func AddOrder(order *model.Order) error
- func AddOrderItem(orderItem *model.OrderItem) error
- func AddSession(sess *model.Session) error
- func CheckUserName(username string) (*model.User, error)
- func CheckUserNameAndPassword(username string, password string) (*model.User, error)
- func DeleteBook(bookID string) error
- func DeleteCartByCartID(cartID string) error
- func DeleteCartItemByID(cartItemID string) error
- func DeleteCartItemsByCartID(cartID string) error
- func DeleteSession(sessID string) error
- func GetBookByID(bookID string) (*model.Book, error)
- func GetBooks() ([]*model.Book, error)
- func GetCartByUserID(userID int) (*model.Cart, error)
- func GetCartItemByBookIDAndCartID(bookID string, cartID string) (*model.CartItem, error)
- func GetCartItemsByCartID(cartID string) ([]*model.CartItem, error)
- func GetMyOrders(userID int) ([]*model.Order, error)
- func GetOrderItemsByOrderID(orderID string) ([]*model.OrderItem, error)
- func GetOrders() ([]*model.Order, error)
- func GetPageBooks(pageNo string) (*model.Page, error)
- func GetPageBooksByPrice(pageNo string, minPrice string, maxPrice string) (*model.Page, error)
- func GetSession(sessID string) (*model.Session, error)
- func IsLogin(r *http.Request) (bool, *model.Session)
- func SaveUser(username string, password string, email string) error
- func UpdateBook(b *model.Book) error
- func UpdateBookCount(cartItem *model.CartItem) error
- func UpdateCart(cart *model.Cart) error
- func UpdateOrderState(orderID string, state int64) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckUserName ¶
CheckUserName 根据用户名和密码从数据库中查询一条记录
func CheckUserNameAndPassword ¶
CheckUserNameAndPassword 根据用户名和密码从数据库中查询一条记录
func DeleteCartByCartID ¶
DeleteCartByCartID 根据购物车的id删除购物车
func DeleteCartItemByID ¶
DeleteCartItemByID 根据购物项的id删除购物项
func DeleteCartItemsByCartID ¶
DeleteCartItemsByCartID 根据购物车的id删除所有的购物项
func GetBookByID ¶
GetBookByID 根据图书的id从数据库中查询出一本图书
func GetCartByUserID ¶
GetCartByUserID 根据用户的id从数据库中查询对应的购物车
func GetCartItemByBookIDAndCartID ¶
GetCartItemByBookIDAndCartID 根据图书的id和购物车的id获取对应的购物项
func GetCartItemsByCartID ¶
GetCartItemsByCartID 根据购物车的id获取购物车中所有的购物项
func GetOrderItemsByOrderID ¶
GetOrderItemsByOrderID 根据订单号获取该订单的所有订单项
func GetPageBooksByPrice ¶
GetPageBooksByPrice 获取带分页和价格范围的图书信息
func GetSession ¶
GetSession 根据session的Id值从数据库中查询Session
func UpdateBookCount ¶
UpdateBookCount 根据购物项中的相关信息更新购物项中图书的数量和金额小计
func UpdateOrderState ¶
UpdateOrderState 更新订单的状态,即发货和收货
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.