Documentation ¶
Index ¶
- func AddBook(book *model.Book) error
- func AddBook2CartItem(cartItem *model.CartItem) error
- func AddCart(userID int64) (*model.Cart, error)
- func AddCartItem(cartItem *model.CartItem) error
- func AddSession(sess *model.Session) error
- func CartIsNULL(cartID string) bool
- func CheckUserNameAndPassword(userName, initPassword string) error
- func DeleteBookByID(bookID string) error
- func DeleteCart(userID int64) error
- func DeleteCartItemByID(cartItemID string) error
- func DeleteSessionByID(sessionID string) error
- func GetBookByID(bookID string) (*model.Book, error)
- func GetCartByUserID(userID int64) (*model.Cart, error)
- func GetCartItemByID(cartItemID string) *model.CartItem
- func GetPageBooksByPrice(pageNo int64, pageSize int64, minPrice, maxPrice float64) (books []*model.Book, totalPageNo, totalRecord int64, err error)
- func GetPageNo(pageNo, pageSize int64) (*model.Page, error)
- func GetPageNoByPrice(pageNo, pageSize int64, minPrice, maxPrice float64) (*model.Page, error)
- func GetSessionByID(sessionID string) (*model.Session, error)
- func GetUserByID(userID int64) (*model.User, error)
- func GetUserByUserName(userName string) (*model.User, error)
- func InsertUser(userName, initPassword, email string) error
- func IsLogin(r *http.Request) (bool, *model.Session)
- func UpdateBook(book *model.Book) error
- func UpdateCartItem(cartItem *model.CartItem) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddBook2CartItem ¶
AddBook2CartItem 在数据库中往购物项里加一本书
func CheckUserNameAndPassword ¶
CheckUserNameAndPassword 检查用户名称和密码
func DeleteCartItemByID ¶
DeleteCartItemByID 根据购物项的ID删除购物项
func DeleteSessionByID ¶
DeleteSessionByID 根据ID从数据库中删除session
func GetCartByUserID ¶
GetCartByUserID 从数据库中得到用户的购物车
func GetCartItemByID ¶
GetCartItemByID 从数据库中拿到购物项
func GetPageBooksByPrice ¶
func GetPageBooksByPrice(pageNo int64, pageSize int64, minPrice, maxPrice float64) (books []*model.Book, totalPageNo, totalRecord int64, err error)
GetPageBooksByPrice 分页根据价格返回图书
func GetPageNoByPrice ¶
GetPageNoByPrice 根据用户输入的价格返回第x页商品信息
func GetSessionByID ¶
GetSessionByID 根据ID从数据库中拿到session
func GetUserByUserName ¶
GetUserByUserName 根据用户名称找用户
func UpdateCartItem ¶
UpdateCartItem 更新数据库中购物项的值
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.