mirror of
https://gitee.com/XM-GO/PandaX.git
synced 2026-05-13 15:12:09 +08:00
规则链日志
This commit is contained in:
41
apps/rule/api/rulechain_log.go
Normal file
41
apps/rule/api/rulechain_log.go
Normal file
@@ -0,0 +1,41 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"github.com/XM-GO/PandaKit/model"
|
||||
"github.com/XM-GO/PandaKit/restfulx"
|
||||
"pandax/apps/rule/entity"
|
||||
"pandax/apps/rule/services"
|
||||
"pandax/pkg/rule_engine/nodes"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type RuleChainMsgLogApi struct {
|
||||
RuleChainMsgLogApp services.RuleChainMsgLogModel
|
||||
}
|
||||
|
||||
func (r *RuleChainMsgLogApi) GetNodeLabels(rc *restfulx.ReqCtx) {
|
||||
rc.ResData = nodes.GetCategory()
|
||||
}
|
||||
|
||||
// GetRuleChainMsgLogList 列表数据
|
||||
func (p *RuleChainMsgLogApi) GetRuleChainMsgLogList(rc *restfulx.ReqCtx) {
|
||||
data := entity.RuleChainMsgLog{}
|
||||
pageNum := restfulx.QueryInt(rc, "pageNum", 1)
|
||||
pageSize := restfulx.QueryInt(rc, "pageSize", 10)
|
||||
data.DeviceName = restfulx.QueryParam(rc, "deviceName")
|
||||
list, total := p.RuleChainMsgLogApp.FindListPage(pageNum, pageSize, data)
|
||||
|
||||
rc.ResData = model.ResultPage{
|
||||
Total: total,
|
||||
PageNum: int64(pageNum),
|
||||
PageSize: int64(pageNum),
|
||||
Data: list,
|
||||
}
|
||||
}
|
||||
|
||||
// DeleteRuleChainMsgLog 删除规则链
|
||||
func (p *RuleChainMsgLogApi) DeleteRuleChainMsgLog(rc *restfulx.ReqCtx) {
|
||||
id := restfulx.PathParam(rc, "id")
|
||||
ids := strings.Split(id, ",")
|
||||
p.RuleChainMsgLogApp.Delete(ids)
|
||||
}
|
||||
Reference in New Issue
Block a user