interface.go 573 B

12345678910111213141516171819202122232425262728293031
  1. package asynq
  2. import (
  3. "context"
  4. "kpt-pasture/config"
  5. "kpt-pasture/service/asynqsvc"
  6. "kpt-pasture/service/redis"
  7. "kpt-pasture/store/kptstore"
  8. "gitee.com/xuyiping_admin/pkg/di"
  9. "github.com/hibiken/asynq"
  10. "go.uber.org/dig"
  11. )
  12. var Module = di.Options(di.Provide(NewJob))
  13. func NewJob(entry Entry) BizExec {
  14. return &entry
  15. }
  16. type Entry struct {
  17. dig.In
  18. Cfg *config.AppConfig
  19. DB *kptstore.DB
  20. AsynqClient asynqsvc.Client
  21. Redis *redis.CacheStoreRedisEntry
  22. }
  23. type BizExec interface {
  24. DayWorkOrder(ctx context.Context, t *asynq.Task) error
  25. }