define nats queue

This commit is contained in:
Sinh 2022-12-26 15:12:48 +07:00
parent b19fea04c8
commit e66596baf6
3 changed files with 23 additions and 0 deletions

8
model/queue_request.go Normal file
View File

@ -0,0 +1,8 @@
package model
type QueueScheduleTaskRequest struct {
ID string `json:"id"`
NatsSubject string `json:"natsSubject"`
Data string `json:"data"`
StartAt int64 `json:"startAt"` // unix
}

View File

@ -15,6 +15,7 @@ var prefixes = struct {
Staff string Staff string
Segment string Segment string
Product string Product string
Queue string
Campaign string Campaign string
Affiliate string Affiliate string
}{ }{
@ -32,6 +33,7 @@ var prefixes = struct {
Staff: "staff", Staff: "staff",
Segment: "segment", Segment: "segment",
Product: "product", Product: "product",
Queue: "queue",
Campaign: "campaign", Campaign: "campaign",
Affiliate: "affiliate", Affiliate: "affiliate",
} }

13
subject/queue.go Normal file
View File

@ -0,0 +1,13 @@
package subject
import "fmt"
func getQueueValue(val string) string {
return fmt.Sprintf("%s.%s", prefixes.Queue, val)
}
var Queue = struct {
ScheduleTask string
}{
ScheduleTask: getQueueValue("schedule_task"),
}