猪群领域其他方法映射到api

This commit is contained in:
2025-10-06 23:22:47 +08:00
parent 632bd20e7d
commit e142405bb3
10 changed files with 2783 additions and 35 deletions

View File

@@ -226,7 +226,7 @@ func (a *API) setupRoutes() {
}
a.logger.Info("猪圈相关接口注册成功 (需要认证和审计)")
// 猪批次相关路由组
// 猪相关路由组
pigBatchGroup := authGroup.Group("/pig-batches")
{
pigBatchGroup.POST("", a.pigBatchController.CreatePigBatch)
@@ -238,6 +238,16 @@ func (a *API) setupRoutes() {
pigBatchGroup.POST("/:fromBatchID/reclassify-pen", a.pigBatchController.ReclassifyPenToNewBatch)
pigBatchGroup.DELETE("/:batchID/remove-pen/:penID", a.pigBatchController.RemoveEmptyPenFromBatch)
pigBatchGroup.POST("/:id/move-pigs-into-pen", a.pigBatchController.MovePigsIntoPen)
pigBatchGroup.POST("/:id/sell-pigs", a.pigBatchController.SellPigs)
pigBatchGroup.POST("/:id/buy-pigs", a.pigBatchController.BuyPigs)
pigBatchGroup.POST("/:sourceBatchID/transfer-across-batches", a.pigBatchController.TransferPigsAcrossBatches)
pigBatchGroup.POST("/:id/transfer-within-batch", a.pigBatchController.TransferPigsWithinBatch)
pigBatchGroup.POST("/:id/record-sick-pigs", a.pigBatchController.RecordSickPigs)
pigBatchGroup.POST("/:id/record-sick-pig-recovery", a.pigBatchController.RecordSickPigRecovery)
pigBatchGroup.POST("/:id/record-sick-pig-death", a.pigBatchController.RecordSickPigDeath)
pigBatchGroup.POST("/:id/record-sick-pig-cull", a.pigBatchController.RecordSickPigCull)
pigBatchGroup.POST("/:id/record-death", a.pigBatchController.RecordDeath)
pigBatchGroup.POST("/:id/record-cull", a.pigBatchController.RecordCull)
}
a.logger.Info("猪批次相关接口注册成功 (需要认证和审计)")