app-cloudep-product-service/internal/logic/product/delete_product_items_logic.go

35 lines
851 B
Go
Raw Normal View History

2025-04-09 09:29:56 +00:00
package productlogic
import (
"context"
"code.30cm.net/digimon/app-cloudep-product-service/gen_result/pb/product"
"code.30cm.net/digimon/app-cloudep-product-service/internal/svc"
"github.com/zeromicro/go-zero/core/logx"
)
type DeleteProductItemsLogic struct {
ctx context.Context
svcCtx *svc.ServiceContext
logx.Logger
}
func NewDeleteProductItemsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteProductItemsLogic {
return &DeleteProductItemsLogic{
ctx: ctx,
svcCtx: svcCtx,
Logger: logx.WithContext(ctx),
}
}
// DeleteProductItems 刪除 Delete Product Item
func (l *DeleteProductItemsLogic) DeleteProductItems(in *product.DeleteProductItemRequest) (*product.OKResp, error) {
err := l.svcCtx.ProductItemUseCase.Delete(l.ctx, in.GetId())
if err != nil {
return nil, err
}
return &product.OKResp{}, nil
}