Files
EdgeAdmin/internal/web/actions/default/servers/components/waf/ipadmin/deleteIP.go

29 lines
677 B
Go
Raw Normal View History

2020-11-07 19:40:18 +08:00
package ipadmin
2023-06-30 18:08:30 +08:00
import ( "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
"github.com/TeaOSLab/EdgeCommon/pkg/langs/codes"
2020-11-07 19:40:18 +08:00
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
)
type DeleteIPAction struct {
actionutils.ParentAction
}
func (this *DeleteIPAction) RunPost(params struct {
FirewallPolicyId int64
ItemId int64
2020-11-07 19:40:18 +08:00
}) {
// 日志
2023-06-30 18:08:30 +08:00
defer this.CreateLogInfo(codes.WAF_LogDeleteIPFromWAFPolicy, params.FirewallPolicyId, params.ItemId)
2020-11-07 19:40:18 +08:00
// TODO 判断权限
_, err := this.RPC().IPItemRPC().DeleteIPItem(this.AdminContext(), &pb.DeleteIPItemRequest{IpItemId: params.ItemId})
if err != nil {
this.ErrorPage(err)
return
}
this.Success()
}