mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-07 23:30:26 +08:00
28 lines
645 B
Go
28 lines
645 B
Go
|
|
// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
|
||
|
|
|
||
|
|
package ipbox
|
||
|
|
|
||
|
|
import (
|
||
|
|
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||
|
|
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
||
|
|
)
|
||
|
|
|
||
|
|
type DeleteFromListAction struct {
|
||
|
|
actionutils.ParentAction
|
||
|
|
}
|
||
|
|
|
||
|
|
func (this *DeleteFromListAction) RunPost(params struct {
|
||
|
|
ListId int64
|
||
|
|
ItemId int64
|
||
|
|
}) {
|
||
|
|
defer this.CreateLogInfo("从IP名单 %d 中删除IP %d", params.ListId, params.ItemId)
|
||
|
|
|
||
|
|
_, err := this.RPC().IPItemRPC().DeleteIPItem(this.AdminContext(), &pb.DeleteIPItemRequest{IpItemId: params.ItemId})
|
||
|
|
if err != nil {
|
||
|
|
this.ErrorPage(err)
|
||
|
|
return
|
||
|
|
}
|
||
|
|
|
||
|
|
this.Success()
|
||
|
|
}
|