fix: job for export table to file

This commit is contained in:
2024-08-29 14:38:22 +08:00
parent d1fd3e3343
commit dab8b3b926
2 changed files with 4 additions and 5 deletions

View File

@@ -45,7 +45,7 @@ func (m *SysJob) GetFileExportTable(c *gin.Context) {
var response []SysJobResponse
for _, job := range results {
var params TargetParams
if err := json.Unmarshal(job.TargetParams, &params); err != nil {
if err := json.Unmarshal([]byte(job.TargetParams), &params); err != nil {
c.JSON(http.StatusInternalServerError, services.ErrResp(err.Error()))
return
}

View File

@@ -2,7 +2,6 @@ package file_export
import (
"be.ems/lib/file"
"gorm.io/datatypes"
)
const (
@@ -10,9 +9,9 @@ const (
)
type SysJob struct {
JobID int64 `gorm:"column:job_id;primary_key;auto_increment" json:"job_id"` //任务ID
InvokeTarget string `gorm:"column:invoke_target" json:"invoke_target"` //调用目标字符串
TargetParams datatypes.JSON `gorm:"column:target_params;type:json" json:"target_params,omitempty"` //调用目标传入参数
JobID int64 `gorm:"column:job_id;primary_key;auto_increment" json:"job_id"` //任务ID
InvokeTarget string `gorm:"column:invoke_target" json:"invoke_target"` //调用目标字符串
TargetParams string `gorm:"column:target_params;type:json" json:"target_params,omitempty"` //调用目标传入参数
}
func (m *SysJob) TableName() string {