blob: a399b3bfd5dc0dc0d0b77418bd4fd5f41f8d2b8d [file] [log] [blame]
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
basePath: /
definitions:
constant.NotificationChannelKey:
enum:
- email
type: string
x-enum-varnames:
- EmailChannel
constant.Privilege:
properties:
key:
type: string
label:
type: string
value:
minimum: 1
type: integer
type: object
entity.BadgeLevel:
enum:
- 1
- 2
- 3
type: integer
x-enum-varnames:
- BadgeLevelBronze
- BadgeLevelSilver
- BadgeLevelGold
handler.RespBody:
properties:
code:
description: http code
type: integer
data:
description: response data
msg:
description: response message
type: string
reason:
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
ssl_cert:
type: string
ssl_enabled:
type: boolean
ssl_key:
type: string
ssl_mode:
type: string
ssl_root_cert:
type: string
required:
- db_type
type: object
install.InitBaseInfoReq:
properties:
contact_email:
maxLength: 500
type: string
email:
maxLength: 500
type: string
external_content_display:
enum:
- always_display
- ask_before_display
type: string
lang:
maxLength: 30
type: string
login_required:
type: boolean
name:
maxLength: 30
minLength: 2
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
- external_content_display
- lang
- name
- password
- site_name
- site_url
type: object
pager.PageModel:
properties:
count:
type: integer
list: {}
type: object
plugin.EmbedConfig:
properties:
enable:
type: boolean
platform:
type: string
type: object
plugin.RenderConfig:
properties:
select_theme:
type: string
type: object
schema.AcceptAnswerReq:
properties:
answer_id:
type: string
question_id:
maxLength: 30
type: string
required:
- question_id
type: object
schema.ActObjectInfo:
properties:
answer_id:
type: string
display_name:
type: string
main_tag_slug_name:
type: string
object_type:
type: string
question_id:
type: string
title:
type: string
username:
type: string
type: object
schema.ActObjectTimeline:
properties:
activity_id:
type: string
activity_type:
type: string
cancelled:
type: boolean
cancelled_at:
type: integer
comment:
type: string
created_at:
type: integer
object_id:
type: string
object_type:
type: string
revision_id:
type: string
user_info:
$ref: '#/definitions/schema.UserBasicInfo'
type: object
schema.ActionRecordResp:
properties:
captcha_id:
type: string
captcha_img:
type: string
verify:
type: boolean
type: object
schema.AddCommentReq:
properties:
captcha_code:
type: string
captcha_id:
type: string
mention_username_list:
description: '@ user id list'
items:
type: string
type: array
object_id:
description: object id
type: string
original_text:
description: original comment content
maxLength: 600
minLength: 2
type: string
reply_comment_id:
description: reply comment id
type: string
required:
- object_id
- original_text
type: object
schema.AddReportReq:
properties:
captcha_code:
type: string
captcha_id:
description: captcha_id
type: string
content:
description: report content
maxLength: 500
type: string
object_id:
description: object id
maxLength: 20
type: string
report_type:
description: report type
type: integer
required:
- object_id
- report_type
type: object
schema.AddTagReq:
properties:
display_name:
description: display_name
maxLength: 35
type: string
original_text:
description: original text
maxLength: 65536
type: string
slug_name:
description: slug_name
maxLength: 35
type: string
required:
- display_name
- original_text
- slug_name
type: object
schema.AddUserReq:
properties:
display_name:
maxLength: 30
minLength: 2
type: string
email:
maxLength: 500
type: string
password:
maxLength: 32
minLength: 8
type: string
required:
- display_name
- email
- password
type: object
schema.AddUsersReq:
properties:
users:
description: users info line by line
type: string
type: object
schema.AdminUpdateAnswerStatusReq:
properties:
answer_id:
type: string
status:
enum:
- available
- deleted
type: string
required:
- answer_id
- status
type: object
schema.AdminUpdateQuestionStatusReq:
properties:
question_id:
type: string
status:
enum:
- available
- closed
- deleted
type: string
required:
- question_id
- status
type: object
schema.AnswerAddReq:
properties:
captcha_code:
type: string
captcha_id:
type: string
content:
maxLength: 65535
minLength: 6
type: string
question_id:
type: string
required:
- content
type: object
schema.AnswerUpdateReq:
properties:
captcha_code:
type: string
captcha_id:
type: string
content:
maxLength: 65535
minLength: 6
type: string
edit_summary:
type: string
id:
type: string
question_id:
type: string
title:
type: string
required:
- content
type: object
schema.AvatarInfo:
properties:
custom:
maxLength: 200
type: string
gravatar:
maxLength: 200
type: string
type:
maxLength: 100
type: string
type: object
schema.BadgeListInfo:
properties:
award_count:
description: badge award count
type: integer
earned_count:
description: badge earned count
type: integer
icon:
description: badge icon
type: string
id:
description: badge id
type: string
level:
allOf:
- $ref: '#/definitions/entity.BadgeLevel'
description: badge level
name:
description: badge name
type: string
type: object
schema.BadgeStatus:
enum:
- active
- inactive
type: string
x-enum-varnames:
- BadgeStatusActive
- BadgeStatusInactive
schema.CloseQuestionReq:
properties:
close_msg:
description: close_type
type: string
close_type:
description: close_type
type: integer
id:
type: string
required:
- id
type: object
schema.CollectionSwitchReq:
properties:
bookmark:
type: boolean
group_id:
type: string
object_id:
type: string
required:
- group_id
- object_id
type: object
schema.CollectionSwitchResp:
properties:
object_collection_count:
type: integer
type: object
schema.ConfigField:
properties:
description:
type: string
name:
type: string
options:
items:
$ref: '#/definitions/schema.ConfigFieldOption'
type: array
required:
type: boolean
title:
type: string
type:
type: string
ui_options:
$ref: '#/definitions/schema.ConfigFieldUIOptions'
value: {}
type: object
schema.ConfigFieldOption:
properties:
label:
type: string
value:
type: string
type: object
schema.ConfigFieldUIOptions:
properties:
action:
$ref: '#/definitions/schema.UIOptionAction'
class_name:
type: string
field_class_name:
type: string
input_type:
type: string
label:
type: string
placeholder:
type: string
rows:
type: string
text:
type: string
variant:
type: string
type: object
schema.ConnectorInfoResp:
properties:
icon:
type: string
link:
type: string
name:
type: string
type: object
schema.ConnectorUserInfoResp:
properties:
binding:
type: boolean
external_id:
type: string
icon:
type: string
link:
type: string
name:
type: string
type: object
schema.DeletePermanentlyReq:
properties:
type:
enum:
- users
- questions
- answers
type: string
required:
- type
type: object
schema.EditUserProfileReq:
properties:
display_name:
maxLength: 30
minLength: 2
type: string
email:
maxLength: 500
type: string
user_id:
type: string
username:
maxLength: 30
minLength: 2
type: string
required:
- display_name
- email
- user_id
type: object
schema.ExternalLoginBindingUserSendEmailReq:
properties:
binding_key:
maxLength: 100
type: string
email:
maxLength: 512
type: string
must:
description: |-
If must is true, whatever email if exists, try to bind user.
If must is false, when email exist, will only be prompted with a warning.
type: boolean
required:
- binding_key
- email
type: object
schema.ExternalLoginBindingUserSendEmailResp:
properties:
access_token:
type: string
email_exist_and_must_be_confirmed:
type: boolean
type: object
schema.ExternalLoginUnbindingReq:
properties:
external_id:
maxLength: 128
type: string
required:
- external_id
type: object
schema.FollowReq:
properties:
is_cancel:
description: is cancel
type: boolean
object_id:
description: object id
type: string
required:
- object_id
type: object
schema.FollowResp:
properties:
follows:
description: the followers of object
type: integer
is_followed:
description: if user is followed object will be true,otherwise false
type: boolean
type: object
schema.GetBadgeInfoResp:
properties:
award_count:
description: badge award count
type: integer
description:
description: badge description
type: string
earned_count:
description: badge earned count
type: integer
icon:
description: badge icon
type: string
id:
description: badge id
type: string
is_single:
description: badge is single or multiple
type: boolean
level:
allOf:
- $ref: '#/definitions/entity.BadgeLevel'
description: badge level
name:
description: badge name
type: string
type: object
schema.GetBadgeListPagedResp:
properties:
award_count:
description: badge award count
type: integer
description:
description: badge description
type: string
earned:
description: badge earned count
type: boolean
group_name:
description: badge group name
type: string
icon:
description: badge icon
type: string
id:
description: badge id
type: string
level:
allOf:
- $ref: '#/definitions/entity.BadgeLevel'
description: badge level
name:
description: badge name
type: string
status:
allOf:
- $ref: '#/definitions/schema.BadgeStatus'
description: badge status
type: object
schema.GetBadgeListResp:
properties:
badges:
description: badge list info
items:
$ref: '#/definitions/schema.BadgeListInfo'
type: array
group_name:
description: badge group name
type: string
type: object
schema.GetCommentPersonalWithPageResp:
properties:
answer_id:
description: answer id
type: string
comment_id:
description: comment id
type: string
content:
description: content
type: string
created_at:
description: create time
type: integer
object_id:
description: object id
type: string
object_type:
description: object type
enum:
- question
- answer
- tag
- comment
type: string
question_id:
description: question id
type: string
title:
description: title
type: string
url_title:
description: url title
type: string
type: object
schema.GetCommentResp:
properties:
comment_id:
description: comment id
type: string
created_at:
description: create time
type: integer
is_vote:
description: current user if already vote this comment
type: boolean
member_actions:
description: MemberActions
items:
$ref: '#/definitions/schema.PermissionMemberAction'
type: array
object_id:
description: object id
type: string
original_text:
description: original comment content
type: string
parsed_text:
description: parsed comment content
type: string
reply_comment_id:
description: reply comment id
type: string
reply_user_display_name:
description: reply user display name
type: string
reply_user_id:
description: reply user id
type: string
reply_user_status:
description: reply user status
type: string
reply_username:
description: reply user username
type: string
user_avatar:
description: user avatar
type: string
user_display_name:
description: user display name
type: string
user_id:
description: user id
type: string
user_status:
description: user status
type: string
username:
description: username
type: string
vote_count:
description: user vote amount
type: integer
type: object
schema.GetCurrentLoginUserInfoResp:
properties:
access_token:
description: access token
type: string
answer_count:
description: answer count
type: integer
authority_group:
description: authority group
type: integer
avatar:
$ref: '#/definitions/schema.AvatarInfo'
bio:
description: bio markdown
type: string
bio_html:
description: bio html
type: string
color_scheme:
description: Color scheme
type: string
created_at:
description: create time
type: integer
display_name:
description: display name
type: string
e_mail:
description: email
type: string
follow_count:
description: follow count
type: integer
have_password:
description: user have password
type: boolean
id:
description: user id
type: string
language:
description: language
type: string
last_login_date:
description: last login date
type: integer
location:
description: location
type: string
mail_status:
description: mail status(1 pass 2 to be verified)
type: integer
mobile:
description: mobile
type: string
notice_status:
description: notice status(1 on 2off)
type: integer
question_count:
description: question count
type: integer
rank:
description: rank
type: integer
role_id:
description: role id
type: integer
status:
description: user status
type: string
username:
description: username
type: string
visit_token:
description: visit token
type: string
website:
description: website
type: string
type: object
schema.GetFollowingTagsResp:
properties:
display_name:
description: display name
type: string
main_tag_slug_name:
description: if main tag slug name is not empty, this tag is synonymous with
the main tag
type: string
recommend:
type: boolean
reserved:
type: boolean
slug_name:
description: slug name
type: string
tag_id:
description: tag id
type: string
type: object
schema.GetObjectTimelineResp:
properties:
object_info:
$ref: '#/definitions/schema.ActObjectInfo'
timeline:
items:
$ref: '#/definitions/schema.ActObjectTimeline'
type: array
type: object
schema.GetOtherUserInfoByUsernameResp:
properties:
answer_count:
description: answer count
type: integer
avatar:
description: avatar
type: string
bio:
description: bio markdown
type: string
bio_html:
description: bio html
type: string
created_at:
description: create time
type: integer
display_name:
description: display name
type: string
follow_count:
description: |-
email
follow count
type: integer
id:
description: user id
type: string
last_login_date:
description: last login date
type: integer
location:
description: location
type: string
mobile:
description: mobile
type: string
question_count:
description: question count
type: integer
rank:
description: rank
type: integer
status:
type: string
status_msg:
type: string
username:
description: username
type: string
website:
description: website
type: string
type: object
schema.GetOtherUserInfoResp:
properties:
info:
$ref: '#/definitions/schema.GetOtherUserInfoByUsernameResp'
type: object
schema.GetPluginConfigResp:
properties:
config_fields:
items:
$ref: '#/definitions/schema.ConfigField'
type: array
description:
type: string
name:
type: string
slug_name:
type: string
version:
type: string
type: object
schema.GetPluginListResp:
properties:
description:
type: string
enabled:
type: boolean
have_config:
type: boolean
link:
type: string
name:
type: string
slug_name:
type: string
version:
type: string
type: object
schema.GetPrivilegesConfigResp:
properties:
options:
items:
$ref: '#/definitions/schema.PrivilegeOption'
type: array
selected_level:
$ref: '#/definitions/schema.PrivilegeLevel'
type: object
schema.GetRankPersonalPageResp:
properties:
answer_id:
description: answer id
type: string
content:
description: content
type: string
created_at:
description: create time
type: integer
object_id:
description: object id
type: string
object_type:
description: object type
enum:
- question
- answer
- tag
- comment
type: string
question_id:
description: question id
type: string
rank_type:
description: rank type
type: string
reputation:
description: reputation
type: integer
title:
description: title
type: string
url_title:
description: url title
type: string
type: object
schema.GetReportListPageResp:
properties:
answer_accepted:
type: boolean
answer_count:
type: integer
answer_id:
type: string
author_user_info:
$ref: '#/definitions/schema.UserBasicInfo'
comment_id:
type: string
created_at:
type: integer
flag_id:
type: string
object_id:
type: string
object_show_status:
type: integer
object_status:
type: integer
object_type:
enum:
- question
- answer
- comment
type: string
original_text:
type: string
parsed_text:
type: string
question_id:
type: string
reason:
$ref: '#/definitions/schema.ReasonItem'
reason_content:
type: string
submit_at:
type: integer
submitter_user:
$ref: '#/definitions/schema.UserBasicInfo'
tags:
items:
$ref: '#/definitions/schema.TagResp'
type: array
title:
type: string
url_title:
type: string
type: object
schema.GetReviewingTypeResp:
properties:
label:
type: string
name:
type: string
todo_amount:
type: integer
type: object
schema.GetRevisionResp:
properties:
content: {}
create_at:
type: integer
id:
type: string
object_id:
type: string
reason:
type: string
status:
type: integer
title:
type: string
url_title:
type: string
use_id:
type: string
user_info:
$ref: '#/definitions/schema.UserBasicInfo'
type: object
schema.GetRoleResp:
properties:
description:
type: string
id:
type: integer
name:
type: string
type: object
schema.GetSMTPConfigResp:
properties:
encryption:
description: '"" SSL TLS'
type: string
from_email:
type: string
from_name:
type: string
smtp_authentication:
type: boolean
smtp_host:
type: string
smtp_password:
type: string
smtp_port:
type: integer
smtp_username:
type: string
type: object
schema.GetSiteLegalInfoResp:
properties:
privacy_policy_original_text:
type: string
privacy_policy_parsed_text:
type: string
terms_of_service_original_text:
type: string
terms_of_service_parsed_text:
type: string
type: object
schema.GetTagBasicResp:
properties:
display_name:
type: string
recommend:
type: boolean
reserved:
type: boolean
slug_name:
type: string
tag_id:
type: string
type: object
schema.GetTagPageResp:
properties:
created_at:
description: created time
type: integer
description:
description: description
type: string
display_name:
description: display_name
type: string
excerpt:
description: excerpt
type: string
follow_count:
description: follower amount
type: integer
is_follower:
description: is follower
type: boolean
original_text:
description: original text
type: string
parsed_text:
description: parsed_text
type: string
question_count:
description: question amount
type: integer
recommend:
type: boolean
reserved:
type: boolean
slug_name:
description: slug_name
type: string
tag_id:
description: tag_id
type: string
updated_at:
description: updated time
type: integer
type: object
schema.GetTagResp:
properties:
created_at:
type: integer
description:
type: string
display_name:
type: string
excerpt:
type: string
follow_count:
type: integer
is_follower:
type: boolean
main_tag_slug_name:
description: if main tag slug name is not empty, this tag is synonymous with
the main tag
type: string
member_actions:
items:
$ref: '#/definitions/schema.PermissionMemberAction'
type: array
original_text:
type: string
parsed_text:
type: string
question_count:
type: integer
recommend:
type: boolean
reserved:
type: boolean
slug_name:
type: string
status:
type: string
tag_id:
type: string
updated_at:
type: integer
type: object
schema.GetTagSynonymsResp:
properties:
member_actions:
description: MemberActions
items:
$ref: '#/definitions/schema.PermissionMemberAction'
type: array
synonyms:
description: synonyms
items:
$ref: '#/definitions/schema.TagSynonym'
type: array
type: object
schema.GetUnreviewedPostPageResp:
properties:
answer_id:
type: string
author_user_info:
$ref: '#/definitions/schema.UserBasicInfo'
comment_id:
type: string
created_at:
type: integer
object_id:
type: string
object_show_status:
type: integer
object_status:
type: integer
object_type:
enum:
- question
- answer
- comment
type: string
original_text:
type: string
parsed_text:
type: string
question_id:
type: string
reason:
type: string
review_id:
type: integer
submit_at:
type: integer
submitter_display_name:
type: string
tags:
items:
$ref: '#/definitions/schema.TagResp'
type: array
title:
type: string
url_title:
type: string
type: object
schema.GetUnreviewedRevisionResp:
properties:
info:
$ref: '#/definitions/schema.UnreviewedRevisionInfoInfo'
type:
type: string
unreviewed_info:
$ref: '#/definitions/schema.GetRevisionResp'
type: object
schema.GetUserActivationResp:
properties:
activation_url:
type: string
type: object
schema.GetUserBadgeAwardListResp:
properties:
earned_count:
description: badge award count
type: integer
icon:
description: badge icon
type: string
id:
description: badge id
type: string
level:
allOf:
- $ref: '#/definitions/entity.BadgeLevel'
description: badge level
name:
description: badge name
type: string
type: object
schema.GetUserNotificationConfigResp:
properties:
all_new_question:
$ref: '#/definitions/schema.NotificationChannelConfig'
all_new_question_for_following_tags:
$ref: '#/definitions/schema.NotificationChannelConfig'
inbox:
$ref: '#/definitions/schema.NotificationChannelConfig'
type: object
schema.GetUserPageResp:
properties:
avatar:
description: avatar
type: string
created_at:
description: create time
type: integer
deleted_at:
description: delete time
type: integer
display_name:
description: display name
type: string
e_mail:
description: email
type: string
rank:
description: rank
type: integer
role_id:
description: role id
type: integer
role_name:
description: role name
type: string
status:
description: user status(normal,suspended,deleted,inactive)
type: string
suspended_at:
description: suspended time
type: integer
user_id:
description: user id
type: string
username:
description: username
type: string
type: object
schema.GetUserPluginListResp:
properties:
name:
type: string
slug_name:
type: string
type: object
schema.GetUserStaffResp:
properties:
avatar:
description: avatar
type: string
display_name:
description: display name
type: string
username:
description: username
type: string
type: object
schema.GetVoteWithPageResp:
properties:
answer_id:
description: answer id
type: string
content:
description: content
type: string
created_at:
description: create time
type: integer
object_id:
description: object id
type: string
object_type:
description: object type
enum:
- question
- answer
- tag
- comment
type: string
question_id:
description: question id
type: string
title:
description: title
type: string
url_title:
description: url title
type: string
vote_type:
description: vote type
type: string
type: object
schema.LoadingAction:
properties:
state:
type: string
text:
type: string
type: object
schema.NotificationChannelConfig:
properties:
enable:
type: boolean
key:
$ref: '#/definitions/constant.NotificationChannelKey'
type: object
schema.NotificationClearIDRequest:
properties:
id:
type: string
type: object
schema.NotificationClearRequest:
properties:
type:
enum:
- inbox
- achievement
type: string
required:
- type
type: object
schema.OnCompleteAction:
properties:
refresh_form_config:
type: boolean
toast_return_message:
type: boolean
type: object
schema.OperationQuestionReq:
properties:
id:
type: string
operation:
description: operation [pin unpin hide show]
type: string
required:
- id
type: object
schema.PermissionMemberAction:
properties:
action:
type: string
name:
type: string
type:
type: string
type: object
schema.PostRenderReq:
properties:
content:
type: string
type: object
schema.PrivilegeLevel:
enum:
- 1
- 2
- 3
- 99
type: integer
x-enum-varnames:
- PrivilegeLevel1
- PrivilegeLevel2
- PrivilegeLevel3
- PrivilegeLevelCustom
schema.PrivilegeOption:
properties:
level:
$ref: '#/definitions/schema.PrivilegeLevel'
level_desc:
type: string
privileges:
items:
$ref: '#/definitions/constant.Privilege'
type: array
type: object
schema.QuestionAdd:
properties:
captcha_code:
type: string
captcha_id:
description: captcha_id
type: string
content:
description: content
maxLength: 65535
minLength: 6
type: string
tags:
description: tags
items:
$ref: '#/definitions/schema.TagItem'
type: array
title:
description: question title
maxLength: 150
minLength: 6
type: string
required:
- content
- tags
- title
type: object
schema.QuestionAddByAnswer:
properties:
answer_content:
maxLength: 65535
minLength: 6
type: string
captcha_code:
type: string
captcha_id:
description: captcha_id
type: string
content:
description: content
maxLength: 65535
minLength: 6
type: string
mention_username_list:
items:
type: string
type: array
tags:
description: tags
items:
$ref: '#/definitions/schema.TagItem'
type: array
title:
description: question title
maxLength: 150
minLength: 6
type: string
required:
- answer_content
- content
- tags
- title
type: object
schema.QuestionPageReq:
properties:
in_days:
minimum: 1
type: integer
order:
enum:
- newest
- active
- hot
- score
- unanswered
- recommend
- frequent
type: string
page:
minimum: 1
type: integer
page_size:
minimum: 1
type: integer
tag:
maxLength: 100
type: string
username:
maxLength: 100
type: string
type: object
schema.QuestionPageResp:
properties:
accepted_answer_id:
description: answer information
type: string
answer_count:
type: integer
collection_count:
type: integer
created_at:
type: integer
description:
type: string
follow_count:
type: integer
id:
type: string
last_answer_id:
type: string
operated_at:
description: operator information
type: integer
operation_type:
type: string
operator:
$ref: '#/definitions/schema.QuestionPageRespOperator'
pin:
description: '1: unpin, 2: pin'
type: integer
show:
description: '0: show, 1: hide'
type: integer
status:
type: integer
tags:
items:
$ref: '#/definitions/schema.TagResp'
type: array
title:
type: string
unique_view_count:
type: integer
url_title:
type: string
view_count:
description: question statistical information
type: integer
vote_count:
type: integer
type: object
schema.QuestionPageRespOperator:
properties:
avatar:
type: string
display_name:
type: string
id:
type: string
rank:
type: integer
status:
type: string
username:
type: string
type: object
schema.QuestionRecoverReq:
properties:
question_id:
type: string
required:
- question_id
type: object
schema.QuestionUpdate:
properties:
captcha_code:
type: string
captcha_id:
description: captcha_id
type: string
content:
description: content
maxLength: 65535
minLength: 6
type: string
edit_summary:
description: edit summary
type: string
id:
description: question id
type: string
invite_user:
items:
type: string
type: array
tags:
description: tags
items:
$ref: '#/definitions/schema.TagItem'
type: array
title:
description: question title
maxLength: 150
minLength: 6
type: string
required:
- content
- id
- tags
- title
type: object
schema.QuestionUpdateInviteUser:
properties:
captcha_code:
type: string
captcha_id:
description: captcha_id
type: string
id:
type: string
invite_user:
items:
type: string
type: array
required:
- id
type: object
schema.ReactionRespItem:
properties:
count:
description: Count is the number of users who reacted
type: integer
emoji:
description: Emoji is the reaction emoji
type: string
is_active:
description: IsActive is if current user has reacted
type: boolean
tooltip:
description: Tooltip is the user's name who reacted
type: string
type: object
schema.ReasonItem:
properties:
content_type:
type: string
description:
type: string
name:
type: string
placeholder:
type: string
reason_key:
type: string
reason_type:
type: integer
type: object
schema.RecoverAnswerReq:
properties:
answer_id:
type: string
required:
- answer_id
type: object
schema.RecoverTagReq:
properties:
tag_id:
type: string
required:
- tag_id
type: object
schema.RemoveAnswerReq:
properties:
captcha_code:
type: string
captcha_id:
type: string
id:
type: string
required:
- id
type: object
schema.RemoveCommentReq:
properties:
captcha_code:
type: string
captcha_id:
type: string
comment_id:
description: comment id
type: string
required:
- comment_id
type: object
schema.RemoveQuestionReq:
properties:
captcha_code:
type: string
captcha_id:
description: captcha_id
type: string
id:
description: question id
type: string
required:
- id
type: object
schema.RemoveTagReq:
properties:
tag_id:
description: tag_id
type: string
required:
- tag_id
type: object
schema.ReopenQuestionReq:
properties:
question_id:
type: string
type: object
schema.ReviewReportReq:
properties:
close_msg:
type: string
close_type:
type: integer
content:
maxLength: 65535
minLength: 6
type: string
flag_id:
type: string
operation_type:
enum:
- edit_post
- close_post
- delete_post
- unlist_post
- ignore_report
type: string
tags:
items:
$ref: '#/definitions/schema.TagItem'
type: array
title:
maxLength: 150
minLength: 6
type: string
required:
- flag_id
- operation_type
type: object
schema.RevisionAuditReq:
properties:
id:
description: object id
type: string
operation:
description: approve or reject
type: string
required:
- id
- operation
type: object
schema.SearchObject:
properties:
accepted:
type: boolean
answer_count:
type: integer
created_at:
type: integer
excerpt:
type: string
id:
type: string
question_id:
type: string
status:
description: Status
type: string
tags:
description: tags
items:
$ref: '#/definitions/schema.TagResp'
type: array
title:
type: string
url_title:
type: string
user_info:
allOf:
- $ref: '#/definitions/schema.SearchObjectUser'
description: user info
vote_count:
type: integer
type: object
schema.SearchObjectUser:
properties:
display_name:
type: string
id:
type: string
rank:
type: integer
status:
type: string
username:
type: string
type: object
schema.SearchResp:
properties:
count:
type: integer
list:
description: search response
items:
$ref: '#/definitions/schema.SearchResult'
type: array
type: object
schema.SearchResult:
properties:
object:
allOf:
- $ref: '#/definitions/schema.SearchObject'
description: this object
object_type:
description: object_type
type: string
type: object
schema.SendUserActivationReq:
properties:
user_id:
type: string
required:
- user_id
type: object
schema.SiteBrandingReq:
properties:
favicon:
maxLength: 512
type: string
logo:
maxLength: 512
type: string
mobile_logo:
maxLength: 512
type: string
square_icon:
maxLength: 512
type: string
type: object
schema.SiteBrandingResp:
properties:
favicon:
maxLength: 512
type: string
logo:
maxLength: 512
type: string
mobile_logo:
maxLength: 512
type: string
square_icon:
maxLength: 512
type: string
type: object
schema.SiteCustomCssHTMLReq:
properties:
custom_css:
maxLength: 65536
type: string
custom_footer:
maxLength: 65536
type: string
custom_head:
maxLength: 65536
type: string
custom_header:
maxLength: 65536
type: string
custom_sidebar:
maxLength: 65536
type: string
type: object
schema.SiteCustomCssHTMLResp:
properties:
custom_css:
maxLength: 65536
type: string
custom_footer:
maxLength: 65536
type: string
custom_head:
maxLength: 65536
type: string
custom_header:
maxLength: 65536
type: string
custom_sidebar:
maxLength: 65536
type: string
type: object
schema.SiteGeneralReq:
properties:
check_update:
type: boolean
contact_email:
maxLength: 512
type: string
description:
maxLength: 2000
type: string
name:
maxLength: 128
type: string
short_description:
maxLength: 255
type: string
site_url:
maxLength: 512
type: string
required:
- contact_email
- name
- site_url
type: object
schema.SiteGeneralResp:
properties:
check_update:
type: boolean
contact_email:
maxLength: 512
type: string
description:
maxLength: 2000
type: string
name:
maxLength: 128
type: string
short_description:
maxLength: 255
type: string
site_url:
maxLength: 512
type: string
required:
- contact_email
- name
- site_url
type: object
schema.SiteInfoResp:
properties:
branding:
$ref: '#/definitions/schema.SiteBrandingResp'
custom_css_html:
$ref: '#/definitions/schema.SiteCustomCssHTMLResp'
general:
$ref: '#/definitions/schema.SiteGeneralResp'
interface:
$ref: '#/definitions/schema.SiteInterfaceResp'
login:
$ref: '#/definitions/schema.SiteLoginResp'
revision:
type: string
site_legal:
$ref: '#/definitions/schema.SiteLegalSimpleResp'
site_seo:
$ref: '#/definitions/schema.SiteSeoResp'
site_users:
$ref: '#/definitions/schema.SiteUsersResp'
site_write:
$ref: '#/definitions/schema.SiteWriteResp'
theme:
$ref: '#/definitions/schema.SiteThemeResp'
version:
type: string
type: object
schema.SiteInterfaceReq:
properties:
language:
maxLength: 128
type: string
time_zone:
maxLength: 128
type: string
required:
- language
- time_zone
type: object
schema.SiteInterfaceResp:
properties:
language:
maxLength: 128
type: string
time_zone:
maxLength: 128
type: string
required:
- language
- time_zone
type: object
schema.SiteLegalReq:
properties:
external_content_display:
enum:
- always_display
- ask_before_display
type: string
privacy_policy_original_text:
type: string
privacy_policy_parsed_text:
type: string
terms_of_service_original_text:
type: string
terms_of_service_parsed_text:
type: string
required:
- external_content_display
type: object
schema.SiteLegalResp:
properties:
external_content_display:
enum:
- always_display
- ask_before_display
type: string
privacy_policy_original_text:
type: string
privacy_policy_parsed_text:
type: string
terms_of_service_original_text:
type: string
terms_of_service_parsed_text:
type: string
required:
- external_content_display
type: object
schema.SiteLegalSimpleResp:
properties:
external_content_display:
enum:
- always_display
- ask_before_display
type: string
required:
- external_content_display
type: object
schema.SiteLoginReq:
properties:
allow_email_domains:
items:
type: string
type: array
allow_email_registrations:
type: boolean
allow_new_registrations:
type: boolean
allow_password_login:
type: boolean
login_required:
type: boolean
type: object
schema.SiteLoginResp:
properties:
allow_email_domains:
items:
type: string
type: array
allow_email_registrations:
type: boolean
allow_new_registrations:
type: boolean
allow_password_login:
type: boolean
login_required:
type: boolean
type: object
schema.SiteSeoReq:
properties:
permalink:
maximum: 4
minimum: 0
type: integer
robots:
type: string
required:
- permalink
- robots
type: object
schema.SiteSeoResp:
properties:
permalink:
maximum: 4
minimum: 0
type: integer
robots:
type: string
required:
- permalink
- robots
type: object
schema.SiteThemeReq:
properties:
color_scheme:
maxLength: 100
type: string
theme:
maxLength: 255
type: string
theme_config:
additionalProperties: true
type: object
required:
- theme
type: object
schema.SiteThemeResp:
properties:
color_scheme:
type: string
theme:
type: string
theme_config:
additionalProperties: true
type: object
theme_options:
items:
$ref: '#/definitions/schema.ThemeOption'
type: array
type: object
schema.SiteUsersReq:
properties:
allow_update_avatar:
type: boolean
allow_update_bio:
type: boolean
allow_update_display_name:
type: boolean
allow_update_location:
type: boolean
allow_update_username:
type: boolean
allow_update_website:
type: boolean
default_avatar:
enum:
- system
- gravatar
type: string
gravatar_base_url:
type: string
required:
- default_avatar
type: object
schema.SiteUsersResp:
properties:
allow_update_avatar:
type: boolean
allow_update_bio:
type: boolean
allow_update_display_name:
type: boolean
allow_update_location:
type: boolean
allow_update_username:
type: boolean
allow_update_website:
type: boolean
default_avatar:
enum:
- system
- gravatar
type: string
gravatar_base_url:
type: string
required:
- default_avatar
type: object
schema.SiteWriteReq:
properties:
authorized_attachment_extensions:
items:
type: string
type: array
authorized_image_extensions:
items:
type: string
type: array
max_attachment_size:
type: integer
max_image_megapixel:
type: integer
max_image_size:
type: integer
recommend_tags:
items:
$ref: '#/definitions/schema.SiteWriteTag'
type: array
required_tag:
type: boolean
reserved_tags:
items:
$ref: '#/definitions/schema.SiteWriteTag'
type: array
restrict_answer:
type: boolean
type: object
schema.SiteWriteResp:
properties:
authorized_attachment_extensions:
items:
type: string
type: array
authorized_image_extensions:
items:
type: string
type: array
max_attachment_size:
type: integer
max_image_megapixel:
type: integer
max_image_size:
type: integer
recommend_tags:
items:
$ref: '#/definitions/schema.SiteWriteTag'
type: array
required_tag:
type: boolean
reserved_tags:
items:
$ref: '#/definitions/schema.SiteWriteTag'
type: array
restrict_answer:
type: boolean
type: object
schema.SiteWriteTag:
properties:
display_name:
type: string
slug_name:
type: string
required:
- slug_name
type: object
schema.TagItem:
properties:
display_name:
description: display_name
maxLength: 35
type: string
original_text:
description: original text
type: string
slug_name:
description: slug_name
maxLength: 35
type: string
type: object
schema.TagResp:
properties:
display_name:
type: string
main_tag_slug_name:
description: if main tag slug name is not empty, this tag is synonymous with
the main tag
type: string
recommend:
type: boolean
reserved:
type: boolean
slug_name:
type: string
type: object
schema.TagSynonym:
properties:
display_name:
description: display name
type: string
main_tag_slug_name:
description: if main tag slug name is not empty, this tag is synonymous with
the main tag
type: string
slug_name:
description: slug name
type: string
tag_id:
description: tag id
type: string
type: object
schema.ThemeOption:
properties:
label:
type: string
value:
type: string
type: object
schema.UIOptionAction:
properties:
loading:
$ref: '#/definitions/schema.LoadingAction'
method:
type: string
on_complete:
$ref: '#/definitions/schema.OnCompleteAction'
url:
type: string
type: object
schema.UnreviewedRevisionInfoInfo:
properties:
answer_accepted:
type: boolean
answer_count:
type: integer
answer_id:
type: string
comment_id:
type: string
content:
type: string
created_at:
type: integer
html:
type: string
object_creator_user_id:
type: string
object_id:
type: string
object_type:
type: string
question_id:
type: string
show_status:
type: integer
status:
type: integer
tags:
items:
$ref: '#/definitions/schema.TagResp'
type: array
title:
type: string
url_title:
type: string
type: object
schema.UpdateBadgeStatusReq:
properties:
id:
description: badge id
type: string
status:
allOf:
- $ref: '#/definitions/schema.BadgeStatus'
description: badge status
required:
- id
- status
type: object
schema.UpdateCommentReq:
properties:
captcha_code:
type: string
captcha_id:
description: whether user can delete it
type: string
comment_id:
description: comment id
type: string
original_text:
description: original comment content
maxLength: 600
minLength: 2
type: string
required:
- comment_id
- original_text
type: object
schema.UpdateFollowTagsReq:
properties:
slug_name_list:
description: tag slug name list
items:
type: string
type: array
type: object
schema.UpdateInfoRequest:
properties:
avatar:
$ref: '#/definitions/schema.AvatarInfo'
bio:
maxLength: 4096
type: string
display_name:
maxLength: 30
minLength: 2
type: string
location:
maxLength: 100
type: string
username:
maxLength: 30
minLength: 2
type: string
website:
maxLength: 500
type: string
type: object
schema.UpdatePluginConfigReq:
properties:
config_fields:
additionalProperties: {}
type: object
plugin_slug_name:
maxLength: 100
type: string
required:
- plugin_slug_name
type: object
schema.UpdatePluginStatusReq:
properties:
enabled:
type: boolean
plugin_slug_name:
maxLength: 100
type: string
required:
- plugin_slug_name
type: object
schema.UpdatePrivilegesConfigReq:
properties:
custom_privileges:
items:
$ref: '#/definitions/constant.Privilege'
type: array
level:
allOf:
- $ref: '#/definitions/schema.PrivilegeLevel'
minimum: 1
required:
- level
type: object
schema.UpdateReactionReq:
properties:
emoji:
enum:
- heart
- smile
- frown
type: string
object_id:
type: string
reaction:
enum:
- activate
- deactivate
type: string
required:
- emoji
- object_id
- reaction
type: object
schema.UpdateReviewReq:
properties:
review_id:
type: integer
status:
enum:
- approve
- reject
type: string
required:
- review_id
- status
type: object
schema.UpdateSMTPConfigReq:
properties:
encryption:
description: '"" SSL TLS'
enum:
- SSL
- TLS
type: string
from_email:
maxLength: 256
type: string
from_name:
maxLength: 256
type: string
smtp_authentication:
type: boolean
smtp_host:
maxLength: 256
type: string
smtp_password:
maxLength: 256
type: string
smtp_port:
maximum: 65535
minimum: 1
type: integer
smtp_username:
maxLength: 256
type: string
test_email_recipient:
type: string
type: object
schema.UpdateTagReq:
properties:
display_name:
description: display_name
maxLength: 35
type: string
edit_summary:
description: edit summary
type: string
original_text:
description: original text
type: string
slug_name:
description: slug_name
maxLength: 35
type: string
tag_id:
description: tag_id
type: string
required:
- tag_id
type: object
schema.UpdateTagSynonymReq:
properties:
synonym_tag_list:
description: synonym tag list
items:
$ref: '#/definitions/schema.TagItem'
type: array
tag_id:
description: tag_id
type: string
required:
- synonym_tag_list
- tag_id
type: object
schema.UpdateUserInterfaceRequest:
properties:
color_scheme:
description: Color scheme
maxLength: 100
type: string
language:
description: language
maxLength: 100
type: string
required:
- color_scheme
- language
type: object
schema.UpdateUserNotificationConfigReq:
properties:
all_new_question:
$ref: '#/definitions/schema.NotificationChannelConfig'
all_new_question_for_following_tags:
$ref: '#/definitions/schema.NotificationChannelConfig'
inbox:
$ref: '#/definitions/schema.NotificationChannelConfig'
type: object
schema.UpdateUserPasswordReq:
properties:
password:
maxLength: 32
minLength: 8
type: string
user_id:
type: string
required:
- password
- user_id
type: object
schema.UpdateUserPluginConfigReq:
properties:
config_fields:
additionalProperties: {}
type: object
plugin_slug_name:
maxLength: 100
type: string
required:
- plugin_slug_name
type: object
schema.UpdateUserRoleReq:
properties:
role_id:
description: role id
type: integer
user_id:
description: user id
type: string
required:
- role_id
- user_id
type: object
schema.UpdateUserStatusReq:
properties:
remove_all_content:
type: boolean
status:
enum:
- normal
- suspended
- deleted
- inactive
type: string
user_id:
type: string
required:
- status
- user_id
type: object
schema.UserBasicInfo:
properties:
avatar:
type: string
display_name:
type: string
id:
type: string
language:
type: string
location:
type: string
rank:
type: integer
status:
type: string
username:
type: string
website:
type: string
type: object
schema.UserChangeEmailSendCodeReq:
properties:
captcha_code:
type: string
captcha_id:
type: string
e_mail:
maxLength: 500
type: string
pass:
maxLength: 32
minLength: 8
type: string
required:
- e_mail
type: object
schema.UserChangeEmailVerifyReq:
properties:
code:
maxLength: 500
type: string
required:
- code
type: object
schema.UserEmailLoginReq:
properties:
captcha_code:
type: string
captcha_id:
type: string
e_mail:
maxLength: 500
type: string
pass:
maxLength: 32
minLength: 8
type: string
required:
- e_mail
- pass
type: object
schema.UserLoginResp:
properties:
access_token:
description: access token
type: string
answer_count:
description: answer count
type: integer
authority_group:
description: authority group
type: integer
avatar:
description: avatar
type: string
bio:
description: bio markdown
type: string
bio_html:
description: bio html
type: string
color_scheme:
description: Color scheme
type: string
created_at:
description: create time
type: integer
display_name:
description: display name
type: string
e_mail:
description: email
type: string
follow_count:
description: follow count
type: integer
have_password:
description: user have password
type: boolean
id:
description: user id
type: string
language:
description: language
type: string
last_login_date:
description: last login date
type: integer
location:
description: location
type: string
mail_status:
description: mail status(1 pass 2 to be verified)
type: integer
mobile:
description: mobile
type: string
notice_status:
description: notice status(1 on 2off)
type: integer
question_count:
description: question count
type: integer
rank:
description: rank
type: integer
role_id:
description: role id
type: integer
status:
description: user status
type: string
username:
description: username
type: string
visit_token:
description: visit token
type: string
website:
description: website
type: string
type: object
schema.UserModifyPasswordReq:
properties:
captcha_code:
type: string
captcha_id:
type: string
old_pass:
maxLength: 32
minLength: 8
type: string
pass:
maxLength: 32
minLength: 8
type: string
required:
- pass
type: object
schema.UserRankingResp:
properties:
staffs:
items:
$ref: '#/definitions/schema.UserRankingSimpleInfo'
type: array
users_with_the_most_reputation:
items:
$ref: '#/definitions/schema.UserRankingSimpleInfo'
type: array
users_with_the_most_vote:
items:
$ref: '#/definitions/schema.UserRankingSimpleInfo'
type: array
type: object
schema.UserRankingSimpleInfo:
properties:
avatar:
description: avatar
type: string
display_name:
description: display name
type: string
rank:
description: rank
type: integer
username:
description: username
type: string
vote_count:
description: vote
type: integer
type: object
schema.UserRePassWordRequest:
properties:
code:
maxLength: 100
type: string
pass:
maxLength: 32
type: string
required:
- code
- pass
type: object
schema.UserRegisterReq:
properties:
captcha_code:
type: string
captcha_id:
type: string
e_mail:
maxLength: 500
type: string
name:
maxLength: 30
minLength: 2
type: string
pass:
maxLength: 32
minLength: 8
type: string
required:
- e_mail
- name
- pass
type: object
schema.UserRetrievePassWordRequest:
properties:
captcha_code:
type: string
captcha_id:
type: string
e_mail:
maxLength: 500
type: string
required:
- e_mail
type: object
schema.UserUnsubscribeNotificationReq:
properties:
code:
maxLength: 500
type: string
required:
- code
type: object
schema.VoteReq:
properties:
captcha_code:
type: string
captcha_id:
type: string
is_cancel:
type: boolean
object_id:
type: string
required:
- object_id
type: object
schema.VoteResp:
properties:
down_votes:
type: integer
up_votes:
type: integer
vote_status:
type: string
votes:
type: integer
type: object
translator.LangOption:
properties:
label:
type: string
progress:
description: Translation completion percentage
type: integer
value:
type: string
type: object
info:
contact: {}
description: Apache Answer API
title: Apache Answer
paths:
/:
get:
consumes:
- application/json
description: if config file not exist try to redirect to install page
produces:
- application/json
responses: {}
summary: if config file not exist try to redirect to install page
tags:
- installation
/answer/admin/api/answer/page:
get:
consumes:
- application/json
description: Status:[available,deleted,pending]
parameters:
- description: page size
in: query
name: page
type: integer
- description: page size
in: query
name: page_size
type: integer
- description: user status
enum:
- available
- deleted
- pending
in: query
name: status
type: string
- description: answer id or question title
in: query
name: query
type: string
- description: question id
in: query
name: question_id
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: AdminAnswerPage admin answer page
tags:
- admin
/answer/admin/api/answer/status:
put:
consumes:
- application/json
description: update answer status
parameters:
- description: AdminUpdateAnswerStatusReq
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.AdminUpdateAnswerStatusReq'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: update answer status
tags:
- admin
/answer/admin/api/badge/status:
put:
consumes:
- application/json
description: update badge status
parameters:
- description: UpdateBadgeStatusReq
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.UpdateBadgeStatusReq'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: update badge status
tags:
- AdminBadge
/answer/admin/api/badges:
get:
consumes:
- application/json
description: list all badges by page
parameters:
- description: page
in: query
name: page
type: integer
- description: page size
in: query
name: page_size
type: integer
- description: badge status
enum:
- ""
- active
- inactive
in: query
name: status
type: string
- description: search param
in: query
name: q
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
items:
$ref: '#/definitions/schema.GetBadgeListPagedResp'
type: array
type: object
security:
- ApiKeyAuth: []
summary: list all badges by page
tags:
- AdminBadge
/answer/admin/api/dashboard:
get:
consumes:
- application/json
description: DashboardInfo
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: DashboardInfo
tags:
- admin
/answer/admin/api/delete/permanently:
delete:
consumes:
- application/json
description: delete permanently
parameters:
- description: DeletePermanentlyReq
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.DeletePermanentlyReq'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: delete permanently
tags:
- admin
/answer/admin/api/language/options:
get:
description: Get language options
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: Get language options
tags:
- Lang
/answer/admin/api/plugin/config:
get:
description: get plugin config
parameters:
- description: plugin_slug_name
in: query
name: plugin_slug_name
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
$ref: '#/definitions/schema.GetPluginConfigResp'
type: object
security:
- ApiKeyAuth: []
summary: get plugin config
tags:
- AdminPlugin
put:
consumes:
- application/json
description: update plugin config
parameters:
- description: UpdatePluginConfigReq
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.UpdatePluginConfigReq'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: update plugin config
tags:
- AdminPlugin
/answer/admin/api/plugin/status:
put:
consumes:
- application/json
description: update plugin status
parameters:
- description: UpdatePluginStatusReq
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.UpdatePluginStatusReq'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: update plugin status
tags:
- AdminPlugin
/answer/admin/api/plugins:
get:
consumes:
- application/json
description: get plugin list
parameters:
- description: 'status: active/inactive'
in: query
name: status
type: string
- description: have config
in: query
name: have_config
type: boolean
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
items:
$ref: '#/definitions/schema.GetPluginListResp'
type: array
type: object
security:
- ApiKeyAuth: []
summary: get plugin list
tags:
- AdminPlugin
/answer/admin/api/question/page:
get:
consumes:
- application/json
description: Status:[available,closed,deleted,pending]
parameters:
- description: page size
in: query
name: page
type: integer
- description: page size
in: query
name: page_size
type: integer
- description: user status
enum:
- available
- closed
- deleted
- pending
in: query
name: status
type: string
- description: question id or title
in: query
name: query
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: AdminQuestionPage admin question page
tags:
- admin
/answer/admin/api/question/status:
put:
consumes:
- application/json
description: update question status
parameters:
- description: AdminUpdateQuestionStatusReq
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.AdminUpdateQuestionStatusReq'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: update question status
tags:
- admin
/answer/admin/api/reasons:
get:
consumes:
- application/json
description: get reasons by object type and action
parameters:
- description: object_type
enum:
- question
- answer
- comment
- user
in: query
name: object_type
required: true
type: string
- description: action
enum:
- status
- close
- flag
- review
in: query
name: action
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: get reasons by object type and action
tags:
- reason
/answer/admin/api/roles:
get:
description: get role list
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
items:
$ref: '#/definitions/schema.GetRoleResp'
type: array
type: object
security:
- ApiKeyAuth: []
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
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
$ref: '#/definitions/schema.GetSMTPConfigResp'
type: object
security:
- ApiKeyAuth: []
summary: GetSMTPConfig get smtp config
tags:
- admin
put:
description: update smtp config
parameters:
- description: smtp config
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.UpdateSMTPConfigReq'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: update smtp config
tags:
- admin
/answer/admin/api/siteinfo/branding:
get:
description: get site interface
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
$ref: '#/definitions/schema.SiteBrandingResp'
type: object
security:
- ApiKeyAuth: []
summary: get site interface
tags:
- admin
put:
description: update site info branding
parameters:
- description: branding info
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.SiteBrandingReq'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: update site info branding
tags:
- admin
/answer/admin/api/siteinfo/custom-css-html:
get:
description: get site info custom html css config
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
$ref: '#/definitions/schema.SiteCustomCssHTMLResp'
type: object
security:
- ApiKeyAuth: []
summary: get site info custom html css config
tags:
- admin
put:
description: update site custom css html config
parameters:
- description: login info
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.SiteCustomCssHTMLReq'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: update site custom css html config
tags:
- admin
/answer/admin/api/siteinfo/general:
get:
description: get site general information
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
$ref: '#/definitions/schema.SiteGeneralResp'
type: object
security:
- ApiKeyAuth: []
summary: get site general information
tags:
- admin
put:
description: update site general information
parameters:
- description: general
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.SiteGeneralReq'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: update site general information
tags:
- admin
/answer/admin/api/siteinfo/interface:
get:
description: get site interface
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
$ref: '#/definitions/schema.SiteInterfaceResp'
type: object
security:
- ApiKeyAuth: []
summary: get site interface
tags:
- admin
put:
description: update site info interface
parameters:
- description: general
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.SiteInterfaceReq'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: update site info interface
tags:
- admin
/answer/admin/api/siteinfo/legal:
get:
description: Set the legal information for the site
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
$ref: '#/definitions/schema.SiteLegalResp'
type: object
security:
- ApiKeyAuth: []
summary: Set the legal information for the site
tags:
- admin
put:
description: update site legal info
parameters:
- description: write info
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.SiteLegalReq'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: update site legal info
tags:
- admin
/answer/admin/api/siteinfo/login:
get:
description: get site info login config
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
$ref: '#/definitions/schema.SiteLoginResp'
type: object
security:
- ApiKeyAuth: []
summary: get site info login config
tags:
- admin
put:
description: update site login
parameters:
- description: login info
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.SiteLoginReq'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: update site login
tags:
- admin
/answer/admin/api/siteinfo/seo:
get:
description: get site seo information
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
$ref: '#/definitions/schema.SiteSeoResp'
type: object
security:
- ApiKeyAuth: []
summary: get site seo information
tags:
- admin
put:
description: update site seo information
parameters:
- description: seo
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.SiteSeoReq'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: update site seo information
tags:
- admin
/answer/admin/api/siteinfo/theme:
get:
description: get site info theme config
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
$ref: '#/definitions/schema.SiteThemeResp'
type: object
security:
- ApiKeyAuth: []
summary: get site info theme config
tags:
- admin
put:
description: update site custom css html config
parameters:
- description: login info
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.SiteThemeReq'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: update site custom css html config
tags:
- admin
/answer/admin/api/siteinfo/users:
get:
description: get site user config
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
$ref: '#/definitions/schema.SiteUsersResp'
type: object
security:
- ApiKeyAuth: []
summary: get site user config
tags:
- admin
put:
description: update site info config about users
parameters:
- description: users info
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.SiteUsersReq'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: update site info config about users
tags:
- admin
/answer/admin/api/siteinfo/write:
get:
description: get site interface
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
$ref: '#/definitions/schema.SiteWriteResp'
type: object
security:
- ApiKeyAuth: []
summary: get site interface
tags:
- admin
put:
description: update site write info
parameters:
- description: write info
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.SiteWriteReq'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: update site write info
tags:
- admin
/answer/admin/api/theme/options:
get:
description: Get theme options
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: Get theme options
tags:
- admin
/answer/admin/api/user:
post:
consumes:
- application/json
description: add user
parameters:
- description: user
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.AddUserReq'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: add user
tags:
- admin
/answer/admin/api/user/activation:
get:
description: get user activation
parameters:
- description: user id
in: query
name: user_id
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
$ref: '#/definitions/schema.GetUserActivationResp'
type: object
security:
- ApiKeyAuth: []
summary: get user activation
tags:
- admin
/answer/admin/api/user/password:
put:
consumes:
- application/json
description: update user password
parameters:
- description: user
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.UpdateUserPasswordReq'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: update user password
tags:
- admin
/answer/admin/api/user/profile:
put:
consumes:
- application/json
description: edit user profile
parameters:
- description: user
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.EditUserProfileReq'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: edit user profile
tags:
- admin
/answer/admin/api/user/role:
put:
consumes:
- application/json
description: update user role
parameters:
- description: user
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.UpdateUserRoleReq'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: update user role
tags:
- admin
/answer/admin/api/user/status:
put:
consumes:
- application/json
description: update user
parameters:
- description: user
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.UpdateUserStatusReq'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: update user
tags:
- admin
/answer/admin/api/users:
post:
consumes:
- application/json
description: add users
parameters:
- description: user
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.AddUsersReq'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: add users
tags:
- admin
/answer/admin/api/users/activation:
post:
description: send user activation
parameters:
- description: SendUserActivationReq
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.SendUserActivationReq'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: send user activation
tags:
- admin
/answer/admin/api/users/page:
get:
description: get user page
parameters:
- description: page size
in: query
name: page
type: integer
- description: page size
in: query
name: page_size
type: integer
- description: 'search query: email, username or id:[id]'
in: query
name: query
type: string
- description: staff user
in: query
name: staff
type: boolean
- description: user status
enum:
- suspended
- deleted
- inactive
in: query
name: status
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
allOf:
- $ref: '#/definitions/pager.PageModel'
- properties:
records:
items:
$ref: '#/definitions/schema.GetUserPageResp'
type: array
type: object
type: object
security:
- ApiKeyAuth: []
summary: get user page
tags:
- admin
/answer/api/v1/activity/timeline:
get:
description: get object timeline
parameters:
- description: object id
in: query
name: object_id
type: string
- description: tag slug name
in: query
name: tag_slug_name
type: string
- description: object type
enum:
- question
- answer
- tag
in: query
name: object_type
type: string
- description: is show vote
in: query
name: show_vote
type: boolean
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
$ref: '#/definitions/schema.GetObjectTimelineResp'
type: object
summary: get object timeline
tags:
- Comment
/answer/api/v1/activity/timeline/detail:
get:
description: get object timeline detail
parameters:
- description: revision id
in: query
name: revision_id
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
$ref: '#/definitions/schema.GetObjectTimelineResp'
type: object
summary: get object timeline detail
tags:
- Comment
/answer/api/v1/answer:
delete:
consumes:
- application/json
description: delete answer
parameters:
- description: answer
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.RemoveAnswerReq'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: delete answer
tags:
- api-answer
post:
consumes:
- application/json
description: Insert Answer
parameters:
- description: AnswerAddReq
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.AnswerAddReq'
produces:
- application/json
responses:
"200":
description: OK
schema:
type: string
security:
- ApiKeyAuth: []
summary: Insert Answer
tags:
- api-answer
put:
consumes:
- application/json
description: Update Answer
parameters:
- description: AnswerUpdateReq
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.AnswerUpdateReq'
produces:
- application/json
responses:
"200":
description: OK
schema:
type: string
security:
- ApiKeyAuth: []
summary: Update Answer
tags:
- api-answer
/answer/api/v1/answer/acceptance:
post:
consumes:
- application/json
description: Accepted
parameters:
- description: AcceptAnswerReq
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.AcceptAnswerReq'
produces:
- application/json
responses:
"200":
description: OK
schema:
type: string
security:
- ApiKeyAuth: []
summary: Accepted
tags:
- api-answer
/answer/api/v1/answer/info:
get:
consumes:
- application/json
description: Get Answer
parameters:
- default: "1"
description: Answer TagID
in: query
name: id
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
type: string
summary: Get Answer
tags:
- api-answer
/answer/api/v1/answer/page:
get:
consumes:
- application/json
description: AnswerList <br> <b>order</b> (default or updated)
parameters:
- description: question_id
in: query
name: question_id
required: true
type: string
- description: order
in: query
name: order
required: true
type: string
- description: page
in: query
name: page
required: true
type: string
- description: page_size
in: query
name: page_size
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
type: string
summary: AnswerList
tags:
- api-answer
/answer/api/v1/answer/recover:
post:
consumes:
- application/json
description: recover deleted answer
parameters:
- description: answer
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.RecoverAnswerReq'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: recover answer
tags:
- Answer
/answer/api/v1/badge:
get:
consumes:
- application/json
description: get badge info
parameters:
- default: string
description: id
in: query
name: id
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
$ref: '#/definitions/schema.GetBadgeInfoResp'
type: object
summary: get badge info
tags:
- api-badge
/answer/api/v1/badge/awards/page:
get:
consumes:
- application/json
description: get badge award list
parameters:
- description: page
in: query
name: page
type: integer
- description: page size
in: query
name: page_size
type: integer
- description: badge id
in: query
name: badge_id
required: true
type: string
- description: only list the award by username
in: query
name: username
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
$ref: '#/definitions/schema.GetBadgeInfoResp'
type: object
summary: get badge award list
tags:
- api-badge
/answer/api/v1/badge/user/awards:
get:
consumes:
- application/json
description: get user badge award list
parameters:
- description: user name
in: query
name: username
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
items:
$ref: '#/definitions/schema.GetUserBadgeAwardListResp'
type: array
type: object
summary: get user badge award list
tags:
- api-badge
/answer/api/v1/badge/user/awards/recent:
get:
consumes:
- application/json
description: get user badge award list
parameters:
- description: user name
in: query
name: username
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
items:
$ref: '#/definitions/schema.GetUserBadgeAwardListResp'
type: array
type: object
summary: get user badge award list
tags:
- api-badge
/answer/api/v1/badges:
get:
consumes:
- application/json
description: list all badges group by group
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
items:
$ref: '#/definitions/schema.GetBadgeListResp'
type: array
type: object
summary: list all badges group by group
tags:
- api-badge
/answer/api/v1/collection/switch:
post:
consumes:
- application/json
description: add collection
parameters:
- description: collection
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.CollectionSwitchReq'
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
$ref: '#/definitions/schema.CollectionSwitchResp'
type: object
security:
- ApiKeyAuth: []
summary: add collection
tags:
- Collection
/answer/api/v1/comment:
delete:
consumes:
- application/json
description: remove comment
parameters:
- description: comment
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.RemoveCommentReq'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: remove comment
tags:
- Comment
get:
description: get comment by id
parameters:
- description: id
in: query
name: id
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
allOf:
- $ref: '#/definitions/pager.PageModel'
- properties:
list:
items:
$ref: '#/definitions/schema.GetCommentResp'
type: array
type: object
type: object
summary: get comment by id
tags:
- Comment
post:
consumes:
- application/json
description: add comment
parameters:
- description: comment
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.AddCommentReq'
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
$ref: '#/definitions/schema.GetCommentResp'
type: object
security:
- ApiKeyAuth: []
summary: add comment
tags:
- Comment
put:
consumes:
- application/json
description: update comment
parameters:
- description: comment
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.UpdateCommentReq'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: update comment
tags:
- Comment
/answer/api/v1/comment/page:
get:
description: get comment page
parameters:
- description: page
in: query
name: page
type: integer
- description: page size
in: query
name: page_size
type: integer
- description: object id
in: query
name: object_id
required: true
type: string
- description: query condition
enum:
- vote
in: query
name: query_cond
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
allOf:
- $ref: '#/definitions/pager.PageModel'
- properties:
list:
items:
$ref: '#/definitions/schema.GetCommentResp'
type: array
type: object
type: object
summary: get comment page
tags:
- Comment
/answer/api/v1/connector/binding/email:
post:
consumes:
- application/json
description: external login binding user send email
parameters:
- description: external login binding user send email
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.ExternalLoginBindingUserSendEmailReq'
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
$ref: '#/definitions/schema.ExternalLoginBindingUserSendEmailResp'
type: object
summary: external login binding user send email
tags:
- PluginConnector
/answer/api/v1/connector/info:
get:
description: get all enabled connectors
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
items:
$ref: '#/definitions/schema.ConnectorInfoResp'
type: array
type: object
security:
- ApiKeyAuth: []
summary: get all enabled connectors
tags:
- PluginConnector
/answer/api/v1/connector/user/info:
get:
description: get all connectors info about user
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
items:
$ref: '#/definitions/schema.ConnectorUserInfoResp'
type: array
type: object
security:
- ApiKeyAuth: []
summary: get all connectors info about user
tags:
- PluginConnector
/answer/api/v1/connector/user/unbinding:
delete:
consumes:
- application/json
description: unbind external user login
parameters:
- description: ExternalLoginUnbindingReq
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.ExternalLoginUnbindingReq'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: unbind external user login
tags:
- PluginConnector
/answer/api/v1/embed/config:
get:
consumes:
- application/json
description: get embed plugin config
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
items:
$ref: '#/definitions/plugin.EmbedConfig'
type: array
type: object
summary: get embed plugin config
tags:
- Plugin
/answer/api/v1/file:
post:
consumes:
- multipart/form-data
description: upload file
parameters:
- description: identify the source of the file upload
enum:
- post
- post_attachment
- avatar
- branding
in: formData
name: source
required: true
type: string
- description: file
in: formData
name: file
required: true
type: file
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
type: string
type: object
security:
- ApiKeyAuth: []
summary: upload file
tags:
- Upload
/answer/api/v1/follow:
post:
consumes:
- application/json
description: follow object or cancel follow operation
parameters:
- description: follow
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.FollowReq'
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
$ref: '#/definitions/schema.FollowResp'
type: object
security:
- ApiKeyAuth: []
summary: follow object or cancel follow operation
tags:
- Activity
/answer/api/v1/follow/tags:
put:
consumes:
- application/json
description: update user follow tags
parameters:
- description: follow
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.UpdateFollowTagsReq'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: update user follow tags
tags:
- Activity
/answer/api/v1/language/config:
get:
description: get language config mapping
parameters:
- description: Accept-Language
in: header
name: Accept-Language
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
summary: get language config mapping
tags:
- Lang
/answer/api/v1/language/options:
get:
description: Get language options
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
summary: Get language options
tags:
- Lang
/answer/api/v1/meta/reaction:
get:
consumes:
- application/json
description: get reaction for an object
parameters:
- description: object_id
in: query
name: object_id
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
$ref: '#/definitions/schema.ReactionRespItem'
type: object
summary: get reaction
tags:
- Meta
put:
consumes:
- application/json
description: update reaction. if not exist, add one
parameters:
- description: reaction
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.UpdateReactionReq'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: add or update reaction
tags:
- Meta
/answer/api/v1/notification/page:
get:
consumes:
- application/json
description: get notification list
parameters:
- description: page size
in: query
name: page
type: integer
- description: page size
in: query
name: page_size
type: integer
- description: type
enum:
- inbox
- achievement
in: query
name: type
required: true
type: string
- description: inbox_type
enum:
- all
- posts
- invites
- votes
in: query
name: inbox_type
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: get notification list
tags:
- Notification
/answer/api/v1/notification/read/state:
put:
consumes:
- application/json
description: ClearUnRead
parameters:
- description: NotificationClearIDRequest
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.NotificationClearIDRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: ClearUnRead
tags:
- Notification
/answer/api/v1/notification/read/state/all:
put:
consumes:
- application/json
description: ClearUnRead
parameters:
- description: NotificationClearRequest
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.NotificationClearRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: ClearUnRead
tags:
- Notification
/answer/api/v1/notification/status:
get:
consumes:
- application/json
description: GetRedDot
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: GetRedDot
tags:
- Notification
put:
consumes:
- application/json
description: DelRedDot
parameters:
- description: NotificationClearRequest
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.NotificationClearRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: DelRedDot
tags:
- Notification
/answer/api/v1/permission:
get:
description: check user permission
parameters:
- description: access-token
in: header
name: Authorization
required: true
type: string
- description: permission key
enum:
- question.add
- question.edit
- question.edit_without_review
- question.delete
- question.close
- question.reopen
- question.vote_up
- question.vote_down
- question.pin
- question.unpin
- question.hide
- question.show
- answer.add
- answer.edit
- answer.edit_without_review
- answer.delete
- answer.accept
- answer.vote_up
- answer.vote_down
- answer.invite_someone_to_answer
- comment.add
- comment.edit
- comment.delete
- comment.vote_up
- comment.vote_down
- report.add
- tag.add
- tag.edit
- tag.edit_slug_name
- tag.edit_without_review
- tag.delete
- tag.synonym
- link.url_limit
- vote.detail
- answer.audit
- question.audit
- tag.audit
- tag.use_reserved_tag
in: query
name: action
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
additionalProperties:
type: boolean
type: object
type: object
security:
- ApiKeyAuth: []
summary: check user permission
tags:
- Permission
/answer/api/v1/personal/answer/page:
get:
consumes:
- application/json
description: list personal answers
parameters:
- default: string
description: username
in: query
name: username
required: true
type: string
- description: order
enum:
- newest
- score
in: query
name: order
required: true
type: string
- default: "0"
description: page
in: query
name: page
required: true
type: string
- default: "20"
description: page_size
in: query
name: page_size
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: list personal answers
tags:
- Personal
/answer/api/v1/personal/collection/page:
get:
consumes:
- application/json
description: list personal collections
parameters:
- default: "0"
description: page
in: query
name: page
required: true
type: string
- default: "20"
description: page_size
in: query
name: page_size
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: list personal collections
tags:
- Collection
/answer/api/v1/personal/comment/page:
get:
description: user personal comment list
parameters:
- description: page
in: query
name: page
type: integer
- description: page size
in: query
name: page_size
type: integer
- description: username
in: query
name: username
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
allOf:
- $ref: '#/definitions/pager.PageModel'
- properties:
list:
items:
$ref: '#/definitions/schema.GetCommentPersonalWithPageResp'
type: array
type: object
type: object
summary: user personal comment list
tags:
- Comment
/answer/api/v1/personal/qa/top:
get:
consumes:
- application/json
description: UserTop
parameters:
- default: string
description: username
in: query
name: username
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
summary: UserTop
tags:
- Question
/answer/api/v1/personal/rank/page:
get:
description: user personal rank list
parameters:
- description: page
in: query
name: page
type: integer
- description: page size
in: query
name: page_size
type: integer
- description: username
in: query
name: username
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
allOf:
- $ref: '#/definitions/pager.PageModel'
- properties:
list:
items:
$ref: '#/definitions/schema.GetRankPersonalPageResp'
type: array
type: object
type: object
summary: user personal rank list
tags:
- Rank
/answer/api/v1/personal/user/info:
get:
consumes:
- application/json
description: GetOtherUserInfoByUsername
parameters:
- description: username
in: query
name: username
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
$ref: '#/definitions/schema.GetOtherUserInfoResp'
type: object
security:
- ApiKeyAuth: []
summary: GetOtherUserInfoByUsername
tags:
- User
/answer/api/v1/personal/vote/page:
get:
consumes:
- application/json
description: get user personal votes
parameters:
- description: page size
in: query
name: page
type: integer
- description: page size
in: query
name: page_size
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
allOf:
- $ref: '#/definitions/pager.PageModel'
- properties:
list:
items:
$ref: '#/definitions/schema.GetVoteWithPageResp'
type: array
type: object
type: object
security:
- ApiKeyAuth: []
summary: get user personal votes
tags:
- Activity
/answer/api/v1/plugin/status:
get:
consumes:
- application/json
description: get all plugins status
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
items:
$ref: '#/definitions/schema.GetPluginListResp'
type: array
type: object
summary: get all plugins status
tags:
- Plugin
/answer/api/v1/post/render:
post:
consumes:
- application/json
description: render post content
parameters:
- description: PostRenderReq
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.PostRenderReq'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: render post content
tags:
- Upload
/answer/api/v1/question:
delete:
consumes:
- application/json
description: delete question
parameters:
- description: question
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.RemoveQuestionReq'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: delete question
tags:
- Question
post:
consumes:
- application/json
description: add question
parameters:
- description: question
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.QuestionAdd'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: add question
tags:
- Question
put:
consumes:
- application/json
description: update question
parameters:
- description: question
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.QuestionUpdate'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: update question
tags:
- Question
/answer/api/v1/question/answer:
post:
consumes:
- application/json
description: add question and answer
parameters:
- description: question
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.QuestionAddByAnswer'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: add question and answer
tags:
- Question
/answer/api/v1/question/info:
get:
consumes:
- application/json
description: get question details
parameters:
- default: "1"
description: Question TagID
in: query
name: id
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
type: string
summary: get question details
tags:
- Question
/answer/api/v1/question/invite:
get:
consumes:
- application/json
description: get question invite user info
parameters:
- default: "1"
description: Question ID
in: query
name: id
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
type: string
summary: get question invite user info
tags:
- Question
put:
consumes:
- application/json
description: update question invite user
parameters:
- description: question
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.QuestionUpdateInviteUser'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: update question invite user
tags:
- Question
/answer/api/v1/question/link:
get:
description: get question link
parameters:
- in: query
minimum: 1
name: in_days
type: integer
- enum:
- newest
- active
- hot
- score
- unanswered
- recommend
- frequent
in: query
name: order
type: string
- in: query
minimum: 1
name: page
type: integer
- in: query
maximum: 100
minimum: 1
name: page_size
type: integer
- in: query
name: question_id
required: true
type: string
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
allOf:
- $ref: '#/definitions/pager.PageModel'
- properties:
list:
items:
$ref: '#/definitions/schema.QuestionPageResp'
type: array
type: object
type: object
summary: get question link
tags:
- Question
/answer/api/v1/question/operation:
put:
consumes:
- application/json
description: Operation question \n operation [pin unpin hide show]
parameters:
- description: question
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.OperationQuestionReq'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: Operation question
tags:
- Question
/answer/api/v1/question/page:
get:
consumes:
- application/json
description: get questions by page
parameters:
- description: QuestionPageReq
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.QuestionPageReq'
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
allOf:
- $ref: '#/definitions/pager.PageModel'
- properties:
list:
items:
$ref: '#/definitions/schema.QuestionPageResp'
type: array
type: object
type: object
summary: get questions by page
tags:
- Question
/answer/api/v1/question/recommend/page:
get:
consumes:
- application/json
description: get recommend questions by page
parameters:
- description: QuestionPageReq
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.QuestionPageReq'
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
allOf:
- $ref: '#/definitions/pager.PageModel'
- properties:
list:
items:
$ref: '#/definitions/schema.QuestionPageResp'
type: array
type: object
type: object
summary: get recommend questions by page
tags:
- Question
/answer/api/v1/question/recover:
post:
consumes:
- application/json
description: recover deleted question
parameters:
- description: question
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.QuestionRecoverReq'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: recover deleted question
tags:
- Question
/answer/api/v1/question/reopen:
put:
consumes:
- application/json
description: reopen question
parameters:
- description: question
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.ReopenQuestionReq'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: reopen question
tags:
- Question
/answer/api/v1/question/similar:
get:
consumes:
- application/json
description: fuzzy query similar questions based on title
parameters:
- default: string
description: title
in: query
name: title
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: fuzzy query similar questions based on title
tags:
- Question
/answer/api/v1/question/similar/tag:
get:
consumes:
- application/json
description: Search Similar Question
parameters:
- default: ""
description: question_id
in: query
name: question_id
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
type: string
summary: Search Similar Question
tags:
- Question
/answer/api/v1/question/status:
put:
consumes:
- application/json
description: Close question
parameters:
- description: question
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.CloseQuestionReq'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: Close question
tags:
- Question
/answer/api/v1/question/tags:
get:
description: get tag list
parameters:
- description: tag
in: query
name: tag
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
items:
$ref: '#/definitions/schema.GetTagBasicResp'
type: array
type: object
security:
- ApiKeyAuth: []
summary: get tag list
tags:
- Tag
/answer/api/v1/reasons:
get:
consumes:
- application/json
description: get reasons by object type and action
parameters:
- description: object_type
enum:
- question
- answer
- comment
- user
in: query
name: object_type
required: true
type: string
- description: action
enum:
- status
- close
- flag
- review
in: query
name: action
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: get reasons by object type and action
tags:
- reason
/answer/api/v1/render/config:
get:
consumes:
- application/json
description: GetRenderConfig
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
$ref: '#/definitions/plugin.RenderConfig'
type: object
summary: GetRenderConfig
tags:
- PluginRender
/answer/api/v1/report:
post:
consumes:
- application/json
description: add report <br> source (question, answer, comment, user)
parameters:
- description: report
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.AddReportReq'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: add report
tags:
- Report
/answer/api/v1/report/review:
put:
consumes:
- application/json
description: review report
parameters:
- description: flag
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.ReviewReportReq'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: review report
tags:
- Report
/answer/api/v1/report/unreviewed/post:
get:
consumes:
- application/json
description: get unreviewed report post page
parameters:
- description: page
in: query
name: page
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
allOf:
- $ref: '#/definitions/pager.PageModel'
- properties:
list:
items:
$ref: '#/definitions/schema.GetReportListPageResp'
type: array
type: object
type: object
security:
- ApiKeyAuth: []
summary: get unreviewed report post page
tags:
- Report
/answer/api/v1/review/pending/post:
put:
consumes:
- application/json
description: update review
parameters:
- description: review
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.UpdateReviewReq'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: update review
tags:
- Review
/answer/api/v1/review/pending/post/page:
get:
consumes:
- application/json
description: get unreviewed post page
parameters:
- description: page
in: query
name: page
type: integer
- description: object_id
in: query
name: object_id
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
allOf:
- $ref: '#/definitions/pager.PageModel'
- properties:
list:
items:
$ref: '#/definitions/schema.GetUnreviewedPostPageResp'
type: array
type: object
type: object
security:
- ApiKeyAuth: []
summary: get unreviewed post page
tags:
- Review
/answer/api/v1/reviewing/type:
get:
description: get reviewing type
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
items:
$ref: '#/definitions/schema.GetReviewingTypeResp'
type: array
type: object
security:
- ApiKeyAuth: []
summary: get reviewing type
tags:
- Revision
/answer/api/v1/revisions:
get:
description: get revision list
parameters:
- description: object id
in: query
name: object_id
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
items:
$ref: '#/definitions/schema.GetRevisionResp'
type: array
type: object
summary: get revision list
tags:
- Revision
/answer/api/v1/revisions/audit:
put:
description: revision audit operation:approve or reject
parameters:
- description: audit
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.RevisionAuditReq'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: revision audit
tags:
- Revision
/answer/api/v1/revisions/edit/check:
get:
consumes:
- application/json
description: check can update revision
parameters:
- default: string
description: id
in: query
name: id
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: check can update revision
tags:
- Revision
/answer/api/v1/revisions/unreviewed:
get:
description: get unreviewed revision list
parameters:
- description: page id
in: query
name: page
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
allOf:
- $ref: '#/definitions/pager.PageModel'
- properties:
list:
items:
$ref: '#/definitions/schema.GetUnreviewedRevisionResp'
type: array
type: object
type: object
security:
- ApiKeyAuth: []
summary: get unreviewed revision list
tags:
- Revision
/answer/api/v1/search:
get:
description: search object
parameters:
- description: query string
in: query
name: q
required: true
type: string
- description: order
enum:
- newest
- active
- score
- relevance
in: query
name: order
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
$ref: '#/definitions/schema.SearchResp'
type: object
security:
- ApiKeyAuth: []
summary: search object
tags:
- Search
/answer/api/v1/search/desc:
get:
description: get search description
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
$ref: '#/definitions/schema.SearchResp'
type: object
summary: get search description
tags:
- Search
/answer/api/v1/siteinfo:
get:
description: get site info
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
$ref: '#/definitions/schema.SiteInfoResp'
type: object
summary: get site info
tags:
- site
/answer/api/v1/siteinfo/legal:
get:
description: get site legal info
parameters:
- description: legal information type
enum:
- tos
- privacy
in: query
name: info_type
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
$ref: '#/definitions/schema.GetSiteLegalInfoResp'
type: object
summary: get site legal info
tags:
- site
/answer/api/v1/tag:
delete:
consumes:
- application/json
description: delete tag
parameters:
- description: tag
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.RemoveTagReq'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: delete tag
tags:
- Tag
get:
consumes:
- application/json
description: get tag one
parameters:
- description: tag id
in: query
name: tag_id
required: true
type: string
- description: tag name
in: query
name: tag_name
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
$ref: '#/definitions/schema.GetTagResp'
type: object
summary: get tag one
tags:
- Tag
post:
consumes:
- application/json
description: add tag
parameters:
- description: tag
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.AddTagReq'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: add tag
tags:
- Tag
put:
consumes:
- application/json
description: update tag
parameters:
- description: tag
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.UpdateTagReq'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: update tag
tags:
- Tag
/answer/api/v1/tag/merge:
post:
consumes:
- application/json
description: merge tag
parameters:
- description: tag
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.AddTagReq'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: merge tag
tags:
- Tag
/answer/api/v1/tag/recover:
post:
consumes:
- application/json
description: recover delete tag
parameters:
- description: tag
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.RecoverTagReq'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: recover delete tag
tags:
- Tag
/answer/api/v1/tag/synonym:
put:
consumes:
- application/json
description: update tag
parameters:
- description: tag
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.UpdateTagSynonymReq'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: update tag
tags:
- Tag
/answer/api/v1/tag/synonyms:
get:
description: get tag synonyms
parameters:
- description: tag id
in: query
name: tag_id
required: true
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
$ref: '#/definitions/schema.GetTagSynonymsResp'
type: object
summary: get tag synonyms
tags:
- Tag
/answer/api/v1/tags:
get:
description: get tags list by slug name
parameters:
- collectionFormat: csv
description: string collection
in: query
items:
type: string
name: tags
type: array
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
items:
$ref: '#/definitions/schema.GetTagBasicResp'
type: array
type: object
summary: get tags list
tags:
- Tag
/answer/api/v1/tags/following:
get:
description: get following tag list
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
items:
$ref: '#/definitions/schema.GetFollowingTagsResp'
type: array
type: object
security:
- ApiKeyAuth: []
summary: get following tag list
tags:
- Tag
/answer/api/v1/tags/page:
get:
description: get tag page
parameters:
- description: page size
in: query
name: page
type: integer
- description: page size
in: query
name: page_size
type: integer
- description: slug_name
in: query
name: slug_name
type: string
- description: query condition
enum:
- popular
- name
- newest
in: query
name: query_cond
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
allOf:
- $ref: '#/definitions/pager.PageModel'
- properties:
list:
items:
$ref: '#/definitions/schema.GetTagPageResp'
type: array
type: object
type: object
summary: get tag page
tags:
- Tag
/answer/api/v1/user/action/record:
get:
description: ActionRecord
parameters:
- description: action
enum:
- login
- e_mail
- find_pass
in: query
name: action
required: true
type: string
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
$ref: '#/definitions/schema.ActionRecordResp'
type: object
security:
- ApiKeyAuth: []
summary: ActionRecord
tags:
- User
/answer/api/v1/user/email:
put:
consumes:
- application/json
description: user change email verification
parameters:
- description: UserChangeEmailVerifyReq
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.UserChangeEmailVerifyReq'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: user change email verification
tags:
- User
/answer/api/v1/user/email/change/code:
post:
consumes:
- application/json
description: send email to the user email then change their email
parameters:
- description: UserChangeEmailSendCodeReq
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.UserChangeEmailSendCodeReq'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: send email to the user email then change their email
tags:
- User
/answer/api/v1/user/email/verification:
post:
consumes:
- application/json
description: UserVerifyEmail
parameters:
- default: ""
description: code
in: query
name: code
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
$ref: '#/definitions/schema.UserLoginResp'
type: object
summary: UserVerifyEmail
tags:
- User
/answer/api/v1/user/email/verification/send:
post:
consumes:
- application/json
description: UserVerifyEmailSend
parameters:
- default: ""
description: captcha_id
in: query
name: captcha_id
type: string
- default: ""
description: captcha_code
in: query
name: captcha_code
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
type: string
security:
- ApiKeyAuth: []
summary: UserVerifyEmailSend
tags:
- User
/answer/api/v1/user/info:
get:
consumes:
- application/json
description: get user info, if user no login response http code is 200, but
user info is null
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
$ref: '#/definitions/schema.GetCurrentLoginUserInfoResp'
type: object
security:
- ApiKeyAuth: []
summary: GetUserInfoByUserID
tags:
- User
put:
consumes:
- application/json
description: UserUpdateInfo update user info
parameters:
- description: access-token
in: header
name: Authorization
required: true
type: string
- description: UpdateInfoRequest
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.UpdateInfoRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: UserUpdateInfo update user info
tags:
- User
/answer/api/v1/user/info/search:
get:
consumes:
- application/json
description: SearchUserListByName
parameters:
- description: username
in: query
name: username
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
$ref: '#/definitions/schema.GetOtherUserInfoResp'
type: object
security:
- ApiKeyAuth: []
summary: SearchUserListByName
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:
- application/json
description: UserEmailLogin
parameters:
- description: UserEmailLogin
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.UserEmailLoginReq'
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
$ref: '#/definitions/schema.UserLoginResp'
type: object
summary: UserEmailLogin
tags:
- User
/answer/api/v1/user/logout:
get:
consumes:
- application/json
description: user logout
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: user logout
tags:
- User
/answer/api/v1/user/notification/config:
post:
consumes:
- application/json
description: get user's notification config
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
$ref: '#/definitions/schema.GetUserNotificationConfigResp'
type: object
security:
- ApiKeyAuth: []
summary: get user's notification config
tags:
- User
put:
consumes:
- application/json
description: update user's notification config
parameters:
- description: UpdateUserNotificationConfigReq
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.UpdateUserNotificationConfigReq'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: update user's notification config
tags:
- User
/answer/api/v1/user/notification/unsubscribe:
put:
consumes:
- application/json
description: unsubscribe notification
parameters:
- description: UserUnsubscribeNotificationReq
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.UserUnsubscribeNotificationReq'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
summary: unsubscribe notification
tags:
- User
/answer/api/v1/user/password:
put:
consumes:
- application/json
description: UserModifyPassWord
parameters:
- description: UserModifyPasswordReq
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.UserModifyPasswordReq'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: UserModifyPassWord
tags:
- User
/answer/api/v1/user/password/replacement:
post:
consumes:
- application/json
description: UseRePassWord
parameters:
- description: UserRePassWordRequest
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.UserRePassWordRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
type: string
summary: UseRePassWord
tags:
- User
/answer/api/v1/user/password/reset:
post:
consumes:
- application/json
description: RetrievePassWord
parameters:
- description: UserRetrievePassWordRequest
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.UserRetrievePassWordRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
type: string
summary: RetrievePassWord
tags:
- User
/answer/api/v1/user/plugin/config:
get:
description: get user plugin config
parameters:
- description: plugin_slug_name
in: query
name: plugin_slug_name
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
$ref: '#/definitions/schema.GetPluginConfigResp'
type: object
security:
- ApiKeyAuth: []
summary: get user plugin config
tags:
- UserPlugin
put:
consumes:
- application/json
description: update user plugin config
parameters:
- description: UpdatePluginConfigReq
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.UpdateUserPluginConfigReq'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: update user plugin config
tags:
- UserPlugin
/answer/api/v1/user/plugin/configs:
get:
consumes:
- application/json
description: get plugin list that used for user.
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
items:
$ref: '#/definitions/schema.GetUserPluginListResp'
type: array
type: object
security:
- ApiKeyAuth: []
summary: get plugin list that used for user.
tags:
- UserPlugin
/answer/api/v1/user/ranking:
get:
consumes:
- application/json
description: get user ranking
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
$ref: '#/definitions/schema.UserRankingResp'
type: object
summary: get user ranking
tags:
- User
/answer/api/v1/user/register/email:
post:
consumes:
- application/json
description: UserRegisterByEmail
parameters:
- description: UserRegisterReq
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.UserRegisterReq'
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
$ref: '#/definitions/schema.UserLoginResp'
type: object
summary: UserRegisterByEmail
tags:
- User
/answer/api/v1/user/staff:
get:
consumes:
- application/json
description: get user staff
parameters:
- description: username
in: query
name: username
required: true
type: string
- description: page_size
in: query
name: page_size
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
$ref: '#/definitions/schema.GetUserStaffResp'
type: object
summary: get user staff
tags:
- User
/answer/api/v1/vote/down:
post:
consumes:
- application/json
description: add vote
parameters:
- description: vote
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.VoteReq'
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
$ref: '#/definitions/schema.VoteResp'
type: object
security:
- ApiKeyAuth: []
summary: vote down
tags:
- Activity
/answer/api/v1/vote/up:
post:
consumes:
- application/json
description: add vote
parameters:
- description: vote
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.VoteReq'
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
$ref: '#/definitions/schema.VoteResp'
type: object
security:
- ApiKeyAuth: []
summary: vote up
tags:
- Activity
/custom.css:
get:
description: get site custom CSS
produces:
- text/css
responses:
"200":
description: OK
schema:
type: string
summary: get site custom CSS
tags:
- site
/installation/base-info:
post:
consumes:
- application/json
description: init base info
parameters:
- description: InitBaseInfoReq
in: body
name: data
required: true
schema:
$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:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
$ref: '#/definitions/install.CheckConfigFileResp'
type: object
summary: check config file if exist when installation
tags:
- 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/config:
get:
description: get installation language config mapping
parameters:
- description: installation language
in: query
name: lang
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
summary: get installation language config mapping
tags:
- Lang
/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:
- application/json
description: list personal questions
parameters:
- default: string
description: username
in: query
name: username
required: true
type: string
- description: order
enum:
- newest
- score
in: query
name: order
required: true
type: string
- default: "0"
description: page
in: query
name: page
required: true
type: string
- default: "20"
description: page_size
in: query
name: page_size
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.RespBody'
security:
- ApiKeyAuth: []
summary: list personal questions
tags:
- Personal
/robots.txt:
get:
description: get site robots information
produces:
- application/json
responses:
"200":
description: OK
schema:
type: string
summary: get site robots information
tags:
- site
securityDefinitions:
ApiKeyAuth:
in: header
name: Authorization
type: apiKey
swagger: "2.0"