modify lead target mig files and added struct for redis tg task

This commit is contained in:
pasha1coil 2024-07-11 11:37:39 +03:00
parent c2a0ba2ac3
commit b7ab43df14
3 changed files with 15 additions and 7 deletions

@ -13,6 +13,7 @@ CREATE TABLE IF NOT EXISTS leadtarget(
Type LeadTargetType NOT NULL, Type LeadTargetType NOT NULL,
QuizID integer NOT NULL DEFAULT 0, QuizID integer NOT NULL DEFAULT 0,
Target text NOT NULL, Target text NOT NULL,
InviteLink text NOT NULL DEFAULT '',
Deleted boolean NOT NULL DEFAULT false, Deleted boolean NOT NULL DEFAULT false,
CreatedAt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP CreatedAt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
); );

@ -314,6 +314,7 @@ type LeadTarget struct {
Type LeadTargetType `json:"type"` Type LeadTargetType `json:"type"`
QuizID int32 `json:"quizID"` QuizID int32 `json:"quizID"`
Target string `json:"target"` Target string `json:"target"`
InviteLink string `json:"inviteLink"` // например указывается для типа телеграмма для созданного канала
Deleted bool `json:"deleted"` Deleted bool `json:"deleted"`
CreatedAt time.Time `json:"createdAt"` CreatedAt time.Time `json:"createdAt"`
} }

@ -20,3 +20,9 @@ const (
InactiveTg TgAccountStatus = "inactive" InactiveTg TgAccountStatus = "inactive"
BanTg TgAccountStatus = "ban" BanTg TgAccountStatus = "ban"
) )
type TgRedisTask struct {
Name string
QuizID int32
AccountID string
}