修复报错

This commit is contained in:
2025-11-05 23:10:51 +08:00
parent 10b123ab93
commit a1f7c09b2a
12 changed files with 51 additions and 44 deletions

View File

@@ -27,7 +27,7 @@ func (c *PigBatchController) TransferPigsAcrossBatches(ctx echo.Context) error {
var req dto.TransferPigsAcrossBatchesRequest
return handleAPIRequest(
c, ctx, action, &req,
reqCtx, c, ctx, action, &req,
func(ctx echo.Context, operatorID uint, primaryID uint, req *dto.TransferPigsAcrossBatchesRequest) error {
// primaryID 在这里是 sourceBatchID
return c.service.TransferPigsAcrossBatches(reqCtx, primaryID, req.DestBatchID, req.FromPenID, req.ToPenID, req.Quantity, operatorID, req.Remarks)
@@ -62,7 +62,7 @@ func (c *PigBatchController) TransferPigsWithinBatch(ctx echo.Context) error {
var req dto.TransferPigsWithinBatchRequest
return handleAPIRequest(
c, ctx, action, &req,
reqCtx, c, ctx, action, &req,
func(ctx echo.Context, operatorID uint, primaryID uint, req *dto.TransferPigsWithinBatchRequest) error {
// primaryID 在这里是 batchID
return c.service.TransferPigsWithinBatch(reqCtx, primaryID, req.FromPenID, req.ToPenID, req.Quantity, operatorID, req.Remarks)