Documentation ¶
Index ¶
- func Database(connRead, connWrite string)
- func NewDBClient(ctx context.Context) *gorm.DB
- type AddressDao
- func (dao *AddressDao) CreateAddress(in *model.Address) error
- func (dao *AddressDao) DeleteAddressByAddressId(aId, uId uint) error
- func (dao *AddressDao) GetAddressByAid(aId uint) (address *model.Address, err error)
- func (dao *AddressDao) ListAddressByUserId(uId uint) (addresses []*model.Address, err error)
- func (dao *AddressDao) UpdateAddressByUserId(aId uint, address *model.Address) error
- type CarouselDao
- type CartDao
- func (dao *CartDao) CreateCart(in *model.Cart) error
- func (dao *CartDao) DeleteCartByCartId(cId, uId uint) error
- func (dao *CartDao) GetCartByAid(aId uint) (cart *model.Cart, err error)
- func (dao *CartDao) ListCartByUserId(uId uint) (cartes []*model.Cart, err error)
- func (dao *CartDao) UpdateCartNumById(cId uint, num int) error
- type CategoryDao
- type FavoriteDao
- type NoticeDao
- type OrderDao
- func (dao *OrderDao) CreateOrder(in *model.Order) error
- func (dao *OrderDao) DeleteOrderByOrderId(aId, uId uint) error
- func (dao *OrderDao) GetOrderById(id, uId uint) (order *model.Order, err error)
- func (dao *OrderDao) ListOrderByCondition(condition map[string]interface{}, page model.BasePage) (orders []*model.Order, total int64, err error)
- func (dao *OrderDao) ListOrderByUserId(uId uint) (orderes []*model.Order, err error)
- func (dao *OrderDao) UpdateOrderByUserId(aId uint, order *model.Order) error
- type ProductDao
- func (dao *ProductDao) CountProductByCondition(condition map[string]interface{}) (total int64, err error)
- func (dao *ProductDao) CreateProduct(product *model.Product) (err error)
- func (dao *ProductDao) GetProductById(id uint) (product *model.Product, err error)
- func (dao *ProductDao) ListProductByCondition(condition map[string]interface{}, page model.BasePage) (products []*model.Product, err error)
- func (dao *ProductDao) SearchProduct(info string, page model.BasePage) (products []*model.Product, count int64, err error)
- func (dao *ProductDao) UpdateProduct(id uint, product *model.Product) error
- type ProductImgDao
- type UserDao
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AddressDao ¶
func NewAddressDao ¶
func NewAddressDao(ctx context.Context) *AddressDao
func (*AddressDao) CreateAddress ¶
func (dao *AddressDao) CreateAddress(in *model.Address) error
func (*AddressDao) DeleteAddressByAddressId ¶
func (dao *AddressDao) DeleteAddressByAddressId(aId, uId uint) error
func (*AddressDao) GetAddressByAid ¶
func (dao *AddressDao) GetAddressByAid(aId uint) (address *model.Address, err error)
func (*AddressDao) ListAddressByUserId ¶
func (dao *AddressDao) ListAddressByUserId(uId uint) (addresses []*model.Address, err error)
func (*AddressDao) UpdateAddressByUserId ¶
func (dao *AddressDao) UpdateAddressByUserId(aId uint, address *model.Address) error
type CarouselDao ¶
func NewCarouselDao ¶
func NewCarouselDao(ctx context.Context) *CarouselDao
func NewCarouselDaoByDB ¶
func NewCarouselDaoByDB(db *gorm.DB) *CarouselDao
func (*CarouselDao) CreateCarousel ¶
func (dao *CarouselDao) CreateCarousel(carousel *model.Carousel) error
CreateCarousel 创建Carousel
func (*CarouselDao) ListCarousel ¶
func (dao *CarouselDao) ListCarousel() (carousel []model.Carousel, err error)
GetUserById 根据 id 获取 user
type CartDao ¶
func NewCartDao ¶
func (*CartDao) DeleteCartByCartId ¶
func (*CartDao) GetCartByAid ¶
func (*CartDao) ListCartByUserId ¶
type CategoryDao ¶
func NewCategoryDao ¶
func NewCategoryDao(ctx context.Context) *CategoryDao
func NewCategoryDaoByDB ¶
func NewCategoryDaoByDB(db *gorm.DB) *CategoryDao
func (*CategoryDao) ListCategory ¶
func (dao *CategoryDao) ListCategory() (category []model.Category, err error)
type FavoriteDao ¶
func NewFavoriteDao ¶
func NewFavoriteDao(ctx context.Context) *FavoriteDao
func NewFavoriteDaoByDB ¶
func NewFavoriteDaoByDB(db *gorm.DB) *FavoriteDao
func (*FavoriteDao) CreateFavorite ¶
func (dao *FavoriteDao) CreateFavorite(in *model.Favorite) error
func (*FavoriteDao) DeleteFavorite ¶
func (dao *FavoriteDao) DeleteFavorite(uId, fId uint) error
DeleteFavorite 删除收藏夹
func (*FavoriteDao) FavoriteExistOrNot ¶
func (dao *FavoriteDao) FavoriteExistOrNot(pId, uId uint) (exist bool, err error)
func (*FavoriteDao) ListFavorite ¶
func (dao *FavoriteDao) ListFavorite(uId uint) (resp []*model.Favorite, err error)
type NoticeDao ¶
func NewNoticeDao ¶
func NewNoticeDaoByDB ¶
func (*NoticeDao) CreateNotice ¶
CreateNotice 创建notice
type OrderDao ¶
func NewOrderDao ¶
func (*OrderDao) DeleteOrderByOrderId ¶
func (*OrderDao) GetOrderById ¶
func (*OrderDao) ListOrderByCondition ¶
func (dao *OrderDao) ListOrderByCondition(condition map[string]interface{}, page model.BasePage) (orders []*model.Order, total int64, err error)
ListOrderByCondition 获取订单List
func (*OrderDao) ListOrderByUserId ¶
type ProductDao ¶
func NewProductDao ¶
func NewProductDao(ctx context.Context) *ProductDao
func NewProductDaoByDB ¶
func NewProductDaoByDB(db *gorm.DB) *ProductDao
func (*ProductDao) CountProductByCondition ¶
func (dao *ProductDao) CountProductByCondition(condition map[string]interface{}) (total int64, err error)
func (*ProductDao) CreateProduct ¶
func (dao *ProductDao) CreateProduct(product *model.Product) (err error)
func (*ProductDao) GetProductById ¶
func (dao *ProductDao) GetProductById(id uint) (product *model.Product, err error)
func (*ProductDao) ListProductByCondition ¶
func (*ProductDao) SearchProduct ¶
func (*ProductDao) UpdateProduct ¶
func (dao *ProductDao) UpdateProduct(id uint, product *model.Product) error
type ProductImgDao ¶
func NewProductImgDao ¶
func NewProductImgDao(ctx context.Context) *ProductImgDao
func NewProductImgDaoByDB ¶
func NewProductImgDaoByDB(db *gorm.DB) *ProductImgDao
func (*ProductImgDao) CreateProductImg ¶
func (dao *ProductImgDao) CreateProductImg(productImg *model.ProductImg) error
func (*ProductImgDao) ListProductImg ¶
func (dao *ProductImgDao) ListProductImg(id uint) (productImg []*model.ProductImg, err error)
type UserDao ¶
func NewUserDao ¶
func NewUserDaoByDB ¶
func (*UserDao) ExistOrNotByUserName ¶
ExistOrNotByUserName 根据username判断是否存在该名字
func (*UserDao) GetUserById ¶
GetUserById 根据 id 获取 user
Click to show internal directories.
Click to hide internal directories.