Documentation
¶
Index ¶
- type QuestionCommon
- func (qs *QuestionCommon) CloseQuestion(ctx context.Context, req *schema.CloseQuestionReq) error
- func (qs *QuestionCommon) FindInfoByID(ctx context.Context, questionIDs []string, loginUserID string) (map[string]*schema.QuestionInfo, error)
- func (qs *QuestionCommon) Info(ctx context.Context, questionID string, loginUserID string) (showinfo *schema.QuestionInfo, err error)
- func (qs *QuestionCommon) ListFormat(ctx context.Context, questionList []*entity.QuestionTag, loginUserID string) ([]*schema.QuestionInfo, error)
- func (as *QuestionCommon) RemoveAnswer(ctx context.Context, id string) (err error)
- func (qs *QuestionCommon) RemoveQuestion(ctx context.Context, req *schema.RemoveQuestionReq) (err error)
- func (qs *QuestionCommon) ShowFormat(ctx context.Context, data *entity.Question) *schema.QuestionInfo
- func (qs *QuestionCommon) ShowFormatWithTag(ctx context.Context, data *entity.QuestionWithTagsRevision) *schema.QuestionInfo
- func (qs *QuestionCommon) ShowListFormat(ctx context.Context, data *entity.QuestionTag) *schema.QuestionInfo
- func (qs *QuestionCommon) UpdataPostSetTime(ctx context.Context, questionID string, setTime time.Time) error
- func (qs *QuestionCommon) UpdataPostTime(ctx context.Context, questionID string) error
- func (qs *QuestionCommon) UpdataPv(ctx context.Context, questionID string) error
- func (qs *QuestionCommon) UpdateAccepted(ctx context.Context, questionID, AnswerID string) error
- func (qs *QuestionCommon) UpdateAnswerCount(ctx context.Context, questionID string, num int) error
- func (qs *QuestionCommon) UpdateCollectionCount(ctx context.Context, questionID string, num int) error
- func (qs *QuestionCommon) UpdateLastAnswer(ctx context.Context, questionID, AnswerID string) error
- type QuestionRepo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type QuestionCommon ¶
type QuestionCommon struct {
AnswerCommon *answercommon.AnswerCommon
// contains filtered or unexported fields
}
QuestionCommon user service
func NewQuestionCommon ¶
func NewQuestionCommon(questionRepo QuestionRepo, answerRepo answercommon.AnswerRepo, voteRepo activity_common.VoteRepo, followCommon activity_common.FollowRepo, tagCommon *tagcommon.TagCommonService, userCommon *usercommon.UserCommon, collectionCommon *collectioncommon.CollectionCommon, answerCommon *answercommon.AnswerCommon, metaService *meta.MetaService, configRepo config.ConfigRepo, ) *QuestionCommon
func (*QuestionCommon) CloseQuestion ¶
func (qs *QuestionCommon) CloseQuestion(ctx context.Context, req *schema.CloseQuestionReq) error
func (*QuestionCommon) FindInfoByID ¶
func (qs *QuestionCommon) FindInfoByID(ctx context.Context, questionIDs []string, loginUserID string) (map[string]*schema.QuestionInfo, error)
func (*QuestionCommon) Info ¶
func (qs *QuestionCommon) Info(ctx context.Context, questionID string, loginUserID string) (showinfo *schema.QuestionInfo, err error)
func (*QuestionCommon) ListFormat ¶
func (qs *QuestionCommon) ListFormat(ctx context.Context, questionList []*entity.QuestionTag, loginUserID string) ([]*schema.QuestionInfo, error)
func (*QuestionCommon) RemoveAnswer ¶
func (as *QuestionCommon) RemoveAnswer(ctx context.Context, id string) (err error)
RemoveAnswer delete answer
func (*QuestionCommon) RemoveQuestion ¶
func (qs *QuestionCommon) RemoveQuestion(ctx context.Context, req *schema.RemoveQuestionReq) (err error)
RemoveQuestion delete question
func (*QuestionCommon) ShowFormat ¶
func (qs *QuestionCommon) ShowFormat(ctx context.Context, data *entity.Question) *schema.QuestionInfo
func (*QuestionCommon) ShowFormatWithTag ¶ added in v0.5.0
func (qs *QuestionCommon) ShowFormatWithTag(ctx context.Context, data *entity.QuestionWithTagsRevision) *schema.QuestionInfo
func (*QuestionCommon) ShowListFormat ¶
func (qs *QuestionCommon) ShowListFormat(ctx context.Context, data *entity.QuestionTag) *schema.QuestionInfo
func (*QuestionCommon) UpdataPostSetTime ¶ added in v0.5.0
func (*QuestionCommon) UpdataPostTime ¶
func (qs *QuestionCommon) UpdataPostTime(ctx context.Context, questionID string) error
func (*QuestionCommon) UpdataPv ¶
func (qs *QuestionCommon) UpdataPv(ctx context.Context, questionID string) error
func (*QuestionCommon) UpdateAccepted ¶
func (qs *QuestionCommon) UpdateAccepted(ctx context.Context, questionID, AnswerID string) error
func (*QuestionCommon) UpdateAnswerCount ¶
func (*QuestionCommon) UpdateCollectionCount ¶
func (*QuestionCommon) UpdateLastAnswer ¶
func (qs *QuestionCommon) UpdateLastAnswer(ctx context.Context, questionID, AnswerID string) error
type QuestionRepo ¶
type QuestionRepo interface {
AddQuestion(ctx context.Context, question *entity.Question) (err error)
RemoveQuestion(ctx context.Context, id string) (err error)
UpdateQuestion(ctx context.Context, question *entity.Question, Cols []string) (err error)
GetQuestion(ctx context.Context, id string) (question *entity.Question, exist bool, err error)
GetQuestionList(ctx context.Context, question *entity.Question) (questions []*entity.Question, err error)
GetQuestionPage(ctx context.Context, page, pageSize int, question *entity.Question) (questions []*entity.Question, total int64, err error)
SearchList(ctx context.Context, search *schema.QuestionSearch) ([]*entity.QuestionTag, int64, error)
UpdateQuestionStatus(ctx context.Context, question *entity.Question) (err error)
SearchByTitleLike(ctx context.Context, title string) (questionList []*entity.Question, err error)
UpdatePvCount(ctx context.Context, questionID string) (err error)
UpdateAnswerCount(ctx context.Context, questionID string, num int) (err error)
UpdateCollectionCount(ctx context.Context, questionID string, num int) (err error)
UpdateAccepted(ctx context.Context, question *entity.Question) (err error)
UpdateLastAnswer(ctx context.Context, question *entity.Question) (err error)
FindByID(ctx context.Context, id []string) (questionList []*entity.Question, err error)
CmsSearchList(ctx context.Context, search *schema.CmsQuestionSearch) ([]*entity.Question, int64, error)
GetQuestionCount(ctx context.Context) (count int64, err error)
}
QuestionRepo question repository
Click to show internal directories.
Click to hide internal directories.