37 lines
826 B
Go
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()
|
|
}
|