2021-12-02 17:11:44 +08:00
|
|
|
// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
|
|
|
|
|
|
|
|
|
|
package ipbox
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
2023-06-30 18:08:30 +08:00
|
|
|
"github.com/TeaOSLab/EdgeCommon/pkg/langs/codes"
|
2021-12-02 17:11:44 +08:00
|
|
|
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type DeleteFromListAction struct {
|
|
|
|
|
actionutils.ParentAction
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (this *DeleteFromListAction) RunPost(params struct {
|
|
|
|
|
ListId int64
|
|
|
|
|
ItemId int64
|
|
|
|
|
}) {
|
2023-06-30 18:08:30 +08:00
|
|
|
defer this.CreateLogInfo(codes.IPItem_LogDeleteIPItem, params.ListId, params.ItemId)
|
2021-12-02 17:11:44 +08:00
|
|
|
|
|
|
|
|
_, err := this.RPC().IPItemRPC().DeleteIPItem(this.AdminContext(), &pb.DeleteIPItemRequest{IpItemId: params.ItemId})
|
|
|
|
|
if err != nil {
|
|
|
|
|
this.ErrorPage(err)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.Success()
|
|
|
|
|
}
|