Documentation ¶
Index ¶
- func GetRecords[T any](db *gorm.DB, request *dto.RepositoryRequest) ([]T, error)
- type IReportRepository
- type ISurveyRepository
- type ReportRepository
- func (r *ReportRepository) GetAccessibleSurveys(ctx context.Context, userID uint, permission string) ([]models.Survey, error)
- func (r *ReportRepository) GetAllSurveys(ctx context.Context) ([]models.Survey, error)
- func (r *ReportRepository) GetAverageResponseTime(ctx context.Context, surveyId uint) (float64, error)
- func (r *ReportRepository) GetChoicesByQuestionID(ctx context.Context, qid uint) ([]models.Choice, error)
- func (r *ReportRepository) GetCorrectChoiceByQuestionID(ctx context.Context, qid uint) (*models.Choice, error)
- func (r *ReportRepository) GetGivenAnswerCount(ctx context.Context, ans string) (int64, error)
- func (r *ReportRepository) GetGivenAnswerCountByQuestionID(ctx context.Context, qid uint, answer string) (int64, error)
- func (r *ReportRepository) GetParticipationCount(ctx context.Context, surveyId uint, userId uint) (int64, error)
- func (r *ReportRepository) GetQuestionsBySurveyID(ctx context.Context, sid uint) ([]models.Question, error)
- func (r *ReportRepository) GetResponseDispersionByHour(ctx context.Context, surveyId uint) (map[int]int, error)
- func (r *ReportRepository) GetSuddenlyFinishedParticipatesForSurvey(ctx context.Context, surveyId uint) (int64, error)
- func (r *ReportRepository) GetSurveyParticipantsCount(ctx context.Context, surveyId uint) (int64, error)
- func (r *ReportRepository) GetSurveyParticipantsCountByPermissionId(ctx context.Context, surveyId uint, permissionId uint) (int64, error)
- func (r *ReportRepository) GetTotalParticipants(ctx context.Context, surveyId uint) ([]userModels.User, error)
- func (r *ReportRepository) GetTotalParticipatesForSurvey(ctx context.Context, surveyId uint) (int64, error)
- func (r *ReportRepository) GetTotalVotesToQuestionCount(ctx context.Context, qid uint) (int64, error)
- type SurveyRepository
- func (r *SurveyRepository) CheckVoteVisibility(surveyID, viewerID, respondentID uint) (bool, error)
- func (r *SurveyRepository) CreateChoice(ctx context.Context, choice *models.Choice) error
- func (r *SurveyRepository) CreateOption(ctx context.Context, option *models.SurveyOption) (*models.SurveyOption, error)
- func (r *SurveyRepository) CreateQuestion(ctx context.Context, question *models.Question) error
- func (r *SurveyRepository) CreateSurvey(ctx context.Context, survey *models.Survey) error
- func (r *SurveyRepository) CreateUserParticipation(ctx context.Context, participation *models.UserSurveyParticipation) (*models.UserSurveyParticipation, error)
- func (r *SurveyRepository) CreateVote(ctx context.Context, v *models.Vote) (*models.Vote, error)
- func (r *SurveyRepository) DeleteOption(c context.Context, id uint) error
- func (q *SurveyRepository) DeleteQuestion(c context.Context, id uint) error
- func (r *SurveyRepository) DeleteQuestionChoices(c context.Context, questionId uint) error
- func (q *SurveyRepository) DeleteSurvey(c context.Context, id uint) error
- func (q *SurveyRepository) DeleteVote(c context.Context, id uint) error
- func (r *SurveyRepository) GetChoiceByTextAndQuestion(ctx context.Context, text string, questionID uint) (*models.Choice, error)
- func (r *SurveyRepository) GetLastUserParticipation(ctx context.Context, userId uint, surveyId uint) (*models.UserSurveyParticipation, error)
- func (r *SurveyRepository) GetOptionByID(ctx context.Context, id uint) (option *models.SurveyOption, err error)
- func (r *SurveyRepository) GetOptions(ctx context.Context, req *dto.RepositoryRequest) (options []*models.SurveyOption, err error)
- func (r *SurveyRepository) GetQuestionByID(ctx context.Context, id uint) (*models.Question, error)
- func (r *SurveyRepository) GetQuestions(ctx context.Context, req *dto.RepositoryRequest) (questions []*models.Question, err error)
- func (r *SurveyRepository) GetSurveyByID(ctx context.Context, surveyId uint) (*models.Survey, error)
- func (r *SurveyRepository) GetSurveyVotes(ctx context.Context, id uint) ([]*models.Vote, error)
- func (r *SurveyRepository) GetSurveys(ctx context.Context, req *dto.RepositoryRequest) (questions []*models.Survey, err error)
- func (r *SurveyRepository) GetUserParticipation(ctx context.Context, participationId uint) (*models.UserSurveyParticipation, error)
- func (r *SurveyRepository) GetUserParticipationList(ctx context.Context, userId uint, surveyId uint) ([]models.UserSurveyParticipation, error)
- func (r *SurveyRepository) GetUserSurveyVote(ctx context.Context, user_id uint, question_id uint) (*models.Vote, error)
- func (r *SurveyRepository) GetVisibleVoteUsers(surveyID, viewerID uint) ([]map[string]interface{}, error)
- func (r *SurveyRepository) GetVoteByID(ctx context.Context, id uint) (*models.Vote, error)
- func (r *SurveyRepository) GetVotes(surveyID, respondentID uint) ([]models.Vote, error)
- func (r *SurveyRepository) SaveFile(fileName string, fileData []byte) (string, error)
- func (r *SurveyRepository) UpdateChoice(ctx context.Context, choice *models.Choice) error
- func (r *SurveyRepository) UpdateOption(ctx context.Context, option *models.SurveyOption) error
- func (q *SurveyRepository) UpdateQuestion(c context.Context, m *models.Question) (*models.Question, error)
- func (r *SurveyRepository) UpdateSurvey(ctx context.Context, survey *models.Survey) error
- func (r *SurveyRepository) UpdateUserParticipation(ctx context.Context, participation *models.UserSurveyParticipation) error
- func (r *SurveyRepository) UpdateVote(ctx context.Context, v *models.Vote) (*models.Vote, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetRecords ¶
Types ¶
type IReportRepository ¶
type IReportRepository interface { GetSurveyParticipantsCount(ctx context.Context, surveyId uint) (int64, error) GetTotalParticipatesForSurvey(ctx context.Context, surveyId uint) (int64, error) GetSurveyParticipantsCountByPermissionId(ctx context.Context, surveyId uint, permissionId uint) (int64, error) GetTotalVotesToQuestionCount(ctx context.Context, qid uint) (int64, error) GetSuddenlyFinishedParticipatesForSurvey(ctx context.Context, surveyId uint) (int64, error) GetQuestionsBySurveyID(ctx context.Context, sid uint) ([]models.Question, error) GetCorrectChoiceByQuestionID(ctx context.Context, qid uint) (*models.Choice, error) GetChoicesByQuestionID(ctx context.Context, qid uint) ([]models.Choice, error) GetGivenAnswerCountByQuestionID(ctx context.Context, qid uint, answer string) (int64, error) GetParticipationCount(ctx context.Context, surveyId uint, userId uint) (int64, error) GetTotalParticipants(ctx context.Context, surveyId uint) ([]userModels.User, error) GetAverageResponseTime(ctx context.Context, surveyId uint) (float64, error) GetResponseDispersionByHour(ctx context.Context, surveyId uint) (map[int]int, error) GetAllSurveys(ctx context.Context) ([]models.Survey, error) GetAccessibleSurveys(ctx context.Context, userID uint, permission string) ([]models.Survey, error) }
type ISurveyRepository ¶
type ISurveyRepository interface { CreateSurvey(ctx context.Context, survey *models.Survey) error GetSurveyByID(ctx context.Context, surveyId uint) (*models.Survey, error) CreateQuestion(ctx context.Context, question *models.Question) error CreateChoice(ctx context.Context, choice *models.Choice) error UpdateChoice(ctx context.Context, choice *models.Choice) error GetChoiceByTextAndQuestion(ctx context.Context, text string, questionID uint) (*models.Choice, error) GetUserParticipationList(ctx context.Context, userId uint, surveyId uint) ([]models.UserSurveyParticipation, error) CreateUserParticipation(ctx context.Context, participation *models.UserSurveyParticipation) (*models.UserSurveyParticipation, error) UpdateUserParticipation(ctx context.Context, participation *models.UserSurveyParticipation) error GetUserParticipation(ctx context.Context, participationId uint) (*models.UserSurveyParticipation, error) GetLastUserParticipation(ctx context.Context, userId uint, surveyId uint) (*models.UserSurveyParticipation, error) CreateVote(ctx context.Context, v *models.Vote) (*models.Vote, error) UpdateVote(ctx context.Context, v *models.Vote) (*models.Vote, error) GetUserSurveyVote(ctx context.Context, user_id uint, question_id uint) (*models.Vote, error) UpdateQuestion(c context.Context, m *models.Question) (*models.Question, error) DeleteQuestion(c context.Context, id uint) error DeleteSurvey(c context.Context, id uint) error GetQuestionByID(ctx context.Context, id uint) (*models.Question, error) DeleteQuestionChoices(ctx context.Context, questionId uint) error GetQuestions(ctx context.Context, req *dto.RepositoryRequest) ([]*models.Question, error) GetSurveys(ctx context.Context, req *dto.RepositoryRequest) (questions []*models.Survey, err error) CheckVoteVisibility(surveyID, viewerID, respondentID uint) (bool, error) GetVotes(surveyID, respondentID uint) ([]models.Vote, error) GetVisibleVoteUsers(surveyID, viewerID uint) ([]map[string]interface{}, error) //GetResponses(ctx context.Context, userID uint, surveyID uint, privacyLevel string) ([]models.Choice, error) DeleteVote(c context.Context, id uint) error GetVoteByID(ctx context.Context, id uint) (*models.Vote, error) UpdateSurvey(ctx context.Context, survey *models.Survey) error GetSurveyVotes(ctx context.Context, id uint) ([]*models.Vote, error) CreateOption(ctx context.Context, option *models.SurveyOption) (*models.SurveyOption, error) UpdateOption(ctx context.Context, option *models.SurveyOption) error DeleteOption(c context.Context, id uint) error GetOptionByID(ctx context.Context, id uint) (*models.SurveyOption, error) GetOptions(ctx context.Context, req *dto.RepositoryRequest) (options []*models.SurveyOption, err error) SaveFile(fileName string, fileData []byte) (string, error) }
type ReportRepository ¶
type ReportRepository struct {
// contains filtered or unexported fields
}
func NewReportRepository ¶
func NewReportRepository(db db.DbService, logger logging.Logger) *ReportRepository
func (*ReportRepository) GetAccessibleSurveys ¶
func (*ReportRepository) GetAllSurveys ¶
func (*ReportRepository) GetAverageResponseTime ¶
func (*ReportRepository) GetChoicesByQuestionID ¶
func (*ReportRepository) GetCorrectChoiceByQuestionID ¶
func (*ReportRepository) GetGivenAnswerCount ¶
func (*ReportRepository) GetGivenAnswerCountByQuestionID ¶
func (*ReportRepository) GetParticipationCount ¶
func (*ReportRepository) GetQuestionsBySurveyID ¶
func (*ReportRepository) GetResponseDispersionByHour ¶
func (*ReportRepository) GetSuddenlyFinishedParticipatesForSurvey ¶
func (*ReportRepository) GetSurveyParticipantsCount ¶
func (*ReportRepository) GetSurveyParticipantsCountByPermissionId ¶
func (*ReportRepository) GetTotalParticipants ¶
func (r *ReportRepository) GetTotalParticipants(ctx context.Context, surveyId uint) ([]userModels.User, error)
func (*ReportRepository) GetTotalParticipatesForSurvey ¶
func (*ReportRepository) GetTotalVotesToQuestionCount ¶
type SurveyRepository ¶
type SurveyRepository struct {
// contains filtered or unexported fields
}
func NewSurveyRepository ¶
func NewSurveyRepository(db db.DbService, logger logging.Logger) *SurveyRepository
func (*SurveyRepository) CheckVoteVisibility ¶
func (r *SurveyRepository) CheckVoteVisibility(surveyID, viewerID, respondentID uint) (bool, error)
func (*SurveyRepository) CreateChoice ¶
func (*SurveyRepository) CreateOption ¶
func (r *SurveyRepository) CreateOption(ctx context.Context, option *models.SurveyOption) (*models.SurveyOption, error)
func (*SurveyRepository) CreateQuestion ¶
func (*SurveyRepository) CreateSurvey ¶
func (*SurveyRepository) CreateUserParticipation ¶
func (r *SurveyRepository) CreateUserParticipation(ctx context.Context, participation *models.UserSurveyParticipation) (*models.UserSurveyParticipation, error)
func (*SurveyRepository) CreateVote ¶
func (*SurveyRepository) DeleteOption ¶
func (r *SurveyRepository) DeleteOption(c context.Context, id uint) error
func (*SurveyRepository) DeleteQuestion ¶
func (q *SurveyRepository) DeleteQuestion(c context.Context, id uint) error
func (*SurveyRepository) DeleteQuestionChoices ¶
func (r *SurveyRepository) DeleteQuestionChoices(c context.Context, questionId uint) error
func (*SurveyRepository) DeleteSurvey ¶
func (q *SurveyRepository) DeleteSurvey(c context.Context, id uint) error
func (*SurveyRepository) DeleteVote ¶
func (q *SurveyRepository) DeleteVote(c context.Context, id uint) error
func (*SurveyRepository) GetChoiceByTextAndQuestion ¶
func (*SurveyRepository) GetLastUserParticipation ¶
func (r *SurveyRepository) GetLastUserParticipation(ctx context.Context, userId uint, surveyId uint) (*models.UserSurveyParticipation, error)
func (*SurveyRepository) GetOptionByID ¶
func (r *SurveyRepository) GetOptionByID(ctx context.Context, id uint) (option *models.SurveyOption, err error)
func (*SurveyRepository) GetOptions ¶
func (r *SurveyRepository) GetOptions(ctx context.Context, req *dto.RepositoryRequest) (options []*models.SurveyOption, err error)
func (*SurveyRepository) GetQuestionByID ¶
func (*SurveyRepository) GetQuestions ¶
func (r *SurveyRepository) GetQuestions(ctx context.Context, req *dto.RepositoryRequest) (questions []*models.Question, err error)
func (*SurveyRepository) GetSurveyByID ¶
func (*SurveyRepository) GetSurveyVotes ¶
func (*SurveyRepository) GetSurveys ¶
func (r *SurveyRepository) GetSurveys(ctx context.Context, req *dto.RepositoryRequest) (questions []*models.Survey, err error)
func (*SurveyRepository) GetUserParticipation ¶
func (r *SurveyRepository) GetUserParticipation(ctx context.Context, participationId uint) (*models.UserSurveyParticipation, error)
func (*SurveyRepository) GetUserParticipationList ¶
func (r *SurveyRepository) GetUserParticipationList(ctx context.Context, userId uint, surveyId uint) ([]models.UserSurveyParticipation, error)
func (*SurveyRepository) GetUserSurveyVote ¶
func (*SurveyRepository) GetVisibleVoteUsers ¶
func (r *SurveyRepository) GetVisibleVoteUsers(surveyID, viewerID uint) ([]map[string]interface{}, error)
func (*SurveyRepository) GetVoteByID ¶
func (*SurveyRepository) GetVotes ¶
func (r *SurveyRepository) GetVotes(surveyID, respondentID uint) ([]models.Vote, error)
func (*SurveyRepository) SaveFile ¶
func (r *SurveyRepository) SaveFile(fileName string, fileData []byte) (string, error)
func (*SurveyRepository) UpdateChoice ¶
func (*SurveyRepository) UpdateOption ¶
func (r *SurveyRepository) UpdateOption(ctx context.Context, option *models.SurveyOption) error
func (*SurveyRepository) UpdateQuestion ¶
func (*SurveyRepository) UpdateSurvey ¶
func (*SurveyRepository) UpdateUserParticipation ¶
func (r *SurveyRepository) UpdateUserParticipation(ctx context.Context, participation *models.UserSurveyParticipation) error
func (*SurveyRepository) UpdateVote ¶
Click to show internal directories.
Click to hide internal directories.