猪群领域其他方法映射到api
This commit is contained in:
@@ -67,3 +67,94 @@ type MovePigsIntoPenRequest struct {
|
||||
Quantity int `json:"quantity" binding:"required,min=1"` // 移入猪只数量
|
||||
Remarks string `json:"remarks"` // 备注
|
||||
}
|
||||
|
||||
// SellPigsRequest 用于处理卖猪的请求体
|
||||
type SellPigsRequest struct {
|
||||
PenID uint `json:"penID" binding:"required"` // 猪栏ID
|
||||
Quantity int `json:"quantity" binding:"required,min=1"` // 卖出猪只数量
|
||||
UnitPrice float64 `json:"unitPrice" binding:"required,min=0"` // 单价
|
||||
TotalPrice float64 `json:"totalPrice" binding:"required,min=0"` // 总价
|
||||
TraderName string `json:"traderName" binding:"required"` // 交易方名称
|
||||
TradeDate time.Time `json:"tradeDate" binding:"required"` // 交易日期
|
||||
Remarks string `json:"remarks"` // 备注
|
||||
}
|
||||
|
||||
// BuyPigsRequest 用于处理买猪的请求体
|
||||
type BuyPigsRequest struct {
|
||||
PenID uint `json:"penID" binding:"required"` // 猪栏ID
|
||||
Quantity int `json:"quantity" binding:"required,min=1"` // 买入猪只数量
|
||||
UnitPrice float64 `json:"unitPrice" binding:"required,min=0"` // 单价
|
||||
TotalPrice float64 `json:"totalPrice" binding:"required,min=0"` // 总价
|
||||
TraderName string `json:"traderName" binding:"required"` // 交易方名称
|
||||
TradeDate time.Time `json:"tradeDate" binding:"required"` // 交易日期
|
||||
Remarks string `json:"remarks"` // 备注
|
||||
}
|
||||
|
||||
// TransferPigsAcrossBatchesRequest 用于跨猪群调栏的请求体
|
||||
type TransferPigsAcrossBatchesRequest struct {
|
||||
DestBatchID uint `json:"destBatchID" binding:"required"` // 目标猪批次ID
|
||||
FromPenID uint `json:"fromPenID" binding:"required"` // 源猪栏ID
|
||||
ToPenID uint `json:"toPenID" binding:"required"` // 目标猪栏ID
|
||||
Quantity uint `json:"quantity" binding:"required,min=1"` // 调栏猪只数量
|
||||
Remarks string `json:"remarks"` // 备注
|
||||
}
|
||||
|
||||
// TransferPigsWithinBatchRequest 用于群内调栏的请求体
|
||||
type TransferPigsWithinBatchRequest struct {
|
||||
FromPenID uint `json:"fromPenID" binding:"required"` // 源猪栏ID
|
||||
ToPenID uint `json:"toPenID" binding:"required"` // 目标猪栏ID
|
||||
Quantity uint `json:"quantity" binding:"required,min=1"` // 调栏猪只数量
|
||||
Remarks string `json:"remarks"` // 备注
|
||||
}
|
||||
|
||||
// RecordSickPigsRequest 用于记录新增病猪事件的请求体
|
||||
type RecordSickPigsRequest struct {
|
||||
PenID uint `json:"penID" binding:"required"` // 猪栏ID
|
||||
Quantity int `json:"quantity" binding:"required,min=1"` // 病猪数量
|
||||
TreatmentLocation models.PigBatchSickPigTreatmentLocation `json:"treatmentLocation" binding:"required"` // 治疗地点
|
||||
HappenedAt time.Time `json:"happenedAt" binding:"required"` // 发生时间
|
||||
Remarks string `json:"remarks"` // 备注
|
||||
}
|
||||
|
||||
// RecordSickPigRecoveryRequest 用于记录病猪康复事件的请求体
|
||||
type RecordSickPigRecoveryRequest struct {
|
||||
PenID uint `json:"penID" binding:"required"` // 猪栏ID
|
||||
Quantity int `json:"quantity" binding:"required,min=1"` // 康复猪数量
|
||||
TreatmentLocation models.PigBatchSickPigTreatmentLocation `json:"treatmentLocation" binding:"required"` // 治疗地点
|
||||
HappenedAt time.Time `json:"happenedAt" binding:"required"` // 发生时间
|
||||
Remarks string `json:"remarks"` // 备注
|
||||
}
|
||||
|
||||
// RecordSickPigDeathRequest 用于记录病猪死亡事件的请求体
|
||||
type RecordSickPigDeathRequest struct {
|
||||
PenID uint `json:"penID" binding:"required"` // 猪栏ID
|
||||
Quantity int `json:"quantity" binding:"required,min=1"` // 死亡猪数量
|
||||
TreatmentLocation models.PigBatchSickPigTreatmentLocation `json:"treatmentLocation" binding:"required"` // 治疗地点
|
||||
HappenedAt time.Time `json:"happenedAt" binding:"required"` // 发生时间
|
||||
Remarks string `json:"remarks"` // 备注
|
||||
}
|
||||
|
||||
// RecordSickPigCullRequest 用于记录病猪淘汰事件的请求体
|
||||
type RecordSickPigCullRequest struct {
|
||||
PenID uint `json:"penID" binding:"required"` // 猪栏ID
|
||||
Quantity int `json:"quantity" binding:"required,min=1"` // 淘汰猪数量
|
||||
TreatmentLocation models.PigBatchSickPigTreatmentLocation `json:"treatmentLocation" binding:"required"` // 治疗地点
|
||||
HappenedAt time.Time `json:"happenedAt" binding:"required"` // 发生时间
|
||||
Remarks string `json:"remarks"` // 备注
|
||||
}
|
||||
|
||||
// RecordDeathRequest 用于记录正常猪只死亡事件的请求体
|
||||
type RecordDeathRequest struct {
|
||||
PenID uint `json:"penID" binding:"required"` // 猪栏ID
|
||||
Quantity int `json:"quantity" binding:"required,min=1"` // 死亡猪数量
|
||||
HappenedAt time.Time `json:"happenedAt" binding:"required"` // 发生时间
|
||||
Remarks string `json:"remarks"` // 备注
|
||||
}
|
||||
|
||||
// RecordCullRequest 用于记录正常猪只淘汰事件的请求体
|
||||
type RecordCullRequest struct {
|
||||
PenID uint `json:"penID" binding:"required"` // 猪栏ID
|
||||
Quantity int `json:"quantity" binding:"required,min=1"` // 淘汰猪数量
|
||||
HappenedAt time.Time `json:"happenedAt" binding:"required"` // 发生时间
|
||||
Remarks string `json:"remarks"` // 备注
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user