update search question

This commit is contained in:
aichy126 2023-04-24 14:17:52 +08:00
parent bed55985dd
commit e95e2f3a2f
4 changed files with 86 additions and 0 deletions

View File

@ -5893,6 +5893,9 @@ const docTemplate = `{
"constant.Privilege": {
"type": "object",
"properties": {
"key": {
"type": "string"
},
"label": {
"type": "string"
},
@ -6382,9 +6385,20 @@ const docTemplate = `{
}
}
},
"schema.ConfigFieldUIOptionAction": {
"type": "object",
"properties": {
"url": {
"type": "string"
}
}
},
"schema.ConfigFieldUIOptions": {
"type": "object",
"properties": {
"action": {
"$ref": "#/definitions/schema.ConfigFieldUIOptionAction"
},
"input_type": {
"type": "string"
},
@ -6396,6 +6410,12 @@ const docTemplate = `{
},
"rows": {
"type": "string"
},
"text": {
"type": "string"
},
"variant": {
"type": "string"
}
}
},
@ -7524,6 +7544,9 @@ const docTemplate = `{
"level": {
"type": "integer"
},
"level_desc": {
"type": "string"
},
"privileges": {
"type": "array",
"items": {
@ -7985,6 +8008,10 @@ const docTemplate = `{
"custom_header": {
"type": "string",
"maxLength": 65536
},
"custom_sidebar": {
"type": "string",
"maxLength": 65536
}
}
},
@ -8006,6 +8033,10 @@ const docTemplate = `{
"custom_header": {
"type": "string",
"maxLength": 65536
},
"custom_sidebar": {
"type": "string",
"maxLength": 65536
}
}
},

View File

@ -5881,6 +5881,9 @@
"constant.Privilege": {
"type": "object",
"properties": {
"key": {
"type": "string"
},
"label": {
"type": "string"
},
@ -6370,9 +6373,20 @@
}
}
},
"schema.ConfigFieldUIOptionAction": {
"type": "object",
"properties": {
"url": {
"type": "string"
}
}
},
"schema.ConfigFieldUIOptions": {
"type": "object",
"properties": {
"action": {
"$ref": "#/definitions/schema.ConfigFieldUIOptionAction"
},
"input_type": {
"type": "string"
},
@ -6384,6 +6398,12 @@
},
"rows": {
"type": "string"
},
"text": {
"type": "string"
},
"variant": {
"type": "string"
}
}
},
@ -7512,6 +7532,9 @@
"level": {
"type": "integer"
},
"level_desc": {
"type": "string"
},
"privileges": {
"type": "array",
"items": {
@ -7973,6 +7996,10 @@
"custom_header": {
"type": "string",
"maxLength": 65536
},
"custom_sidebar": {
"type": "string",
"maxLength": 65536
}
}
},
@ -7994,6 +8021,10 @@
"custom_header": {
"type": "string",
"maxLength": 65536
},
"custom_sidebar": {
"type": "string",
"maxLength": 65536
}
}
},

View File

@ -1,6 +1,8 @@
definitions:
constant.Privilege:
properties:
key:
type: string
label:
type: string
value:
@ -339,8 +341,15 @@ definitions:
value:
type: string
type: object
schema.ConfigFieldUIOptionAction:
properties:
url:
type: string
type: object
schema.ConfigFieldUIOptions:
properties:
action:
$ref: '#/definitions/schema.ConfigFieldUIOptionAction'
input_type:
type: string
label:
@ -349,6 +358,10 @@ definitions:
type: string
rows:
type: string
text:
type: string
variant:
type: string
type: object
schema.ConnectorInfoResp:
properties:
@ -1156,6 +1169,8 @@ definitions:
properties:
level:
type: integer
level_desc:
type: string
privileges:
items:
$ref: '#/definitions/constant.Privilege'
@ -1482,6 +1497,9 @@ definitions:
custom_header:
maxLength: 65536
type: string
custom_sidebar:
maxLength: 65536
type: string
type: object
schema.SiteCustomCssHTMLResp:
properties:
@ -1497,6 +1515,9 @@ definitions:
custom_header:
maxLength: 65536
type: string
custom_sidebar:
maxLength: 65536
type: string
type: object
schema.SiteGeneralReq:
properties:

View File

@ -271,6 +271,9 @@ func (qr *questionRepo) GetQuestionPage(ctx context.Context, page, pageSize int,
} else {
session.And("question.show = ?", entity.QuestionShow)
}
if inDays > 0 {
session.And("question.created_at > ?", time.Now().AddDate(0, 0, -inDays))
}
switch orderCond {
case "newest":