coupon

package
v1.0.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 23, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CouponRepo

type CouponRepo interface {
	// CreateCoupon 创建优惠券
	CreateCoupon(ctx context.Context, name, code string, count int, typ int32, discount, startTime, expireTime, userLimit int64, subscribe string, usedCount int64, enable bool) error

	// UpdateCoupon 更新优惠券
	UpdateCoupon(ctx context.Context, id int, name, code string, count int, typ int32, discount, startTime, expireTime, userLimit int64, subscribe string, usedCount int64, enable bool) error

	// DeleteCoupon 删除优惠券
	DeleteCoupon(ctx context.Context, id int) error

	// BatchDeleteCoupon 批量删除优惠券
	BatchDeleteCoupon(ctx context.Context, ids []int) error

	// GetCouponList 获取优惠券列表
	GetCouponList(ctx context.Context, page, size, subscribe int64, search string) ([]*ent.ProxyCoupon, int32, error)

	// FindCouponByCode 根据代码查找优惠券(用于检查重复)
	FindCouponByCode(ctx context.Context, code string) (*ent.ProxyCoupon, error)
}

CouponRepo coupon repository interface

type CouponUseCase

type CouponUseCase struct {
	// contains filtered or unexported fields
}

CouponUseCase coupon use case

func NewCouponUseCase

func NewCouponUseCase(repo CouponRepo, logger log.Logger) *CouponUseCase

NewCouponUseCase creates a new CouponUseCase

func (*CouponUseCase) BatchDeleteCoupon

func (uc *CouponUseCase) BatchDeleteCoupon(ctx context.Context, ids []int) error

BatchDeleteCoupon 批量删除优惠券

func (*CouponUseCase) CreateCoupon

func (uc *CouponUseCase) CreateCoupon(ctx context.Context, name, code string, count int, typ int32, discount, startTime, expireTime, userLimit int64, subscribe []int, usedCount int64, enable bool) error

CreateCoupon 创建优惠券

func (*CouponUseCase) DeleteCoupon

func (uc *CouponUseCase) DeleteCoupon(ctx context.Context, id int) error

DeleteCoupon 删除优惠券

func (*CouponUseCase) GetCouponList

func (uc *CouponUseCase) GetCouponList(ctx context.Context, page, size, subscribe int64, search string) ([]*ent.ProxyCoupon, int32, error)

GetCouponList 获取优惠券列表

func (*CouponUseCase) UpdateCoupon

func (uc *CouponUseCase) UpdateCoupon(ctx context.Context, id int, name, code string, count int, typ int32, discount, startTime, expireTime, userLimit int64, subscribe []int, usedCount int64, enable bool) error

UpdateCoupon 更新优惠券

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL