增加删除API节点功能

This commit is contained in:
GoEdgeLab
2020-10-10 20:41:33 +08:00
parent 444ca7535e
commit 32ac0d62d3
5 changed files with 39 additions and 1 deletions

View File

@@ -0,0 +1,22 @@
package api
import (
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
)
type DeleteAction struct {
actionutils.ParentAction
}
func (this *DeleteAction) RunPost(params struct {
NodeId int64
}) {
_, err := this.RPC().APINodeRPC().DeleteAPINode(this.AdminContext(), &pb.DeleteAPINodeRequest{NodeId: params.NodeId})
if err != nil {
this.ErrorPage(err)
return
}
this.Success()
}