package activity

import (
	"context"
	"errors"

	"gorm.io/gorm"

	"bindbox-game/internal/repository/mysql/model"
)

func (s *service) GetActivity(ctx context.Context, id int64) (*model.Activities, error) {
	item, err := s.readDB.Activities.WithContext(ctx).Where(s.readDB.Activities.ID.Eq(id)).First()
	if err != nil {
		if errors.Is(err, gorm.ErrRecordNotFound) {
			return nil, err
		}
		return nil, err
	}
	return item, nil
}
