update custom_sidebar

This commit is contained in:
aichy126 2023-04-17 17:59:53 +08:00
parent 2bd0ef8a24
commit 910484013c
4 changed files with 348 additions and 4 deletions

View File

@ -662,6 +662,77 @@ const docTemplate = `{
}
}
},
"/answer/admin/api/setting/privileges": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "GetPrivilegesConfig get privileges config",
"produces": [
"application/json"
],
"tags": [
"admin"
],
"summary": "GetPrivilegesConfig get privileges config",
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/handler.RespBody"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/schema.GetPrivilegesConfigResp"
}
}
}
]
}
}
}
},
"put": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "update privileges config",
"produces": [
"application/json"
],
"tags": [
"admin"
],
"summary": "update privileges config",
"parameters": [
{
"description": "config",
"name": "data",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/schema.UpdatePrivilegesConfigReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handler.RespBody"
}
}
}
}
},
"/answer/admin/api/setting/smtp": {
"get": {
"security": [
@ -5780,6 +5851,17 @@ const docTemplate = `{
}
},
"definitions": {
"constant.Privilege": {
"type": "object",
"properties": {
"label": {
"type": "string"
},
"value": {
"type": "integer"
}
}
},
"handler.RespBody": {
"type": "object",
"properties": {
@ -6681,6 +6763,20 @@ const docTemplate = `{
}
}
},
"schema.GetPrivilegesConfigResp": {
"type": "object",
"properties": {
"options": {
"type": "array",
"items": {
"$ref": "#/definitions/schema.PrivilegeOption"
}
},
"selected_level": {
"type": "integer"
}
}
},
"schema.GetRankPersonalWithPageResp": {
"type": "object",
"properties": {
@ -7368,6 +7464,20 @@ const docTemplate = `{
}
}
},
"schema.PrivilegeOption": {
"type": "object",
"properties": {
"level": {
"type": "integer"
},
"privileges": {
"type": "array",
"items": {
"$ref": "#/definitions/constant.Privilege"
}
}
}
},
"schema.QuestionAdd": {
"type": "object",
"required": [
@ -7809,6 +7919,10 @@ const docTemplate = `{
"custom_header": {
"type": "string",
"maxLength": 65536
},
"custom_sidebar": {
"type": "string",
"maxLength": 65536
}
}
},
@ -7830,6 +7944,10 @@ const docTemplate = `{
"custom_header": {
"type": "string",
"maxLength": 65536
},
"custom_sidebar": {
"type": "string",
"maxLength": 65536
}
}
},
@ -8420,6 +8538,19 @@ const docTemplate = `{
}
}
},
"schema.UpdatePrivilegesConfigReq": {
"type": "object",
"required": [
"level"
],
"properties": {
"level": {
"type": "integer",
"maximum": 3,
"minimum": 1
}
}
},
"schema.UpdateSMTPConfigReq": {
"type": "object",
"properties": {

View File

@ -650,6 +650,77 @@
}
}
},
"/answer/admin/api/setting/privileges": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "GetPrivilegesConfig get privileges config",
"produces": [
"application/json"
],
"tags": [
"admin"
],
"summary": "GetPrivilegesConfig get privileges config",
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/handler.RespBody"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/schema.GetPrivilegesConfigResp"
}
}
}
]
}
}
}
},
"put": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "update privileges config",
"produces": [
"application/json"
],
"tags": [
"admin"
],
"summary": "update privileges config",
"parameters": [
{
"description": "config",
"name": "data",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/schema.UpdatePrivilegesConfigReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handler.RespBody"
}
}
}
}
},
"/answer/admin/api/setting/smtp": {
"get": {
"security": [
@ -5768,6 +5839,17 @@
}
},
"definitions": {
"constant.Privilege": {
"type": "object",
"properties": {
"label": {
"type": "string"
},
"value": {
"type": "integer"
}
}
},
"handler.RespBody": {
"type": "object",
"properties": {
@ -6669,6 +6751,20 @@
}
}
},
"schema.GetPrivilegesConfigResp": {
"type": "object",
"properties": {
"options": {
"type": "array",
"items": {
"$ref": "#/definitions/schema.PrivilegeOption"
}
},
"selected_level": {
"type": "integer"
}
}
},
"schema.GetRankPersonalWithPageResp": {
"type": "object",
"properties": {
@ -7356,6 +7452,20 @@
}
}
},
"schema.PrivilegeOption": {
"type": "object",
"properties": {
"level": {
"type": "integer"
},
"privileges": {
"type": "array",
"items": {
"$ref": "#/definitions/constant.Privilege"
}
}
}
},
"schema.QuestionAdd": {
"type": "object",
"required": [
@ -7797,6 +7907,10 @@
"custom_header": {
"type": "string",
"maxLength": 65536
},
"custom_sidebar": {
"type": "string",
"maxLength": 65536
}
}
},
@ -7818,6 +7932,10 @@
"custom_header": {
"type": "string",
"maxLength": 65536
},
"custom_sidebar": {
"type": "string",
"maxLength": 65536
}
}
},
@ -8408,6 +8526,19 @@
}
}
},
"schema.UpdatePrivilegesConfigReq": {
"type": "object",
"required": [
"level"
],
"properties": {
"level": {
"type": "integer",
"maximum": 3,
"minimum": 1
}
}
},
"schema.UpdateSMTPConfigReq": {
"type": "object",
"properties": {

View File

@ -1,4 +1,11 @@
definitions:
constant.Privilege:
properties:
label:
type: string
value:
type: integer
type: object
handler.RespBody:
properties:
code:
@ -631,6 +638,15 @@ definitions:
version:
type: string
type: object
schema.GetPrivilegesConfigResp:
properties:
options:
items:
$ref: '#/definitions/schema.PrivilegeOption'
type: array
selected_level:
type: integer
type: object
schema.GetRankPersonalWithPageResp:
properties:
answer_id:
@ -1126,6 +1142,15 @@ definitions:
content:
type: string
type: object
schema.PrivilegeOption:
properties:
level:
type: integer
privileges:
items:
$ref: '#/definitions/constant.Privilege'
type: array
type: object
schema.QuestionAdd:
properties:
content:
@ -1438,6 +1463,9 @@ definitions:
custom_header:
maxLength: 65536
type: string
custom_sidebar:
maxLength: 65536
type: string
type: object
schema.SiteCustomCssHTMLResp:
properties:
@ -1453,6 +1481,9 @@ definitions:
custom_header:
maxLength: 65536
type: string
custom_sidebar:
maxLength: 65536
type: string
type: object
schema.SiteGeneralReq:
properties:
@ -1860,6 +1891,15 @@ definitions:
required:
- plugin_slug_name
type: object
schema.UpdatePrivilegesConfigReq:
properties:
level:
maximum: 3
minimum: 1
type: integer
required:
- level
type: object
schema.UpdateSMTPConfigReq:
properties:
encryption:
@ -2596,6 +2636,47 @@ paths:
summary: get role list
tags:
- admin
/answer/admin/api/setting/privileges:
get:
description: GetPrivilegesConfig get privileges config
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
$ref: '#/definitions/schema.GetPrivilegesConfigResp'
type: object
security:
- ApiKeyAuth: []
summary: GetPrivilegesConfig get privileges config
tags:
- admin
put:
description: update privileges config
parameters:
- description: config
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.UpdatePrivilegesConfigReq'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: update privileges config
tags:
- admin
/answer/admin/api/setting/smtp:
get:
description: GetSMTPConfig get smtp config

View File

@ -114,10 +114,11 @@ type SiteLoginReq struct {
// SiteCustomCssHTMLReq site custom css html
type SiteCustomCssHTMLReq struct {
CustomHead string `validate:"omitempty,gt=0,lte=65536" json:"custom_head"`
CustomCss string `validate:"omitempty,gt=0,lte=65536" json:"custom_css"`
CustomHeader string `validate:"omitempty,gt=0,lte=65536" json:"custom_header"`
CustomFooter string `validate:"omitempty,gt=0,lte=65536" json:"custom_footer"`
CustomHead string `validate:"omitempty,gt=0,lte=65536" json:"custom_head"`
CustomCss string `validate:"omitempty,gt=0,lte=65536" json:"custom_css"`
CustomHeader string `validate:"omitempty,gt=0,lte=65536" json:"custom_header"`
CustomFooter string `validate:"omitempty,gt=0,lte=65536" json:"custom_footer"`
CustomSideBar string `validate:"omitempty,gt=0,lte=65536" json:"custom_sidebar"`
}
// SiteThemeReq site theme config