处理路由冲突
This commit is contained in:
@@ -55,7 +55,7 @@ func (c *PigBatchController) CreatePigBatch(ctx *gin.Context) {
|
||||
// @Produce json
|
||||
// @Param id path int true "猪批次ID"
|
||||
// @Success 200 {object} controller.Response{data=dto.PigBatchResponseDTO} "获取成功"
|
||||
// @Router /api/v1/pig-batches/{id} [get]\
|
||||
// @Router /api/v1/pig-batches/{id} [get]
|
||||
func (c *PigBatchController) GetPigBatch(ctx *gin.Context) {
|
||||
const action = "获取猪批次"
|
||||
|
||||
@@ -144,7 +144,7 @@ func (c *PigBatchController) ListPigBatches(ctx *gin.Context) {
|
||||
// @Param id path int true "猪批次ID"
|
||||
// @Param body body dto.AssignEmptyPensToBatchRequest true "待分配的猪栏ID列表"
|
||||
// @Success 200 {object} controller.Response "分配成功"
|
||||
// @Router /api/v1/pig-batches/{id}/assign-pens [post]
|
||||
// @Router /api/v1/pig-batches/assign-pens/{id} [post]
|
||||
func (c *PigBatchController) AssignEmptyPensToBatch(ctx *gin.Context) {
|
||||
const action = "为猪批次分配空栏"
|
||||
var req dto.AssignEmptyPensToBatchRequest
|
||||
@@ -168,7 +168,7 @@ func (c *PigBatchController) AssignEmptyPensToBatch(ctx *gin.Context) {
|
||||
// @Param fromBatchID path int true "源猪批次ID"
|
||||
// @Param body body dto.ReclassifyPenToNewBatchRequest true "划拨请求信息 (包含目标批次ID、猪栏ID和备注)"
|
||||
// @Success 200 {object} controller.Response "划拨成功"
|
||||
// @Router /api/v1/pig-batches/{fromBatchID}/reclassify-pen [post]
|
||||
// @Router /api/v1/pig-batches/reclassify-pen/{fromBatchID} [post]
|
||||
func (c *PigBatchController) ReclassifyPenToNewBatch(ctx *gin.Context) {
|
||||
const action = "划拨猪栏到新批次"
|
||||
var req dto.ReclassifyPenToNewBatchRequest
|
||||
@@ -199,7 +199,7 @@ func (c *PigBatchController) ReclassifyPenToNewBatch(ctx *gin.Context) {
|
||||
// @Param batchID path int true "猪批次ID"
|
||||
// @Param penID path int true "待移除的猪栏ID"
|
||||
// @Success 200 {object} controller.Response "移除成功"
|
||||
// @Router /api/v1/pig-batches/{batchID}/remove-pen/{penID} [delete]
|
||||
// @Router /api/v1/pig-batches/remove-pen/{penID}/{batchID} [delete]
|
||||
func (c *PigBatchController) RemoveEmptyPenFromBatch(ctx *gin.Context) {
|
||||
const action = "从猪批次移除空栏"
|
||||
|
||||
@@ -235,7 +235,7 @@ func (c *PigBatchController) RemoveEmptyPenFromBatch(ctx *gin.Context) {
|
||||
// @Param id path int true "猪批次ID"
|
||||
// @Param body body dto.MovePigsIntoPenRequest true "移入猪只请求信息 (包含目标猪栏ID、数量和备注)"
|
||||
// @Success 200 {object} controller.Response "移入成功"
|
||||
// @Router /api/v1/pig-batches/{id}/move-pigs-into-pen [post]
|
||||
// @Router /api/v1/pig-batches/move-pigs-into-pen/{id} [post]
|
||||
func (c *PigBatchController) MovePigsIntoPen(ctx *gin.Context) {
|
||||
const action = "将猪只移入猪栏"
|
||||
var req dto.MovePigsIntoPenRequest
|
||||
|
||||
@@ -14,7 +14,7 @@ import (
|
||||
// @Param id path int true "猪批次ID"
|
||||
// @Param body body dto.RecordSickPigsRequest true "记录病猪请求信息"
|
||||
// @Success 200 {object} controller.Response "记录成功"
|
||||
// @Router /api/v1/pig-batches/{id}/record-sick-pigs [post]
|
||||
// @Router /api/v1/pig-batches/record-sick-pigs/{id} [post]
|
||||
func (c *PigBatchController) RecordSickPigs(ctx *gin.Context) {
|
||||
const action = "记录新增病猪事件"
|
||||
var req dto.RecordSickPigsRequest
|
||||
@@ -38,7 +38,7 @@ func (c *PigBatchController) RecordSickPigs(ctx *gin.Context) {
|
||||
// @Param id path int true "猪批次ID"
|
||||
// @Param body body dto.RecordSickPigRecoveryRequest true "记录病猪康复请求信息"
|
||||
// @Success 200 {object} controller.Response "记录成功"
|
||||
// @Router /api/v1/pig-batches/{id}/record-sick-pig-recovery [post]
|
||||
// @Router /api/v1/pig-batches/record-sick-pig-recovery/{id} [post]
|
||||
func (c *PigBatchController) RecordSickPigRecovery(ctx *gin.Context) {
|
||||
const action = "记录病猪康复事件"
|
||||
var req dto.RecordSickPigRecoveryRequest
|
||||
@@ -62,7 +62,7 @@ func (c *PigBatchController) RecordSickPigRecovery(ctx *gin.Context) {
|
||||
// @Param id path int true "猪批次ID"
|
||||
// @Param body body dto.RecordSickPigDeathRequest true "记录病猪死亡请求信息"
|
||||
// @Success 200 {object} controller.Response "记录成功"
|
||||
// @Router /api/v1/pig-batches/{id}/record-sick-pig-death [post]
|
||||
// @Router /api/v1/pig-batches/record-sick-pig-death/{id} [post]
|
||||
func (c *PigBatchController) RecordSickPigDeath(ctx *gin.Context) {
|
||||
const action = "记录病猪死亡事件"
|
||||
var req dto.RecordSickPigDeathRequest
|
||||
@@ -86,7 +86,7 @@ func (c *PigBatchController) RecordSickPigDeath(ctx *gin.Context) {
|
||||
// @Param id path int true "猪批次ID"
|
||||
// @Param body body dto.RecordSickPigCullRequest true "记录病猪淘汰请求信息"
|
||||
// @Success 200 {object} controller.Response "记录成功"
|
||||
// @Router /api/v1/pig-batches/{id}/record-sick-pig-cull [post]
|
||||
// @Router /api/v1/pig-batches/record-sick-pig-cull/{id} [post]
|
||||
func (c *PigBatchController) RecordSickPigCull(ctx *gin.Context) {
|
||||
const action = "记录病猪淘汰事件"
|
||||
var req dto.RecordSickPigCullRequest
|
||||
@@ -110,7 +110,7 @@ func (c *PigBatchController) RecordSickPigCull(ctx *gin.Context) {
|
||||
// @Param id path int true "猪批次ID"
|
||||
// @Param body body dto.RecordDeathRequest true "记录正常猪只死亡请求信息"
|
||||
// @Success 200 {object} controller.Response "记录成功"
|
||||
// @Router /api/v1/pig-batches/{id}/record-death [post]
|
||||
// @Router /api/v1/pig-batches/record-death/{id} [post]
|
||||
func (c *PigBatchController) RecordDeath(ctx *gin.Context) {
|
||||
const action = "记录正常猪只死亡事件"
|
||||
var req dto.RecordDeathRequest
|
||||
@@ -134,7 +134,7 @@ func (c *PigBatchController) RecordDeath(ctx *gin.Context) {
|
||||
// @Param id path int true "猪批次ID"
|
||||
// @Param body body dto.RecordCullRequest true "记录正常猪只淘汰请求信息"
|
||||
// @Success 200 {object} controller.Response "记录成功"
|
||||
// @Router /api/v1/pig-batches/{id}/record-cull [post]
|
||||
// @Router /api/v1/pig-batches/record-cull/{id} [post]
|
||||
func (c *PigBatchController) RecordCull(ctx *gin.Context) {
|
||||
const action = "记录正常猪只淘汰事件"
|
||||
var req dto.RecordCullRequest
|
||||
|
||||
@@ -14,7 +14,7 @@ import (
|
||||
// @Param id path int true "猪批次ID"
|
||||
// @Param body body dto.SellPigsRequest true "卖猪请求信息"
|
||||
// @Success 200 {object} controller.Response "卖猪成功"
|
||||
// @Router /api/v1/pig-batches/{id}/sell-pigs [post]
|
||||
// @Router /api/v1/pig-batches/sell-pigs/{id} [post]
|
||||
func (c *PigBatchController) SellPigs(ctx *gin.Context) {
|
||||
const action = "卖猪"
|
||||
var req dto.SellPigsRequest
|
||||
@@ -38,7 +38,7 @@ func (c *PigBatchController) SellPigs(ctx *gin.Context) {
|
||||
// @Param id path int true "猪批次ID"
|
||||
// @Param body body dto.BuyPigsRequest true "买猪请求信息"
|
||||
// @Success 200 {object} controller.Response "买猪成功"
|
||||
// @Router /api/v1/pig-batches/{id}/buy-pigs [post]
|
||||
// @Router /api/v1/pig-batches/buy-pigs/{id} [post]
|
||||
func (c *PigBatchController) BuyPigs(ctx *gin.Context) {
|
||||
const action = "买猪"
|
||||
var req dto.BuyPigsRequest
|
||||
|
||||
@@ -16,7 +16,7 @@ import (
|
||||
// @Param sourceBatchID path int true "源猪批次ID"
|
||||
// @Param body body dto.TransferPigsAcrossBatchesRequest true "跨群调栏请求信息"
|
||||
// @Success 200 {object} controller.Response "调栏成功"
|
||||
// @Router /api/v1/pig-batches/{sourceBatchID}/transfer-across-batches [post]
|
||||
// @Router /api/v1/pig-batches/transfer-across-batches/{sourceBatchID} [post]
|
||||
func (c *PigBatchController) TransferPigsAcrossBatches(ctx *gin.Context) {
|
||||
const action = "跨猪群调栏"
|
||||
var req dto.TransferPigsAcrossBatchesRequest
|
||||
@@ -48,7 +48,7 @@ func (c *PigBatchController) TransferPigsAcrossBatches(ctx *gin.Context) {
|
||||
// @Param id path int true "猪批次ID"
|
||||
// @Param body body dto.TransferPigsWithinBatchRequest true "群内调栏请求信息"
|
||||
// @Success 200 {object} controller.Response "调栏成功"
|
||||
// @Router /api/v1/pig-batches/{id}/transfer-within-batch [post]
|
||||
// @Router /api/v1/pig-batches/transfer-within-batch/{id} [post]
|
||||
func (c *PigBatchController) TransferPigsWithinBatch(ctx *gin.Context) {
|
||||
const action = "群内调栏"
|
||||
var req dto.TransferPigsWithinBatchRequest
|
||||
|
||||
Reference in New Issue
Block a user