{"modulePath":"github.com/answerdev/answer","version":"v1.2.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package service\n\n## Variables\n\n```go\nvar ProviderSetService = wire.NewSet(\n\tcomment.NewCommentService,\n\tcomment_common.NewCommentCommonService,\n\treport.NewReportService,\n\tNewVoteService,\n\ttag.NewTagService,\n\tfollow.NewFollowService,\n\tNewCollectionGroupService,\n\tNewCollectionService,\n\taction.NewCaptchaService,\n\tauth.NewAuthService,\n\tNewUserService,\n\tNewQuestionService,\n\tNewAnswerService,\n\texport.NewEmailService,\n\ttagcommon.NewTagCommonService,\n\tusercommon.NewUserCommon,\n\tquestioncommon.NewQuestionCommon,\n\tanswercommon.NewAnswerCommon,\n\tuploader.NewUploaderService,\n\tcollectioncommon.NewCollectionCommon,\n\trevision_common.NewRevisionService,\n\tNewRevisionService,\n\trank.NewRankService,\n\tsearch_parser.NewSearchParser,\n\tNewSearchService,\n\tmeta.NewMetaService,\n\tobject_info.NewObjService,\n\treport_handle_admin.NewReportHandle,\n\treport_admin.NewReportAdminService,\n\tuser_admin.NewUserAdminService,\n\treason.NewReasonService,\n\tsiteinfo_common.NewSiteInfoCommonService,\n\tsiteinfo.NewSiteInfoService,\n\tnotficationcommon.NewNotificationCommon,\n\tnotification.NewNotificationService,\n\tactivity.NewAnswerActivityService,\n\tdashboard.NewDashboardService,\n\tactivity_common.NewActivityCommon,\n\tactivity.NewActivityService,\n\trole.NewRoleService,\n\trole.NewUserRoleRelService,\n\trole.NewRolePowerRelService,\n\tuser_external_login.NewUserExternalLoginService,\n\tuser_external_login.NewUserCenterLoginService,\n\tplugin_common.NewPluginCommonService,\n\tconfig.NewConfigService,\n\tnotice_queue.NewNotificationQueueService,\n\tactivity_queue.NewActivityQueueService,\n\tuser_notification_config.NewUserNotificationConfigService,\n\tnotification.NewExternalNotificationService,\n\tnotice_queue.NewNewQuestionNotificationQueueService,\n)\n```\nProviderSetService is providers.\n\n## Types\n\n```go\ntype AnswerService struct {\n\tAnswerCommon *answercommon.AnswerCommon\n\t// contains filtered or unexported fields\n}\n```\nAnswerService user service\n\n```go\nfunc NewAnswerService(\n\tanswerRepo answercommon.AnswerRepo,\n\tquestionRepo questioncommon.QuestionRepo,\n\tquestionCommon *questioncommon.QuestionCommon,\n\tuserCommon *usercommon.UserCommon,\n\tcollectionCommon *collectioncommon.CollectionCommon,\n\tuserRepo usercommon.UserRepo,\n\trevisionService *revision_common.RevisionService,\n\tanswerAcceptActivityRepo *activity.AnswerActivityService,\n\tanswerCommon *answercommon.AnswerCommon,\n\tvoteRepo activity_common.VoteRepo,\n\temailService *export.EmailService,\n\troleService *role.UserRoleRelService,\n\tnotificationQueueService notice_queue.NotificationQueueService,\n\texternalNotificationQueueService notice_queue.ExternalNotificationQueueService,\n\tactivityQueueService activity_queue.ActivityQueueService,\n) *AnswerService\n```\n\n```go\nfunc (as *AnswerService) AcceptAnswer(ctx context.Context, req *schema.AcceptAnswerReq) (err error)\n```\nAcceptAnswer accept answer\n\n```go\nfunc (as *AnswerService) AdminSetAnswerStatus(ctx context.Context, req *schema.AdminUpdateAnswerStatusReq) error\n```\n\n```go\nfunc (as *AnswerService) Get(ctx context.Context, answerID, loginUserID string) (*schema.AnswerInfo, *schema.QuestionInfo, bool, error)\n```\n\n```go\nfunc (as *AnswerService) Insert(ctx context.Context, req *schema.AnswerAddReq) (string, error)\n```\n\n```go\nfunc (as *AnswerService) RecoverAnswer(ctx context.Context, req *schema.RecoverAnswerReq) (err error)\n```\nRecoverAnswer recover deleted answer\n\n```go\nfunc (as *AnswerService) RemoveAnswer(ctx context.Context, req *schema.RemoveAnswerReq) (err error)\n```\nRemoveAnswer delete answer\n\n```go\nfunc (as *AnswerService) SearchFormatInfo(ctx context.Context, answers []*entity.Answer, req *schema.AnswerListReq) (\n\t[]*schema.AnswerInfo, error)\n```\n\n```go\nfunc (as *AnswerService) SearchList(ctx context.Context, req *schema.AnswerListReq) ([]*schema.AnswerInfo, int64, error)\n```\n\n```go\nfunc (as *AnswerService) ShowFormat(ctx context.Context, data *entity.Answer) *schema.AnswerInfo\n```\n\n```go\nfunc (as *AnswerService) Update(ctx context.Context, req *schema.AnswerUpdateReq) (string, error)\n```\n\n```go\ntype CollectionGroupRepo interface {\n\tAddCollectionGroup(ctx context.Context, collectionGroup *entity.CollectionGroup) (err error)\n\tAddCollectionDefaultGroup(ctx context.Context, userID string) (collectionGroup *entity.CollectionGroup, err error)\n\tUpdateCollectionGroup(ctx context.Context, collectionGroup *entity.CollectionGroup, cols []string) (err error)\n\tGetCollectionGroup(ctx context.Context, id string) (collectionGroup *entity.CollectionGroup, exist bool, err error)\n\tGetCollectionGroupPage(ctx context.Context, page, pageSize int, collectionGroup *entity.CollectionGroup) (collectionGroupList []*entity.CollectionGroup, total int64, err error)\n\tGetDefaultID(ctx context.Context, userID string) (collectionGroup *entity.CollectionGroup, has bool, err error)\n}\n```\nCollectionGroupRepo collectionGroup repository\n\n```go\ntype CollectionGroupService struct {\n\t// contains filtered or unexported fields\n}\n```\nCollectionGroupService user service\n\n```go\nfunc NewCollectionGroupService(collectionGroupRepo CollectionGroupRepo) *CollectionGroupService\n```\n\n```go\nfunc (cs *CollectionGroupService) AddCollectionGroup(ctx context.Context, req *schema.AddCollectionGroupReq) (err error)\n```\nAddCollectionGroup add collection group\n\n```go\nfunc (cs *CollectionGroupService) GetCollectionGroup(ctx context.Context, id string) (resp *schema.GetCollectionGroupResp, err error)\n```\nGetCollectionGroup get collection group one\n\n```go\nfunc (cs *CollectionGroupService) UpdateCollectionGroup(ctx context.Context, req *schema.UpdateCollectionGroupReq, cols []string) (err error)\n```\nUpdateCollectionGroup update collection group\n\n```go\ntype CollectionService struct {\n\t// contains filtered or unexported fields\n}\n```\nCollectionService user service\n\n```go\nfunc NewCollectionService(\n\tcollectionRepo collectioncommon.CollectionRepo,\n\tcollectionGroupRepo CollectionGroupRepo,\n\tquestionCommon *questioncommon.QuestionCommon,\n) *CollectionService\n```\n\n```go\nfunc (cs *CollectionService) CollectionSwitch(ctx context.Context, dto *schema.CollectionSwitchDTO) (resp *schema.CollectionSwitchResp, err error)\n```\n\n```go\ntype QuestionService struct {\n\t// contains filtered or unexported fields\n}\n```\nQuestionService user service\n\n```go\nfunc NewQuestionService(\n\tquestionRepo questioncommon.QuestionRepo,\n\ttagCommon *tagcommon.TagCommonService,\n\tquestioncommon *questioncommon.QuestionCommon,\n\tuserCommon *usercommon.UserCommon,\n\tuserRepo usercommon.UserRepo,\n\trevisionService *revision_common.RevisionService,\n\tmetaService *meta.MetaService,\n\tcollectionCommon *collectioncommon.CollectionCommon,\n\tanswerActivityService *activity.AnswerActivityService,\n\temailService *export.EmailService,\n\tnotificationQueueService notice_queue.NotificationQueueService,\n\texternalNotificationQueueService notice_queue.ExternalNotificationQueueService,\n\tactivityQueueService activity_queue.ActivityQueueService,\n\tsiteInfoService siteinfo_common.SiteInfoCommonService,\n\tnewQuestionNotificationService *notification.ExternalNotificationService,\n) *QuestionService\n```\n\n```go\nfunc (qs *QuestionService) AddQuestion(ctx context.Context, req *schema.QuestionAdd) (questionInfo any, err error)\n```\nAddQuestion add question\n\n```go\nfunc (qs *QuestionService) AddQuestionCheckTags(ctx context.Context, Tags []*entity.Tag) ([]string, error)\n```\n\n```go\nfunc (qs *QuestionService) AdminAnswerPage(ctx context.Context, req *schema.AdminAnswerPageReq) (\n\tresp *pager.PageModel, err error)\n```\nAdminAnswerPage search answer list\n\n```go\nfunc (qs *QuestionService) AdminQuestionPage(\n\tctx context.Context, req *schema.AdminQuestionPageReq) (\n\tresp *pager.PageModel, err error)\n```\n\n```go\nfunc (qs *QuestionService) AdminSetQuestionStatus(ctx context.Context, req *schema.AdminUpdateQuestionStatusReq) error\n```\n\n```go\nfunc (qs *QuestionService) ChangeTag(ctx context.Context, objectTagData *schema.TagChange) error\n```\n\n```go\nfunc (qs *QuestionService) CheckAddQuestion(ctx context.Context, req *schema.QuestionAdd) (errorlist any, err error)\n```\n\n```go\nfunc (qs *QuestionService) CheckChangeReservedTag(ctx context.Context, oldobjectTagData, objectTagData []*entity.Tag) (bool, bool, []string, []string)\n```\n\n```go\nfunc (qs *QuestionService) CloseQuestion(ctx context.Context, req *schema.CloseQuestionReq) error\n```\n\n```go\nfunc (qs *QuestionService) GetQuestion(ctx context.Context, questionID, userID string,\n\tper schema.QuestionPermission) (resp *schema.QuestionInfo, err error)\n```\nGetQuestion get question one\n\n```go\nfunc (qs *QuestionService) GetQuestionAndAddPV(ctx context.Context, questionID, loginUserID string,\n\tper schema.QuestionPermission) (\n\tresp *schema.QuestionInfo, err error)\n```\nGetQuestionAndAddPV get question one\n\n```go\nfunc (qs *QuestionService) GetQuestionPage(ctx context.Context, req *schema.QuestionPageReq) (\n\tquestions []*schema.QuestionPageResp, total int64, err error)\n```\nGetQuestionPage query questions page\n\n```go\nfunc (qs *QuestionService) GetQuestionsByTitle(ctx context.Context, title string) (\n\tresp []*schema.QuestionBaseInfo, err error)\n```\nGetQuestionsByTitle get questions by title\n\n```go\nfunc (qs *QuestionService) HasNewTag(ctx context.Context, tags []*schema.TagItem) (bool, error)\n```\nHasNewTag\n\n```go\nfunc (qs *QuestionService) InviteUserInfo(ctx context.Context, questionID string) (inviteList []*schema.UserBasicInfo, err error)\n```\n\n```go\nfunc (qs *QuestionService) OperationQuestion(ctx context.Context, req *schema.OperationQuestionReq) (err error)\n```\nOperationQuestion\n\n```go\nfunc (qs *QuestionService) PersonalAnswerPage(ctx context.Context, req *schema.PersonalAnswerPageReq) (\n\tpageModel *pager.PageModel, err error)\n```\n\n```go\nfunc (qs *QuestionService) PersonalCollectionPage(ctx context.Context, req *schema.PersonalCollectionPageReq) (\n\tpageModel *pager.PageModel, err error)\n```\nPersonalCollectionPage get collection list by user\n\n```go\nfunc (qs *QuestionService) PersonalQuestionPage(ctx context.Context, req *schema.PersonalQuestionPageReq) (\n\tpageModel *pager.PageModel, err error)\n```\nPersonalQuestionPage get question list by user\n\n```go\nfunc (qs *QuestionService) RecoverQuestion(ctx context.Context, req *schema.QuestionRecoverReq) (err error)\n```\n\n```go\nfunc (qs *QuestionService) RemoveQuestion(ctx context.Context, req *schema.RemoveQuestionReq) (err error)\n```\nRemoveQuestion delete question\n\n```go\nfunc (qs *QuestionService) ReopenQuestion(ctx context.Context, req *schema.ReopenQuestionReq) error\n```\nReopenQuestion reopen question\n\n```go\nfunc (qs *QuestionService) SearchUserTopList(ctx context.Context, userName string, loginUserID string) ([]*schema.UserQuestionInfo, []*schema.UserAnswerInfo, error)\n```\n\n```go\nfunc (qs *QuestionService) SimilarQuestion(ctx context.Context, questionID string, loginUserID string) ([]*schema.QuestionPageResp, int64, error)\n```\nSimilarQuestion\n\n```go\nfunc (qs *QuestionService) SitemapCron(ctx context.Context)\n```\n\n```go\nfunc (qs *QuestionService) UpdateQuestion(ctx context.Context, req *schema.QuestionUpdate) (questionInfo any, err error)\n```\nUpdateQuestion update question\n\n```go\nfunc (qs *QuestionService) UpdateQuestionCheckTags(ctx context.Context, req *schema.QuestionUpdate) (errorlist []*validator.FormErrorField, err error)\n```\n\n```go\nfunc (qs *QuestionService) UpdateQuestionInviteUser(ctx context.Context, req *schema.QuestionUpdateInviteUser) (err error)\n```\n\n```go\ntype RevisionService struct {\n\t// contains filtered or unexported fields\n}\n```\nRevisionService user service\n\n```go\nfunc NewRevisionService(\n\trevisionRepo revision.RevisionRepo,\n\tuserCommon *usercommon.UserCommon,\n\tquestionCommon *questioncommon.QuestionCommon,\n\tanswerService *AnswerService,\n\tobjectInfoService *object_info.ObjService,\n\tquestionRepo questioncommon.QuestionRepo,\n\tanswerRepo answercommon.AnswerRepo,\n\ttagRepo tag_common.TagRepo,\n\ttagCommon *tagcommon.TagCommonService,\n\tnotificationQueueService notice_queue.NotificationQueueService,\n\tactivityQueueService activity_queue.ActivityQueueService,\n) *RevisionService\n```\n\n```go\nfunc (rs *RevisionService) CheckCanUpdateRevision(ctx context.Context, req *schema.CheckCanQuestionUpdate) (\n\tresp *schema.ErrTypeData, err error)\n```\nCheckCanUpdateRevision can check revision\n\n```go\nfunc (rs *RevisionService) GetRevisionList(ctx context.Context, req *schema.GetRevisionListReq) (resp []schema.GetRevisionResp, err error)\n```\nGetRevisionList get revision list all\n\n```go\nfunc (rs *RevisionService) GetUnreviewedRevisionPage(ctx context.Context, req *schema.RevisionSearch) (\n\tresp *pager.PageModel, err error)\n```\nGetUnreviewedRevisionPage get unreviewed list\n\n```go\nfunc (rs *RevisionService) RevisionAudit(ctx context.Context, req *schema.RevisionAuditReq) (err error)\n```\n\n```go\ntype SearchService struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewSearchService(\n\tsearchParser *search_parser.SearchParser,\n\tsearchRepo search_common.SearchRepo,\n) *SearchService\n```\n\n```go\nfunc (ss *SearchService) Search(ctx context.Context, dto *schema.SearchDTO) (resp *schema.SearchResp, err error)\n```\nSearch search contents\n\n```go\ntype UserService struct {\n\t// contains filtered or unexported fields\n}\n```\nUserService user service\n\n```go\nfunc NewUserService(userRepo usercommon.UserRepo,\n\tuserActivity activity.UserActiveActivityRepo,\n\tactivityRepo activity_common.ActivityRepo,\n\temailService *export.EmailService,\n\tauthService *auth.AuthService,\n\tsiteInfoService siteinfo_common.SiteInfoCommonService,\n\tuserRoleService *role.UserRoleRelService,\n\tuserCommonService *usercommon.UserCommon,\n\tuserExternalLoginService *user_external_login.UserExternalLoginService,\n\tuserNotificationConfigRepo user_notification_config.UserNotificationConfigRepo,\n\tuserNotificationConfigService *user_notification_config.UserNotificationConfigService,\n) *UserService\n```\n\n```go\nfunc (us *UserService) EmailLogin(ctx context.Context, req *schema.UserEmailLoginReq) (resp *schema.UserLoginResp, err error)\n```\nEmailLogin email login\n\n```go\nfunc (us *UserService) GetOtherUserInfoByUsername(ctx context.Context, username string) (\n\tresp *schema.GetOtherUserInfoByUsernameResp, err error)\n```\n\n```go\nfunc (us *UserService) GetUserInfoByUserID(ctx context.Context, token, userID string) (\n\tresp *schema.GetCurrentLoginUserInfoResp, err error)\n```\nGetUserInfoByUserID get user info by user id\n\n```go\nfunc (us *UserService) RetrievePassWord(ctx context.Context, req *schema.UserRetrievePassWordRequest) error\n```\nRetrievePassWord .\n\n```go\nfunc (us *UserService) SearchUserListByName(ctx context.Context, req *schema.GetOtherUserInfoByUsernameReq) (\n\tresp []*schema.UserBasicInfo, err error)\n```\n\n```go\nfunc (us *UserService) UpdateInfo(ctx context.Context, req *schema.UpdateInfoRequest) (\n\terrFields []*validator.FormErrorField, err error)\n```\nUpdateInfo update user info\n\n```go\nfunc (us *UserService) UpdatePasswordWhenForgot(ctx context.Context, req *schema.UserRePassWordRequest) (err error)\n```\nUpdatePasswordWhenForgot update user password when user forgot password\n\n```go\nfunc (us *UserService) UserChangeEmailSendCode(ctx context.Context, req *schema.UserChangeEmailSendCodeReq) (\n\tresp []*validator.FormErrorField, err error)\n```\nUserChangeEmailSendCode user change email verification\n\n```go\nfunc (us *UserService) UserChangeEmailVerify(ctx context.Context, content string) (resp *schema.UserLoginResp, err error)\n```\nUserChangeEmailVerify user change email verify code\n\n```go\nfunc (us *UserService) UserModifyPassWordVerification(ctx context.Context, req *schema.UserModifyPasswordReq) (bool, error)\n```\n\n```go\nfunc (us *UserService) UserModifyPassword(ctx context.Context, req *schema.UserModifyPasswordReq) error\n```\nUserModifyPassword user modify password\n\n```go\nfunc (us *UserService) UserRanking(ctx context.Context) (resp *schema.UserRankingResp, err error)\n```\nUserRanking get user ranking\n\n```go\nfunc (us *UserService) UserRegisterByEmail(ctx context.Context, registerUserInfo *schema.UserRegisterReq) (\n\tresp *schema.UserLoginResp, errFields []*validator.FormErrorField, err error,\n)\n```\nUserRegisterByEmail user register\n\n```go\nfunc (us *UserService) UserUnsubscribeNotification(\n\tctx context.Context, req *schema.UserUnsubscribeNotificationReq) (err error)\n```\nUserUnsubscribeNotification user unsubscribe email notification\n\n```go\nfunc (us *UserService) UserUpdateInterface(ctx context.Context, req *schema.UpdateUserInterfaceRequest) (err error)\n```\nUserUpdateInterface update user interface\n\n```go\nfunc (us *UserService) UserVerifyEmail(ctx context.Context, req *schema.UserVerifyEmailReq) (resp *schema.UserLoginResp, err error)\n```\n\n```go\nfunc (us *UserService) UserVerifyEmailSend(ctx context.Context, userID string) error\n```\n\n```go\ntype VoteRepo interface {\n\tVote(ctx context.Context, op *schema.VoteOperationInfo) (err error)\n\tCancelVote(ctx context.Context, op *schema.VoteOperationInfo) (err error)\n\tGetAndSaveVoteResult(ctx context.Context, objectID, objectType string) (up, down int64, err error)\n\tListUserVotes(ctx context.Context, userID string, page int, pageSize int, activityTypes []int) (\n\t\tvoteList []*entity.Activity, total int64, err error)\n}\n```\nVoteRepo activity repository\n\n```go\ntype VoteService struct {\n\t// contains filtered or unexported fields\n}\n```\nVoteService user service\n\n```go\nfunc NewVoteService(\n\tvoteRepo VoteRepo,\n\tconfigService *config.ConfigService,\n\tquestionRepo questioncommon.QuestionRepo,\n\tanswerRepo answercommon.AnswerRepo,\n\tcommentCommonRepo comment_common.CommentCommonRepo,\n\tobjectService *object_info.ObjService,\n) *VoteService\n```\n\n```go\nfunc (vs *VoteService) ListUserVotes(ctx context.Context, req schema.GetVoteWithPageReq) (resp *pager.PageModel, err error)\n```\nListUserVotes list user's votes\n\n```go\nfunc (vs *VoteService) VoteDown(ctx context.Context, req *schema.VoteReq) (resp *schema.VoteResp, err error)\n```\nVoteDown vote down\n\n```go\nfunc (vs *VoteService) VoteUp(ctx context.Context, req *schema.VoteReq) (resp *schema.VoteResp, err error)\n```\nVoteUp vote up\n\n","path":"github.com/answerdev/answer/internal/service","name":"service","synopsis":"","isRedistributable":true}
