You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
603 B
Go

package coupon
// CouponRepository 优惠券仓储接口
type CouponRepository interface {
// Create 创建优惠券
Create(coupon *Coupon) error
// GetByID 根据ID获取优惠券
GetByID(id uint64) (*Coupon, error)
// GetByCode 根据优惠券码获取优惠券
GetByCode(code string) (*Coupon, error)
// List 获取优惠券列表
List(page, size int) ([]*Coupon, int64, error)
// ListByUserID 获取用户的优惠券列表
ListByUserID(userID uint64) ([]*Coupon, error)
// Update 更新优惠券
Update(coupon *Coupon) error
// Delete 删除优惠券
Delete(id uint64) error
}