fix: job for export table to file

This commit is contained in:
simonzhangsz committed 2024-08-29 14:38:22 +08:00
1 parent d1fd3e3343
commit dab8b3b926
2 files changed
+4 -5

No files matched your search

+1 -1
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
}
+3 -4
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 {