Skip to content

A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.

update search question

aichy126e95e2f3a2f25
diff --git a/docs/docs.go b/docs/docs.go
index cd4baca8..3f07ef25 100644
--- a/docs/docs.go
+++ b/docs/docs.go
@@ -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
}
}
},
diff --git a/docs/swagger.json b/docs/swagger.json
index f0c10bfb..d60e69fa 100644
--- a/docs/swagger.json
+++ b/docs/swagger.json
@@ -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
}
}
},
diff --git a/docs/swagger.yaml b/docs/swagger.yaml
index d3dd6775..68a7e49e 100644
--- a/docs/swagger.yaml
+++ b/docs/swagger.yaml
@@ -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:
diff --git a/internal/repo/question/question_repo.go b/internal/repo/question/question_repo.go
index fdb1066a..2ee02fc4 100644
--- a/internal/repo/question/question_repo.go
+++ b/internal/repo/question/question_repo.go
@@ -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":