数据集

This commit is contained in:
XM-GO
2023-04-30 11:15:15 +08:00
parent e825f42fd8
commit 5dfa857249
8 changed files with 61 additions and 28 deletions

View File

@@ -31,11 +31,11 @@ func (r *RuleChainApi) RuleChainTest(rc *restfulx.ReqCtx) {
// GetVisualRuleChainList WorkInfo列表数据
func (p *RuleChainApi) GetVisualRuleChainList(rc *restfulx.ReqCtx) {
data := entity.VisualRuleChain{}
pageNum := restfulx.QueryInt(rc, "pageNum", 1)
pageSize := restfulx.QueryInt(rc, "pageSize", 10)
ruleName := restfulx.QueryParam(rc, "ruleName")
status := restfulx.QueryParam(rc, "status")
data := entity.VisualRuleChain{RuleName: ruleName, Status: status}
data.RuleName = restfulx.QueryParam(rc, "ruleName")
data.Status = restfulx.QueryParam(rc, "status")
list, total := p.VisualRuleChainApp.FindListPage(pageNum, pageSize, data)
rc.ResData = model.ResultPage{

View File

@@ -6,6 +6,7 @@ package api
// 生成人panda
// ==========================================================================
import (
"github.com/XM-GO/PandaKit/biz"
"github.com/XM-GO/PandaKit/model"
"github.com/XM-GO/PandaKit/restfulx"
"strings"
@@ -35,6 +36,15 @@ func (p *VisualDataSetFieldApi) GetVisualDataSetFieldList(rc *restfulx.ReqCtx) {
}
}
// GetVisualDataSetFieldListAll DataSetField列表数据
func (p *VisualDataSetFieldApi) GetVisualDataSetFieldListAll(rc *restfulx.ReqCtx) {
data := entity.VisualDataSetField{}
data.TableId = restfulx.QueryParam(rc, "tableId")
biz.NotEmpty(data.TableId, "tableId 必传")
rc.ResData = p.VisualDataSetFieldApp.FindList(data)
}
// GetVisualDataSetField 获取DataSetField
func (p *VisualDataSetFieldApi) GetVisualDataSetField(rc *restfulx.ReqCtx) {
fieldId := restfulx.PathParam(rc, "fieldId")

View File

@@ -17,6 +17,7 @@ import (
"pandax/apps/visual/driver"
"pandax/apps/visual/entity"
"pandax/apps/visual/services"
"pandax/pkg/global"
"pandax/pkg/tool"
"path"
"strings"
@@ -80,7 +81,14 @@ func (p *VisualDataSetTableApi) InsertVisualDataSetTable(rc *restfulx.ReqCtx) {
}
one := p.VisualDataSourceApp.FindOne(data.DataSourceId)
if driver.TestConnection(one) != nil {
one.Status = "0"
one := p.VisualDataSourceApp.Update(*one)
global.Log.Errorf("数据源:%s不在线", one.SourceName)
return
}
instance := driver.NewDbInstance(one)
sql := ""
if data.TableType == "db" {
sql = fmt.Sprintf(`select * from %s LIMIT 1`, info["table"])