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