完成任务5
This commit is contained in:
@@ -4,20 +4,20 @@ import "git.huangwc.com/pig/pig-farm-controller/internal/infra/models"
|
||||
|
||||
// CreateDeviceRequest 定义了创建设备时需要传入的参数
|
||||
type CreateDeviceRequest struct {
|
||||
Name string `json:"name" binding:"required"`
|
||||
DeviceTemplateID uint `json:"device_template_id" binding:"required"`
|
||||
AreaControllerID uint `json:"area_controller_id" binding:"required"`
|
||||
Location string `json:"location,omitempty"`
|
||||
Properties map[string]interface{} `json:"properties,omitempty"`
|
||||
Name string `json:"name" validate:"required"`
|
||||
DeviceTemplateID uint `json:"device_template_id" validate:"required"`
|
||||
AreaControllerID uint `json:"area_controller_id" validate:"required"`
|
||||
Location string `json:"location,omitempty" validate:"omitempty"`
|
||||
Properties map[string]interface{} `json:"properties,omitempty" validate:"omitempty"`
|
||||
}
|
||||
|
||||
// UpdateDeviceRequest 定义了更新设备时需要传入的参数
|
||||
type UpdateDeviceRequest struct {
|
||||
Name string `json:"name" binding:"required"`
|
||||
DeviceTemplateID uint `json:"device_template_id" binding:"required"`
|
||||
AreaControllerID uint `json:"area_controller_id" binding:"required"`
|
||||
Location string `json:"location,omitempty"`
|
||||
Properties map[string]interface{} `json:"properties,omitempty"`
|
||||
Name string `json:"name" validate:"required"`
|
||||
DeviceTemplateID uint `json:"device_template_id" validate:"required"`
|
||||
AreaControllerID uint `json:"area_controller_id" validate:"required"`
|
||||
Location string `json:"location,omitempty" validate:"omitempty"`
|
||||
Properties map[string]interface{} `json:"properties,omitempty" validate:"omitempty"`
|
||||
}
|
||||
|
||||
// ManualControlDeviceRequest 定义了手动控制设备时需要传入的参数
|
||||
@@ -28,38 +28,38 @@ type ManualControlDeviceRequest struct {
|
||||
|
||||
// CreateAreaControllerRequest 定义了创建区域主控时需要传入的参数
|
||||
type CreateAreaControllerRequest struct {
|
||||
Name string `json:"name" binding:"required"`
|
||||
NetworkID string `json:"network_id" binding:"required"`
|
||||
Location string `json:"location,omitempty"`
|
||||
Properties map[string]interface{} `json:"properties,omitempty"`
|
||||
Name string `json:"name" validate:"required"`
|
||||
NetworkID string `json:"network_id" validate:"required"`
|
||||
Location string `json:"location,omitempty" validate:"omitempty"`
|
||||
Properties map[string]interface{} `json:"properties,omitempty" validate:"omitempty"`
|
||||
}
|
||||
|
||||
// UpdateAreaControllerRequest 定义了更新区域主控时需要传入的参数
|
||||
type UpdateAreaControllerRequest struct {
|
||||
Name string `json:"name" binding:"required"`
|
||||
NetworkID string `json:"network_id" binding:"required"`
|
||||
Location string `json:"location,omitempty"`
|
||||
Properties map[string]interface{} `json:"properties,omitempty"`
|
||||
Name string `json:"name" validate:"required"`
|
||||
NetworkID string `json:"network_id" validate:"required"`
|
||||
Location string `json:"location,omitempty" validate:"omitempty"`
|
||||
Properties map[string]interface{} `json:"properties,omitempty" validate:"omitempty"`
|
||||
}
|
||||
|
||||
// CreateDeviceTemplateRequest 定义了创建设备模板时需要传入的参数
|
||||
type CreateDeviceTemplateRequest struct {
|
||||
Name string `json:"name" binding:"required"`
|
||||
Manufacturer string `json:"manufacturer,omitempty"`
|
||||
Description string `json:"description,omitempty"`
|
||||
Category models.DeviceCategory `json:"category" binding:"required"`
|
||||
Commands map[string]interface{} `json:"commands" binding:"required"`
|
||||
Values []models.ValueDescriptor `json:"values,omitempty"`
|
||||
Name string `json:"name" validate:"required"`
|
||||
Manufacturer string `json:"manufacturer,omitempty" validate:"omitempty"`
|
||||
Description string `json:"description,omitempty" validate:"omitempty"`
|
||||
Category models.DeviceCategory `json:"category" validate:"required"`
|
||||
Commands map[string]interface{} `json:"commands" validate:"required"`
|
||||
Values []models.ValueDescriptor `json:"values,omitempty" validate:"omitempty,dive"`
|
||||
}
|
||||
|
||||
// UpdateDeviceTemplateRequest 定义了更新设备模板时需要传入的参数
|
||||
type UpdateDeviceTemplateRequest struct {
|
||||
Name string `json:"name" binding:"required"`
|
||||
Manufacturer string `json:"manufacturer,omitempty"`
|
||||
Description string `json:"description,omitempty"`
|
||||
Category models.DeviceCategory `json:"category" binding:"required"`
|
||||
Commands map[string]interface{} `json:"commands" binding:"required"`
|
||||
Values []models.ValueDescriptor `json:"values,omitempty"`
|
||||
Name string `json:"name" validate:"required"`
|
||||
Manufacturer string `json:"manufacturer,omitempty" validate:"omitempty"`
|
||||
Description string `json:"description,omitempty" validate:"omitempty"`
|
||||
Category models.DeviceCategory `json:"category" validate:"required"`
|
||||
Commands map[string]interface{} `json:"commands" validate:"required"`
|
||||
Values []models.ValueDescriptor `json:"values,omitempty" validate:"omitempty,dive"`
|
||||
}
|
||||
|
||||
// DeviceResponse 定义了返回给客户端的单个设备信息的结构
|
||||
|
||||
@@ -20,13 +20,13 @@ type PaginationDTO struct {
|
||||
|
||||
// ListSensorDataRequest 定义了获取传感器数据列表的请求参数
|
||||
type ListSensorDataRequest struct {
|
||||
Page int `form:"page,default=1"`
|
||||
PageSize int `form:"pageSize,default=10"`
|
||||
DeviceID *uint `form:"device_id"`
|
||||
SensorType *string `form:"sensor_type"`
|
||||
StartTime *time.Time `form:"start_time"`
|
||||
EndTime *time.Time `form:"end_time"`
|
||||
OrderBy string `form:"order_by"`
|
||||
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响应的传感器数据结构
|
||||
@@ -48,13 +48,13 @@ type ListSensorDataResponse struct {
|
||||
|
||||
// ListDeviceCommandLogRequest 定义了获取设备命令日志列表的请求参数
|
||||
type ListDeviceCommandLogRequest struct {
|
||||
Page int `form:"page,default=1"`
|
||||
PageSize int `form:"pageSize,default=10"`
|
||||
DeviceID *uint `form:"device_id"`
|
||||
ReceivedSuccess *bool `form:"received_success"`
|
||||
StartTime *time.Time `form:"start_time"`
|
||||
EndTime *time.Time `form:"end_time"`
|
||||
OrderBy string `form:"order_by"`
|
||||
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响应的设备命令日志结构
|
||||
@@ -76,13 +76,13 @@ type ListDeviceCommandLogResponse struct {
|
||||
|
||||
// ListPlanExecutionLogRequest 定义了获取计划执行日志列表的请求参数
|
||||
type ListPlanExecutionLogRequest struct {
|
||||
Page int `form:"page,default=1"`
|
||||
PageSize int `form:"pageSize,default=10"`
|
||||
PlanID *uint `form:"plan_id"`
|
||||
Status *string `form:"status"`
|
||||
StartTime *time.Time `form:"start_time"`
|
||||
EndTime *time.Time `form:"end_time"`
|
||||
OrderBy string `form:"order_by"`
|
||||
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响应的计划执行日志结构
|
||||
@@ -108,14 +108,14 @@ type ListPlanExecutionLogResponse struct {
|
||||
|
||||
// ListTaskExecutionLogRequest 定义了获取任务执行日志列表的请求参数
|
||||
type ListTaskExecutionLogRequest struct {
|
||||
Page int `form:"page,default=1"`
|
||||
PageSize int `form:"pageSize,default=10"`
|
||||
PlanExecutionLogID *uint `form:"plan_execution_log_id"`
|
||||
TaskID *int `form:"task_id"`
|
||||
Status *string `form:"status"`
|
||||
StartTime *time.Time `form:"start_time"`
|
||||
EndTime *time.Time `form:"end_time"`
|
||||
OrderBy string `form:"order_by"`
|
||||
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响应的简化版任务结构
|
||||
@@ -149,13 +149,13 @@ type ListTaskExecutionLogResponse struct {
|
||||
|
||||
// ListPendingCollectionRequest 定义了获取待采集请求列表的请求参数
|
||||
type ListPendingCollectionRequest struct {
|
||||
Page int `form:"page,default=1"`
|
||||
PageSize int `form:"pageSize,default=10"`
|
||||
DeviceID *uint `form:"device_id"`
|
||||
Status *string `form:"status"`
|
||||
StartTime *time.Time `form:"start_time"`
|
||||
EndTime *time.Time `form:"end_time"`
|
||||
OrderBy string `form:"order_by"`
|
||||
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响应的待采集请求结构
|
||||
@@ -178,15 +178,15 @@ type ListPendingCollectionResponse struct {
|
||||
|
||||
// ListUserActionLogRequest 定义了获取用户操作日志列表的请求参数
|
||||
type ListUserActionLogRequest struct {
|
||||
Page int `form:"page,default=1"`
|
||||
PageSize int `form:"pageSize,default=10"`
|
||||
UserID *uint `form:"user_id"`
|
||||
Username *string `form:"username"`
|
||||
ActionType *string `form:"action_type"`
|
||||
Status *string `form:"status"`
|
||||
StartTime *time.Time `form:"start_time"`
|
||||
EndTime *time.Time `form:"end_time"`
|
||||
OrderBy string `form:"order_by"`
|
||||
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响应的用户操作日志结构
|
||||
@@ -215,13 +215,13 @@ type ListUserActionLogResponse struct {
|
||||
|
||||
// ListRawMaterialPurchaseRequest 定义了获取原料采购列表的请求参数
|
||||
type ListRawMaterialPurchaseRequest struct {
|
||||
Page int `form:"page,default=1"`
|
||||
PageSize int `form:"pageSize,default=10"`
|
||||
RawMaterialID *uint `form:"raw_material_id"`
|
||||
Supplier *string `form:"supplier"`
|
||||
StartTime *time.Time `form:"start_time"`
|
||||
EndTime *time.Time `form:"end_time"`
|
||||
OrderBy string `form:"order_by"`
|
||||
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响应的简化版原料结构
|
||||
@@ -253,14 +253,14 @@ type ListRawMaterialPurchaseResponse struct {
|
||||
|
||||
// ListRawMaterialStockLogRequest 定义了获取原料库存日志列表的请求参数
|
||||
type ListRawMaterialStockLogRequest struct {
|
||||
Page int `form:"page,default=1"`
|
||||
PageSize int `form:"pageSize,default=10"`
|
||||
RawMaterialID *uint `form:"raw_material_id"`
|
||||
SourceType *string `form:"source_type"`
|
||||
SourceID *uint `form:"source_id"`
|
||||
StartTime *time.Time `form:"start_time"`
|
||||
EndTime *time.Time `form:"end_time"`
|
||||
OrderBy string `form:"order_by"`
|
||||
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响应的原料库存日志结构
|
||||
@@ -284,14 +284,14 @@ type ListRawMaterialStockLogResponse struct {
|
||||
|
||||
// ListFeedUsageRecordRequest 定义了获取饲料使用记录列表的请求参数
|
||||
type ListFeedUsageRecordRequest struct {
|
||||
Page int `form:"page,default=1"`
|
||||
PageSize int `form:"pageSize,default=10"`
|
||||
PenID *uint `form:"pen_id"`
|
||||
FeedFormulaID *uint `form:"feed_formula_id"`
|
||||
OperatorID *uint `form:"operator_id"`
|
||||
StartTime *time.Time `form:"start_time"`
|
||||
EndTime *time.Time `form:"end_time"`
|
||||
OrderBy string `form:"order_by"`
|
||||
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响应的简化版猪栏结构
|
||||
@@ -329,15 +329,15 @@ type ListFeedUsageRecordResponse struct {
|
||||
|
||||
// ListMedicationLogRequest 定义了获取用药记录列表的请求参数
|
||||
type ListMedicationLogRequest struct {
|
||||
Page int `form:"page,default=1"`
|
||||
PageSize int `form:"pageSize,default=10"`
|
||||
PigBatchID *uint `form:"pig_batch_id"`
|
||||
MedicationID *uint `form:"medication_id"`
|
||||
Reason *string `form:"reason"`
|
||||
OperatorID *uint `form:"operator_id"`
|
||||
StartTime *time.Time `form:"start_time"`
|
||||
EndTime *time.Time `form:"end_time"`
|
||||
OrderBy string `form:"order_by"`
|
||||
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响应的简化版药品结构
|
||||
@@ -370,14 +370,14 @@ type ListMedicationLogResponse struct {
|
||||
|
||||
// ListPigBatchLogRequest 定义了获取猪批次日志列表的请求参数
|
||||
type ListPigBatchLogRequest struct {
|
||||
Page int `form:"page,default=1"`
|
||||
PageSize int `form:"pageSize,default=10"`
|
||||
PigBatchID *uint `form:"pig_batch_id"`
|
||||
ChangeType *string `form:"change_type"`
|
||||
OperatorID *uint `form:"operator_id"`
|
||||
StartTime *time.Time `form:"start_time"`
|
||||
EndTime *time.Time `form:"end_time"`
|
||||
OrderBy string `form:"order_by"`
|
||||
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响应的猪批次日志结构
|
||||
@@ -405,12 +405,12 @@ type ListPigBatchLogResponse struct {
|
||||
|
||||
// ListWeighingBatchRequest 定义了获取批次称重记录列表的请求参数
|
||||
type ListWeighingBatchRequest struct {
|
||||
Page int `form:"page,default=1"`
|
||||
PageSize int `form:"pageSize,default=10"`
|
||||
PigBatchID *uint `form:"pig_batch_id"`
|
||||
StartTime *time.Time `form:"start_time"`
|
||||
EndTime *time.Time `form:"end_time"`
|
||||
OrderBy string `form:"order_by"`
|
||||
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响应的批次称重记录结构
|
||||
@@ -433,14 +433,14 @@ type ListWeighingBatchResponse struct {
|
||||
|
||||
// ListWeighingRecordRequest 定义了获取单次称重记录列表的请求参数
|
||||
type ListWeighingRecordRequest struct {
|
||||
Page int `form:"page,default=1"`
|
||||
PageSize int `form:"pageSize,default=10"`
|
||||
WeighingBatchID *uint `form:"weighing_batch_id"`
|
||||
PenID *uint `form:"pen_id"`
|
||||
OperatorID *uint `form:"operator_id"`
|
||||
StartTime *time.Time `form:"start_time"`
|
||||
EndTime *time.Time `form:"end_time"`
|
||||
OrderBy string `form:"order_by"`
|
||||
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响应的单次称重记录结构
|
||||
@@ -466,16 +466,16 @@ type ListWeighingRecordResponse struct {
|
||||
|
||||
// ListPigTransferLogRequest 定义了获取猪只迁移日志列表的请求参数
|
||||
type ListPigTransferLogRequest struct {
|
||||
Page int `form:"page,default=1"`
|
||||
PageSize int `form:"pageSize,default=10"`
|
||||
PigBatchID *uint `form:"pig_batch_id"`
|
||||
PenID *uint `form:"pen_id"`
|
||||
TransferType *string `form:"transfer_type"`
|
||||
OperatorID *uint `form:"operator_id"`
|
||||
CorrelationID *string `form:"correlation_id"`
|
||||
StartTime *time.Time `form:"start_time"`
|
||||
EndTime *time.Time `form:"end_time"`
|
||||
OrderBy string `form:"order_by"`
|
||||
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响应的猪只迁移日志结构
|
||||
@@ -503,16 +503,16 @@ type ListPigTransferLogResponse struct {
|
||||
|
||||
// ListPigSickLogRequest 定义了获取病猪日志列表的请求参数
|
||||
type ListPigSickLogRequest struct {
|
||||
Page int `form:"page,default=1"`
|
||||
PageSize int `form:"pageSize,default=10"`
|
||||
PigBatchID *uint `form:"pig_batch_id"`
|
||||
PenID *uint `form:"pen_id"`
|
||||
Reason *string `form:"reason"`
|
||||
TreatmentLocation *string `form:"treatment_location"`
|
||||
OperatorID *uint `form:"operator_id"`
|
||||
StartTime *time.Time `form:"start_time"`
|
||||
EndTime *time.Time `form:"end_time"`
|
||||
OrderBy string `form:"order_by"`
|
||||
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响应的病猪日志结构
|
||||
@@ -542,14 +542,14 @@ type ListPigSickLogResponse struct {
|
||||
|
||||
// ListPigPurchaseRequest 定义了获取猪只采购记录列表的请求参数
|
||||
type ListPigPurchaseRequest struct {
|
||||
Page int `form:"page,default=1"`
|
||||
PageSize int `form:"pageSize,default=10"`
|
||||
PigBatchID *uint `form:"pig_batch_id"`
|
||||
Supplier *string `form:"supplier"`
|
||||
OperatorID *uint `form:"operator_id"`
|
||||
StartTime *time.Time `form:"start_time"`
|
||||
EndTime *time.Time `form:"end_time"`
|
||||
OrderBy string `form:"order_by"`
|
||||
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响应的猪只采购记录结构
|
||||
@@ -577,14 +577,14 @@ type ListPigPurchaseResponse struct {
|
||||
|
||||
// ListPigSaleRequest 定义了获取猪只销售记录列表的请求参数
|
||||
type ListPigSaleRequest struct {
|
||||
Page int `form:"page,default=1"`
|
||||
PageSize int `form:"pageSize,default=10"`
|
||||
PigBatchID *uint `form:"pig_batch_id"`
|
||||
Buyer *string `form:"buyer"`
|
||||
OperatorID *uint `form:"operator_id"`
|
||||
StartTime *time.Time `form:"start_time"`
|
||||
EndTime *time.Time `form:"end_time"`
|
||||
OrderBy string `form:"order_by"`
|
||||
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响应的猪只销售记录结构
|
||||
|
||||
@@ -11,20 +11,20 @@ import (
|
||||
// SendTestNotificationRequest 定义了发送测试通知请求的 JSON 结构
|
||||
type SendTestNotificationRequest struct {
|
||||
// Type 指定要测试的通知渠道
|
||||
Type notify.NotifierType `json:"type" binding:"required"`
|
||||
Type notify.NotifierType `json:"type" validate:"required"`
|
||||
}
|
||||
|
||||
// ListNotificationRequest 定义了获取通知列表的请求参数
|
||||
type ListNotificationRequest struct {
|
||||
Page int `form:"page,default=1"`
|
||||
PageSize int `form:"pageSize,default=10"`
|
||||
UserID *uint `form:"user_id"`
|
||||
NotifierType *notify.NotifierType `form:"notifier_type"`
|
||||
Status *models.NotificationStatus `form:"status"`
|
||||
Level *zapcore.Level `form:"level"`
|
||||
StartTime *time.Time `form:"start_time"`
|
||||
EndTime *time.Time `form:"end_time"`
|
||||
OrderBy string `form:"order_by"`
|
||||
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"`
|
||||
}
|
||||
|
||||
// NotificationDTO 是用于API响应的通知结构
|
||||
|
||||
@@ -8,11 +8,11 @@ import (
|
||||
|
||||
// PigBatchCreateDTO 定义了创建猪批次的请求结构
|
||||
type PigBatchCreateDTO struct {
|
||||
BatchNumber string `json:"batch_number" binding:"required"` // 批次编号,必填
|
||||
OriginType models.PigBatchOriginType `json:"origin_type" binding:"required"` // 批次来源,必填
|
||||
StartDate time.Time `json:"start_date" binding:"required"` // 批次开始日期,必填
|
||||
InitialCount int `json:"initial_count" binding:"required,min=1"` // 初始数量,必填,最小为1
|
||||
Status models.PigBatchStatus `json:"status" binding:"required"` // 批次状态,必填
|
||||
BatchNumber string `json:"batch_number" validate:"required"` // 批次编号,必填
|
||||
OriginType models.PigBatchOriginType `json:"origin_type" validate:"required"` // 批次来源,必填
|
||||
StartDate time.Time `json:"start_date" validate:"required"` // 批次开始日期,必填
|
||||
InitialCount int `json:"initial_count" validate:"required,min=1"` // 初始数量,必填,最小为1
|
||||
Status models.PigBatchStatus `json:"status" validate:"required"` // 批次状态,必填
|
||||
}
|
||||
|
||||
// PigBatchUpdateDTO 定义了更新猪批次的请求结构
|
||||
@@ -27,7 +27,7 @@ type PigBatchUpdateDTO struct {
|
||||
|
||||
// PigBatchQueryDTO 定义了查询猪批次的请求结构
|
||||
type PigBatchQueryDTO struct {
|
||||
IsActive *bool `json:"is_active" form:"is_active"` // 是否活跃,可选,用于URL查询参数
|
||||
IsActive *bool `json:"is_active" query:"is_active"` // 是否活跃,可选,用于URL查询参数
|
||||
}
|
||||
|
||||
// PigBatchResponseDTO 定义了猪批次信息的响应结构
|
||||
@@ -48,115 +48,115 @@ type PigBatchResponseDTO struct {
|
||||
|
||||
// AssignEmptyPensToBatchRequest 用于为猪批次分配空栏的请求体
|
||||
type AssignEmptyPensToBatchRequest struct {
|
||||
PenIDs []uint `json:"penIDs" binding:"required,min=1" example:"[1,2,3]"` // 待分配的猪栏ID列表
|
||||
PenIDs []uint `json:"penIDs" validate:"required,min=1,dive" example:"[1,2,3]"` // 待分配的猪栏ID列表
|
||||
}
|
||||
|
||||
// ReclassifyPenToNewBatchRequest 用于将猪栏划拨到新批次的请求体
|
||||
type ReclassifyPenToNewBatchRequest struct {
|
||||
ToBatchID uint `json:"toBatchID" binding:"required"` // 目标猪批次ID
|
||||
PenID uint `json:"penID" binding:"required"` // 待划拨的猪栏ID
|
||||
Remarks string `json:"remarks"` // 备注
|
||||
ToBatchID uint `json:"toBatchID" validate:"required"` // 目标猪批次ID
|
||||
PenID uint `json:"penID" validate:"required"` // 待划拨的猪栏ID
|
||||
Remarks string `json:"remarks"` // 备注
|
||||
}
|
||||
|
||||
// RemoveEmptyPenFromBatchRequest 用于从猪批次移除空栏的请求体
|
||||
type RemoveEmptyPenFromBatchRequest struct {
|
||||
PenID uint `json:"penID" binding:"required"` // 待移除的猪栏ID
|
||||
PenID uint `json:"penID" validate:"required"` // 待移除的猪栏ID
|
||||
}
|
||||
|
||||
// MovePigsIntoPenRequest 用于将猪只从“虚拟库存”移入指定猪栏的请求体
|
||||
type MovePigsIntoPenRequest struct {
|
||||
ToPenID uint `json:"toPenID" binding:"required"` // 目标猪栏ID
|
||||
Quantity int `json:"quantity" binding:"required,min=1"` // 移入猪只数量
|
||||
Remarks string `json:"remarks"` // 备注
|
||||
ToPenID uint `json:"toPenID" validate:"required"` // 目标猪栏ID
|
||||
Quantity int `json:"quantity" validate:"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"` // 备注
|
||||
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"` // 备注
|
||||
}
|
||||
|
||||
// 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"` // 备注
|
||||
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"` // 备注
|
||||
}
|
||||
|
||||
// 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"` // 备注
|
||||
DestBatchID uint `json:"destBatchID" validate:"required"` // 目标猪批次ID
|
||||
FromPenID uint `json:"fromPenID" validate:"required"` // 源猪栏ID
|
||||
ToPenID uint `json:"toPenID" validate:"required"` // 目标猪栏ID
|
||||
Quantity uint `json:"quantity" validate:"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"` // 备注
|
||||
FromPenID uint `json:"fromPenID" validate:"required"` // 源猪栏ID
|
||||
ToPenID uint `json:"toPenID" validate:"required"` // 目标猪栏ID
|
||||
Quantity uint `json:"quantity" validate:"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"` // 备注
|
||||
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"` // 备注
|
||||
}
|
||||
|
||||
// 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"` // 备注
|
||||
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"` // 备注
|
||||
}
|
||||
|
||||
// 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"` // 备注
|
||||
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"` // 备注
|
||||
}
|
||||
|
||||
// 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"` // 备注
|
||||
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"` // 备注
|
||||
}
|
||||
|
||||
// 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"` // 备注
|
||||
PenID uint `json:"penID" validate:"required"` // 猪栏ID
|
||||
Quantity int `json:"quantity" validate:"required,min=1"` // 死亡猪数量
|
||||
HappenedAt time.Time `json:"happenedAt" validate:"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"` // 备注
|
||||
PenID uint `json:"penID" validate:"required"` // 猪栏ID
|
||||
Quantity int `json:"quantity" validate:"required,min=1"` // 淘汰猪数量
|
||||
HappenedAt time.Time `json:"happenedAt" validate:"required"` // 发生时间
|
||||
Remarks string `json:"remarks"` // 备注
|
||||
}
|
||||
|
||||
@@ -22,32 +22,32 @@ type PenResponse struct {
|
||||
|
||||
// CreatePigHouseRequest 定义了创建猪舍的请求结构
|
||||
type CreatePigHouseRequest struct {
|
||||
Name string `json:"name" binding:"required"`
|
||||
Name string `json:"name" validate:"required"`
|
||||
Description string `json:"description"`
|
||||
}
|
||||
|
||||
// UpdatePigHouseRequest 定义了更新猪舍的请求结构
|
||||
type UpdatePigHouseRequest struct {
|
||||
Name string `json:"name" binding:"required"`
|
||||
Name string `json:"name" validate:"required"`
|
||||
Description string `json:"description"`
|
||||
}
|
||||
|
||||
// CreatePenRequest 定义了创建猪栏的请求结构
|
||||
type CreatePenRequest struct {
|
||||
PenNumber string `json:"pen_number" binding:"required"`
|
||||
HouseID uint `json:"house_id" binding:"required"`
|
||||
Capacity int `json:"capacity" binding:"required"`
|
||||
PenNumber string `json:"pen_number" validate:"required"`
|
||||
HouseID uint `json:"house_id" validate:"required"`
|
||||
Capacity int `json:"capacity" validate:"required"`
|
||||
}
|
||||
|
||||
// UpdatePenRequest 定义了更新猪栏的请求结构
|
||||
type UpdatePenRequest struct {
|
||||
PenNumber string `json:"pen_number" binding:"required"`
|
||||
HouseID uint `json:"house_id" binding:"required"`
|
||||
Capacity int `json:"capacity" binding:"required"`
|
||||
Status models.PenStatus `json:"status" binding:"required,oneof=空闲 使用中 病猪栏 康复栏 清洗消毒 维修中"` // 添加oneof校验
|
||||
PenNumber string `json:"pen_number" validate:"required"`
|
||||
HouseID uint `json:"house_id" validate:"required"`
|
||||
Capacity int `json:"capacity" validate:"required"`
|
||||
Status models.PenStatus `json:"status" validate:"required,oneof=空闲 使用中 病猪栏 康复栏 清洗消毒 维修中"` // 添加oneof校验
|
||||
}
|
||||
|
||||
// UpdatePenStatusRequest 定义了更新猪栏状态的请求结构
|
||||
type UpdatePenStatusRequest struct {
|
||||
Status models.PenStatus `json:"status" binding:"required,oneof=空闲 使用中 病猪栏 康复栏 清洗消毒 维修中" example:"病猪栏"`
|
||||
Status models.PenStatus `json:"status" validate:"required,oneof=空闲 使用中 病猪栏 康复栏 清洗消毒 维修中" example:"病猪栏"`
|
||||
}
|
||||
|
||||
@@ -7,20 +7,20 @@ import (
|
||||
|
||||
// ListPlansQuery 定义了获取计划列表时的查询参数
|
||||
type ListPlansQuery struct {
|
||||
PlanType repository.PlanTypeFilter `form:"planType,default=自定义任务"` // 计划类型
|
||||
Page int `form:"page,default=1"` // 页码
|
||||
PageSize int `form:"pageSize,default=10"` // 每页大小
|
||||
PlanType repository.PlanTypeFilter `query:"planType"` // 计划类型
|
||||
Page int `query:"page"` // 页码
|
||||
PageSize int `query:"pageSize"` // 每页大小
|
||||
}
|
||||
|
||||
// CreatePlanRequest 定义创建计划请求的结构体
|
||||
type CreatePlanRequest struct {
|
||||
Name string `json:"name" binding:"required" example:"猪舍温度控制计划"`
|
||||
Name string `json:"name" validate:"required" example:"猪舍温度控制计划"`
|
||||
Description string `json:"description" example:"根据温度自动调节风扇和加热器"`
|
||||
ExecutionType models.PlanExecutionType `json:"execution_type" binding:"required" example:"自动"`
|
||||
ExecuteNum uint `json:"execute_num,omitempty" example:"10"`
|
||||
CronExpression string `json:"cron_expression" example:"0 0 6 * * *"`
|
||||
SubPlanIDs []uint `json:"sub_plan_ids,omitempty"`
|
||||
Tasks []TaskRequest `json:"tasks,omitempty"`
|
||||
ExecutionType models.PlanExecutionType `json:"execution_type" validate:"required" example:"自动"`
|
||||
ExecuteNum uint `json:"execute_num,omitempty" validate:"omitempty,min=0" example:"10"`
|
||||
CronExpression string `json:"cron_expression" validate:"omitempty,cron" example:"0 0 6 * * *"`
|
||||
SubPlanIDs []uint `json:"sub_plan_ids,omitempty" validate:"omitempty,dive"`
|
||||
Tasks []TaskRequest `json:"tasks,omitempty" validate:"omitempty,dive"`
|
||||
}
|
||||
|
||||
// PlanResponse 定义计划详情响应的结构体
|
||||
@@ -49,11 +49,11 @@ type ListPlansResponse struct {
|
||||
type UpdatePlanRequest struct {
|
||||
Name string `json:"name" example:"猪舍温度控制计划V2"`
|
||||
Description string `json:"description" example:"更新后的描述"`
|
||||
ExecutionType models.PlanExecutionType `json:"execution_type" binding:"required" example:"自动"`
|
||||
ExecuteNum uint `json:"execute_num,omitempty" example:"10"`
|
||||
CronExpression string `json:"cron_expression" example:"0 0 6 * * *"`
|
||||
SubPlanIDs []uint `json:"sub_plan_ids,omitempty"`
|
||||
Tasks []TaskRequest `json:"tasks,omitempty"`
|
||||
ExecutionType models.PlanExecutionType `json:"execution_type" validate:"required" example:"自动"`
|
||||
ExecuteNum uint `json:"execute_num,omitempty" validate:"omitempty,min=0" example:"10"`
|
||||
CronExpression string `json:"cron_expression" validate:"omitempty,cron" example:"0 0 6 * * *"`
|
||||
SubPlanIDs []uint `json:"sub_plan_ids,omitempty" validate:"omitempty,dive"`
|
||||
Tasks []TaskRequest `json:"tasks,omitempty" validate:"omitempty,dive"`
|
||||
}
|
||||
|
||||
// SubPlanResponse 定义子计划响应结构体
|
||||
|
||||
@@ -2,15 +2,15 @@ package dto
|
||||
|
||||
// CreateUserRequest 定义创建用户请求的结构体
|
||||
type CreateUserRequest struct {
|
||||
Username string `json:"username" binding:"required" example:"newuser"`
|
||||
Password string `json:"password" binding:"required" example:"password123"`
|
||||
Username string `json:"username" validate:"required" example:"newuser"`
|
||||
Password string `json:"password" validate:"required" example:"password123"`
|
||||
}
|
||||
|
||||
// LoginRequest 定义登录请求的结构体
|
||||
type LoginRequest struct {
|
||||
// Identifier 可以是用户名、邮箱、手机号、微信号或飞书账号
|
||||
Identifier string `json:"identifier" binding:"required" example:"testuser"`
|
||||
Password string `json:"password" binding:"required" example:"password123"`
|
||||
Identifier string `json:"identifier" validate:"required" example:"testuser"`
|
||||
Password string `json:"password" validate:"required" example:"password123"`
|
||||
}
|
||||
|
||||
// CreateUserResponse 定义创建用户成功响应的结构体
|
||||
|
||||
Reference in New Issue
Block a user