voucher/internal/service/voucher.go

36 lines
616 B
Go

package service
import (
"github.com/go-kratos/kratos/v2/transport/http"
"github.com/robfig/cron"
"voucher/internal/biz"
"voucher/internal/conf"
)
type VoucherService struct {
bc *conf.Bootstrap
cron *cron.Cron
VoucherBiz *biz.VoucherBiz
}
func NewVoucherService(
bc *conf.Bootstrap,
cron *cron.Cron,
VoucherBiz *biz.VoucherBiz,
) *VoucherService {
return &VoucherService{
bc: bc,
cron: cron,
VoucherBiz: VoucherBiz,
}
}
func (s *VoucherService) Test(ctx http.Context) error {
if err := s.VoucherBiz.ExecuteNotice(ctx); err != nil {
return err
}
return nil
}