作者 yangfu

fix: table preview

... ... @@ -11,6 +11,9 @@ import (
)
func (tableService *TableService) TablePreview(ctx *domain.Context, cmd *command.TablePreviewCommand) (interface{}, error) {
if cmd.TableId == 0 {
return &dto.TablePreviewDto{}, nil
}
if err := cmd.ValidateCommand(); err != nil {
return nil, application.ThrowError(application.ARG_ERROR, err.Error())
}
... ...
... ... @@ -278,6 +278,9 @@ func (ptr *QuerySetService) PreviewPrepare(ctx *domain.Context, querySetId int,
return t, nil
}
}
if len(queryComponents) == 0 {
return &domain.Table{}, nil
}
// 验证
if err = ptr.validQueryComponents(queryComponents); err != nil {
... ...