feat: add task type

This commit is contained in:
Максим Слипенко 2024-12-12 23:51:13 +03:00
parent cbf156f01e
commit 32b99f4f11
3 changed files with 15 additions and 1 deletions

2
.gitignore vendored
View file

@ -130,3 +130,5 @@ fabric.properties
# Игнорируем папку uploads # Игнорируем папку uploads
uploads uploads
app.db

View file

@ -29,11 +29,22 @@ const (
StatusCancelled // 4 StatusCancelled // 4
) )
type TaskType int
const (
// For future purpose
TypeTestOnly TaskType = iota // 0
TypeUpsert // 1
// For future purpose
TypeDelete // 2
)
type Task struct { type Task struct {
gorm.Model gorm.Model
ID int ID int
Status TaskStatus Status TaskStatus
Type TaskType
RepoID int RepoID int
Repo GitRepo Repo GitRepo

View file

@ -16,6 +16,7 @@ func (s *Service) Create(repo string) (*models.Task, error) {
task := models.Task{ task := models.Task{
RepoID: taskRepo.ID, RepoID: taskRepo.ID,
ALTRepo: altRepo, ALTRepo: altRepo,
Type: models.TypeUpsert,
} }
result := s.app.Db.Create(&task) result := s.app.Db.Create(&task)