修bug
This commit is contained in:
@@ -244,7 +244,6 @@ func (c *PigFarmController) CreatePen(ctx *gin.Context) {
|
|||||||
HouseID: pen.HouseID,
|
HouseID: pen.HouseID,
|
||||||
Capacity: pen.Capacity,
|
Capacity: pen.Capacity,
|
||||||
Status: pen.Status,
|
Status: pen.Status,
|
||||||
PigBatchID: *pen.PigBatchID,
|
|
||||||
}
|
}
|
||||||
controller.SendSuccessWithAudit(ctx, controller.CodeCreated, "创建成功", resp, action, "创建成功", resp)
|
controller.SendSuccessWithAudit(ctx, controller.CodeCreated, "创建成功", resp, action, "创建成功", resp)
|
||||||
}
|
}
|
||||||
@@ -283,7 +282,9 @@ func (c *PigFarmController) GetPen(ctx *gin.Context) {
|
|||||||
HouseID: pen.HouseID,
|
HouseID: pen.HouseID,
|
||||||
Capacity: pen.Capacity,
|
Capacity: pen.Capacity,
|
||||||
Status: pen.Status,
|
Status: pen.Status,
|
||||||
PigBatchID: *pen.PigBatchID,
|
}
|
||||||
|
if pen.PigBatchID != nil {
|
||||||
|
resp.PigBatchID = *pen.PigBatchID
|
||||||
}
|
}
|
||||||
controller.SendSuccessWithAudit(ctx, controller.CodeSuccess, "获取成功", resp, action, "获取成功", resp)
|
controller.SendSuccessWithAudit(ctx, controller.CodeSuccess, "获取成功", resp, action, "获取成功", resp)
|
||||||
}
|
}
|
||||||
@@ -307,14 +308,17 @@ func (c *PigFarmController) ListPens(ctx *gin.Context) {
|
|||||||
|
|
||||||
var resp []dto.PenResponse
|
var resp []dto.PenResponse
|
||||||
for _, pen := range pens {
|
for _, pen := range pens {
|
||||||
resp = append(resp, dto.PenResponse{
|
res := dto.PenResponse{
|
||||||
ID: pen.ID,
|
ID: pen.ID,
|
||||||
PenNumber: pen.PenNumber,
|
PenNumber: pen.PenNumber,
|
||||||
HouseID: pen.HouseID,
|
HouseID: pen.HouseID,
|
||||||
Capacity: pen.Capacity,
|
Capacity: pen.Capacity,
|
||||||
Status: pen.Status,
|
Status: pen.Status,
|
||||||
PigBatchID: *pen.PigBatchID,
|
}
|
||||||
})
|
if pen.PigBatchID != nil {
|
||||||
|
res.PigBatchID = *pen.PigBatchID
|
||||||
|
}
|
||||||
|
resp = append(resp, res)
|
||||||
}
|
}
|
||||||
|
|
||||||
controller.SendSuccessWithAudit(ctx, controller.CodeSuccess, "获取成功", resp, action, "获取成功", resp)
|
controller.SendSuccessWithAudit(ctx, controller.CodeSuccess, "获取成功", resp, action, "获取成功", resp)
|
||||||
@@ -363,7 +367,9 @@ func (c *PigFarmController) UpdatePen(ctx *gin.Context) {
|
|||||||
HouseID: pen.HouseID,
|
HouseID: pen.HouseID,
|
||||||
Capacity: pen.Capacity,
|
Capacity: pen.Capacity,
|
||||||
Status: pen.Status,
|
Status: pen.Status,
|
||||||
PigBatchID: *pen.PigBatchID,
|
}
|
||||||
|
if pen.PigBatchID != nil {
|
||||||
|
resp.PigBatchID = *pen.PigBatchID
|
||||||
}
|
}
|
||||||
controller.SendSuccessWithAudit(ctx, controller.CodeSuccess, "更新成功", resp, action, "更新成功", resp)
|
controller.SendSuccessWithAudit(ctx, controller.CodeSuccess, "更新成功", resp, action, "更新成功", resp)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user