Documentation ¶
Index ¶
- type IQuestionService
- type IReportService
- type ISurveyService
- type QuestionService
- func (q *QuestionService) DeleteQuestion(c context.Context, id uint) error
- func (q *QuestionService) GetQuestion(c context.Context, id uint) (response *dto.Question, err error)
- func (q *QuestionService) GetQuestions(c context.Context, req dto.GetQuestionsRequest) (response []*dto.Question, err error)
- func (q *QuestionService) UpdateQuestion(c context.Context, id uint, req dto.QuestionUpdateRequest) (question *dto.Question, err error)
- type ReportService
- func (s *ReportService) GetAccessibleSurveys(ctx context.Context, userID uint, permission string) ([]models.Survey, error)
- func (s *ReportService) GetAllSurveys(ctx context.Context) ([]models.Survey, error)
- func (s *ReportService) GetAverageResponseTime(ctx context.Context, surveyId uint) (float64, error)
- func (s *ReportService) GetChoicesByPercentage(ctx context.Context, surveyId uint) ([]dto.QuestionReport, error)
- func (s *ReportService) GetCorrectAnswerPercentage(ctx context.Context, surveyId uint) ([]dto.CorrectAnswerPercentageToShow, error)
- func (s *ReportService) GetMultipleParticipationCount(ctx context.Context, surveyId uint) ([]dto.ParticipationReport, error)
- func (s *ReportService) GetResponseDispersionByHour(ctx context.Context, surveyId uint) ([]dto.HourDispersionDTO, error)
- func (s *ReportService) GetSurveyReport(ctx context.Context, surveyId uint) (*dto.ReportResponse, error)
- func (s *ReportService) GetTotalParticipationPercentage(ctx context.Context, surveyId uint) (uint, error)
- func (s *ReportService) SuddenlyFinishedParticipationPercentage(ctx context.Context, surveyId uint) (float64, error)
- type SurveyService
- func (s *SurveyService) CanUserParticipateToSurvey(c context.Context, userId uint, surveyId uint) (bool, error)
- func (s *SurveyService) CanUserVoteOnSurvey(c context.Context, userId uint, surveyId uint) (bool, error)
- func (s *SurveyService) CommitParticipation(c context.Context, participationId uint) error
- func (s *SurveyService) CommitVote(c context.Context, vote models.Vote) error
- func (s *SurveyService) CreateOption(c context.Context, userId uint, surveyId uint, ...) (response *dto.SurveyOptionResponse, err error)
- func (s *SurveyService) CreateSurvey(c context.Context, req dto.SurveyCreateRequest) (*dto.SurveyResponse, error)
- func (s *SurveyService) DeleteOption(c context.Context, id uint) error
- func (s *SurveyService) DeleteSurvey(c context.Context, id uint) error
- func (s *SurveyService) DeleteVote(c context.Context, id uint) error
- func (s *SurveyService) EndParticipation(c context.Context, participationId uint) error
- func (s *SurveyService) GetOptions(c context.Context, req dto.SurveyOptionsGetRequest) (response []*dto.SurveyOptionResponse, err error)
- func (s *SurveyService) GetSurvey(c context.Context, id uint) (*dto.SurveyResponse, error)
- func (s *SurveyService) GetSurveyQuestionsInOrder(c context.Context, surveyId uint) (questionsAnswerMap dto.QuestionsAnswerMap, err error)
- func (s *SurveyService) GetSurveyVotes(c context.Context, surveyId uint) (response []dto.GetVoteResponse, err error)
- func (s *SurveyService) GetSurveys(c context.Context, req dto.SurveysGetRequest) (response []*dto.SurveyResponse, err error)
- func (s *SurveyService) GetVisibleVoteUsers(surveyID, viewerID uint) ([]map[string]interface{}, error)
- func (s *SurveyService) GetVote(c context.Context, id uint) (*dto.GetVoteResponse, error)
- func (s *SurveyService) GetVotes(surveyID, viewerID, respondentID uint) ([]map[string]interface{}, error)
- func (s *SurveyService) Participate(c context.Context, userId uint, surveyId uint) (*dto.UserSurveyParticipationResponse, error)
- func (s *SurveyService) UpdateOption(c context.Context, id uint, req dto.SurveyOptionCreateRequest) (response *dto.SurveyOptionResponse, err error)
- func (s *SurveyService) UpdateSurvey(c context.Context, id uint, req dto.SurveyUpdateRequest) (response *dto.SurveyResponse, err error)
- func (s *SurveyService) UploadMedia(fileHeader *multipart.FileHeader) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IQuestionService ¶
type IQuestionService interface { GetQuestion(c context.Context, id uint) (response *dto.Question, err error) GetQuestions(c context.Context, req dto.GetQuestionsRequest) (response []*dto.Question, err error) UpdateQuestion(c context.Context, id uint, req dto.QuestionUpdateRequest) (question *dto.Question, err error) DeleteQuestion(c context.Context, id uint) error }
type IReportService ¶
type IReportService interface { GetTotalParticipationPercentage(ctx context.Context, surveyId uint) (uint, error) GetCorrectAnswerPercentage(ctx context.Context, surveyId uint) ([]dto.CorrectAnswerPercentageToShow, error) SuddenlyFinishedParticipationPercentage(ctx context.Context, surveyId uint) (float64, error) GetChoicesByPercentage(ctx context.Context, surveyId uint) ([]dto.QuestionReport, error) GetMultipleParticipationCount(ctx context.Context, surveyId uint) ([]dto.ParticipationReport, error) GetAverageResponseTime(ctx context.Context, surveyId uint) (float64, error) GetResponseDispersionByHour(ctx context.Context, surveyId uint) ([]dto.HourDispersionDTO, error) GetSurveyReport(ctx context.Context, surveyId uint) (*dto.ReportResponse, error) GetAllSurveys(ctx context.Context) ([]models.Survey, error) GetAccessibleSurveys(ctx context.Context, userID uint, permission string) ([]models.Survey, error) }
type ISurveyService ¶
type ISurveyService interface { CreateSurvey(c context.Context, req dto.SurveyCreateRequest) (*dto.SurveyResponse, error) UpdateSurvey(c context.Context, id uint, req dto.SurveyUpdateRequest) (*dto.SurveyResponse, error) GetSurvey(c context.Context, id uint) (*dto.SurveyResponse, error) GetVote(c context.Context, id uint) (*dto.GetVoteResponse, error) GetSurveys(c context.Context, req dto.SurveysGetRequest) ([]*dto.SurveyResponse, error) DeleteSurvey(c context.Context, id uint) error CanUserParticipateToSurvey(c context.Context, userId uint, surveyId uint) (bool, error) Participate(c context.Context, userId uint, surveyId uint) (*dto.UserSurveyParticipationResponse, error) EndParticipation(c context.Context, participationId uint) error CommitParticipation(c context.Context, participationId uint) error CanUserVoteOnSurvey(c context.Context, userId uint, surveyId uint) (bool, error) CommitVote(c context.Context, vote models.Vote) error DeleteVote(c context.Context, id uint) error GetSurveyQuestionsInOrder(c context.Context, surveyId uint) (questionsAnswerMap dto.QuestionsAnswerMap, err error) GetVotes(surveyID, viewerID, respondentID uint) ([]map[string]interface{}, error) GetVisibleVoteUsers(surveyID, viewerID uint) ([]map[string]interface{}, error) GetSurveyVotes(c context.Context, surveyId uint) ([]dto.GetVoteResponse, error) CreateOption(c context.Context, userId uint, surveyId uint, req dto.SurveyOptionCreateRequest) (*dto.SurveyOptionResponse, error) UpdateOption(c context.Context, id uint, req dto.SurveyOptionCreateRequest) (*dto.SurveyOptionResponse, error) DeleteOption(c context.Context, id uint) error GetOptions(c context.Context, req dto.SurveyOptionsGetRequest) (response []*dto.SurveyOptionResponse, err error) UploadMedia(fileHeader *multipart.FileHeader) (string, error) }
type QuestionService ¶
type QuestionService struct {
// contains filtered or unexported fields
}
func NewQuestionService ¶
func NewQuestionService(conf *config.Config, repo repository.ISurveyRepository, logger logging.Logger) *QuestionService
func (*QuestionService) DeleteQuestion ¶
func (q *QuestionService) DeleteQuestion(c context.Context, id uint) error
func (*QuestionService) GetQuestion ¶
func (*QuestionService) GetQuestions ¶
func (q *QuestionService) GetQuestions(c context.Context, req dto.GetQuestionsRequest) (response []*dto.Question, err error)
func (*QuestionService) UpdateQuestion ¶
func (q *QuestionService) UpdateQuestion(c context.Context, id uint, req dto.QuestionUpdateRequest) (question *dto.Question, err error)
type ReportService ¶
type ReportService struct {
// contains filtered or unexported fields
}
func NewReportService ¶
func NewReportService(conf *config.Config, repo repository.IReportRepository, logger logging.Logger) *ReportService
func (*ReportService) GetAccessibleSurveys ¶
func (*ReportService) GetAllSurveys ¶
func (*ReportService) GetAverageResponseTime ¶
func (*ReportService) GetChoicesByPercentage ¶
func (s *ReportService) GetChoicesByPercentage(ctx context.Context, surveyId uint) ([]dto.QuestionReport, error)
func (*ReportService) GetCorrectAnswerPercentage ¶
func (s *ReportService) GetCorrectAnswerPercentage(ctx context.Context, surveyId uint) ([]dto.CorrectAnswerPercentageToShow, error)
func (*ReportService) GetMultipleParticipationCount ¶
func (s *ReportService) GetMultipleParticipationCount(ctx context.Context, surveyId uint) ([]dto.ParticipationReport, error)
func (*ReportService) GetResponseDispersionByHour ¶
func (s *ReportService) GetResponseDispersionByHour(ctx context.Context, surveyId uint) ([]dto.HourDispersionDTO, error)
func (*ReportService) GetSurveyReport ¶
func (s *ReportService) GetSurveyReport(ctx context.Context, surveyId uint) (*dto.ReportResponse, error)
func (*ReportService) GetTotalParticipationPercentage ¶
func (*ReportService) SuddenlyFinishedParticipationPercentage ¶
type SurveyService ¶
type SurveyService struct {
// contains filtered or unexported fields
}
func NewSurveyService ¶
func NewSurveyService(conf *config.Config, repo repository.ISurveyRepository, logger logging.Logger, notificationService notification.INotificationService) *SurveyService
func (*SurveyService) CanUserParticipateToSurvey ¶
func (*SurveyService) CanUserVoteOnSurvey ¶
func (*SurveyService) CommitParticipation ¶
func (s *SurveyService) CommitParticipation(c context.Context, participationId uint) error
func (*SurveyService) CommitVote ¶
func (*SurveyService) CreateOption ¶
func (s *SurveyService) CreateOption(c context.Context, userId uint, surveyId uint, req dto.SurveyOptionCreateRequest) (response *dto.SurveyOptionResponse, err error)
func (*SurveyService) CreateSurvey ¶
func (s *SurveyService) CreateSurvey(c context.Context, req dto.SurveyCreateRequest) (*dto.SurveyResponse, error)
func (*SurveyService) DeleteOption ¶
func (s *SurveyService) DeleteOption(c context.Context, id uint) error
func (*SurveyService) DeleteSurvey ¶
func (s *SurveyService) DeleteSurvey(c context.Context, id uint) error
func (*SurveyService) DeleteVote ¶
func (s *SurveyService) DeleteVote(c context.Context, id uint) error
func (*SurveyService) EndParticipation ¶
func (s *SurveyService) EndParticipation(c context.Context, participationId uint) error
func (*SurveyService) GetOptions ¶
func (s *SurveyService) GetOptions(c context.Context, req dto.SurveyOptionsGetRequest) (response []*dto.SurveyOptionResponse, err error)
func (*SurveyService) GetSurvey ¶
func (s *SurveyService) GetSurvey(c context.Context, id uint) (*dto.SurveyResponse, error)
func (*SurveyService) GetSurveyQuestionsInOrder ¶
func (s *SurveyService) GetSurveyQuestionsInOrder(c context.Context, surveyId uint) (questionsAnswerMap dto.QuestionsAnswerMap, err error)
func (*SurveyService) GetSurveyVotes ¶
func (s *SurveyService) GetSurveyVotes(c context.Context, surveyId uint) (response []dto.GetVoteResponse, err error)
func (*SurveyService) GetSurveys ¶
func (s *SurveyService) GetSurveys(c context.Context, req dto.SurveysGetRequest) (response []*dto.SurveyResponse, err error)
func (*SurveyService) GetVisibleVoteUsers ¶
func (s *SurveyService) GetVisibleVoteUsers(surveyID, viewerID uint) ([]map[string]interface{}, error)
func (*SurveyService) GetVote ¶
func (s *SurveyService) GetVote(c context.Context, id uint) (*dto.GetVoteResponse, error)
func (*SurveyService) GetVotes ¶
func (s *SurveyService) GetVotes(surveyID, viewerID, respondentID uint) ([]map[string]interface{}, error)
func (*SurveyService) Participate ¶
func (s *SurveyService) Participate(c context.Context, userId uint, surveyId uint) (*dto.UserSurveyParticipationResponse, error)
func (*SurveyService) UpdateOption ¶
func (s *SurveyService) UpdateOption(c context.Context, id uint, req dto.SurveyOptionCreateRequest) (response *dto.SurveyOptionResponse, err error)
func (*SurveyService) UpdateSurvey ¶
func (s *SurveyService) UpdateSurvey(c context.Context, id uint, req dto.SurveyUpdateRequest) (response *dto.SurveyResponse, err error)
func (*SurveyService) UploadMedia ¶
func (s *SurveyService) UploadMedia(fileHeader *multipart.FileHeader) (string, error)
Click to show internal directories.
Click to hide internal directories.