25 lines
657 B
Go
25 lines
657 B
Go
package myPlant
|
|
|
|
import (
|
|
"context"
|
|
"github.com/zeromicro/go-zero/core/logx"
|
|
"sundynix-micro-go/app/plant/api/internal/svc"
|
|
"sundynix-micro-go/app/plant/api/internal/types"
|
|
"sundynix-micro-go/app/plant/rpc/plant"
|
|
)
|
|
|
|
type DeletePlantLogic struct {
|
|
logx.Logger
|
|
ctx context.Context
|
|
svcCtx *svc.ServiceContext
|
|
}
|
|
|
|
func NewDeletePlantLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeletePlantLogic {
|
|
return &DeletePlantLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx}
|
|
}
|
|
|
|
func (l *DeletePlantLogic) DeletePlant(req *types.IdsReq) error {
|
|
_, err := l.svcCtx.PlantRpc.DeletePlant(l.ctx, &plant.IdsReq{Ids: req.Ids})
|
|
return err
|
|
}
|