// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved. //go:build plus package plan import ( "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils" "github.com/TeaOSLab/EdgeCommon/pkg/langs/codes" "github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb" ) type DeleteAction struct { actionutils.ParentAction } func (this *DeleteAction) RunPost(params struct { PlanId int64 }) { defer this.CreateLogInfo(codes.Plan_LogDeletePlan, params.PlanId) // TODO 检查套餐是否正在使用 _, err := this.RPC().PlanRPC().DeletePlan(this.AdminContext(), &pb.DeletePlanRequest{PlanId: params.PlanId}) if err != nil { this.ErrorPage(err) return } this.Success() }