feat/add-database #8
3 changed files with 15 additions and 1 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -129,4 +129,6 @@ fabric.properties
|
|||
.idea/**/azureSettings.xml
|
||||
|
||||
# Игнорируем папку uploads
|
||||
uploads
|
||||
uploads
|
||||
|
||||
app.db
|
|
@ -29,11 +29,22 @@ const (
|
|||
StatusCancelled // 4
|
||||
)
|
||||
|
||||
type TaskType int
|
||||
|
||||
const (
|
||||
// For future purpose
|
||||
TypeTestOnly TaskType = iota // 0
|
||||
TypeUpsert // 1
|
||||
// For future purpose
|
||||
TypeDelete // 2
|
||||
)
|
||||
|
||||
type Task struct {
|
||||
gorm.Model
|
||||
|
||||
ID int
|
||||
Status TaskStatus
|
||||
Type TaskType
|
||||
|
||||
RepoID int
|
||||
Repo GitRepo
|
||||
|
|
|
@ -16,6 +16,7 @@ func (s *Service) Create(repo string) (*models.Task, error) {
|
|||
task := models.Task{
|
||||
RepoID: taskRepo.ID,
|
||||
ALTRepo: altRepo,
|
||||
Type: models.TypeUpsert,
|
||||
}
|
||||
|
||||
result := s.app.Db.Create(&task)
|
||||
|
|
Loading…
Reference in a new issue