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

View File

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

View File

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

View File

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