uint/uint64全部改为uint32
This commit is contained in:
@@ -12,10 +12,10 @@ import (
|
||||
|
||||
// PigTransferLogListOptions 定义了查询猪只迁移日志时的可选参数
|
||||
type PigTransferLogListOptions struct {
|
||||
PigBatchID *uint
|
||||
PenID *uint
|
||||
PigBatchID *uint32
|
||||
PenID *uint32
|
||||
TransferType *models.PigTransferType // 迁移类型
|
||||
OperatorID *uint
|
||||
OperatorID *uint32
|
||||
CorrelationID *string
|
||||
StartTime *time.Time // 基于 transfer_time 字段
|
||||
EndTime *time.Time // 基于 transfer_time 字段
|
||||
@@ -28,7 +28,7 @@ type PigTransferLogRepository interface {
|
||||
CreatePigTransferLog(ctx context.Context, tx *gorm.DB, log *models.PigTransferLog) error
|
||||
|
||||
// GetLogsForPenSince 获取指定猪栏自特定时间点以来的所有迁移日志,按时间倒序排列。
|
||||
GetLogsForPenSince(ctx context.Context, tx *gorm.DB, penID uint, since time.Time) ([]*models.PigTransferLog, error)
|
||||
GetLogsForPenSince(ctx context.Context, tx *gorm.DB, penID uint32, since time.Time) ([]*models.PigTransferLog, error)
|
||||
|
||||
// ListPigTransferLogs 支持分页和过滤的猪只迁移日志列表查询
|
||||
ListPigTransferLogs(ctx context.Context, opts PigTransferLogListOptions, page, pageSize int) ([]models.PigTransferLog, int64, error)
|
||||
@@ -52,7 +52,7 @@ func (r *gormPigTransferLogRepository) CreatePigTransferLog(ctx context.Context,
|
||||
}
|
||||
|
||||
// GetLogsForPenSince 实现了获取猪栏自特定时间点以来所有迁移日志的逻辑。
|
||||
func (r *gormPigTransferLogRepository) GetLogsForPenSince(ctx context.Context, tx *gorm.DB, penID uint, since time.Time) ([]*models.PigTransferLog, error) {
|
||||
func (r *gormPigTransferLogRepository) GetLogsForPenSince(ctx context.Context, tx *gorm.DB, penID uint32, since time.Time) ([]*models.PigTransferLog, error) {
|
||||
repoCtx := logs.AddFuncName(ctx, r.ctx, "GetLogsForPenSince")
|
||||
var logs []*models.PigTransferLog
|
||||
err := tx.WithContext(repoCtx).Where("pen_id = ? AND transfer_time >= ?", penID, since).Order("transfer_time DESC").Find(&logs).Error
|
||||
|
||||
Reference in New Issue
Block a user