修复bug
This commit is contained in:
392
docs/docs.go
392
docs/docs.go
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -20,13 +20,13 @@ type PaginationDTO struct {
|
||||
|
||||
// ListSensorDataRequest 定义了获取传感器数据列表的请求参数
|
||||
type ListSensorDataRequest struct {
|
||||
Page int `query:"page"`
|
||||
PageSize int `query:"page_size"`
|
||||
DeviceID *uint `query:"device_id"`
|
||||
SensorType *string `query:"sensor_type"`
|
||||
StartTime *time.Time `query:"start_time"`
|
||||
EndTime *time.Time `query:"end_time"`
|
||||
OrderBy string `query:"order_by"`
|
||||
Page int `json:"page" query:"page"`
|
||||
PageSize int `json:"page_size" query:"page_size"`
|
||||
DeviceID *uint `json:"device_id" query:"device_id"`
|
||||
SensorType *string `json:"sensor_type" query:"sensor_type"`
|
||||
StartTime *time.Time `json:"start_time" query:"start_time"`
|
||||
EndTime *time.Time `json:"end_time" query:"end_time"`
|
||||
OrderBy string `json:"order_by" query:"order_by"`
|
||||
}
|
||||
|
||||
// SensorDataDTO 是用于API响应的传感器数据结构
|
||||
@@ -48,13 +48,13 @@ type ListSensorDataResponse struct {
|
||||
|
||||
// ListDeviceCommandLogRequest 定义了获取设备命令日志列表的请求参数
|
||||
type ListDeviceCommandLogRequest struct {
|
||||
Page int `query:"page"`
|
||||
PageSize int `query:"page_size"`
|
||||
DeviceID *uint `query:"device_id"`
|
||||
ReceivedSuccess *bool `query:"received_success"`
|
||||
StartTime *time.Time `query:"start_time"`
|
||||
EndTime *time.Time `query:"end_time"`
|
||||
OrderBy string `query:"order_by"`
|
||||
Page int `json:"page" query:"page"`
|
||||
PageSize int `json:"page_size" query:"page_size"`
|
||||
DeviceID *uint `json:"device_id" query:"device_id"`
|
||||
ReceivedSuccess *bool `json:"received_success" query:"received_success"`
|
||||
StartTime *time.Time `json:"start_time" query:"start_time"`
|
||||
EndTime *time.Time `json:"end_time" query:"end_time"`
|
||||
OrderBy string `json:"order_by" query:"order_by"`
|
||||
}
|
||||
|
||||
// DeviceCommandLogDTO 是用于API响应的设备命令日志结构
|
||||
@@ -76,13 +76,13 @@ type ListDeviceCommandLogResponse struct {
|
||||
|
||||
// ListPlanExecutionLogRequest 定义了获取计划执行日志列表的请求参数
|
||||
type ListPlanExecutionLogRequest struct {
|
||||
Page int `query:"page"`
|
||||
PageSize int `query:"page_size"`
|
||||
PlanID *uint `query:"plan_id"`
|
||||
Status *string `query:"status"`
|
||||
StartTime *time.Time `query:"start_time"`
|
||||
EndTime *time.Time `query:"end_time"`
|
||||
OrderBy string `query:"order_by"`
|
||||
Page int `json:"page" query:"page"`
|
||||
PageSize int `json:"page_size" query:"page_size"`
|
||||
PlanID *uint `json:"plan_id" query:"plan_id"`
|
||||
Status *string `json:"status" query:"status"`
|
||||
StartTime *time.Time `json:"start_time" query:"start_time"`
|
||||
EndTime *time.Time `json:"end_time" query:"end_time"`
|
||||
OrderBy string `json:"order_by" query:"order_by"`
|
||||
}
|
||||
|
||||
// PlanExecutionLogDTO 是用于API响应的计划执行日志结构
|
||||
@@ -108,14 +108,14 @@ type ListPlanExecutionLogResponse struct {
|
||||
|
||||
// ListTaskExecutionLogRequest 定义了获取任务执行日志列表的请求参数
|
||||
type ListTaskExecutionLogRequest struct {
|
||||
Page int `query:"page"`
|
||||
PageSize int `query:"page_size"`
|
||||
PlanExecutionLogID *uint `query:"plan_execution_log_id"`
|
||||
TaskID *int `query:"task_id"`
|
||||
Status *string `query:"status"`
|
||||
StartTime *time.Time `query:"start_time"`
|
||||
EndTime *time.Time `query:"end_time"`
|
||||
OrderBy string `query:"order_by"`
|
||||
Page int `json:"page" query:"page"`
|
||||
PageSize int `json:"page_size" query:"page_size"`
|
||||
PlanExecutionLogID *uint `json:"plan_execution_log_id" query:"plan_execution_log_id"`
|
||||
TaskID *int `json:"task_id" query:"task_id"`
|
||||
Status *string `json:"status" query:"status"`
|
||||
StartTime *time.Time `json:"start_time" query:"start_time"`
|
||||
EndTime *time.Time `json:"end_time" query:"end_time"`
|
||||
OrderBy string `json:"order_by" query:"order_by"`
|
||||
}
|
||||
|
||||
// TaskDTO 是用于API响应的简化版任务结构
|
||||
@@ -149,13 +149,13 @@ type ListTaskExecutionLogResponse struct {
|
||||
|
||||
// ListPendingCollectionRequest 定义了获取待采集请求列表的请求参数
|
||||
type ListPendingCollectionRequest struct {
|
||||
Page int `query:"page"`
|
||||
PageSize int `query:"page_size"`
|
||||
DeviceID *uint `query:"device_id"`
|
||||
Status *string `query:"status"`
|
||||
StartTime *time.Time `query:"start_time"`
|
||||
EndTime *time.Time `query:"end_time"`
|
||||
OrderBy string `query:"order_by"`
|
||||
Page int `json:"page" query:"page"`
|
||||
PageSize int `json:"page_size" query:"page_size"`
|
||||
DeviceID *uint `json:"device_id" query:"device_id"`
|
||||
Status *string `json:"status" query:"status"`
|
||||
StartTime *time.Time `json:"start_time" query:"start_time"`
|
||||
EndTime *time.Time `json:"end_time" query:"end_time"`
|
||||
OrderBy string `json:"order_by" query:"order_by"`
|
||||
}
|
||||
|
||||
// PendingCollectionDTO 是用于API响应的待采集请求结构
|
||||
@@ -178,15 +178,15 @@ type ListPendingCollectionResponse struct {
|
||||
|
||||
// ListUserActionLogRequest 定义了获取用户操作日志列表的请求参数
|
||||
type ListUserActionLogRequest struct {
|
||||
Page int `query:"page"`
|
||||
PageSize int `query:"page_size"`
|
||||
UserID *uint `query:"user_id"`
|
||||
Username *string `query:"username"`
|
||||
ActionType *string `query:"action_type"`
|
||||
Status *string `query:"status"`
|
||||
StartTime *time.Time `query:"start_time"`
|
||||
EndTime *time.Time `query:"end_time"`
|
||||
OrderBy string `query:"order_by"`
|
||||
Page int `json:"page" query:"page"`
|
||||
PageSize int `json:"page_size" query:"page_size"`
|
||||
UserID *uint `json:"user_id" query:"user_id"`
|
||||
Username *string `json:"username" query:"username"`
|
||||
ActionType *string `json:"action_type" query:"action_type"`
|
||||
Status *string `json:"status" query:"status"`
|
||||
StartTime *time.Time `json:"start_time" query:"start_time"`
|
||||
EndTime *time.Time `json:"end_time" query:"end_time"`
|
||||
OrderBy string `json:"order_by" query:"order_by"`
|
||||
}
|
||||
|
||||
// UserActionLogDTO 是用于API响应的用户操作日志结构
|
||||
@@ -215,13 +215,13 @@ type ListUserActionLogResponse struct {
|
||||
|
||||
// ListRawMaterialPurchaseRequest 定义了获取原料采购列表的请求参数
|
||||
type ListRawMaterialPurchaseRequest struct {
|
||||
Page int `query:"page"`
|
||||
PageSize int `query:"page_size"`
|
||||
RawMaterialID *uint `query:"raw_material_id"`
|
||||
Supplier *string `query:"supplier"`
|
||||
StartTime *time.Time `query:"start_time"`
|
||||
EndTime *time.Time `query:"end_time"`
|
||||
OrderBy string `query:"order_by"`
|
||||
Page int `json:"page" query:"page"`
|
||||
PageSize int `json:"page_size" query:"page_size"`
|
||||
RawMaterialID *uint `json:"raw_material_id" query:"raw_material_id"`
|
||||
Supplier *string `json:"supplier" query:"supplier"`
|
||||
StartTime *time.Time `json:"start_time" query:"start_time"`
|
||||
EndTime *time.Time `json:"end_time" query:"end_time"`
|
||||
OrderBy string `json:"order_by" query:"order_by"`
|
||||
}
|
||||
|
||||
// RawMaterialDTO 是用于API响应的简化版原料结构
|
||||
@@ -253,14 +253,14 @@ type ListRawMaterialPurchaseResponse struct {
|
||||
|
||||
// ListRawMaterialStockLogRequest 定义了获取原料库存日志列表的请求参数
|
||||
type ListRawMaterialStockLogRequest struct {
|
||||
Page int `query:"page"`
|
||||
PageSize int `query:"page_size"`
|
||||
RawMaterialID *uint `query:"raw_material_id"`
|
||||
SourceType *string `query:"source_type"`
|
||||
SourceID *uint `query:"source_id"`
|
||||
StartTime *time.Time `query:"start_time"`
|
||||
EndTime *time.Time `query:"end_time"`
|
||||
OrderBy string `query:"order_by"`
|
||||
Page int `json:"page" query:"page"`
|
||||
PageSize int `json:"page_size" query:"page_size"`
|
||||
RawMaterialID *uint `json:"raw_material_id" query:"raw_material_id"`
|
||||
SourceType *string `json:"source_type" query:"source_type"`
|
||||
SourceID *uint `json:"source_id" query:"source_id"`
|
||||
StartTime *time.Time `json:"start_time" query:"start_time"`
|
||||
EndTime *time.Time `json:"end_time" query:"end_time"`
|
||||
OrderBy string `json:"order_by" query:"order_by"`
|
||||
}
|
||||
|
||||
// RawMaterialStockLogDTO 是用于API响应的原料库存日志结构
|
||||
@@ -284,14 +284,14 @@ type ListRawMaterialStockLogResponse struct {
|
||||
|
||||
// ListFeedUsageRecordRequest 定义了获取饲料使用记录列表的请求参数
|
||||
type ListFeedUsageRecordRequest struct {
|
||||
Page int `query:"page"`
|
||||
PageSize int `query:"page_size"`
|
||||
PenID *uint `query:"pen_id"`
|
||||
FeedFormulaID *uint `query:"feed_formula_id"`
|
||||
OperatorID *uint `query:"operator_id"`
|
||||
StartTime *time.Time `query:"start_time"`
|
||||
EndTime *time.Time `query:"end_time"`
|
||||
OrderBy string `query:"order_by"`
|
||||
Page int `json:"page" query:"page"`
|
||||
PageSize int `json:"page_size" query:"page_size"`
|
||||
PenID *uint `json:"pen_id" query:"pen_id"`
|
||||
FeedFormulaID *uint `json:"feed_formula_id" query:"feed_formula_id"`
|
||||
OperatorID *uint `json:"operator_id" query:"operator_id"`
|
||||
StartTime *time.Time `json:"start_time" query:"start_time"`
|
||||
EndTime *time.Time `json:"end_time" query:"end_time"`
|
||||
OrderBy string `json:"order_by" query:"order_by"`
|
||||
}
|
||||
|
||||
// PenDTO 是用于API响应的简化版猪栏结构
|
||||
@@ -329,15 +329,15 @@ type ListFeedUsageRecordResponse struct {
|
||||
|
||||
// ListMedicationLogRequest 定义了获取用药记录列表的请求参数
|
||||
type ListMedicationLogRequest struct {
|
||||
Page int `query:"page"`
|
||||
PageSize int `query:"page_size"`
|
||||
PigBatchID *uint `query:"pig_batch_id"`
|
||||
MedicationID *uint `query:"medication_id"`
|
||||
Reason *string `query:"reason"`
|
||||
OperatorID *uint `query:"operator_id"`
|
||||
StartTime *time.Time `query:"start_time"`
|
||||
EndTime *time.Time `query:"end_time"`
|
||||
OrderBy string `query:"order_by"`
|
||||
Page int `json:"page" query:"page"`
|
||||
PageSize int `json:"page_size" query:"page_size"`
|
||||
PigBatchID *uint `json:"pig_batch_id" query:"pig_batch_id"`
|
||||
MedicationID *uint `json:"medication_id" query:"medication_id"`
|
||||
Reason *string `json:"reason" query:"reason"`
|
||||
OperatorID *uint `json:"operator_id" query:"operator_id"`
|
||||
StartTime *time.Time `json:"start_time" query:"start_time"`
|
||||
EndTime *time.Time `json:"end_time" query:"end_time"`
|
||||
OrderBy string `json:"order_by" query:"order_by"`
|
||||
}
|
||||
|
||||
// MedicationDTO 是用于API响应的简化版药品结构
|
||||
@@ -370,14 +370,14 @@ type ListMedicationLogResponse struct {
|
||||
|
||||
// ListPigBatchLogRequest 定义了获取猪批次日志列表的请求参数
|
||||
type ListPigBatchLogRequest struct {
|
||||
Page int `query:"page"`
|
||||
PageSize int `query:"page_size"`
|
||||
PigBatchID *uint `query:"pig_batch_id"`
|
||||
ChangeType *string `query:"change_type"`
|
||||
OperatorID *uint `query:"operator_id"`
|
||||
StartTime *time.Time `query:"start_time"`
|
||||
EndTime *time.Time `query:"end_time"`
|
||||
OrderBy string `query:"order_by"`
|
||||
Page int `json:"page" query:"page"`
|
||||
PageSize int `json:"page_size" query:"page_size"`
|
||||
PigBatchID *uint `json:"pig_batch_id" query:"pig_batch_id"`
|
||||
ChangeType *string `json:"change_type" query:"change_type"`
|
||||
OperatorID *uint `json:"operator_id" query:"operator_id"`
|
||||
StartTime *time.Time `json:"start_time" query:"start_time"`
|
||||
EndTime *time.Time `json:"end_time" query:"end_time"`
|
||||
OrderBy string `json:"order_by" query:"order_by"`
|
||||
}
|
||||
|
||||
// PigBatchLogDTO 是用于API响应的猪批次日志结构
|
||||
@@ -405,12 +405,12 @@ type ListPigBatchLogResponse struct {
|
||||
|
||||
// ListWeighingBatchRequest 定义了获取批次称重记录列表的请求参数
|
||||
type ListWeighingBatchRequest struct {
|
||||
Page int `query:"page"`
|
||||
PageSize int `query:"page_size"`
|
||||
PigBatchID *uint `query:"pig_batch_id"`
|
||||
StartTime *time.Time `query:"start_time"`
|
||||
EndTime *time.Time `query:"end_time"`
|
||||
OrderBy string `query:"order_by"`
|
||||
Page int `json:"page" query:"page"`
|
||||
PageSize int `json:"page_size" query:"page_size"`
|
||||
PigBatchID *uint `json:"pig_batch_id" query:"pig_batch_id"`
|
||||
StartTime *time.Time `json:"start_time" query:"start_time"`
|
||||
EndTime *time.Time `json:"end_time" query:"end_time"`
|
||||
OrderBy string `json:"order_by" query:"order_by"`
|
||||
}
|
||||
|
||||
// WeighingBatchDTO 是用于API响应的批次称重记录结构
|
||||
@@ -433,14 +433,14 @@ type ListWeighingBatchResponse struct {
|
||||
|
||||
// ListWeighingRecordRequest 定义了获取单次称重记录列表的请求参数
|
||||
type ListWeighingRecordRequest struct {
|
||||
Page int `query:"page"`
|
||||
PageSize int `query:"page_size"`
|
||||
WeighingBatchID *uint `query:"weighing_batch_id"`
|
||||
PenID *uint `query:"pen_id"`
|
||||
OperatorID *uint `query:"operator_id"`
|
||||
StartTime *time.Time `query:"start_time"`
|
||||
EndTime *time.Time `query:"end_time"`
|
||||
OrderBy string `query:"order_by"`
|
||||
Page int `json:"page" query:"page"`
|
||||
PageSize int `json:"page_size" query:"page_size"`
|
||||
WeighingBatchID *uint `json:"weighing_batch_id" query:"weighing_batch_id"`
|
||||
PenID *uint `json:"pen_id" query:"pen_id"`
|
||||
OperatorID *uint `json:"operator_id" query:"operator_id"`
|
||||
StartTime *time.Time `json:"start_time" query:"start_time"`
|
||||
EndTime *time.Time `json:"end_time" query:"end_time"`
|
||||
OrderBy string `json:"order_by" query:"order_by"`
|
||||
}
|
||||
|
||||
// WeighingRecordDTO 是用于API响应的单次称重记录结构
|
||||
@@ -466,16 +466,16 @@ type ListWeighingRecordResponse struct {
|
||||
|
||||
// ListPigTransferLogRequest 定义了获取猪只迁移日志列表的请求参数
|
||||
type ListPigTransferLogRequest struct {
|
||||
Page int `query:"page"`
|
||||
PageSize int `query:"page_size"`
|
||||
PigBatchID *uint `query:"pig_batch_id"`
|
||||
PenID *uint `query:"pen_id"`
|
||||
TransferType *string `query:"transfer_type"`
|
||||
OperatorID *uint `query:"operator_id"`
|
||||
CorrelationID *string `query:"correlation_id"`
|
||||
StartTime *time.Time `query:"start_time"`
|
||||
EndTime *time.Time `query:"end_time"`
|
||||
OrderBy string `query:"order_by"`
|
||||
Page int `json:"page" query:"page"`
|
||||
PageSize int `json:"page_size" query:"page_size"`
|
||||
PigBatchID *uint `json:"pig_batch_id" query:"pig_batch_id"`
|
||||
PenID *uint `json:"pen_id" query:"pen_id"`
|
||||
TransferType *string `json:"transfer_type" query:"transfer_type"`
|
||||
OperatorID *uint `json:"operator_id" query:"operator_id"`
|
||||
CorrelationID *string `json:"correlation_id" query:"correlation_id"`
|
||||
StartTime *time.Time `json:"start_time" query:"start_time"`
|
||||
EndTime *time.Time `json:"end_time" query:"end_time"`
|
||||
OrderBy string `json:"order_by" query:"order_by"`
|
||||
}
|
||||
|
||||
// PigTransferLogDTO 是用于API响应的猪只迁移日志结构
|
||||
@@ -503,16 +503,16 @@ type ListPigTransferLogResponse struct {
|
||||
|
||||
// ListPigSickLogRequest 定义了获取病猪日志列表的请求参数
|
||||
type ListPigSickLogRequest struct {
|
||||
Page int `query:"page"`
|
||||
PageSize int `query:"page_size"`
|
||||
PigBatchID *uint `query:"pig_batch_id"`
|
||||
PenID *uint `query:"pen_id"`
|
||||
Reason *string `query:"reason"`
|
||||
TreatmentLocation *string `query:"treatment_location"`
|
||||
OperatorID *uint `query:"operator_id"`
|
||||
StartTime *time.Time `query:"start_time"`
|
||||
EndTime *time.Time `query:"end_time"`
|
||||
OrderBy string `query:"order_by"`
|
||||
Page int `json:"page" query:"page"`
|
||||
PageSize int `json:"page_size" query:"page_size"`
|
||||
PigBatchID *uint `json:"pig_batch_id" query:"pig_batch_id"`
|
||||
PenID *uint `json:"pen_id" query:"pen_id"`
|
||||
Reason *string `json:"reason" query:"reason"`
|
||||
TreatmentLocation *string `json:"treatment_location" query:"treatment_location"`
|
||||
OperatorID *uint `json:"operator_id" query:"operator_id"`
|
||||
StartTime *time.Time `json:"start_time" query:"start_time"`
|
||||
EndTime *time.Time `json:"end_time" query:"end_time"`
|
||||
OrderBy string `json:"order_by" query:"order_by"`
|
||||
}
|
||||
|
||||
// PigSickLogDTO 是用于API响应的病猪日志结构
|
||||
@@ -542,14 +542,14 @@ type ListPigSickLogResponse struct {
|
||||
|
||||
// ListPigPurchaseRequest 定义了获取猪只采购记录列表的请求参数
|
||||
type ListPigPurchaseRequest struct {
|
||||
Page int `query:"page"`
|
||||
PageSize int `query:"page_size"`
|
||||
PigBatchID *uint `query:"pig_batch_id"`
|
||||
Supplier *string `query:"supplier"`
|
||||
OperatorID *uint `query:"operator_id"`
|
||||
StartTime *time.Time `query:"start_time"`
|
||||
EndTime *time.Time `query:"end_time"`
|
||||
OrderBy string `query:"order_by"`
|
||||
Page int `json:"page" query:"page"`
|
||||
PageSize int `json:"page_size" query:"page_size"`
|
||||
PigBatchID *uint `json:"pig_batch_id" query:"pig_batch_id"`
|
||||
Supplier *string `json:"supplier" query:"supplier"`
|
||||
OperatorID *uint `json:"operator_id" query:"operator_id"`
|
||||
StartTime *time.Time `json:"start_time" query:"start_time"`
|
||||
EndTime *time.Time `json:"end_time" query:"end_time"`
|
||||
OrderBy string `json:"order_by" query:"order_by"`
|
||||
}
|
||||
|
||||
// PigPurchaseDTO 是用于API响应的猪只采购记录结构
|
||||
@@ -577,14 +577,14 @@ type ListPigPurchaseResponse struct {
|
||||
|
||||
// ListPigSaleRequest 定义了获取猪只销售记录列表的请求参数
|
||||
type ListPigSaleRequest struct {
|
||||
Page int `query:"page"`
|
||||
PageSize int `query:"page_size"`
|
||||
PigBatchID *uint `query:"pig_batch_id"`
|
||||
Buyer *string `query:"buyer"`
|
||||
OperatorID *uint `query:"operator_id"`
|
||||
StartTime *time.Time `query:"start_time"`
|
||||
EndTime *time.Time `query:"end_time"`
|
||||
OrderBy string `query:"order_by"`
|
||||
Page int `json:"page" query:"page"`
|
||||
PageSize int `json:"page_size" query:"page_size"`
|
||||
PigBatchID *uint `json:"pig_batch_id" query:"pig_batch_id"`
|
||||
Buyer *string `json:"buyer" query:"buyer"`
|
||||
OperatorID *uint `json:"operator_id" query:"operator_id"`
|
||||
StartTime *time.Time `json:"start_time" query:"start_time"`
|
||||
EndTime *time.Time `json:"end_time" query:"end_time"`
|
||||
OrderBy string `json:"order_by" query:"order_by"`
|
||||
}
|
||||
|
||||
// PigSaleDTO 是用于API响应的猪只销售记录结构
|
||||
|
||||
@@ -16,15 +16,15 @@ type SendTestNotificationRequest struct {
|
||||
|
||||
// ListNotificationRequest 定义了获取通知列表的请求参数
|
||||
type ListNotificationRequest struct {
|
||||
Page int `query:"page"`
|
||||
PageSize int `query:"pageSize"`
|
||||
UserID *uint `query:"user_id"`
|
||||
NotifierType *notify.NotifierType `query:"notifier_type"`
|
||||
Status *models.NotificationStatus `query:"status"`
|
||||
Level *zapcore.Level `query:"level"`
|
||||
StartTime *time.Time `query:"start_time"`
|
||||
EndTime *time.Time `query:"end_time"`
|
||||
OrderBy string `query:"order_by"`
|
||||
Page int `json:"page" query:"page"`
|
||||
PageSize int `json:"page_size" query:"page_size"`
|
||||
UserID *uint `json:"user_id" query:"user_id"`
|
||||
NotifierType *notify.NotifierType `json:"notifier_type" query:"notifier_type"`
|
||||
Status *models.NotificationStatus `json:"status" query:"status"`
|
||||
Level *zapcore.Level `json:"level" query:"level"`
|
||||
StartTime *time.Time `json:"start_time" query:"start_time"`
|
||||
EndTime *time.Time `json:"end_time" query:"end_time"`
|
||||
OrderBy string `json:"order_by" query:"order_by"`
|
||||
}
|
||||
|
||||
// NotificationDTO 是用于API响应的通知结构
|
||||
|
||||
@@ -32,131 +32,131 @@ type PigBatchQueryDTO struct {
|
||||
|
||||
// PigBatchResponseDTO 定义了猪批次信息的响应结构
|
||||
type PigBatchResponseDTO struct {
|
||||
ID uint `json:"id"` // 批次ID
|
||||
BatchNumber string `json:"batch_number"` // 批次编号
|
||||
OriginType models.PigBatchOriginType `json:"origin_type"` // 批次来源
|
||||
StartDate time.Time `json:"start_date"` // 批次开始日期
|
||||
EndDate time.Time `json:"end_date"` // 批次结束日期
|
||||
InitialCount int `json:"initial_count"` // 初始数量
|
||||
Status models.PigBatchStatus `json:"status"` // 批次状态
|
||||
IsActive bool `json:"is_active"` // 是否活跃
|
||||
CurrentTotalQuantity int `json:"currentTotalQuantity"` // 当前总数
|
||||
CurrentTotalPigsInPens int `json:"currentTotalPigsInPens"` // 当前存栏总数
|
||||
CreateTime time.Time `json:"create_time"` // 创建时间
|
||||
UpdateTime time.Time `json:"update_time"` // 更新时间
|
||||
ID uint `json:"id"` // 批次ID
|
||||
BatchNumber string `json:"batch_number"` // 批次编号
|
||||
OriginType models.PigBatchOriginType `json:"origin_type"` // 批次来源
|
||||
StartDate time.Time `json:"start_date"` // 批次开始日期
|
||||
EndDate time.Time `json:"end_date"` // 批次结束日期
|
||||
InitialCount int `json:"initial_count"` // 初始数量
|
||||
Status models.PigBatchStatus `json:"status"` // 批次状态
|
||||
IsActive bool `json:"is_active"` // 是否活跃
|
||||
CurrentTotalQuantity int `json:"current_total_quantity"` // 当前总数
|
||||
CurrentTotalPigsInPens int `json:"current_total_pigs_in_pens"` // 当前存栏总数
|
||||
CreateTime time.Time `json:"create_time"` // 创建时间
|
||||
UpdateTime time.Time `json:"update_time"` // 更新时间
|
||||
}
|
||||
|
||||
// AssignEmptyPensToBatchRequest 用于为猪批次分配空栏的请求体
|
||||
type AssignEmptyPensToBatchRequest struct {
|
||||
PenIDs []uint `json:"penIDs" validate:"required,min=1,dive" example:"1,2,3"` // 待分配的猪栏ID列表
|
||||
PenIDs []uint `json:"pen_ids" validate:"required,min=1,dive" example:"1,2,3"` // 待分配的猪栏ID列表
|
||||
}
|
||||
|
||||
// ReclassifyPenToNewBatchRequest 用于将猪栏划拨到新批次的请求体
|
||||
type ReclassifyPenToNewBatchRequest struct {
|
||||
ToBatchID uint `json:"toBatchID" validate:"required"` // 目标猪批次ID
|
||||
PenID uint `json:"penID" validate:"required"` // 待划拨的猪栏ID
|
||||
Remarks string `json:"remarks"` // 备注
|
||||
ToBatchID uint `json:"to_batch_id" validate:"required"` // 目标猪批次ID
|
||||
PenID uint `json:"pen_id" validate:"required"` // 待划拨的猪栏ID
|
||||
Remarks string `json:"remarks"` // 备注
|
||||
}
|
||||
|
||||
// RemoveEmptyPenFromBatchRequest 用于从猪批次移除空栏的请求体
|
||||
type RemoveEmptyPenFromBatchRequest struct {
|
||||
PenID uint `json:"penID" validate:"required"` // 待移除的猪栏ID
|
||||
PenID uint `json:"pen_id" validate:"required"` // 待移除的猪栏ID
|
||||
}
|
||||
|
||||
// MovePigsIntoPenRequest 用于将猪只从“虚拟库存”移入指定猪栏的请求体
|
||||
type MovePigsIntoPenRequest struct {
|
||||
ToPenID uint `json:"toPenID" validate:"required"` // 目标猪栏ID
|
||||
ToPenID uint `json:"to_pen_id" validate:"required"` // 目标猪栏ID
|
||||
Quantity int `json:"quantity" validate:"required,min=1"` // 移入猪只数量
|
||||
Remarks string `json:"remarks"` // 备注
|
||||
}
|
||||
|
||||
// SellPigsRequest 用于处理卖猪的请求体
|
||||
type SellPigsRequest struct {
|
||||
PenID uint `json:"penID" validate:"required"` // 猪栏ID
|
||||
Quantity int `json:"quantity" validate:"required,min=1"` // 卖出猪只数量
|
||||
UnitPrice float64 `json:"unitPrice" validate:"required,min=0"` // 单价
|
||||
TotalPrice float64 `json:"totalPrice" validate:"required,min=0"` // 总价
|
||||
TraderName string `json:"traderName" validate:"required"` // 交易方名称
|
||||
TradeDate time.Time `json:"tradeDate" validate:"required"` // 交易日期
|
||||
Remarks string `json:"remarks"` // 备注
|
||||
PenID uint `json:"pen_id" validate:"required"` // 猪栏ID
|
||||
Quantity int `json:"quantity" validate:"required,min=1"` // 卖出猪只数量
|
||||
UnitPrice float64 `json:"unit_price" validate:"required,min=0"` // 单价
|
||||
TotalPrice float64 `json:"total_price" validate:"required,min=0"` // 总价
|
||||
TraderName string `json:"trader_name" validate:"required"` // 交易方名称
|
||||
TradeDate time.Time `json:"trade_date" validate:"required"` // 交易日期
|
||||
Remarks string `json:"remarks"` // 备注
|
||||
}
|
||||
|
||||
// BuyPigsRequest 用于处理买猪的请求体
|
||||
type BuyPigsRequest struct {
|
||||
PenID uint `json:"penID" validate:"required"` // 猪栏ID
|
||||
Quantity int `json:"quantity" validate:"required,min=1"` // 买入猪只数量
|
||||
UnitPrice float64 `json:"unitPrice" validate:"required,min=0"` // 单价
|
||||
TotalPrice float64 `json:"totalPrice" validate:"required,min=0"` // 总价
|
||||
TraderName string `json:"traderName" validate:"required"` // 交易方名称
|
||||
TradeDate time.Time `json:"tradeDate" validate:"required"` // 交易日期
|
||||
Remarks string `json:"remarks"` // 备注
|
||||
PenID uint `json:"pen_id" validate:"required"` // 猪栏ID
|
||||
Quantity int `json:"quantity" validate:"required,min=1"` // 买入猪只数量
|
||||
UnitPrice float64 `json:"unit_price" validate:"required,min=0"` // 单价
|
||||
TotalPrice float64 `json:"total_price" validate:"required,min=0"` // 总价
|
||||
TraderName string `json:"trader_name" validate:"required"` // 交易方名称
|
||||
TradeDate time.Time `json:"trade_date" validate:"required"` // 交易日期
|
||||
Remarks string `json:"remarks"` // 备注
|
||||
}
|
||||
|
||||
// TransferPigsAcrossBatchesRequest 用于跨猪群调栏的请求体
|
||||
type TransferPigsAcrossBatchesRequest struct {
|
||||
DestBatchID uint `json:"destBatchID" validate:"required"` // 目标猪批次ID
|
||||
FromPenID uint `json:"fromPenID" validate:"required"` // 源猪栏ID
|
||||
ToPenID uint `json:"toPenID" validate:"required"` // 目标猪栏ID
|
||||
DestBatchID uint `json:"dest_batch_id" validate:"required"` // 目标猪批次ID
|
||||
FromPenID uint `json:"from_pen_id" validate:"required"` // 源猪栏ID
|
||||
ToPenID uint `json:"to_pen_id" validate:"required"` // 目标猪栏ID
|
||||
Quantity uint `json:"quantity" validate:"required,min=1"` // 调栏猪只数量
|
||||
Remarks string `json:"remarks"` // 备注
|
||||
}
|
||||
|
||||
// TransferPigsWithinBatchRequest 用于群内调栏的请求体
|
||||
type TransferPigsWithinBatchRequest struct {
|
||||
FromPenID uint `json:"fromPenID" validate:"required"` // 源猪栏ID
|
||||
ToPenID uint `json:"toPenID" validate:"required"` // 目标猪栏ID
|
||||
FromPenID uint `json:"from_pen_id" validate:"required"` // 源猪栏ID
|
||||
ToPenID uint `json:"to_pen_id" validate:"required"` // 目标猪栏ID
|
||||
Quantity uint `json:"quantity" validate:"required,min=1"` // 调栏猪只数量
|
||||
Remarks string `json:"remarks"` // 备注
|
||||
}
|
||||
|
||||
// RecordSickPigsRequest 用于记录新增病猪事件的请求体
|
||||
type RecordSickPigsRequest struct {
|
||||
PenID uint `json:"penID" validate:"required"` // 猪栏ID
|
||||
Quantity int `json:"quantity" validate:"required,min=1"` // 病猪数量
|
||||
TreatmentLocation models.PigBatchSickPigTreatmentLocation `json:"treatmentLocation" validate:"required"` // 治疗地点
|
||||
HappenedAt time.Time `json:"happenedAt" validate:"required"` // 发生时间
|
||||
Remarks string `json:"remarks"` // 备注
|
||||
PenID uint `json:"pen_id" validate:"required"` // 猪栏ID
|
||||
Quantity int `json:"quantity" validate:"required,min=1"` // 病猪数量
|
||||
TreatmentLocation models.PigBatchSickPigTreatmentLocation `json:"treatment_location" validate:"required"` // 治疗地点
|
||||
HappenedAt time.Time `json:"happened_at" validate:"required"` // 发生时间
|
||||
Remarks string `json:"remarks"` // 备注
|
||||
}
|
||||
|
||||
// RecordSickPigRecoveryRequest 用于记录病猪康复事件的请求体
|
||||
type RecordSickPigRecoveryRequest struct {
|
||||
PenID uint `json:"penID" validate:"required"` // 猪栏ID
|
||||
Quantity int `json:"quantity" validate:"required,min=1"` // 康复猪数量
|
||||
TreatmentLocation models.PigBatchSickPigTreatmentLocation `json:"treatmentLocation" validate:"required"` // 治疗地点
|
||||
HappenedAt time.Time `json:"happenedAt" validate:"required"` // 发生时间
|
||||
Remarks string `json:"remarks"` // 备注
|
||||
PenID uint `json:"pen_id" validate:"required"` // 猪栏ID
|
||||
Quantity int `json:"quantity" validate:"required,min=1"` // 康复猪数量
|
||||
TreatmentLocation models.PigBatchSickPigTreatmentLocation `json:"treatment_location" validate:"required"` // 治疗地点
|
||||
HappenedAt time.Time `json:"happened_at" validate:"required"` // 发生时间
|
||||
Remarks string `json:"remarks"` // 备注
|
||||
}
|
||||
|
||||
// RecordSickPigDeathRequest 用于记录病猪死亡事件的请求体
|
||||
type RecordSickPigDeathRequest struct {
|
||||
PenID uint `json:"penID" validate:"required"` // 猪栏ID
|
||||
Quantity int `json:"quantity" validate:"required,min=1"` // 死亡猪数量
|
||||
TreatmentLocation models.PigBatchSickPigTreatmentLocation `json:"treatmentLocation" validate:"required"` // 治疗地点
|
||||
HappenedAt time.Time `json:"happenedAt" validate:"required"` // 发生时间
|
||||
Remarks string `json:"remarks"` // 备注
|
||||
PenID uint `json:"pen_id" validate:"required"` // 猪栏ID
|
||||
Quantity int `json:"quantity" validate:"required,min=1"` // 死亡猪数量
|
||||
TreatmentLocation models.PigBatchSickPigTreatmentLocation `json:"treatment_location" validate:"required"` // 治疗地点
|
||||
HappenedAt time.Time `json:"happened_at" validate:"required"` // 发生时间
|
||||
Remarks string `json:"remarks"` // 备注
|
||||
}
|
||||
|
||||
// RecordSickPigCullRequest 用于记录病猪淘汰事件的请求体
|
||||
type RecordSickPigCullRequest struct {
|
||||
PenID uint `json:"penID" validate:"required"` // 猪栏ID
|
||||
Quantity int `json:"quantity" validate:"required,min=1"` // 淘汰猪数量
|
||||
TreatmentLocation models.PigBatchSickPigTreatmentLocation `json:"treatmentLocation" validate:"required"` // 治疗地点
|
||||
HappenedAt time.Time `json:"happenedAt" validate:"required"` // 发生时间
|
||||
Remarks string `json:"remarks"` // 备注
|
||||
PenID uint `json:"pen_id" validate:"required"` // 猪栏ID
|
||||
Quantity int `json:"quantity" validate:"required,min=1"` // 淘汰猪数量
|
||||
TreatmentLocation models.PigBatchSickPigTreatmentLocation `json:"treatment_location" validate:"required"` // 治疗地点
|
||||
HappenedAt time.Time `json:"happened_at" validate:"required"` // 发生时间
|
||||
Remarks string `json:"remarks"` // 备注
|
||||
}
|
||||
|
||||
// RecordDeathRequest 用于记录正常猪只死亡事件的请求体
|
||||
type RecordDeathRequest struct {
|
||||
PenID uint `json:"penID" validate:"required"` // 猪栏ID
|
||||
PenID uint `json:"pen_id" validate:"required"` // 猪栏ID
|
||||
Quantity int `json:"quantity" validate:"required,min=1"` // 死亡猪数量
|
||||
HappenedAt time.Time `json:"happenedAt" validate:"required"` // 发生时间
|
||||
HappenedAt time.Time `json:"happened_at" validate:"required"` // 发生时间
|
||||
Remarks string `json:"remarks"` // 备注
|
||||
}
|
||||
|
||||
// RecordCullRequest 用于记录正常猪只淘汰事件的请求体
|
||||
type RecordCullRequest struct {
|
||||
PenID uint `json:"penID" validate:"required"` // 猪栏ID
|
||||
PenID uint `json:"pen_id" validate:"required"` // 猪栏ID
|
||||
Quantity int `json:"quantity" validate:"required,min=1"` // 淘汰猪数量
|
||||
HappenedAt time.Time `json:"happenedAt" validate:"required"` // 发生时间
|
||||
HappenedAt time.Time `json:"happened_at" validate:"required"` // 发生时间
|
||||
Remarks string `json:"remarks"` // 备注
|
||||
}
|
||||
|
||||
@@ -7,9 +7,9 @@ import (
|
||||
|
||||
// ListPlansQuery 定义了获取计划列表时的查询参数
|
||||
type ListPlansQuery struct {
|
||||
PlanType repository.PlanTypeFilter `query:"planType"` // 计划类型
|
||||
Page int `query:"page"` // 页码
|
||||
PageSize int `query:"pageSize"` // 每页大小
|
||||
PlanType repository.PlanTypeFilter `json:"plan_type" query:"planType"` // 计划类型
|
||||
Page int `json:"page" query:"page"` // 页码
|
||||
PageSize int `json:"page_size" query:"page_size"` // 每页大小
|
||||
}
|
||||
|
||||
// CreatePlanRequest 定义创建计划请求的结构体
|
||||
|
||||
Reference in New Issue
Block a user