处理路由冲突

This commit is contained in:
2025-10-10 18:23:06 +08:00
parent 6d8cb7ca4e
commit b4d31d3133
6 changed files with 30 additions and 30 deletions

View File

@@ -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