Files
waf-platform/EdgeUser/internal/web/actions/default/ns/domains/deletePage.go
2026-02-04 20:27:13 +08:00

37 lines
826 B
Go

// Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. Official site: https://goedge.cn .
package domains
import (
"github.com/TeaOSLab/EdgeCommon/pkg/langs/codes"
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
"github.com/TeaOSLab/EdgeUser/internal/web/actions/actionutils"
)
type DeletePageAction struct {
actionutils.ParentAction
}
func (this *DeletePageAction) RunPost(params struct {
DomainIds []int64
}) {
defer this.CreateLogInfo(codes.NS_LogDeleteNSDomainsBatch, this.UserId())
if len(params.DomainIds) == 0 {
this.Success()
return
}
for _, domainId := range params.DomainIds {
_, err := this.RPC().NSDomainRPC().DeleteNSDomain(this.UserContext(), &pb.DeleteNSDomainRequest{
NsDomainId: domainId,
})
if err != nil {
this.ErrorPage(err)
return
}
}
this.Success()
}