28 lines
657 B
Go
28 lines
657 B
Go
// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
|
|
|
|
package clusters
|
|
|
|
import (
|
|
"github.com/TeaOSLab/EdgeCommon/pkg/langs/codes"
|
|
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
|
"github.com/TeaOSLab/EdgeUser/internal/web/actions/actionutils"
|
|
)
|
|
|
|
type DeleteAction struct {
|
|
actionutils.ParentAction
|
|
}
|
|
|
|
func (this *DeleteAction) RunPost(params struct {
|
|
RouteId int64
|
|
}) {
|
|
defer this.CreateLogInfo(codes.NSRoute_LogDeleteNSRoute, params.RouteId)
|
|
|
|
_, err := this.RPC().NSRouteRPC().DeleteNSRoute(this.UserContext(), &pb.DeleteNSRouteRequest{NsRouteId: params.RouteId})
|
|
if err != nil {
|
|
this.ErrorPage(err)
|
|
return
|
|
}
|
|
|
|
this.Success()
|
|
}
|