120 lines
4.2 KiB
Go
120 lines
4.2 KiB
Go
|
|
// Code generated by goctl. DO NOT EDIT.
|
||
|
|
// goctl 1.9.2
|
||
|
|
// Source: inventory.proto
|
||
|
|
|
||
|
|
package server
|
||
|
|
|
||
|
|
import (
|
||
|
|
"context"
|
||
|
|
|
||
|
|
"muyu-apiserver/rpc/inventory/internal/logic"
|
||
|
|
"muyu-apiserver/rpc/inventory/internal/svc"
|
||
|
|
"muyu-apiserver/rpc/inventory/pb"
|
||
|
|
)
|
||
|
|
|
||
|
|
type InventoryServiceServer struct {
|
||
|
|
svcCtx *svc.ServiceContext
|
||
|
|
pb.UnimplementedInventoryServiceServer
|
||
|
|
}
|
||
|
|
|
||
|
|
func NewInventoryServiceServer(svcCtx *svc.ServiceContext) *InventoryServiceServer {
|
||
|
|
return &InventoryServiceServer{
|
||
|
|
svcCtx: svcCtx,
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
// Product
|
||
|
|
func (s *InventoryServiceServer) CreateProduct(ctx context.Context, in *pb.CreateProductReq) (*pb.IdResp, error) {
|
||
|
|
l := logic.NewCreateProductLogic(ctx, s.svcCtx)
|
||
|
|
return l.CreateProduct(in)
|
||
|
|
}
|
||
|
|
|
||
|
|
func (s *InventoryServiceServer) UpdateProduct(ctx context.Context, in *pb.UpdateProductReq) (*pb.Empty, error) {
|
||
|
|
l := logic.NewUpdateProductLogic(ctx, s.svcCtx)
|
||
|
|
return l.UpdateProduct(in)
|
||
|
|
}
|
||
|
|
|
||
|
|
func (s *InventoryServiceServer) DeleteProduct(ctx context.Context, in *pb.DeleteProductReq) (*pb.Empty, error) {
|
||
|
|
l := logic.NewDeleteProductLogic(ctx, s.svcCtx)
|
||
|
|
return l.DeleteProduct(in)
|
||
|
|
}
|
||
|
|
|
||
|
|
func (s *InventoryServiceServer) GetProduct(ctx context.Context, in *pb.GetProductReq) (*pb.ProductInfo, error) {
|
||
|
|
l := logic.NewGetProductLogic(ctx, s.svcCtx)
|
||
|
|
return l.GetProduct(in)
|
||
|
|
}
|
||
|
|
|
||
|
|
func (s *InventoryServiceServer) ListProduct(ctx context.Context, in *pb.ListProductReq) (*pb.ListProductResp, error) {
|
||
|
|
l := logic.NewListProductLogic(ctx, s.svcCtx)
|
||
|
|
return l.ListProduct(in)
|
||
|
|
}
|
||
|
|
|
||
|
|
// Import
|
||
|
|
func (s *InventoryServiceServer) ImportProducts(ctx context.Context, in *pb.ImportProductReq) (*pb.ImportProductResp, error) {
|
||
|
|
l := logic.NewImportProductsLogic(ctx, s.svcCtx)
|
||
|
|
return l.ImportProducts(in)
|
||
|
|
}
|
||
|
|
|
||
|
|
func (s *InventoryServiceServer) ListImportLog(ctx context.Context, in *pb.ListImportLogReq) (*pb.ListImportLogResp, error) {
|
||
|
|
l := logic.NewListImportLogLogic(ctx, s.svcCtx)
|
||
|
|
return l.ListImportLog(in)
|
||
|
|
}
|
||
|
|
|
||
|
|
// Stock Statistics
|
||
|
|
func (s *InventoryServiceServer) GetStockSummary(ctx context.Context, in *pb.StockSummaryReq) (*pb.StockSummaryResp, error) {
|
||
|
|
l := logic.NewGetStockSummaryLogic(ctx, s.svcCtx)
|
||
|
|
return l.GetStockSummary(in)
|
||
|
|
}
|
||
|
|
|
||
|
|
func (s *InventoryServiceServer) GetStockGroup(ctx context.Context, in *pb.StockGroupReq) (*pb.StockGroupResp, error) {
|
||
|
|
l := logic.NewGetStockGroupLogic(ctx, s.svcCtx)
|
||
|
|
return l.GetStockGroup(in)
|
||
|
|
}
|
||
|
|
|
||
|
|
// Stock Check
|
||
|
|
func (s *InventoryServiceServer) CreateStockCheck(ctx context.Context, in *pb.CreateStockCheckReq) (*pb.IdResp, error) {
|
||
|
|
l := logic.NewCreateStockCheckLogic(ctx, s.svcCtx)
|
||
|
|
return l.CreateStockCheck(in)
|
||
|
|
}
|
||
|
|
|
||
|
|
func (s *InventoryServiceServer) UpdateStockCheck(ctx context.Context, in *pb.UpdateStockCheckReq) (*pb.Empty, error) {
|
||
|
|
l := logic.NewUpdateStockCheckLogic(ctx, s.svcCtx)
|
||
|
|
return l.UpdateStockCheck(in)
|
||
|
|
}
|
||
|
|
|
||
|
|
func (s *InventoryServiceServer) ConfirmStockCheck(ctx context.Context, in *pb.ConfirmStockCheckReq) (*pb.Empty, error) {
|
||
|
|
l := logic.NewConfirmStockCheckLogic(ctx, s.svcCtx)
|
||
|
|
return l.ConfirmStockCheck(in)
|
||
|
|
}
|
||
|
|
|
||
|
|
func (s *InventoryServiceServer) GetStockCheck(ctx context.Context, in *pb.GetStockCheckReq) (*pb.StockCheckInfo, error) {
|
||
|
|
l := logic.NewGetStockCheckLogic(ctx, s.svcCtx)
|
||
|
|
return l.GetStockCheck(in)
|
||
|
|
}
|
||
|
|
|
||
|
|
func (s *InventoryServiceServer) ListStockCheck(ctx context.Context, in *pb.ListStockCheckReq) (*pb.ListStockCheckResp, error) {
|
||
|
|
l := logic.NewListStockCheckLogic(ctx, s.svcCtx)
|
||
|
|
return l.ListStockCheck(in)
|
||
|
|
}
|
||
|
|
|
||
|
|
// Stock Adjust
|
||
|
|
func (s *InventoryServiceServer) CreateStockAdjust(ctx context.Context, in *pb.CreateStockAdjustReq) (*pb.IdResp, error) {
|
||
|
|
l := logic.NewCreateStockAdjustLogic(ctx, s.svcCtx)
|
||
|
|
return l.CreateStockAdjust(in)
|
||
|
|
}
|
||
|
|
|
||
|
|
func (s *InventoryServiceServer) ApproveStockAdjust(ctx context.Context, in *pb.ApproveStockAdjustReq) (*pb.Empty, error) {
|
||
|
|
l := logic.NewApproveStockAdjustLogic(ctx, s.svcCtx)
|
||
|
|
return l.ApproveStockAdjust(in)
|
||
|
|
}
|
||
|
|
|
||
|
|
func (s *InventoryServiceServer) GetStockAdjust(ctx context.Context, in *pb.GetStockAdjustReq) (*pb.StockAdjustInfo, error) {
|
||
|
|
l := logic.NewGetStockAdjustLogic(ctx, s.svcCtx)
|
||
|
|
return l.GetStockAdjust(in)
|
||
|
|
}
|
||
|
|
|
||
|
|
func (s *InventoryServiceServer) ListStockAdjust(ctx context.Context, in *pb.ListStockAdjustReq) (*pb.ListStockAdjustResp, error) {
|
||
|
|
l := logic.NewListStockAdjustLogic(ctx, s.svcCtx)
|
||
|
|
return l.ListStockAdjust(in)
|
||
|
|
}
|