mirror of https://gitee.com/answerdev/answer.git
update search question
This commit is contained in:
parent
910484013c
commit
499cfe9917
|
@ -7545,6 +7545,10 @@ const docTemplate = `{
|
|||
"schema.QuestionPageReq": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"inDays": {
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
},
|
||||
"orderCond": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
|
|
|
@ -7533,6 +7533,10 @@
|
|||
"schema.QuestionPageReq": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"inDays": {
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
},
|
||||
"orderCond": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
|
|
|
@ -1202,6 +1202,9 @@ definitions:
|
|||
type: object
|
||||
schema.QuestionPageReq:
|
||||
properties:
|
||||
inDays:
|
||||
minimum: 1
|
||||
type: integer
|
||||
orderCond:
|
||||
enum:
|
||||
- newest
|
||||
|
|
|
@ -245,7 +245,7 @@ func (qr *questionRepo) GetQuestionIDsPage(ctx context.Context, page, pageSize i
|
|||
}
|
||||
|
||||
// GetQuestionPage query question page
|
||||
func (qr *questionRepo) GetQuestionPage(ctx context.Context, page, pageSize int, userID, tagID, orderCond string) (
|
||||
func (qr *questionRepo) GetQuestionPage(ctx context.Context, page, pageSize int, userID, tagID, orderCond string, inDays int) (
|
||||
questionList []*entity.Question, total int64, err error) {
|
||||
questionList = make([]*entity.Question, 0)
|
||||
|
||||
|
|
|
@ -277,6 +277,7 @@ type QuestionPageReq struct {
|
|||
OrderCond string `validate:"omitempty,oneof=newest active frequent score unanswered" form:"order"`
|
||||
Tag string `validate:"omitempty,gt=0,lte=100" form:"tag"`
|
||||
Username string `validate:"omitempty,gt=0,lte=100" form:"username"`
|
||||
InDays int `validate:"omitempty,min=1" form:"in_days"`
|
||||
|
||||
LoginUserID string `json:"-"`
|
||||
UserIDBeSearched string `json:"-"`
|
||||
|
|
|
@ -32,7 +32,7 @@ type QuestionRepo interface {
|
|||
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, userID, tagID, orderCond string) (
|
||||
GetQuestionPage(ctx context.Context, page, pageSize int, userID, tagID, orderCond string, inDays int) (
|
||||
questionList []*entity.Question, total int64, err error)
|
||||
UpdateQuestionStatus(ctx context.Context, question *entity.Question) (err error)
|
||||
UpdateQuestionStatusWithOutUpdateTime(ctx context.Context, question *entity.Question) (err error)
|
||||
|
|
|
@ -931,7 +931,7 @@ func (qs *QuestionService) GetQuestionPage(ctx context.Context, req *schema.Ques
|
|||
}
|
||||
|
||||
questionList, total, err := qs.questionRepo.GetQuestionPage(ctx, req.Page, req.PageSize,
|
||||
req.UserIDBeSearched, req.TagID, req.OrderCond)
|
||||
req.UserIDBeSearched, req.TagID, req.OrderCond, req.InDays)
|
||||
if err != nil {
|
||||
return nil, 0, err
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue