610 lines
		
	
	
		
			23 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			610 lines
		
	
	
		
			23 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
package dto
 | 
						|
 | 
						|
import (
 | 
						|
	"encoding/json"
 | 
						|
	"time"
 | 
						|
 | 
						|
	"git.huangwc.com/pig/pig-farm-controller/internal/infra/models"
 | 
						|
)
 | 
						|
 | 
						|
// --- General ---
 | 
						|
 | 
						|
// PaginationDTO 定义了分页信息的标准结构
 | 
						|
type PaginationDTO struct {
 | 
						|
	Total    int64 `json:"total"`
 | 
						|
	Page     int   `json:"page"`
 | 
						|
	PageSize int   `json:"pageSize"`
 | 
						|
}
 | 
						|
 | 
						|
// --- SensorData ---
 | 
						|
 | 
						|
// ListSensorDataRequest 定义了获取传感器数据列表的请求参数
 | 
						|
type ListSensorDataRequest struct {
 | 
						|
	Page       int        `query:"page"`
 | 
						|
	PageSize   int        `query:"pageSize"`
 | 
						|
	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"`
 | 
						|
}
 | 
						|
 | 
						|
// SensorDataDTO 是用于API响应的传感器数据结构
 | 
						|
type SensorDataDTO struct {
 | 
						|
	Time                 time.Time         `json:"time"`
 | 
						|
	DeviceID             uint              `json:"device_id"`
 | 
						|
	RegionalControllerID uint              `json:"regional_controller_id"`
 | 
						|
	SensorType           models.SensorType `json:"sensor_type"`
 | 
						|
	Data                 json.RawMessage   `json:"data"`
 | 
						|
}
 | 
						|
 | 
						|
// ListSensorDataResponse 是获取传感器数据列表的响应结构
 | 
						|
type ListSensorDataResponse struct {
 | 
						|
	List       []SensorDataDTO `json:"list"`
 | 
						|
	Pagination PaginationDTO   `json:"pagination"`
 | 
						|
}
 | 
						|
 | 
						|
// --- DeviceCommandLog ---
 | 
						|
 | 
						|
// ListDeviceCommandLogRequest 定义了获取设备命令日志列表的请求参数
 | 
						|
type ListDeviceCommandLogRequest struct {
 | 
						|
	Page            int        `query:"page"`
 | 
						|
	PageSize        int        `query:"pageSize"`
 | 
						|
	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"`
 | 
						|
}
 | 
						|
 | 
						|
// DeviceCommandLogDTO 是用于API响应的设备命令日志结构
 | 
						|
type DeviceCommandLogDTO struct {
 | 
						|
	MessageID       string     `json:"message_id"`
 | 
						|
	DeviceID        uint       `json:"device_id"`
 | 
						|
	SentAt          time.Time  `json:"sent_at"`
 | 
						|
	AcknowledgedAt  *time.Time `json:"acknowledged_at"`
 | 
						|
	ReceivedSuccess bool       `json:"received_success"`
 | 
						|
}
 | 
						|
 | 
						|
// ListDeviceCommandLogResponse 是获取设备命令日志列表的响应结构
 | 
						|
type ListDeviceCommandLogResponse struct {
 | 
						|
	List       []DeviceCommandLogDTO `json:"list"`
 | 
						|
	Pagination PaginationDTO         `json:"pagination"`
 | 
						|
}
 | 
						|
 | 
						|
// --- PlanExecutionLog ---
 | 
						|
 | 
						|
// ListPlanExecutionLogRequest 定义了获取计划执行日志列表的请求参数
 | 
						|
type ListPlanExecutionLogRequest struct {
 | 
						|
	Page      int        `query:"page"`
 | 
						|
	PageSize  int        `query:"pageSize"`
 | 
						|
	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"`
 | 
						|
}
 | 
						|
 | 
						|
// PlanExecutionLogDTO 是用于API响应的计划执行日志结构
 | 
						|
type PlanExecutionLogDTO struct {
 | 
						|
	ID        uint                   `json:"id"`
 | 
						|
	CreatedAt time.Time              `json:"created_at"`
 | 
						|
	UpdatedAt time.Time              `json:"updated_at"`
 | 
						|
	PlanID    uint                   `json:"plan_id"`
 | 
						|
	PlanName  string                 `json:"plan_name"`
 | 
						|
	Status    models.ExecutionStatus `json:"status"`
 | 
						|
	StartedAt time.Time              `json:"started_at"`
 | 
						|
	EndedAt   time.Time              `json:"ended_at"`
 | 
						|
	Error     string                 `json:"error"`
 | 
						|
}
 | 
						|
 | 
						|
// ListPlanExecutionLogResponse 是获取计划执行日志列表的响应结构
 | 
						|
type ListPlanExecutionLogResponse struct {
 | 
						|
	List       []PlanExecutionLogDTO `json:"list"`
 | 
						|
	Pagination PaginationDTO         `json:"pagination"`
 | 
						|
}
 | 
						|
 | 
						|
// --- TaskExecutionLog ---
 | 
						|
 | 
						|
// ListTaskExecutionLogRequest 定义了获取任务执行日志列表的请求参数
 | 
						|
type ListTaskExecutionLogRequest struct {
 | 
						|
	Page               int        `query:"page"`
 | 
						|
	PageSize           int        `query:"pageSize"`
 | 
						|
	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"`
 | 
						|
}
 | 
						|
 | 
						|
// TaskDTO 是用于API响应的简化版任务结构
 | 
						|
type TaskDTO struct {
 | 
						|
	ID          uint   `json:"id"`
 | 
						|
	Name        string `json:"name"`
 | 
						|
	Description string `json:"description"`
 | 
						|
}
 | 
						|
 | 
						|
// TaskExecutionLogDTO 是用于API响应的任务执行日志结构
 | 
						|
type TaskExecutionLogDTO struct {
 | 
						|
	ID                 uint                   `json:"id"`
 | 
						|
	CreatedAt          time.Time              `json:"created_at"`
 | 
						|
	UpdatedAt          time.Time              `json:"updated_at"`
 | 
						|
	PlanExecutionLogID uint                   `json:"plan_execution_log_id"`
 | 
						|
	TaskID             int                    `json:"task_id"`
 | 
						|
	Task               TaskDTO                `json:"task"` // 嵌套的任务信息
 | 
						|
	Status             models.ExecutionStatus `json:"status"`
 | 
						|
	Output             string                 `json:"output"`
 | 
						|
	StartedAt          time.Time              `json:"started_at"`
 | 
						|
	EndedAt            time.Time              `json:"ended_at"`
 | 
						|
}
 | 
						|
 | 
						|
// ListTaskExecutionLogResponse 是获取任务执行日志列表的响应结构
 | 
						|
type ListTaskExecutionLogResponse struct {
 | 
						|
	List       []TaskExecutionLogDTO `json:"list"`
 | 
						|
	Pagination PaginationDTO         `json:"pagination"`
 | 
						|
}
 | 
						|
 | 
						|
// --- PendingCollection ---
 | 
						|
 | 
						|
// ListPendingCollectionRequest 定义了获取待采集请求列表的请求参数
 | 
						|
type ListPendingCollectionRequest struct {
 | 
						|
	Page      int        `query:"page"`
 | 
						|
	PageSize  int        `query:"pageSize"`
 | 
						|
	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"`
 | 
						|
}
 | 
						|
 | 
						|
// PendingCollectionDTO 是用于API响应的待采集请求结构
 | 
						|
type PendingCollectionDTO struct {
 | 
						|
	CorrelationID   string                         `json:"correlation_id"`
 | 
						|
	DeviceID        uint                           `json:"device_id"`
 | 
						|
	CommandMetadata models.UintArray               `json:"command_metadata"`
 | 
						|
	Status          models.PendingCollectionStatus `json:"status"`
 | 
						|
	FulfilledAt     *time.Time                     `json:"fulfilled_at"`
 | 
						|
	CreatedAt       time.Time                      `json:"created_at"`
 | 
						|
}
 | 
						|
 | 
						|
// ListPendingCollectionResponse 是获取待采集请求列表的响应结构
 | 
						|
type ListPendingCollectionResponse struct {
 | 
						|
	List       []PendingCollectionDTO `json:"list"`
 | 
						|
	Pagination PaginationDTO          `json:"pagination"`
 | 
						|
}
 | 
						|
 | 
						|
// --- UserActionLog ---
 | 
						|
 | 
						|
// ListUserActionLogRequest 定义了获取用户操作日志列表的请求参数
 | 
						|
type ListUserActionLogRequest struct {
 | 
						|
	Page       int        `query:"page"`
 | 
						|
	PageSize   int        `query:"pageSize"`
 | 
						|
	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"`
 | 
						|
}
 | 
						|
 | 
						|
// UserActionLogDTO 是用于API响应的用户操作日志结构
 | 
						|
type UserActionLogDTO struct {
 | 
						|
	ID             uint               `json:"id"`
 | 
						|
	Time           time.Time          `json:"time"`
 | 
						|
	UserID         uint               `json:"user_id"`
 | 
						|
	Username       string             `json:"username"`
 | 
						|
	SourceIP       string             `json:"source_ip"`
 | 
						|
	ActionType     string             `json:"action_type"`
 | 
						|
	TargetResource json.RawMessage    `json:"target_resource"`
 | 
						|
	Description    string             `json:"description"`
 | 
						|
	Status         models.AuditStatus `json:"status"`
 | 
						|
	HTTPPath       string             `json:"http_path"`
 | 
						|
	HTTPMethod     string             `json:"http_method"`
 | 
						|
	ResultDetails  string             `json:"result_details"`
 | 
						|
}
 | 
						|
 | 
						|
// ListUserActionLogResponse 是获取用户操作日志列表的响应结构
 | 
						|
type ListUserActionLogResponse struct {
 | 
						|
	List       []UserActionLogDTO `json:"list"`
 | 
						|
	Pagination PaginationDTO      `json:"pagination"`
 | 
						|
}
 | 
						|
 | 
						|
// --- RawMaterialPurchase ---
 | 
						|
 | 
						|
// ListRawMaterialPurchaseRequest 定义了获取原料采购列表的请求参数
 | 
						|
type ListRawMaterialPurchaseRequest struct {
 | 
						|
	Page          int        `query:"page"`
 | 
						|
	PageSize      int        `query:"pageSize"`
 | 
						|
	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"`
 | 
						|
}
 | 
						|
 | 
						|
// RawMaterialDTO 是用于API响应的简化版原料结构
 | 
						|
type RawMaterialDTO struct {
 | 
						|
	ID   uint   `json:"id"`
 | 
						|
	Name string `json:"name"`
 | 
						|
}
 | 
						|
 | 
						|
// RawMaterialPurchaseDTO 是用于API响应的原料采购结构
 | 
						|
type RawMaterialPurchaseDTO struct {
 | 
						|
	ID            uint           `json:"id"`
 | 
						|
	RawMaterialID uint           `json:"raw_material_id"`
 | 
						|
	RawMaterial   RawMaterialDTO `json:"raw_material"`
 | 
						|
	Supplier      string         `json:"supplier"`
 | 
						|
	Amount        float64        `json:"amount"`
 | 
						|
	UnitPrice     float64        `json:"unit_price"`
 | 
						|
	TotalPrice    float64        `json:"total_price"`
 | 
						|
	PurchaseDate  time.Time      `json:"purchase_date"`
 | 
						|
	CreatedAt     time.Time      `json:"created_at"`
 | 
						|
}
 | 
						|
 | 
						|
// ListRawMaterialPurchaseResponse 是获取原料采购列表的响应结构
 | 
						|
type ListRawMaterialPurchaseResponse struct {
 | 
						|
	List       []RawMaterialPurchaseDTO `json:"list"`
 | 
						|
	Pagination PaginationDTO            `json:"pagination"`
 | 
						|
}
 | 
						|
 | 
						|
// --- RawMaterialStockLog ---
 | 
						|
 | 
						|
// ListRawMaterialStockLogRequest 定义了获取原料库存日志列表的请求参数
 | 
						|
type ListRawMaterialStockLogRequest struct {
 | 
						|
	Page          int        `query:"page"`
 | 
						|
	PageSize      int        `query:"pageSize"`
 | 
						|
	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"`
 | 
						|
}
 | 
						|
 | 
						|
// RawMaterialStockLogDTO 是用于API响应的原料库存日志结构
 | 
						|
type RawMaterialStockLogDTO struct {
 | 
						|
	ID            uint                      `json:"id"`
 | 
						|
	RawMaterialID uint                      `json:"raw_material_id"`
 | 
						|
	ChangeAmount  float64                   `json:"change_amount"`
 | 
						|
	SourceType    models.StockLogSourceType `json:"source_type"`
 | 
						|
	SourceID      uint                      `json:"source_id"`
 | 
						|
	HappenedAt    time.Time                 `json:"happened_at"`
 | 
						|
	Remarks       string                    `json:"remarks"`
 | 
						|
}
 | 
						|
 | 
						|
// ListRawMaterialStockLogResponse 是获取原料库存日志列表的响应结构
 | 
						|
type ListRawMaterialStockLogResponse struct {
 | 
						|
	List       []RawMaterialStockLogDTO `json:"list"`
 | 
						|
	Pagination PaginationDTO            `json:"pagination"`
 | 
						|
}
 | 
						|
 | 
						|
// --- FeedUsageRecord ---
 | 
						|
 | 
						|
// ListFeedUsageRecordRequest 定义了获取饲料使用记录列表的请求参数
 | 
						|
type ListFeedUsageRecordRequest struct {
 | 
						|
	Page          int        `query:"page"`
 | 
						|
	PageSize      int        `query:"pageSize"`
 | 
						|
	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"`
 | 
						|
}
 | 
						|
 | 
						|
// PenDTO 是用于API响应的简化版猪栏结构
 | 
						|
type PenDTO struct {
 | 
						|
	ID   uint   `json:"id"`
 | 
						|
	Name string `json:"name"`
 | 
						|
}
 | 
						|
 | 
						|
// FeedFormulaDTO 是用于API响应的简化版饲料配方结构
 | 
						|
type FeedFormulaDTO struct {
 | 
						|
	ID   uint   `json:"id"`
 | 
						|
	Name string `json:"name"`
 | 
						|
}
 | 
						|
 | 
						|
// FeedUsageRecordDTO 是用于API响应的饲料使用记录结构
 | 
						|
type FeedUsageRecordDTO struct {
 | 
						|
	ID            uint           `json:"id"`
 | 
						|
	PenID         uint           `json:"pen_id"`
 | 
						|
	Pen           PenDTO         `json:"pen"`
 | 
						|
	FeedFormulaID uint           `json:"feed_formula_id"`
 | 
						|
	FeedFormula   FeedFormulaDTO `json:"feed_formula"`
 | 
						|
	Amount        float64        `json:"amount"`
 | 
						|
	RecordedAt    time.Time      `json:"recorded_at"`
 | 
						|
	OperatorID    uint           `json:"operator_id"`
 | 
						|
	Remarks       string         `json:"remarks"`
 | 
						|
}
 | 
						|
 | 
						|
// ListFeedUsageRecordResponse 是获取饲料使用记录列表的响应结构
 | 
						|
type ListFeedUsageRecordResponse struct {
 | 
						|
	List       []FeedUsageRecordDTO `json:"list"`
 | 
						|
	Pagination PaginationDTO        `json:"pagination"`
 | 
						|
}
 | 
						|
 | 
						|
// --- MedicationLog ---
 | 
						|
 | 
						|
// ListMedicationLogRequest 定义了获取用药记录列表的请求参数
 | 
						|
type ListMedicationLogRequest struct {
 | 
						|
	Page         int        `query:"page"`
 | 
						|
	PageSize     int        `query:"pageSize"`
 | 
						|
	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"`
 | 
						|
}
 | 
						|
 | 
						|
// MedicationDTO 是用于API响应的简化版药品结构
 | 
						|
type MedicationDTO struct {
 | 
						|
	ID   uint   `json:"id"`
 | 
						|
	Name string `json:"name"`
 | 
						|
}
 | 
						|
 | 
						|
// MedicationLogDTO 是用于API响应的用药记录结构
 | 
						|
type MedicationLogDTO struct {
 | 
						|
	ID           uint                        `json:"id"`
 | 
						|
	PigBatchID   uint                        `json:"pig_batch_id"`
 | 
						|
	MedicationID uint                        `json:"medication_id"`
 | 
						|
	Medication   MedicationDTO               `json:"medication"`
 | 
						|
	DosageUsed   float64                     `json:"dosage_used"`
 | 
						|
	TargetCount  int                         `json:"target_count"`
 | 
						|
	Reason       models.MedicationReasonType `json:"reason"`
 | 
						|
	Description  string                      `json:"description"`
 | 
						|
	OperatorID   uint                        `json:"operator_id"`
 | 
						|
	HappenedAt   time.Time                   `json:"happened_at"`
 | 
						|
}
 | 
						|
 | 
						|
// ListMedicationLogResponse 是获取用药记录列表的响应结构
 | 
						|
type ListMedicationLogResponse struct {
 | 
						|
	List       []MedicationLogDTO `json:"list"`
 | 
						|
	Pagination PaginationDTO      `json:"pagination"`
 | 
						|
}
 | 
						|
 | 
						|
// --- PigBatchLog ---
 | 
						|
 | 
						|
// ListPigBatchLogRequest 定义了获取猪批次日志列表的请求参数
 | 
						|
type ListPigBatchLogRequest struct {
 | 
						|
	Page       int        `query:"page"`
 | 
						|
	PageSize   int        `query:"pageSize"`
 | 
						|
	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"`
 | 
						|
}
 | 
						|
 | 
						|
// PigBatchLogDTO 是用于API响应的猪批次日志结构
 | 
						|
type PigBatchLogDTO struct {
 | 
						|
	ID          uint                 `json:"id"`
 | 
						|
	CreatedAt   time.Time            `json:"created_at"`
 | 
						|
	UpdatedAt   time.Time            `json:"updated_at"`
 | 
						|
	PigBatchID  uint                 `json:"pig_batch_id"`
 | 
						|
	ChangeType  models.LogChangeType `json:"change_type"`
 | 
						|
	ChangeCount int                  `json:"change_count"`
 | 
						|
	Reason      string               `json:"reason"`
 | 
						|
	BeforeCount int                  `json:"before_count"`
 | 
						|
	AfterCount  int                  `json:"after_count"`
 | 
						|
	OperatorID  uint                 `json:"operator_id"`
 | 
						|
	HappenedAt  time.Time            `json:"happened_at"`
 | 
						|
}
 | 
						|
 | 
						|
// ListPigBatchLogResponse 是获取猪批次日志列表的响应结构
 | 
						|
type ListPigBatchLogResponse struct {
 | 
						|
	List       []PigBatchLogDTO `json:"list"`
 | 
						|
	Pagination PaginationDTO    `json:"pagination"`
 | 
						|
}
 | 
						|
 | 
						|
// --- WeighingBatch ---
 | 
						|
 | 
						|
// ListWeighingBatchRequest 定义了获取批次称重记录列表的请求参数
 | 
						|
type ListWeighingBatchRequest struct {
 | 
						|
	Page       int        `query:"page"`
 | 
						|
	PageSize   int        `query:"pageSize"`
 | 
						|
	PigBatchID *uint      `query:"pig_batch_id"`
 | 
						|
	StartTime  *time.Time `query:"start_time"`
 | 
						|
	EndTime    *time.Time `query:"end_time"`
 | 
						|
	OrderBy    string     `query:"order_by"`
 | 
						|
}
 | 
						|
 | 
						|
// WeighingBatchDTO 是用于API响应的批次称重记录结构
 | 
						|
type WeighingBatchDTO struct {
 | 
						|
	ID           uint      `json:"id"`
 | 
						|
	CreatedAt    time.Time `json:"created_at"`
 | 
						|
	UpdatedAt    time.Time `json:"updated_at"`
 | 
						|
	WeighingTime time.Time `json:"weighing_time"`
 | 
						|
	Description  string    `json:"description"`
 | 
						|
	PigBatchID   uint      `json:"pig_batch_id"`
 | 
						|
}
 | 
						|
 | 
						|
// ListWeighingBatchResponse 是获取批次称重记录列表的响应结构
 | 
						|
type ListWeighingBatchResponse struct {
 | 
						|
	List       []WeighingBatchDTO `json:"list"`
 | 
						|
	Pagination PaginationDTO      `json:"pagination"`
 | 
						|
}
 | 
						|
 | 
						|
// --- WeighingRecord ---
 | 
						|
 | 
						|
// ListWeighingRecordRequest 定义了获取单次称重记录列表的请求参数
 | 
						|
