fix: 导出表列表项查询

This commit is contained in:
TsMask
2025-02-27 19:31:28 +08:00
parent 62cb97ed1c
commit 2c6ad22bf2

View File

@@ -29,21 +29,17 @@ type SysJobResponse struct {
}
type TargetParams struct {
Duration int `json:"duration"`
TableName string `json:"tableName"`
Columns string `json:"columns"` // exported column name of time string
TimeCol string `json:"timeCol"` // time stamp of column name
TimeUnit string `json:"timeUnit"` // timestamp unit: second/micro/milli
Extras string `json:"extras"` // extras condition for where
FilePath string `json:"filePath"` // file path
Hour int `json:"hour"` // hour
TableName string `json:"tableName"`
Columns []string `json:"columns"`
FilePath string `json:"filePath"` // file path
}
func (m *SysJob) GetFileExportTable(c *gin.Context) {
var results []SysJob
err := db.DB("").Table(m.TableName()).Where("invoke_target=? and status=1", INVOKE_FILE_EXPORT).
Find(&results).Error
if err != nil {
tx := db.DB("").Table("sys_job").Where("invoke_target=?", INVOKE_FILE_EXPORT)
if err := tx.Find(&results).Error; err != nil {
c.JSON(http.StatusOK, services.ErrResp(err.Error()))
return
}