mirror of
https://gitee.com/XM-GO/PandaX.git
synced 2026-04-23 02:48:34 +08:00
[优化]
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"github.com/PandaXGO/PandaKit/biz"
|
||||
"github.com/PandaXGO/PandaKit/model"
|
||||
"github.com/PandaXGO/PandaKit/restfulx"
|
||||
"github.com/PandaXGO/PandaKit/utils"
|
||||
"pandax/apps/job/api/from"
|
||||
"pandax/apps/job/entity"
|
||||
"pandax/apps/job/jobs"
|
||||
"pandax/apps/job/services"
|
||||
"pandax/kit/biz"
|
||||
"pandax/kit/model"
|
||||
"pandax/kit/restfulx"
|
||||
"pandax/kit/utils"
|
||||
"strings"
|
||||
)
|
||||
|
||||
@@ -19,7 +19,7 @@ type JobApi struct {
|
||||
func (j *JobApi) CreateJob(rc *restfulx.ReqCtx) {
|
||||
var job entity.SysJob
|
||||
restfulx.BindQuery(rc, &job)
|
||||
job.Id = utils.GenerateID()
|
||||
job.Id = utils.GenerateID("j")
|
||||
job.Owner = rc.LoginAccount.UserName
|
||||
job.OrgId = rc.LoginAccount.OrganizationId
|
||||
_, err := j.JobApp.Insert(job)
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"github.com/PandaXGO/PandaKit/biz"
|
||||
"github.com/PandaXGO/PandaKit/model"
|
||||
"github.com/PandaXGO/PandaKit/restfulx"
|
||||
"pandax/apps/job/entity"
|
||||
"pandax/apps/job/services"
|
||||
"pandax/kit/biz"
|
||||
"pandax/kit/model"
|
||||
"pandax/kit/restfulx"
|
||||
"strings"
|
||||
)
|
||||
|
||||
|
||||
@@ -2,11 +2,11 @@ package jobs
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/PandaXGO/PandaKit/utils"
|
||||
"pandax/apps/job/entity"
|
||||
logEntity "pandax/apps/job/entity"
|
||||
"pandax/apps/job/services"
|
||||
logServices "pandax/apps/job/services"
|
||||
"pandax/kit/utils"
|
||||
"pandax/pkg/global"
|
||||
"sync"
|
||||
"time"
|
||||
@@ -52,7 +52,7 @@ type ExecJob struct {
|
||||
func (e *ExecJob) Run() {
|
||||
startTime := time.Now()
|
||||
jobLog := logEntity.JobLog{Name: e.Name, EntryId: e.EntryId, TargetInvoke: e.InvokeTarget, Status: "0"}
|
||||
jobLog.Id = utils.GenerateID()
|
||||
jobLog.Id = utils.GenerateID("j")
|
||||
jobLog.OrgId = e.OrgId
|
||||
jobLog.Owner = e.Owner
|
||||
var obj = jobList[e.InvokeTarget]
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"github.com/PandaXGO/PandaKit/model"
|
||||
"github.com/PandaXGO/PandaKit/restfulx"
|
||||
"pandax/apps/job/api"
|
||||
"pandax/apps/job/entity"
|
||||
"pandax/apps/job/services"
|
||||
"pandax/kit/model"
|
||||
"pandax/kit/restfulx"
|
||||
|
||||
restfulspec "github.com/emicklei/go-restful-openapi/v2"
|
||||
"github.com/emicklei/go-restful/v3"
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"github.com/PandaXGO/PandaKit/model"
|
||||
"github.com/PandaXGO/PandaKit/restfulx"
|
||||
"pandax/apps/job/api"
|
||||
"pandax/apps/job/services"
|
||||
"pandax/kit/model"
|
||||
"pandax/kit/restfulx"
|
||||
|
||||
restfulspec "github.com/emicklei/go-restful-openapi/v2"
|
||||
"github.com/emicklei/go-restful/v3"
|
||||
|
||||
Reference in New Issue
Block a user