2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-04 09:13:49 +08:00

feat: 提交一批插件

This commit is contained in:
耗子
2024-09-27 22:51:54 +08:00
parent a00b44c485
commit 9a295241c3
27 changed files with 1294 additions and 50 deletions

View File

@@ -2,6 +2,7 @@ package data
import (
"github.com/TheTNB/panel/internal/biz"
"github.com/TheTNB/panel/internal/job"
"github.com/TheTNB/panel/internal/panel"
)
@@ -37,3 +38,12 @@ func (r *taskRepo) Delete(id uint) error {
func (r *taskRepo) UpdateStatus(id uint, status biz.TaskStatus) error {
return panel.Orm.Model(&biz.Task{}).Where("id = ?", id).Update("status", status).Error
}
func (r *taskRepo) Push(task *biz.Task) error {
if err := panel.Orm.Create(task).Error; err != nil {
return err
}
return panel.Queue.Push(job.NewProcessTask(r), []any{
task.ID,
})
}