Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DetailExportJob ¶
func DetailExportJob(ctx *gin.Context, req *DetailExportJobRequest, resp *DetailExportJobResponse)
DetailExportJob 获取导出任务
Types ¶
type DetailExportJobRequest ¶
type DetailExportJobRequest struct { apiobj.BaseRequest Request struct { JobID string `json:"job_id"` } }
DetailExportJobRequest 获取导出任务
type DetailExportJobResponse ¶
type DetailExportJobResponse struct { apiobj.BaseResponse Response struct { JobID string `json:"job_id"` FileURL string `json:"file_url"` Status string `json:"status"` ErrMsg string `json:"err_msg"` } }
DetailExportJobResponse 获取导出任务返回
type ExportJob ¶
type ExportJob struct { gorm.Model // JobUUID JobUUID string `gorm:"column:job_uuid;type:varchar(36);not null;index"` // UserID 用户ID UserID uint `gorm:"column:user_id;type:int;not null;index"` // Purpose 导出类型,按业务分类,需要和导出文件上传 storage.Storager 的类型一致 Purpose config.FilePurpose `gorm:"column:purpose;type:varchar(255);not null;index"` // ExportStatus 导出状态 ExportStatus ExportStatus `gorm:"column:export_status;type:varchar(20);not null;index"` // CostSeconds 耗时 CostSeconds int `gorm:"column:cost_seconds;type:int;not null"` // TimeoutSeconds 超时时间 TimeoutSeconds int `gorm:"column:timeout_seconds;type:int;not null"` // Output 输出路径, 使用 storage.FileInfo.StoragePath 获取 Output string `gorm:"column:output;type:varchar(255);not null"` // ErrorMsg 错误信息 ErrorMsg string `gorm:"column:error_msg;type:varchar(255)"` }
ExportJob 导出任务
func CreateExportJob ¶
CreateExportJob 新建导出任务
func UpdateJobStatus ¶
UpdateJobStatus 更新任务状态
type ExportStatus ¶
type ExportStatus = string
ExportStatus 导出状态
const ( // ExportStatusPending 等待导出 ExportStatusPending ExportStatus = "pending" // ExportStatusSuccess 成功 ExportStatusSuccess ExportStatus = "success" // ExportStatusFailed 失败 ExportStatusFailed ExportStatus = "failed" )
Click to show internal directories.
Click to hide internal directories.