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.

doc: update the swagger documentation

LinkinStar12b8dc726f18
diff --git a/docs/docs.go b/docs/docs.go
index eb097216..27ec7532 100644
--- a/docs/docs.go
+++ b/docs/docs.go
@@ -62,6 +62,12 @@ const docTemplate = `{
"description": "answer id or question title",
"name": "query",
"in": "query"
+ },
+ {
+ "type": "string",
+ "description": "question id",
+ "name": "question_id",
+ "in": "query"
}
],
"responses": {
@@ -143,11 +149,6 @@ const docTemplate = `{
},
"/answer/admin/api/language/options": {
"get": {
- "security": [
- {
- "ApiKeyAuth": []
- }
- ],
"description": "Get language options",
"produces": [
"application/json"
@@ -1443,11 +1444,6 @@ const docTemplate = `{
},
"/answer/api/v1/language/options": {
"get": {
- "security": [
- {
- "ApiKeyAuth": []
- }
- ],
"description": "Get language options",
"produces": [
"application/json"
@@ -3402,6 +3398,52 @@ const docTemplate = `{
}
}
},
+ "/answer/api/v1/user/interface": {
+ "put": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "UserUpdateInterface update user interface config",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "User"
+ ],
+ "summary": "UserUpdateInterface update user interface config",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "access-token",
+ "name": "Authorization",
+ "in": "header",
+ "required": true
+ },
+ {
+ "description": "UpdateInfoRequest",
+ "name": "data",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/schema.UpdateUserInterfaceRequest"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/handler.RespBody"
+ }
+ }
+ }
+ }
+ },
"/answer/api/v1/user/login/email": {
"post": {
"description": "UserEmailLogin",
@@ -3721,14 +3763,14 @@ const docTemplate = `{
}
}
},
- "/answer/api/v1/user/status": {
- "get": {
+ "/answer/api/v1/vote/down": {
+ "post": {
"security": [
{
"ApiKeyAuth": []
}
],
- "description": "get user status info",
+ "description": "add vote",
"consumes": [
"application/json"
],
@@ -3736,9 +3778,20 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "User"
+ "Activity"
+ ],
+ "summary": "vote down",
+ "parameters": [
+ {
+ "description": "vote",
+ "name": "data",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/schema.VoteReq"
+ }
+ }
],
- "summary": "get user status info",
"responses": {
"200": {
"description": "OK",
@@ -3751,7 +3804,7 @@ const docTemplate = `{
"type": "object",
"properties": {
"data": {
- "$ref": "#/definitions/schema.GetUserResp"
+ "$ref": "#/definitions/schema.VoteResp"
}
}
}
@@ -3761,7 +3814,7 @@ const docTemplate = `{
}
}
},
- "/answer/api/v1/vote/down": {
+ "/answer/api/v1/vote/up": {
"post": {
"security": [
{
@@ -3778,7 +3831,7 @@ const docTemplate = `{
"tags": [
"Activity"
],
- "summary": "vote down",
+ "summary": "vote up",
"parameters": [
{
"description": "vote",
@@ -3812,14 +3865,43 @@ const docTemplate = `{
}
}
},
- "/answer/api/v1/vote/up": {
+ "/installation/base-info": {
"post": {
- "security": [
+ "description": "init base info",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "installation"
+ ],
+ "summary": "init base info",
+ "parameters": [
{
- "ApiKeyAuth": []
+ "description": "InitBaseInfoReq",
+ "name": "data",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/install.InitBaseInfoReq"
+ }
}
],
- "description": "add vote",
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/handler.RespBody"
+ }
+ }
+ }
+ }
+ },
+ "/installation/config-file/check": {
+ "post": {
+ "description": "check config file if exist when installation",
"consumes": [
"application/json"
],
@@ -3827,17 +3909,52 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "Activity"
+ "installation"
],
- "summary": "vote up",
+ "summary": "check config file if exist when installation",
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/handler.RespBody"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/install.CheckConfigFileResp"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/installation/db/check": {
+ "post": {
+ "description": "check database if exist when installation",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "installation"
+ ],
+ "summary": "check database if exist when installation",
"parameters": [
{
- "description": "vote",
+ "description": "CheckDatabaseReq",
"name": "data",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/schema.VoteReq"
+ "$ref": "#/definitions/install.CheckDatabaseReq"
}
}
],
@@ -3853,7 +3970,76 @@ const docTemplate = `{
"type": "object",
"properties": {
"data": {
- "$ref": "#/definitions/schema.VoteResp"
+ "$ref": "#/definitions/install.CheckConfigFileResp"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/installation/init": {
+ "post": {
+ "description": "init environment",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "installation"
+ ],
+ "summary": "init environment",
+ "parameters": [
+ {
+ "description": "CheckDatabaseReq",
+ "name": "data",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/install.CheckDatabaseReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/handler.RespBody"
+ }
+ }
+ }
+ }
+ },
+ "/installation/language/options": {
+ "get": {
+ "description": "get installation language options",
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "Lang"
+ ],
+ "summary": "get installation language options",
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/handler.RespBody"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/translator.LangOption"
+ }
}
}
}
@@ -3961,6 +4147,94 @@ const docTemplate = `{
}
}
},
+ "install.CheckConfigFileResp": {
+ "type": "object",
+ "properties": {
+ "config_file_exist": {
+ "type": "boolean"
+ },
+ "db_connection_success": {
+ "type": "boolean"
+ },
+ "db_table_exist": {
+ "type": "boolean"
+ }
+ }
+ },
+ "install.CheckDatabaseReq": {
+ "type": "object",
+ "required": [
+ "db_type"
+ ],
+ "properties": {
+ "db_file": {
+ "type": "string"
+ },
+ "db_host": {
+ "type": "string"
+ },
+ "db_name": {
+ "type": "string"
+ },
+ "db_password": {
+ "type": "string"
+ },
+ "db_type": {
+ "type": "string",
+ "enum": [
+ "postgres",
+ "sqlite3",
+ "mysql"
+ ]
+ },
+ "db_username": {
+ "type": "string"
+ }
+ }
+ },
+ "install.InitBaseInfoReq": {
+ "type": "object",
+ "required": [
+ "contact_email",
+ "email",
+ "lang",
+ "name",
+ "password",
+ "site_name",
+ "site_url"
+ ],
+ "properties": {
+ "contact_email": {
+ "type": "string",
+ "maxLength": 500
+ },
+ "email": {
+ "type": "string",
+ "maxLength": 500
+ },
+ "lang": {
+ "type": "string",
+ "maxLength": 30
+ },
+ "name": {
+ "type": "string",
+ "maxLength": 30
+ },
+ "password": {
+ "type": "string",
+ "maxLength": 32,
+ "minLength": 8
+ },
+ "site_name": {
+ "type": "string",
+ "maxLength": 30
+ },
+ "site_url": {
+ "type": "string",
+ "maxLength": 512
+ }
+ }
+ },
"pager.PageModel": {
"type": "object",
"properties": {
@@ -4833,6 +5107,10 @@ const docTemplate = `{
"description": "is admin",
"type": "boolean"
},
+ "language": {
+ "description": "language",
+ "type": "string"
+ },
"last_login_date": {
"description": "last login date",
"type": "integer"
@@ -4929,6 +5207,10 @@ const docTemplate = `{
"description": "is admin",
"type": "boolean"
},
+ "language": {
+ "description": "language",
+ "type": "string"
+ },
"last_login_date": {
"description": "last login date",
"type": "integer"
@@ -5614,6 +5896,19 @@ const docTemplate = `{
}
}
},
+ "schema.UpdateUserInterfaceRequest": {
+ "type": "object",
+ "required": [
+ "language"
+ ],
+ "properties": {
+ "language": {
+ "description": "language",
+ "type": "string",
+ "maxLength": 100
+ }
+ }
+ },
"schema.UpdateUserStatusReq": {
"type": "object",
"required": [
@@ -5854,6 +6149,17 @@ const docTemplate = `{
"type": "integer"
}
}
+ },
+ "translator.LangOption": {
+ "type": "object",
+ "properties": {
+ "label": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ }
}
},
"securityDefinitions": {
diff --git a/docs/swagger.json b/docs/swagger.json
index a45709d0..39b4c363 100644
--- a/docs/swagger.json
+++ b/docs/swagger.json
@@ -50,6 +50,12 @@
"description": "answer id or question title",
"name": "query",
"in": "query"
+ },
+ {
+ "type": "string",
+ "description": "question id",
+ "name": "question_id",
+ "in": "query"
}
],
"responses": {
@@ -131,11 +137,6 @@
},
"/answer/admin/api/language/options": {
"get": {
- "security": [
- {
- "ApiKeyAuth": []
- }
- ],
"description": "Get language options",
"produces": [
"application/json"
@@ -1431,11 +1432,6 @@
},
"/answer/api/v1/language/options": {
"get": {
- "security": [
- {
- "ApiKeyAuth": []
- }
- ],
"description": "Get language options",
"produces": [
"application/json"
@@ -3390,6 +3386,52 @@
}
}
},
+ "/answer/api/v1/user/interface": {
+ "put": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "UserUpdateInterface update user interface config",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "User"
+ ],
+ "summary": "UserUpdateInterface update user interface config",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "access-token",
+ "name": "Authorization",
+ "in": "header",
+ "required": true
+ },
+ {
+ "description": "UpdateInfoRequest",
+ "name": "data",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/schema.UpdateUserInterfaceRequest"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/handler.RespBody"
+ }
+ }
+ }
+ }
+ },
"/answer/api/v1/user/login/email": {
"post": {
"description": "UserEmailLogin",
@@ -3709,14 +3751,14 @@
}
}
},
- "/answer/api/v1/user/status": {
- "get": {
+ "/answer/api/v1/vote/down": {
+ "post": {
"security": [
{
"ApiKeyAuth": []
}
],
- "description": "get user status info",
+ "description": "add vote",
"consumes": [
"application/json"
],
@@ -3724,9 +3766,20 @@
"application/json"
],
"tags": [
- "User"
+ "Activity"
+ ],
+ "summary": "vote down",
+ "parameters": [
+ {
+ "description": "vote",
+ "name": "data",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/schema.VoteReq"
+ }
+ }
],
- "summary": "get user status info",
"responses": {
"200": {
"description": "OK",
@@ -3739,7 +3792,7 @@
"type": "object",
"properties": {
"data": {
- "$ref": "#/definitions/schema.GetUserResp"
+ "$ref": "#/definitions/schema.VoteResp"
}
}
}
@@ -3749,7 +3802,7 @@
}
}
},
- "/answer/api/v1/vote/down": {
+ "/answer/api/v1/vote/up": {
"post": {
"security": [
{
@@ -3766,7 +3819,7 @@
"tags": [
"Activity"
],
- "summary": "vote down",
+ "summary": "vote up",
"parameters": [
{
"description": "vote",
@@ -3800,14 +3853,43 @@
}
}
},
- "/answer/api/v1/vote/up": {
+ "/installation/base-info": {
"post": {
- "security": [
+ "description": "init base info",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "installation"
+ ],
+ "summary": "init base info",
+ "parameters": [
{
- "ApiKeyAuth": []
+ "description": "InitBaseInfoReq",
+ "name": "data",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/install.InitBaseInfoReq"
+ }
}
],
- "description": "add vote",
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/handler.RespBody"
+ }
+ }
+ }
+ }
+ },
+ "/installation/config-file/check": {
+ "post": {
+ "description": "check config file if exist when installation",
"consumes": [
"application/json"
],
@@ -3815,17 +3897,52 @@
"application/json"
],
"tags": [
- "Activity"
+ "installation"
],
- "summary": "vote up",
+ "summary": "check config file if exist when installation",
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/handler.RespBody"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/install.CheckConfigFileResp"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/installation/db/check": {
+ "post": {
+ "description": "check database if exist when installation",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "installation"
+ ],
+ "summary": "check database if exist when installation",
"parameters": [
{
- "description": "vote",
+ "description": "CheckDatabaseReq",
"name": "data",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/schema.VoteReq"
+ "$ref": "#/definitions/install.CheckDatabaseReq"
}
}
],
@@ -3841,7 +3958,76 @@
"type": "object",
"properties": {
"data": {
- "$ref": "#/definitions/schema.VoteResp"
+ "$ref": "#/definitions/install.CheckConfigFileResp"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/installation/init": {
+ "post": {
+ "description": "init environment",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "installation"
+ ],
+ "summary": "init environment",
+ "parameters": [
+ {
+ "description": "CheckDatabaseReq",
+ "name": "data",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/install.CheckDatabaseReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/handler.RespBody"
+ }
+ }
+ }
+ }
+ },
+ "/installation/language/options": {
+ "get": {
+ "description": "get installation language options",
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "Lang"
+ ],
+ "summary": "get installation language options",
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/handler.RespBody"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/translator.LangOption"
+ }
}
}
}
@@ -3949,6 +4135,94 @@
}
}
},
+ "install.CheckConfigFileResp": {
+ "type": "object",
+ "properties": {
+ "config_file_exist": {
+ "type": "boolean"
+ },
+ "db_connection_success": {
+ "type": "boolean"
+ },
+ "db_table_exist": {
+ "type": "boolean"
+ }
+ }
+ },
+ "install.CheckDatabaseReq": {
+ "type": "object",
+ "required": [
+ "db_type"
+ ],
+ "properties": {
+ "db_file": {
+ "type": "string"
+ },
+ "db_host": {
+ "type": "string"
+ },
+ "db_name": {
+ "type": "string"
+ },
+ "db_password": {
+ "type": "string"
+ },
+ "db_type": {
+ "type": "string",
+ "enum": [
+ "postgres",
+ "sqlite3",
+ "mysql"
+ ]
+ },
+ "db_username": {
+ "type": "string"
+ }
+ }
+ },
+ "install.InitBaseInfoReq": {
+ "type": "object",
+ "required": [
+ "contact_email",
+ "email",
+ "lang",
+ "name",
+ "password",
+ "site_name",
+ "site_url"
+ ],
+ "properties": {
+ "contact_email": {
+ "type": "string",
+ "maxLength": 500
+ },
+ "email": {
+ "type": "string",
+ "maxLength": 500
+ },
+ "lang": {
+ "type": "string",
+ "maxLength": 30
+ },
+ "name": {
+ "type": "string",
+ "maxLength": 30
+ },
+ "password": {
+ "type": "string",
+ "maxLength": 32,
+ "minLength": 8
+ },
+ "site_name": {
+ "type": "string",
+ "maxLength": 30
+ },
+ "site_url": {
+ "type": "string",
+ "maxLength": 512
+ }
+ }
+ },
"pager.PageModel": {
"type": "object",
"properties": {
@@ -4821,6 +5095,10 @@
"description": "is admin",
"type": "boolean"
},
+ "language": {
+ "description": "language",
+ "type": "string"
+ },
"last_login_date": {
"description": "last login date",
"type": "integer"
@@ -4917,6 +5195,10 @@
"description": "is admin",
"type": "boolean"
},
+ "language": {
+ "description": "language",
+ "type": "string"
+ },
"last_login_date": {
"description": "last login date",
"type": "integer"
@@ -5602,6 +5884,19 @@
}
}
},
+ "schema.UpdateUserInterfaceRequest": {
+ "type": "object",
+ "required": [
+ "language"
+ ],
+ "properties": {
+ "language": {
+ "description": "language",
+ "type": "string",
+ "maxLength": 100
+ }
+ }
+ },
"schema.UpdateUserStatusReq": {
"type": "object",
"required": [
@@ -5842,6 +6137,17 @@
"type": "integer"
}
}
+ },
+ "translator.LangOption": {
+ "type": "object",
+ "properties": {
+ "label": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ }
}
},
"securityDefinitions": {
diff --git a/docs/swagger.yaml b/docs/swagger.yaml
index 17b2360a..72801460 100644
--- a/docs/swagger.yaml
+++ b/docs/swagger.yaml
@@ -20,6 +20,69 @@ definitions:
description: reason key
type: string
type: object
+ install.CheckConfigFileResp:
+ properties:
+ config_file_exist:
+ type: boolean
+ db_connection_success:
+ type: boolean
+ db_table_exist:
+ type: boolean
+ type: object
+ install.CheckDatabaseReq:
+ properties:
+ db_file:
+ type: string
+ db_host:
+ type: string
+ db_name:
+ type: string
+ db_password:
+ type: string
+ db_type:
+ enum:
+ - postgres
+ - sqlite3
+ - mysql
+ type: string
+ db_username:
+ type: string
+ required:
+ - db_type
+ type: object
+ install.InitBaseInfoReq:
+ properties:
+ contact_email:
+ maxLength: 500
+ type: string
+ email:
+ maxLength: 500
+ type: string
+ lang:
+ maxLength: 30
+ type: string
+ name:
+ maxLength: 30
+ type: string
+ password:
+ maxLength: 32
+ minLength: 8
+ type: string
+ site_name:
+ maxLength: 30
+ type: string
+ site_url:
+ maxLength: 512
+ type: string
+ required:
+ - contact_email
+ - email
+ - lang
+ - name
+ - password
+ - site_name
+ - site_url
+ type: object
pager.PageModel:
properties:
count:
@@ -652,6 +715,9 @@ definitions:
is_admin:
description: is admin
type: boolean
+ language:
+ description: language
+ type: string
last_login_date:
description: last login date
type: integer
@@ -723,6 +789,9 @@ definitions:
is_admin:
description: is admin
type: boolean
+ language:
+ description: language
+ type: string
last_login_date:
description: last login date
type: integer
@@ -1219,6 +1288,15 @@ definitions:
- synonym_tag_list
- tag_id
type: object
+ schema.UpdateUserInterfaceRequest:
+ properties:
+ language:
+ description: language
+ maxLength: 100
+ type: string
+ required:
+ - language
+ type: object
schema.UpdateUserStatusReq:
properties:
status:
@@ -1390,6 +1468,13 @@ definitions:
votes:
type: integer
type: object
+ translator.LangOption:
+ properties:
+ label:
+ type: string
+ value:
+ type: string
+ type: object
info:
contact: {}
paths:
@@ -1418,6 +1503,10 @@ paths:
in: query
name: query
type: string
+ - description: question id
+ in: query
+ name: question_id
+ type: string
produces:
- application/json
responses:
@@ -1481,8 +1570,6 @@ paths:
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
- security:
- - ApiKeyAuth: []
summary: Get language options
tags:
- Lang
@@ -2267,8 +2354,6 @@ paths:
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
- security:
- - ApiKeyAuth: []
summary: Get language options
tags:
- Lang
@@ -3455,6 +3540,35 @@ paths:
summary: UserUpdateInfo update user info
tags:
- User
+ /answer/api/v1/user/interface:
+ put:
+ consumes:
+ - application/json
+ description: UserUpdateInterface update user interface config
+ parameters:
+ - description: access-token
+ in: header
+ name: Authorization
+ required: true
+ type: string
+ - description: UpdateInfoRequest
+ in: body
+ name: data
+ required: true
+ schema:
+ $ref: '#/definitions/schema.UpdateUserInterfaceRequest'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/handler.RespBody'
+ security:
+ - ApiKeyAuth: []
+ summary: UserUpdateInterface update user interface config
+ tags:
+ - User
/answer/api/v1/user/login/email:
post:
consumes:
@@ -3647,11 +3761,18 @@ paths:
summary: UserRegisterByEmail
tags:
- User
- /answer/api/v1/user/status:
- get:
+ /answer/api/v1/vote/down:
+ post:
consumes:
- application/json
- description: get user status info
+ description: add vote
+ parameters:
+ - description: vote
+ in: body
+ name: data
+ required: true
+ schema:
+ $ref: '#/definitions/schema.VoteReq'
produces:
- application/json
responses:
@@ -3662,14 +3783,14 @@ paths:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
- $ref: '#/definitions/schema.GetUserResp'
+ $ref: '#/definitions/schema.VoteResp'
type: object
security:
- ApiKeyAuth: []
- summary: get user status info
+ summary: vote down
tags:
- - User
- /answer/api/v1/vote/down:
+ - Activity
+ /answer/api/v1/vote/up:
post:
consumes:
- application/json
@@ -3695,21 +3816,36 @@ paths:
type: object
security:
- ApiKeyAuth: []
- summary: vote down
+ summary: vote up
tags:
- Activity
- /answer/api/v1/vote/up:
+ /installation/base-info:
post:
consumes:
- application/json
- description: add vote
+ description: init base info
parameters:
- - description: vote
+ - description: InitBaseInfoReq
in: body
name: data
required: true
schema:
- $ref: '#/definitions/schema.VoteReq'
+ $ref: '#/definitions/install.InitBaseInfoReq'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/handler.RespBody'
+ summary: init base info
+ tags:
+ - installation
+ /installation/config-file/check:
+ post:
+ consumes:
+ - application/json
+ description: check config file if exist when installation
produces:
- application/json
responses:
@@ -3720,13 +3856,80 @@ paths:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
- $ref: '#/definitions/schema.VoteResp'
+ $ref: '#/definitions/install.CheckConfigFileResp'
type: object
- security:
- - ApiKeyAuth: []
- summary: vote up
+ summary: check config file if exist when installation
tags:
- - Activity
+ - installation
+ /installation/db/check:
+ post:
+ consumes:
+ - application/json
+ description: check database if exist when installation
+ parameters:
+ - description: CheckDatabaseReq
+ in: body
+ name: data
+ required: true
+ schema:
+ $ref: '#/definitions/install.CheckDatabaseReq'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ allOf:
+ - $ref: '#/definitions/handler.RespBody'
+ - properties:
+ data:
+ $ref: '#/definitions/install.CheckConfigFileResp'
+ type: object
+ summary: check database if exist when installation
+ tags:
+ - installation
+ /installation/init:
+ post:
+ consumes:
+ - application/json
+ description: init environment
+ parameters:
+ - description: CheckDatabaseReq
+ in: body
+ name: data
+ required: true
+ schema:
+ $ref: '#/definitions/install.CheckDatabaseReq'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/handler.RespBody'
+ summary: init environment
+ tags:
+ - installation
+ /installation/language/options:
+ get:
+ description: get installation language options
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ allOf:
+ - $ref: '#/definitions/handler.RespBody'
+ - properties:
+ data:
+ items:
+ $ref: '#/definitions/translator.LangOption'
+ type: array
+ type: object
+ summary: get installation language options
+ tags:
+ - Lang
/personal/question/page:
get:
consumes:
diff --git a/internal/install/install_controller.go b/internal/install/install_controller.go
index d7f8ebac..6963e44b 100644
--- a/internal/install/install_controller.go
+++ b/internal/install/install_controller.go
@@ -24,7 +24,7 @@ import (
// @Description get installation language options
// @Tags Lang
// @Produce json
-// @Success 200 {object} handler.RespBody{data=[]*translator.LangOption}
+// @Success 200 {object} handler.RespBody{data=[]translator.LangOption}
// @Router /installation/language/options [get]
func LangOptions(ctx *gin.Context) {
handler.HandleResponse(ctx, nil, translator.LanguageOptions)
@@ -94,7 +94,7 @@ func CheckDatabase(ctx *gin.Context) {
// @Accept json
// @Produce json
// @Param data body install.CheckDatabaseReq true "CheckDatabaseReq"
-// @Success 200 {object} handler.RespBody{data=install.CheckConfigFileResp{}}
+// @Success 200 {object} handler.RespBody{}
// @Router /installation/init [post]
func InitEnvironment(ctx *gin.Context) {
req := &CheckDatabaseReq{}
@@ -146,7 +146,7 @@ func InitEnvironment(ctx *gin.Context) {
// @Accept json
// @Produce json
// @Param data body install.InitBaseInfoReq true "InitBaseInfoReq"
-// @Success 200 {object} handler.RespBody{data=install.CheckConfigFileResp{}}
+// @Success 200 {object} handler.RespBody{}
// @Router /installation/base-info [post]
func InitBaseInfo(ctx *gin.Context) {
req := &InitBaseInfoReq{}