type ListWeighingRecordRequest struct {
 | 
						|
	Page            int        `query:"page"`
 | 
						|
	PageSize        int        `query:"pageSize"`
 | 
						|
	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"`
 | 
						|
}
 | 
						|
 | 
						|
// WeighingRecordDTO 是用于API响应的单次称重记录结构
 | 
						|
type WeighingRecordDTO struct {
 | 
						|
	ID              uint      `json:"id"`
 | 
						|
	CreatedAt       time.Time `json:"created_at"`
 | 
						|
	UpdatedAt       time.Time `json:"updated_at"`
 | 
						|
	Weight          float64   `json:"weight"`
 | 
						|
	WeighingBatchID uint      `json:"weighing_batch_id"`
 | 
						|
	PenID           uint      `json:"pen_id"`
 | 
						|
	OperatorID      uint      `json:"operator_id"`
 | 
						|
	Remark          string    `json:"remark"`
 | 
						|
	WeighingTime    time.Time `json:"weighing_time"`
 | 
						|
}
 | 
						|
 | 
						|
// ListWeighingRecordResponse 是获取单次称重记录列表的响应结构
 | 
						|
type ListWeighingRecordResponse struct {
 | 
						|
	List       []WeighingRecordDTO `json:"list"`
 | 
						|
	Pagination PaginationDTO       `json:"pagination"`
 | 
						|
}
 | 
						|
 | 
						|
// --- PigTransferLog ---
 | 
						|
 | 
						|
// ListPigTransferLogRequest 定义了获取猪只迁移日志列表的请求参数
 | 
						|
type ListPigTransferLogRequest struct {
 | 
						|
	Page          int        `query:"page"`
 | 
						|
	PageSize      int        `query:"pageSize"`
 | 
						|
	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"`
 | 
						|
}
 | 
						|
 | 
						|
// PigTransferLogDTO 是用于API响应的猪只迁移日志结构
 | 
						|
type PigTransferLogDTO struct {
 | 
						|
	ID            uint                   `json:"id"`
 | 
						|
	CreatedAt     time.Time              `json:"created_at"`
 | 
						|
	UpdatedAt     time.Time              `json:"updated_at"`
 | 
						|
	TransferTime  time.Time              `json:"transfer_time"`
 | 
						|
	PigBatchID    uint                   `json:"pig_batch_id"`
 | 
						|
	PenID         uint                   `json:"pen_id"`
 | 
						|
	Quantity      int                    `json:"quantity"`
 | 
						|
	Type          models.PigTransferType `json:"type"`
 | 
						|
	CorrelationID string                 `json:"correlation_id"`
 | 
						|
	OperatorID    uint                   `json:"operator_id"`
 | 
						|
	Remarks       string                 `json:"remarks"`
 | 
						|
}
 | 
						|
 | 
						|
// ListPigTransferLogResponse 是获取猪只迁移日志列表的响应结构
 | 
						|
type ListPigTransferLogResponse struct {
 | 
						|
	List       []PigTransferLogDTO `json:"list"`
 | 
						|
	Pagination PaginationDTO       `json:"pagination"`
 | 
						|
}
 | 
						|
 | 
						|
// --- PigSickLog ---
 | 
						|
 | 
						|
// ListPigSickLogRequest 定义了获取病猪日志列表的请求参数
 | 
						|
type ListPigSickLogRequest struct {
 | 
						|
	Page              int        `query:"page"`
 | 
						|
	PageSize          int        `query:"pageSize"`
 | 
						|
	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"`
 | 
						|
}
 | 
						|
 | 
						|
// PigSickLogDTO 是用于API响应的病猪日志结构
 | 
						|
type PigSickLogDTO struct {
 | 
						|
	ID                uint                                    `json:"id"`
 | 
						|
	CreatedAt         time.Time                               `json:"created_at"`
 | 
						|
	UpdatedAt         time.Time                               `json:"updated_at"`
 | 
						|
	PigBatchID        uint                                    `json:"pig_batch_id"`
 | 
						|
	PenID             uint                                    `json:"pen_id"`
 | 
						|
	ChangeCount       int                                     `json:"change_count"`
 | 
						|
	Reason            models.PigBatchSickPigReasonType        `json:"reason"`
 | 
						|
	BeforeCount       int                                     `json:"before_count"`
 | 
						|
	AfterCount        int                                     `json:"after_count"`
 | 
						|
	Remarks           string                                  `json:"remarks"`
 | 
						|
	TreatmentLocation models.PigBatchSickPigTreatmentLocation `json:"treatment_location"`
 | 
						|
	OperatorID        uint                                    `json:"operator_id"`
 | 
						|
	HappenedAt        time.Time                               `json:"happened_at"`
 | 
						|
}
 | 
						|
 | 
						|
// ListPigSickLogResponse 是获取病猪日志列表的响应结构
 | 
						|
type ListPigSickLogResponse struct {
 | 
						|
	List       []PigSickLogDTO `json:"list"`
 | 
						|
	Pagination PaginationDTO   `json:"pagination"`
 | 
						|
}
 | 
						|
 | 
						|
// --- PigPurchase ---
 | 
						|
 | 
						|
// ListPigPurchaseRequest 定义了获取猪只采购记录列表的请求参数
 | 
						|
type ListPigPurchaseRequest struct {
 | 
						|
	Page       int        `query:"page"`
 | 
						|
	PageSize   int        `query:"pageSize"`
 | 
						|
	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"`
 | 
						|
}
 | 
						|
 | 
						|
// PigPurchaseDTO 是用于API响应的猪只采购记录结构
 | 
						|
type PigPurchaseDTO struct {
 | 
						|
	ID           uint      `json:"id"`
 | 
						|
	CreatedAt    time.Time `json:"created_at"`
 | 
						|
	UpdatedAt    time.Time `json:"updated_at"`
 | 
						|
	PigBatchID   uint      `json:"pig_batch_id"`
 | 
						|
	PurchaseDate time.Time `json:"purchase_date"`
 | 
						|
	Supplier     string    `json:"supplier"`
 | 
						|
	Quantity     int       `json:"quantity"`
 | 
						|
	UnitPrice    float64   `json:"unit_price"`
 | 
						|
	TotalPrice   float64   `json:"total_price"`
 | 
						|
	Remarks      string    `json:"remarks"`
 | 
						|
	OperatorID   uint      `json:"operator_id"`
 | 
						|
}
 | 
						|
 | 
						|
// ListPigPurchaseResponse 是获取猪只采购记录列表的响应结构
 | 
						|
type ListPigPurchaseResponse struct {
 | 
						|
	List       []PigPurchaseDTO `json:"list"`
 | 
						|
	Pagination PaginationDTO    `json:"pagination"`
 | 
						|
}
 | 
						|
 | 
						|
// --- PigSale ---
 | 
						|
 | 
						|
// ListPigSaleRequest 定义了获取猪只销售记录列表的请求参数
 | 
						|
type ListPigSaleRequest struct {
 | 
						|
	Page       int        `query:"page"`
 | 
						|
	PageSize   int        `query:"pageSize"`
 | 
						|
	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"`
 | 
						|
}
 | 
						|
 | 
						|
// PigSaleDTO 是用于API响应的猪只销售记录结构
 | 
						|
type PigSaleDTO struct {
 | 
						|
	ID         uint      `json:"id"`
 | 
						|
	CreatedAt  time.Time `json:"created_at"`
 | 
						|
	UpdatedAt  time.Time `json:"updated_at"`
 | 
						|
	PigBatchID uint      `json:"pig_batch_id"`
 | 
						|
	SaleDate   time.Time `json:"sale_date"`
 | 
						|
	Buyer      string    `json:"buyer"`
 | 
						|
	Quantity   int       `json:"quantity"`
 | 
						|
	UnitPrice  float64   `json:"unit_price"`
 | 
						|
	TotalPrice float64   `json:"total_price"`
 | 
						|
	Remarks    string    `json:"remarks"`
 | 
						|
	OperatorID uint      `json:"operator_id"`
 | 
						|
}
 | 
						|
 | 
						|
// ListPigSaleResponse 是获取猪只销售记录列表的响应结构
 | 
						|
type ListPigSaleResponse struct {
 | 
						|
	List       []PigSaleDTO  `json:"list"`
 | 
						|
	Pagination PaginationDTO `json:"pagination"`
 | 
						|
}
 |