Skip to content

Commit

Permalink
Removendo comentários
Browse files Browse the repository at this point in the history
  • Loading branch information
mffonseca committed Jul 24, 2024
1 parent ae52be1 commit 5b6617f
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion backend/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func GetEventGoogleMeet() string {
return meetEvent
}

func SetupOAuthConfig() *oauth2.Config { // Função que lê as variáveis de ambiente e retorna um ponteiro para uma configuração OAuth2
func SetupOAuthConfig() *oauth2.Config {

err := godotenv.Load()

Expand Down
2 changes: 1 addition & 1 deletion backend/internal/services/calendar_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"google.golang.org/api/calendar/v3"
)

type CalendarService interface { // Interface que define os métodos que devem ser implementados por um serviço de calendário
type CalendarService interface {
InitializeService(ctx context.Context, config *oauth2.Config, token *oauth2.Token) (CalendarAPI, error)
AddGuestToEvent(ctx context.Context, service CalendarAPI, hangoutLink, email string) (*calendar.Event, error)
FindEventByHangoutLink(ctx context.Context, service CalendarAPI, hangoutLink string) (*calendar.Event, error)
Expand Down
2 changes: 1 addition & 1 deletion backend/internal/services/email_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ import (
"google.golang.org/api/calendar/v3"
)

type EmailService interface { // Interface que define os métodos que devem ser implementados por um serviço de e-mail
type EmailService interface {
SendMentorshipInvitation(recipient string, eventDetails *calendar.Event, token *oauth2.Token) error
}
4 changes: 2 additions & 2 deletions backend/internal/services/gmail_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ type GmailService struct {
token *oauth2.Token
}

func NewGmailService(config *oauth2.Config, token *oauth2.Token) EmailService { // Construtor responsável por encapsular a criação de uma instância de GmailService e retornar um ponteiro para ela
func NewGmailService(config *oauth2.Config, token *oauth2.Token) EmailService {
return &GmailService{
config: config,
token: token,
}
}

func (gs *GmailService) SendMentorshipInvitation(recipient string, eventDetails *calendar.Event, token *oauth2.Token) error { // Método que envia um convite de mentoria por e-mail
func (gs *GmailService) SendMentorshipInvitation(recipient string, eventDetails *calendar.Event, token *oauth2.Token) error {

ctx := context.Background()
client := gs.config.Client(ctx, token)
Expand Down
10 changes: 5 additions & 5 deletions backend/internal/services/google_calendar_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ import (
"google.golang.org/api/option"
)

type GoogleCalendarService struct{} // Estrutura que implementa a interface CalendarService
type GoogleCalendarService struct{}

func NewGoogleCalendarService() CalendarService { // Construtor responsável por encapsular a criação de uma instância de GoogleCalendarService e retornar um ponteiro para ela
func NewGoogleCalendarService() CalendarService {
return &GoogleCalendarService{}
}

func (gcs *GoogleCalendarService) InitializeService(ctx context.Context, config *oauth2.Config, token *oauth2.Token) (CalendarAPI, error) { // Método que inicializa o serviço de calendário
func (gcs *GoogleCalendarService) InitializeService(ctx context.Context, config *oauth2.Config, token *oauth2.Token) (CalendarAPI, error) {

client, err := auth.CreateOAuthClient(ctx, config, token)

Expand All @@ -34,7 +34,7 @@ func (gcs *GoogleCalendarService) InitializeService(ctx context.Context, config
return &RealCalendarService{GoogleCalendar: service}, nil
}

func (gcs *GoogleCalendarService) FindEventByHangoutLink(ctx context.Context, api CalendarAPI, hangoutLink string) (*calendar.Event, error) { // Método que recebe um link do Google Meet e retorna o evento correspondente
func (gcs *GoogleCalendarService) FindEventByHangoutLink(ctx context.Context, api CalendarAPI, hangoutLink string) (*calendar.Event, error) {

events, err := api.EventsList("primary").Do()

Expand All @@ -51,7 +51,7 @@ func (gcs *GoogleCalendarService) FindEventByHangoutLink(ctx context.Context, ap
return nil, fmt.Errorf("event with HangoutLink %s not found", hangoutLink)
}

func (gcs *GoogleCalendarService) AddGuestToEvent(ctx context.Context, api CalendarAPI, hangoutLink, email string) (*calendar.Event, error) { // Método que adiciona um convidado a um evento
func (gcs *GoogleCalendarService) AddGuestToEvent(ctx context.Context, api CalendarAPI, hangoutLink, email string) (*calendar.Event, error) {

eventDetails, err := gcs.FindEventByHangoutLink(ctx, api, hangoutLink)

Expand Down

0 comments on commit 5b6617f

Please sign in to comment.