fix:修复命名错误

This commit is contained in:
Amnesia
2026-03-14 19:56:31 +08:00
parent 9eed15efd5
commit 05c846c295
4 changed files with 9 additions and 9 deletions

View File

@@ -23,15 +23,15 @@ func NewRabbitMQ(cfg *config.RabbitMQConfig) (*RabbitMQ, error) {
return nil, errors.New("rabbitmq config is nil")
}
url := "amqp://" + cfg.Username + ":" + cfg.Password + "@" + cfg.Host + ":" + strconv.Itoa(cfg.Port) + "/"
Conn, err := amqp.Dial(url)
conn, err := amqp.Dial(url)
if err != nil {
return nil, err
}
Ch, err := Conn.Channel()
ch, err := conn.Channel()
if err != nil {
return nil, err
}
return &RabbitMQ{Conn: Conn, Ch: Ch}, nil
return &RabbitMQ{Conn: conn, Ch: ch}, nil
}
func (r *RabbitMQ) Close() error {

View File

@@ -19,7 +19,7 @@ const (
type TimelineEvent struct {
EventID string `json:"event_id"`
ViedoID uint `json:"video_id"`
VideoID uint `json:"video_id"`
CreateTime int64 `json:"create_time"`
OccurredAt time.Time `json:"occurred_at"`
}
@@ -36,7 +36,7 @@ func NewTimelineMQ(base *RabbitMQ) (*TimelineMQ, error) {
func (t *TimelineMQ) PublishVideo(ctx context.Context, videoID uint, createTime time.Time) error {
if t == nil || t.RabbitMQ == nil {
return errors.New("timelike mq is not initialized")
return errors.New("timeline mq is not initialized")
}
if videoID == 0 {
return errors.New("videoID are required")
@@ -47,7 +47,7 @@ func (t *TimelineMQ) PublishVideo(ctx context.Context, videoID uint, createTime
}
timeline := TimelineEvent{
EventID: id,
ViedoID: videoID,
VideoID: videoID,
CreateTime: createTime.UnixMilli(),
OccurredAt: time.Now(),
}