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.

feat: add time zone config

LinkinStard091d8d56677
diff --git a/docs/docs.go b/docs/docs.go
index 4f0bfb5a..16ac77ca 100644
--- a/docs/docs.go
+++ b/docs/docs.go
@@ -509,14 +509,14 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "Get siteinfo general",
+ "description": "get site general information",
"produces": [
"application/json"
],
"tags": [
"admin"
],
- "summary": "Get siteinfo general",
+ "summary": "get site general information",
"responses": {
"200": {
"description": "OK",
@@ -544,14 +544,14 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "Get siteinfo interface",
+ "description": "update site general information",
"produces": [
"application/json"
],
"tags": [
"admin"
],
- "summary": "Get siteinfo interface",
+ "summary": "update site general information",
"parameters": [
{
"description": "general",
@@ -580,14 +580,14 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "Get siteinfo interface",
+ "description": "get site interface",
"produces": [
"application/json"
],
"tags": [
"admin"
],
- "summary": "Get siteinfo interface",
+ "summary": "get site interface",
"parameters": [
{
"description": "general",
@@ -626,14 +626,14 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "Get siteinfo interface",
+ "description": "update site info interface",
"produces": [
"application/json"
],
"tags": [
"admin"
],
- "summary": "Get siteinfo interface",
+ "summary": "update site info interface",
"parameters": [
{
"description": "general",
@@ -5348,7 +5348,8 @@ const docTemplate = `{
"type": "object",
"required": [
"language",
- "theme"
+ "theme",
+ "time_zone"
],
"properties": {
"language": {
@@ -5362,6 +5363,10 @@ const docTemplate = `{
"theme": {
"type": "string",
"maxLength": 128
+ },
+ "time_zone": {
+ "type": "string",
+ "maxLength": 128
}
}
},
@@ -5369,7 +5374,8 @@ const docTemplate = `{
"type": "object",
"required": [
"language",
- "theme"
+ "theme",
+ "time_zone"
],
"properties": {
"language": {
@@ -5383,6 +5389,10 @@ const docTemplate = `{
"theme": {
"type": "string",
"maxLength": 128
+ },
+ "time_zone": {
+ "type": "string",
+ "maxLength": 128
}
}
},
diff --git a/docs/swagger.json b/docs/swagger.json
index e856d606..8476352c 100644
--- a/docs/swagger.json
+++ b/docs/swagger.json
@@ -497,14 +497,14 @@
"ApiKeyAuth": []
}
],
- "description": "Get siteinfo general",
+ "description": "get site general information",
"produces": [
"application/json"
],
"tags": [
"admin"
],
- "summary": "Get siteinfo general",
+ "summary": "get site general information",
"responses": {
"200": {
"description": "OK",
@@ -532,14 +532,14 @@
"ApiKeyAuth": []
}
],
- "description": "Get siteinfo interface",
+ "description": "update site general information",
"produces": [
"application/json"
],
"tags": [
"admin"
],
- "summary": "Get siteinfo interface",
+ "summary": "update site general information",
"parameters": [
{
"description": "general",
@@ -568,14 +568,14 @@
"ApiKeyAuth": []
}
],
- "description": "Get siteinfo interface",
+ "description": "get site interface",
"produces": [
"application/json"
],
"tags": [
"admin"
],
- "summary": "Get siteinfo interface",
+ "summary": "get site interface",
"parameters": [
{
"description": "general",
@@ -614,14 +614,14 @@
"ApiKeyAuth": []
}
],
- "description": "Get siteinfo interface",
+ "description": "update site info interface",
"produces": [
"application/json"
],
"tags": [
"admin"
],
- "summary": "Get siteinfo interface",
+ "summary": "update site info interface",
"parameters": [
{
"description": "general",
@@ -5336,7 +5336,8 @@
"type": "object",
"required": [
"language",
- "theme"
+ "theme",
+ "time_zone"
],
"properties": {
"language": {
@@ -5350,6 +5351,10 @@
"theme": {
"type": "string",
"maxLength": 128
+ },
+ "time_zone": {
+ "type": "string",
+ "maxLength": 128
}
}
},
@@ -5357,7 +5362,8 @@
"type": "object",
"required": [
"language",
- "theme"
+ "theme",
+ "time_zone"
],
"properties": {
"language": {
@@ -5371,6 +5377,10 @@
"theme": {
"type": "string",
"maxLength": 128
+ },
+ "time_zone": {
+ "type": "string",
+ "maxLength": 128
}
}
},
diff --git a/docs/swagger.yaml b/docs/swagger.yaml
index adc19f98..81c96d96 100644
--- a/docs/swagger.yaml
+++ b/docs/swagger.yaml
@@ -1024,9 +1024,13 @@ definitions:
theme:
maxLength: 128
type: string
+ time_zone:
+ maxLength: 128
+ type: string
required:
- language
- theme
+ - time_zone
type: object
schema.SiteInterfaceResp:
properties:
@@ -1039,9 +1043,13 @@ definitions:
theme:
maxLength: 128
type: string
+ time_zone:
+ maxLength: 128
+ type: string
required:
- language
- theme
+ - time_zone
type: object
schema.TagItem:
properties:
@@ -1675,7 +1683,7 @@ paths:
- admin
/answer/admin/api/siteinfo/general:
get:
- description: Get siteinfo general
+ description: get site general information
produces:
- application/json
responses:
@@ -1690,11 +1698,11 @@ paths:
type: object
security:
- ApiKeyAuth: []
- summary: Get siteinfo general
+ summary: get site general information
tags:
- admin
put:
- description: Get siteinfo interface
+ description: update site general information
parameters:
- description: general
in: body
@@ -1711,12 +1719,12 @@ paths:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
- summary: Get siteinfo interface
+ summary: update site general information
tags:
- admin
/answer/admin/api/siteinfo/interface:
get:
- description: Get siteinfo interface
+ description: get site interface
parameters:
- description: general
in: body
@@ -1738,11 +1746,11 @@ paths:
type: object
security:
- ApiKeyAuth: []
- summary: Get siteinfo interface
+ summary: get site interface
tags:
- admin
put:
- description: Get siteinfo interface
+ description: update site info interface
parameters:
- description: general
in: body
@@ -1759,7 +1767,7 @@ paths:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
- summary: Get siteinfo interface
+ summary: update site info interface
tags:
- admin
/answer/admin/api/theme/options:
diff --git a/internal/controller_backyard/siteinfo_controller.go b/internal/controller_backyard/siteinfo_controller.go
index 30bfd1bf..821b517e 100644
--- a/internal/controller_backyard/siteinfo_controller.go
+++ b/internal/controller_backyard/siteinfo_controller.go
@@ -18,9 +18,9 @@ func NewSiteInfoController(siteInfoService *service.SiteInfoService) *SiteInfoCo
}
}
-// GetGeneral godoc
-// @Summary Get siteinfo general
-// @Description Get siteinfo general
+// GetGeneral get site general information
+// @Summary get site general information
+// @Description get site general information
// @Security ApiKeyAuth
// @Tags admin
// @Produce json
@@ -31,9 +31,9 @@ func (sc *SiteInfoController) GetGeneral(ctx *gin.Context) {
handler.HandleResponse(ctx, err, resp)
}
-// GetInterface godoc
-// @Summary Get siteinfo interface
-// @Description Get siteinfo interface
+// GetInterface get site interface
+// @Summary get site interface
+// @Description get site interface
// @Security ApiKeyAuth
// @Tags admin
// @Produce json
@@ -45,9 +45,9 @@ func (sc *SiteInfoController) GetInterface(ctx *gin.Context) {
handler.HandleResponse(ctx, err, resp)
}
-// UpdateGeneral godoc
-// @Summary Get siteinfo interface
-// @Description Get siteinfo interface
+// UpdateGeneral update site general information
+// @Summary update site general information
+// @Description update site general information
// @Security ApiKeyAuth
// @Tags admin
// @Produce json
@@ -63,9 +63,9 @@ func (sc *SiteInfoController) UpdateGeneral(ctx *gin.Context) {
handler.HandleResponse(ctx, err, nil)
}
-// UpdateInterface godoc
-// @Summary Get siteinfo interface
-// @Description Get siteinfo interface
+// UpdateInterface update site interface
+// @Summary update site info interface
+// @Description update site info interface
// @Security ApiKeyAuth
// @Tags admin
// @Produce json
diff --git a/internal/schema/siteinfo_schema.go b/internal/schema/siteinfo_schema.go
index ff93e72d..446b986d 100644
--- a/internal/schema/siteinfo_schema.go
+++ b/internal/schema/siteinfo_schema.go
@@ -2,16 +2,17 @@ package schema
// SiteGeneralReq site general request
type SiteGeneralReq struct {
- Name string `validate:"required,gt=1,lte=128" comment:"site name" form:"name" json:"name"`
- ShortDescription string `validate:"required,gt=3,lte=255" comment:"short site description" form:"short_description" json:"short_description"`
- Description string `validate:"required,gt=3,lte=2000" comment:"site description" form:"description" json:"description"`
+ Name string `validate:"required,gt=1,lte=128" form:"name" json:"name"`
+ ShortDescription string `validate:"required,gt=3,lte=255" form:"short_description" json:"short_description"`
+ Description string `validate:"required,gt=3,lte=2000" form:"description" json:"description"`
}
// SiteInterfaceReq site interface request
type SiteInterfaceReq struct {
- Logo string `validate:"omitempty,gt=0,lte=256" comment:"logo" form:"logo" json:"logo"`
- Theme string `validate:"required,gt=1,lte=128" comment:"theme" form:"theme" json:"theme"`
- Language string `validate:"required,gt=1,lte=128" comment:"interface language" form:"language" json:"language"`
+ Logo string `validate:"omitempty,gt=0,lte=256" form:"logo" json:"logo"`
+ Theme string `validate:"required,gt=1,lte=128" form:"theme" json:"theme"`
+ Language string `validate:"required,gt=1,lte=128" form:"language" json:"language"`
+ TimeZone string `validate:"required,gt=1,lte=128" form:"time_zone" json:"time_zone"`
}
// SiteGeneralResp site general response