issue_29 #32
96
docs/docs.go
96
docs/docs.go
@@ -899,12 +899,6 @@ const docTemplate = `{
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"500": {
|
|
||||||
"description": "内部服务器错误",
|
|
||||||
"schema": {
|
|
||||||
"$ref": "#/definitions/controller.Response"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -949,18 +943,6 @@ const docTemplate = `{
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"400": {
|
|
||||||
"description": "请求参数错误",
|
|
||||||
"schema": {
|
|
||||||
"$ref": "#/definitions/controller.Response"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"500": {
|
|
||||||
"description": "内部服务器错误",
|
|
||||||
"schema": {
|
|
||||||
"$ref": "#/definitions/controller.Response"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1002,24 +984,6 @@ const docTemplate = `{
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"400": {
|
|
||||||
"description": "无效的ID格式",
|
|
||||||
"schema": {
|
|
||||||
"$ref": "#/definitions/controller.Response"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"404": {
|
|
||||||
"description": "猪批次不存在",
|
|
||||||
"schema": {
|
|
||||||
"$ref": "#/definitions/controller.Response"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"500": {
|
|
||||||
"description": "内部服务器错误",
|
|
||||||
"schema": {
|
|
||||||
"$ref": "#/definitions/controller.Response"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -1071,24 +1035,6 @@ const docTemplate = `{
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"400": {
|
|
||||||
"description": "请求参数错误或无效的ID格式",
|
|
||||||
"schema": {
|
|
||||||
"$ref": "#/definitions/controller.Response"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"404": {
|
|
||||||
"description": "猪批次不存在",
|
|
||||||
"schema": {
|
|
||||||
"$ref": "#/definitions/controller.Response"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"500": {
|
|
||||||
"description": "内部服务器错误",
|
|
||||||
"schema": {
|
|
||||||
"$ref": "#/definitions/controller.Response"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -1116,24 +1062,6 @@ const docTemplate = `{
|
|||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/controller.Response"
|
"$ref": "#/definitions/controller.Response"
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"400": {
|
|
||||||
"description": "无效的ID格式",
|
|
||||||
"schema": {
|
|
||||||
"$ref": "#/definitions/controller.Response"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"404": {
|
|
||||||
"description": "猪批次不存在",
|
|
||||||
"schema": {
|
|
||||||
"$ref": "#/definitions/controller.Response"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"500": {
|
|
||||||
"description": "内部服务器错误",
|
|
||||||
"schema": {
|
|
||||||
"$ref": "#/definitions/controller.Response"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1175,30 +1103,6 @@ const docTemplate = `{
|
|||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/controller.Response"
|
"$ref": "#/definitions/controller.Response"
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"400": {
|
|
||||||
"description": "请求参数错误或无效的ID格式",
|
|
||||||
"schema": {
|
|
||||||
"$ref": "#/definitions/controller.Response"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"404": {
|
|
||||||
"description": "猪批次或猪栏不存在",
|
|
||||||
"schema": {
|
|
||||||
"$ref": "#/definitions/controller.Response"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"409": {
|
|
||||||
"description": "业务逻辑冲突 (如猪栏已被使用)",
|
|
||||||
"schema": {
|
|
||||||
"$ref": "#/definitions/controller.Response"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"500": {
|
|
||||||
"description": "内部服务器错误",
|
|
||||||
"schema": {
|
|
||||||
"$ref": "#/definitions/controller.Response"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -888,12 +888,6 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"500": {
|
|
||||||
"description": "内部服务器错误",
|
|
||||||
"schema": {
|
|
||||||
"$ref": "#/definitions/controller.Response"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -938,18 +932,6 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"400": {
|
|
||||||
"description": "请求参数错误",
|
|
||||||
"schema": {
|
|
||||||
"$ref": "#/definitions/controller.Response"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"500": {
|
|
||||||
"description": "内部服务器错误",
|
|
||||||
"schema": {
|
|
||||||
"$ref": "#/definitions/controller.Response"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -991,24 +973,6 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"400": {
|
|
||||||
"description": "无效的ID格式",
|
|
||||||
"schema": {
|
|
||||||
"$ref": "#/definitions/controller.Response"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"404": {
|
|
||||||
"description": "猪批次不存在",
|
|
||||||
"schema": {
|
|
||||||
"$ref": "#/definitions/controller.Response"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"500": {
|
|
||||||
"description": "内部服务器错误",
|
|
||||||
"schema": {
|
|
||||||
"$ref": "#/definitions/controller.Response"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -1060,24 +1024,6 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"400": {
|
|
||||||
"description": "请求参数错误或无效的ID格式",
|
|
||||||
"schema": {
|
|
||||||
"$ref": "#/definitions/controller.Response"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"404": {
|
|
||||||
"description": "猪批次不存在",
|
|
||||||
"schema": {
|
|
||||||
"$ref": "#/definitions/controller.Response"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"500": {
|
|
||||||
"description": "内部服务器错误",
|
|
||||||
"schema": {
|
|
||||||
"$ref": "#/definitions/controller.Response"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -1105,24 +1051,6 @@
|
|||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/controller.Response"
|
"$ref": "#/definitions/controller.Response"
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"400": {
|
|
||||||
"description": "无效的ID格式",
|
|
||||||
"schema": {
|
|
||||||
"$ref": "#/definitions/controller.Response"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"404": {
|
|
||||||
"description": "猪批次不存在",
|
|
||||||
"schema": {
|
|
||||||
"$ref": "#/definitions/controller.Response"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"500": {
|
|
||||||
"description": "内部服务器错误",
|
|
||||||
"schema": {
|
|
||||||
"$ref": "#/definitions/controller.Response"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1164,30 +1092,6 @@
|
|||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/controller.Response"
|
"$ref": "#/definitions/controller.Response"
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"400": {
|
|
||||||
"description": "请求参数错误或无效的ID格式",
|
|
||||||
"schema": {
|
|
||||||
"$ref": "#/definitions/controller.Response"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"404": {
|
|
||||||
"description": "猪批次或猪栏不存在",
|
|
||||||
"schema": {
|
|
||||||
"$ref": "#/definitions/controller.Response"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"409": {
|
|
||||||
"description": "业务逻辑冲突 (如猪栏已被使用)",
|
|
||||||
"schema": {
|
|
||||||
"$ref": "#/definitions/controller.Response"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"500": {
|
|
||||||
"description": "内部服务器错误",
|
|
||||||
"schema": {
|
|
||||||
"$ref": "#/definitions/controller.Response"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1344,10 +1344,6 @@ paths:
|
|||||||
$ref: '#/definitions/dto.PigBatchResponseDTO'
|
$ref: '#/definitions/dto.PigBatchResponseDTO'
|
||||||
type: array
|
type: array
|
||||||
type: object
|
type: object
|
||||||
"500":
|
|
||||||
description: 内部服务器错误
|
|
||||||
schema:
|
|
||||||
$ref: '#/definitions/controller.Response'
|
|
||||||
summary: 获取猪批次列表
|
summary: 获取猪批次列表
|
||||||
tags:
|
tags:
|
||||||
- 猪批次管理
|
- 猪批次管理
|
||||||
@@ -1374,14 +1370,6 @@ paths:
|
|||||||
data:
|
data:
|
||||||
$ref: '#/definitions/dto.PigBatchResponseDTO'
|
$ref: '#/definitions/dto.PigBatchResponseDTO'
|
||||||
type: object
|
type: object
|
||||||
"400":
|
|
||||||
description: 请求参数错误
|
|
||||||
schema:
|
|
||||||
$ref: '#/definitions/controller.Response'
|
|
||||||
"500":
|
|
||||||
description: 内部服务器错误
|
|
||||||
schema:
|
|
||||||
$ref: '#/definitions/controller.Response'
|
|
||||||
summary: 创建猪批次
|
summary: 创建猪批次
|
||||||
tags:
|
tags:
|
||||||
- 猪批次管理
|
- 猪批次管理
|
||||||
@@ -1401,18 +1389,6 @@ paths:
|
|||||||
description: 删除成功
|
description: 删除成功
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/controller.Response'
|
$ref: '#/definitions/controller.Response'
|
||||||
"400":
|
|
||||||
description: 无效的ID格式
|
|
||||||
schema:
|
|
||||||
$ref: '#/definitions/controller.Response'
|
|
||||||
"404":
|
|
||||||
description: 猪批次不存在
|
|
||||||
schema:
|
|
||||||
$ref: '#/definitions/controller.Response'
|
|
||||||
"500":
|
|
||||||
description: 内部服务器错误
|
|
||||||
schema:
|
|
||||||
$ref: '#/definitions/controller.Response'
|
|
||||||
summary: 删除猪批次
|
summary: 删除猪批次
|
||||||
tags:
|
tags:
|
||||||
- 猪批次管理
|
- 猪批次管理
|
||||||
@@ -1436,18 +1412,6 @@ paths:
|
|||||||
data:
|
data:
|
||||||
$ref: '#/definitions/dto.PigBatchResponseDTO'
|
$ref: '#/definitions/dto.PigBatchResponseDTO'
|
||||||
type: object
|
type: object
|
||||||
"400":
|
|
||||||
description: 无效的ID格式
|
|
||||||
schema:
|
|
||||||
$ref: '#/definitions/controller.Response'
|
|
||||||
"404":
|
|
||||||
description: 猪批次不存在
|
|
||||||
schema:
|
|
||||||
$ref: '#/definitions/controller.Response'
|
|
||||||
"500":
|
|
||||||
description: 内部服务器错误
|
|
||||||
schema:
|
|
||||||
$ref: '#/definitions/controller.Response'
|
|
||||||
summary: 获取单个猪批次
|
summary: 获取单个猪批次
|
||||||
tags:
|
tags:
|
||||||
- 猪批次管理
|
- 猪批次管理
|
||||||
@@ -1479,18 +1443,6 @@ paths:
|
|||||||
data:
|
data:
|
||||||
$ref: '#/definitions/dto.PigBatchResponseDTO'
|
$ref: '#/definitions/dto.PigBatchResponseDTO'
|
||||||
type: object
|
type: object
|
||||||
"400":
|
|
||||||
description: 请求参数错误或无效的ID格式
|
|
||||||
schema:
|
|
||||||
$ref: '#/definitions/controller.Response'
|
|
||||||
"404":
|
|
||||||
description: 猪批次不存在
|
|
||||||
schema:
|
|
||||||
$ref: '#/definitions/controller.Response'
|
|
||||||
"500":
|
|
||||||
description: 内部服务器错误
|
|
||||||
schema:
|
|
||||||
$ref: '#/definitions/controller.Response'
|
|
||||||
summary: 更新猪批次
|
summary: 更新猪批次
|
||||||
tags:
|
tags:
|
||||||
- 猪批次管理
|
- 猪批次管理
|
||||||
@@ -1518,22 +1470,6 @@ paths:
|
|||||||
description: 更新成功
|
description: 更新成功
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/controller.Response'
|
$ref: '#/definitions/controller.Response'
|
||||||
"400":
|
|
||||||
description: 请求参数错误或无效的ID格式
|
|
||||||
schema:
|
|
||||||
$ref: '#/definitions/controller.Response'
|
|
||||||
"404":
|
|
||||||
description: 猪批次或猪栏不存在
|
|
||||||
schema:
|
|
||||||
$ref: '#/definitions/controller.Response'
|
|
||||||
"409":
|
|
||||||
description: 业务逻辑冲突 (如猪栏已被使用)
|
|
||||||
schema:
|
|
||||||
$ref: '#/definitions/controller.Response'
|
|
||||||
"500":
|
|
||||||
description: 内部服务器错误
|
|
||||||
schema:
|
|
||||||
$ref: '#/definitions/controller.Response'
|
|
||||||
summary: 更新猪批次关联的猪栏
|
summary: 更新猪批次关联的猪栏
|
||||||
tags:
|
tags:
|
||||||
- 猪批次管理
|
- 猪批次管理
|
||||||
|
|||||||
@@ -34,8 +34,6 @@ func NewPigBatchController(logger *logs.Logger, service service.PigBatchService)
|
|||||||
// @Produce json
|
// @Produce json
|
||||||
// @Param body body dto.PigBatchCreateDTO true "猪批次信息"
|
// @Param body body dto.PigBatchCreateDTO true "猪批次信息"
|
||||||
// @Success 201 {object} controller.Response{data=dto.PigBatchResponseDTO} "创建成功"
|
// @Success 201 {object} controller.Response{data=dto.PigBatchResponseDTO} "创建成功"
|
||||||
// @Failure 400 {object} controller.Response "请求参数错误"
|
|
||||||
// @Failure 500 {object} controller.Response "内部服务器错误"
|
|
||||||
// @Router /api/v1/pig-batches [post]
|
// @Router /api/v1/pig-batches [post]
|
||||||
func (c *PigBatchController) CreatePigBatch(ctx *gin.Context) {
|
func (c *PigBatchController) CreatePigBatch(ctx *gin.Context) {
|
||||||
const action = "创建猪批次"
|
const action = "创建猪批次"
|
||||||
@@ -64,9 +62,6 @@ func (c *PigBatchController) CreatePigBatch(ctx *gin.Context) {
|
|||||||
// @Produce json
|
// @Produce json
|
||||||
// @Param id path int true "猪批次ID"
|
// @Param id path int true "猪批次ID"
|
||||||
// @Success 200 {object} controller.Response{data=dto.PigBatchResponseDTO} "获取成功"
|
// @Success 200 {object} controller.Response{data=dto.PigBatchResponseDTO} "获取成功"
|
||||||
// @Failure 400 {object} controller.Response "无效的ID格式"
|
|
||||||
// @Failure 404 {object} controller.Response "猪批次不存在"
|
|
||||||
// @Failure 500 {object} controller.Response "内部服务器错误"
|
|
||||||
// @Router /api/v1/pig-batches/{id} [get]
|
// @Router /api/v1/pig-batches/{id} [get]
|
||||||
func (c *PigBatchController) GetPigBatch(ctx *gin.Context) {
|
func (c *PigBatchController) GetPigBatch(ctx *gin.Context) {
|
||||||
const action = "获取猪批次"
|
const action = "获取猪批次"
|
||||||
@@ -99,9 +94,6 @@ func (c *PigBatchController) GetPigBatch(ctx *gin.Context) {
|
|||||||
// @Param id path int true "猪批次ID"
|
// @Param id path int true "猪批次ID"
|
||||||
// @Param body body dto.PigBatchUpdateDTO true "猪批次信息"
|
// @Param body body dto.PigBatchUpdateDTO true "猪批次信息"
|
||||||
// @Success 200 {object} controller.Response{data=dto.PigBatchResponseDTO} "更新成功"
|
// @Success 200 {object} controller.Response{data=dto.PigBatchResponseDTO} "更新成功"
|
||||||
// @Failure 400 {object} controller.Response "请求参数错误或无效的ID格式"
|
|
||||||
// @Failure 404 {object} controller.Response "猪批次不存在"
|
|
||||||
// @Failure 500 {object} controller.Response "内部服务器错误"
|
|
||||||
// @Router /api/v1/pig-batches/{id} [put]
|
// @Router /api/v1/pig-batches/{id} [put]
|
||||||
func (c *PigBatchController) UpdatePigBatch(ctx *gin.Context) {
|
func (c *PigBatchController) UpdatePigBatch(ctx *gin.Context) {
|
||||||
const action = "更新猪批次"
|
const action = "更新猪批次"
|
||||||
@@ -138,9 +130,6 @@ func (c *PigBatchController) UpdatePigBatch(ctx *gin.Context) {
|
|||||||
// @Produce json
|
// @Produce json
|
||||||
// @Param id path int true "猪批次ID"
|
// @Param id path int true "猪批次ID"
|
||||||
// @Success 200 {object} controller.Response "删除成功"
|
// @Success 200 {object} controller.Response "删除成功"
|
||||||
// @Failure 400 {object} controller.Response "无效的ID格式"
|
|
||||||
// @Failure 404 {object} controller.Response "猪批次不存在"
|
|
||||||
// @Failure 500 {object} controller.Response "内部服务器错误"
|
|
||||||
// @Router /api/v1/pig-batches/{id} [delete]
|
// @Router /api/v1/pig-batches/{id} [delete]
|
||||||
func (c *PigBatchController) DeletePigBatch(ctx *gin.Context) {
|
func (c *PigBatchController) DeletePigBatch(ctx *gin.Context) {
|
||||||
const action = "删除猪批次"
|
const action = "删除猪批次"
|
||||||
@@ -170,7 +159,6 @@ func (c *PigBatchController) DeletePigBatch(ctx *gin.Context) {
|
|||||||
// @Produce json
|
// @Produce json
|
||||||
// @Param is_active query bool false "是否活跃 (true/false)"
|
// @Param is_active query bool false "是否活跃 (true/false)"
|
||||||
// @Success 200 {object} controller.Response{data=[]dto.PigBatchResponseDTO} "获取成功"
|
// @Success 200 {object} controller.Response{data=[]dto.PigBatchResponseDTO} "获取成功"
|
||||||
// @Failure 500 {object} controller.Response "内部服务器错误"
|
|
||||||
// @Router /api/v1/pig-batches [get]
|
// @Router /api/v1/pig-batches [get]
|
||||||
func (c *PigBatchController) ListPigBatches(ctx *gin.Context) {
|
func (c *PigBatchController) ListPigBatches(ctx *gin.Context) {
|
||||||
const action = "获取猪批次列表"
|
const action = "获取猪批次列表"
|
||||||
@@ -200,10 +188,6 @@ func (c *PigBatchController) ListPigBatches(ctx *gin.Context) {
|
|||||||
// @Param id path int true "猪批次ID"
|
// @Param id path int true "猪批次ID"
|
||||||
// @Param body body dto.PigBatchUpdatePensRequest true "猪批次关联的猪栏ID列表"
|
// @Param body body dto.PigBatchUpdatePensRequest true "猪批次关联的猪栏ID列表"
|
||||||
// @Success 200 {object} controller.Response "更新成功"
|
// @Success 200 {object} controller.Response "更新成功"
|
||||||
// @Failure 400 {object} controller.Response "请求参数错误或无效的ID格式"
|
|
||||||
// @Failure 404 {object} controller.Response "猪批次或猪栏不存在"
|
|
||||||
// @Failure 409 {object} controller.Response "业务逻辑冲突 (如猪栏已被使用)"
|
|
||||||
// @Failure 500 {object} controller.Response "内部服务器错误"
|
|
||||||
// @Router /api/v1/pig-batches/{id}/pens [put]
|
// @Router /api/v1/pig-batches/{id}/pens [put]
|
||||||
func (c *PigBatchController) UpdatePigBatchPens(ctx *gin.Context) {
|
func (c *PigBatchController) UpdatePigBatchPens(ctx *gin.Context) {
|
||||||
const action = "更新猪批次关联猪栏"
|
const action = "更新猪批次关联猪栏"
|
||||||
|
|||||||
Reference in New Issue
Block a user