feat(all): v1.0
This commit is contained in:
28
app/user/cmd/api/internal/queue/routes.go
Normal file
28
app/user/cmd/api/internal/queue/routes.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package queue
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/hibiken/asynq"
|
||||
"qnc-server/app/user/cmd/api/internal/svc"
|
||||
"qnc-server/app/user/cmd/api/internal/types"
|
||||
)
|
||||
|
||||
type CronJob struct {
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
}
|
||||
|
||||
func NewCronJob(ctx context.Context, svcCtx *svc.ServiceContext) *CronJob {
|
||||
return &CronJob{
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
func (l *CronJob) Register() *asynq.ServeMux {
|
||||
|
||||
mux := asynq.NewServeMux()
|
||||
|
||||
mux.Handle(types.MsgPaySuccessQuery, NewPaySuccessNotifyUserHandler(l.svcCtx))
|
||||
return mux
|
||||
}
|
||||
Reference in New Issue
Block a user