34 lines
718 B
Go
34 lines
718 B
Go
|
|
package supplier
|
||
|
|
|
||
|
|
import (
|
||
|
|
"context"
|
||
|
|
|
||
|
|
"muyu-apiserver/gateway/internal/svc"
|
||
|
|
"muyu-apiserver/pkg/ctxdata"
|
||
|
|
"muyu-apiserver/rpc/purchase/purchaseservice"
|
||
|
|
|
||
|
|
"github.com/zeromicro/go-zero/core/logx"
|
||
|
|
)
|
||
|
|
|
||
|
|
type DeleteSupplierLogic struct {
|
||
|
|
logx.Logger
|
||
|
|
ctx context.Context
|
||
|
|
svcCtx *svc.ServiceContext
|
||
|
|
}
|
||
|
|
|
||
|
|
func NewDeleteSupplierLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteSupplierLogic {
|
||
|
|
return &DeleteSupplierLogic{
|
||
|
|
Logger: logx.WithContext(ctx),
|
||
|
|
ctx: ctx,
|
||
|
|
svcCtx: svcCtx,
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
func (l *DeleteSupplierLogic) DeleteSupplier() error {
|
||
|
|
id := ctxdata.GetPathId(l.ctx)
|
||
|
|
_, err := l.svcCtx.PurchaseRpc.DeleteSupplier(l.ctx, &purchaseservice.DeleteSupplierReq{
|
||
|
|
SupplierId: id,
|
||
|
|
})
|
||
|
|
return err
|
||
|
|
}
|