A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.
feat(users): update api docs
LinkinStars1211907b6426
diff --git a/docs/docs.go b/docs/docs.goindex 23093265..10453be2 100644--- a/docs/docs.go+++ b/docs/docs.go@@ -1741,6 +1741,45 @@ const docTemplate = `{}}},+ "/answer/admin/api/users": {+ "post": {+ "security": [+ {+ "ApiKeyAuth": []+ }+ ],+ "description": "add users",+ "consumes": [+ "application/json"+ ],+ "produces": [+ "application/json"+ ],+ "tags": [+ "admin"+ ],+ "summary": "add users",+ "parameters": [+ {+ "description": "user",+ "name": "data",+ "in": "body",+ "required": true,+ "schema": {+ "$ref": "#/definitions/schema.AddUserReq"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "OK",+ "schema": {+ "$ref": "#/definitions/handler.RespBody"+ }+ }+ }+ }+ },"/answer/admin/api/users/activation": {"post": {"security": [@@ -4515,7 +4554,39 @@ const docTemplate = `{"type": "object","properties": {"data": {- "$ref": "#/definitions/schema.SearchListResp"+ "$ref": "#/definitions/schema.SearchResp"+ }+ }+ }+ ]+ }+ }+ }+ }+ },+ "/answer/api/v1/search/desc": {+ "get": {+ "description": "get search description",+ "produces": [+ "application/json"+ ],+ "tags": [+ "Search"+ ],+ "summary": "get search description",+ "responses": {+ "200": {+ "description": "OK",+ "schema": {+ "allOf": [+ {+ "$ref": "#/definitions/handler.RespBody"+ },+ {+ "type": "object",+ "properties": {+ "data": {+ "$ref": "#/definitions/schema.SearchResp"}}}@@ -5406,7 +5477,7 @@ const docTemplate = `{"in": "body","required": true,"schema": {- "$ref": "#/definitions/schema.UserEmailLogin"+ "$ref": "#/definitions/schema.UserEmailLoginReq"}}],@@ -6346,6 +6417,13 @@ const docTemplate = `{"original_text"],"properties": {+ "captcha_code": {+ "type": "string"+ },+ "captcha_id": {+ "description": "captcha_id",+ "type": "string"+ },"mention_username_list": {"description": "@ user id list","type": "array",@@ -6376,6 +6454,13 @@ const docTemplate = `{"report_type"],"properties": {+ "captcha_code": {+ "type": "string"+ },+ "captcha_id": {+ "description": "captcha_id",+ "type": "string"+ },"content": {"description": "report content","type": "string",@@ -6480,6 +6565,12 @@ const docTemplate = `{"content"],"properties": {+ "captcha_code": {+ "type": "string"+ },+ "captcha_id": {+ "type": "string"+ },"content": {"type": "string","maxLength": 65535,@@ -6496,6 +6587,12 @@ const docTemplate = `{"content"],"properties": {+ "captcha_code": {+ "type": "string"+ },+ "captcha_id": {+ "type": "string"+ },"content": {"type": "string","maxLength": 65535,@@ -6926,6 +7023,7 @@ const docTemplate = `{"type": "integer"},"have_password": {+ "description": "user have password","type": "boolean"},"id": {@@ -7702,6 +7800,13 @@ const docTemplate = `{"title"],"properties": {+ "captcha_code": {+ "type": "string"+ },+ "captcha_id": {+ "description": "captcha_id",+ "type": "string"+ },"content": {"description": "content","type": "string",@@ -7737,6 +7842,13 @@ const docTemplate = `{"maxLength": 65535,"minLength": 6},+ "captcha_code": {+ "type": "string"+ },+ "captcha_id": {+ "description": "captcha_id",+ "type": "string"+ },"content": {"description": "content","type": "string",@@ -7898,6 +8010,13 @@ const docTemplate = `{"title"],"properties": {+ "captcha_code": {+ "type": "string"+ },+ "captcha_id": {+ "description": "captcha_id",+ "type": "string"+ },"content": {"description": "content","type": "string",@@ -7939,6 +8058,13 @@ const docTemplate = `{"id"],"properties": {+ "captcha_code": {+ "type": "string"+ },+ "captcha_id": {+ "description": "captcha_id",+ "type": "string"+ },"id": {"type": "string"},@@ -7956,8 +8082,13 @@ const docTemplate = `{"id"],"properties": {+ "captcha_code": {+ "type": "string"+ },+ "captcha_id": {+ "type": "string"+ },"id": {- "description": "answer id","type": "string"}}@@ -7968,6 +8099,13 @@ const docTemplate = `{"comment_id"],"properties": {+ "captcha_code": {+ "type": "string"+ },+ "captcha_id": {+ "description": "captcha_id",+ "type": "string"+ },"comment_id": {"description": "comment id","type": "string"@@ -7980,6 +8118,13 @@ const docTemplate = `{"id"],"properties": {+ "captcha_code": {+ "type": "string"+ },+ "captcha_id": {+ "description": "captcha_id",+ "type": "string"+ },"id": {"description": "question id","type": "string"@@ -8041,24 +8186,6 @@ const docTemplate = `{}}},- "schema.SearchListResp": {- "type": "object",- "properties": {- "count": {- "type": "integer"- },- "extra": {- "description": "extra fields"- },- "list": {- "description": "search response",- "type": "array",- "items": {- "$ref": "#/definitions/schema.SearchResults"- }- }- }- },"schema.SearchObject": {"type": "object","properties": {@@ -8107,7 +8234,22 @@ const docTemplate = `{}}},- "schema.SearchResults": {+ "schema.SearchResp": {+ "type": "object",+ "properties": {+ "count": {+ "type": "integer"+ },+ "list": {+ "description": "search response",+ "type": "array",+ "items": {+ "$ref": "#/definitions/schema.SearchResult"+ }+ }+ }+ },+ "schema.SearchResult": {"type": "object","properties": {"object": {@@ -8729,6 +8871,13 @@ const docTemplate = `{"original_text"],"properties": {+ "captcha_code": {+ "type": "string"+ },+ "captcha_id": {+ "description": "captcha_id",+ "type": "string"+ },"comment_id": {"description": "comment id","type": "string"@@ -9004,39 +9153,30 @@ const docTemplate = `{"type": "object","properties": {"avatar": {- "description": "avatar","type": "string"},"display_name": {- "description": "display_name","type": "string"},"id": {- "description": "user_id","type": "string"},"ip_info": {- "description": "ip info","type": "string"},"location": {- "description": "location","type": "string"},"rank": {- "description": "rank","type": "integer"},"status": {- "description": "status","type": "string"},"username": {- "description": "name","type": "string"},"website": {- "description": "website","type": "string"}}@@ -9078,7 +9218,7 @@ const docTemplate = `{}}},- "schema.UserEmailLogin": {+ "schema.UserEmailLoginReq": {"type": "object","required": ["e_mail",@@ -9086,20 +9226,16 @@ const docTemplate = `{],"properties": {"captcha_code": {- "description": "captcha_code","type": "string"},"captcha_id": {- "description": "captcha_id","type": "string"},"e_mail": {- "description": "e_mail","type": "string","maxLength": 500},"pass": {- "description": "password","type": "string","maxLength": 32,"minLength": 8@@ -9309,12 +9445,10 @@ const docTemplate = `{],"properties": {"code": {- "description": "code","type": "string","maxLength": 100},"pass": {- "description": "Password","type": "string","maxLength": 32}@@ -9329,25 +9463,20 @@ const docTemplate = `{],"properties": {"captcha_code": {- "description": "captcha_code","type": "string"},"captcha_id": {- "description": "captcha_id","type": "string"},"e_mail": {- "description": "email","type": "string","maxLength": 500},"name": {- "description": "name","type": "string","maxLength": 30},"pass": {- "description": "password","type": "string","maxLength": 32,"minLength": 8@@ -9361,15 +9490,12 @@ const docTemplate = `{],"properties": {"captcha_code": {- "description": "captcha_code","type": "string"},"captcha_id": {- "description": "captcha_id","type": "string"},"e_mail": {- "description": "e_mail","type": "string","maxLength": 500}@@ -9381,6 +9507,13 @@ const docTemplate = `{"object_id"],"properties": {+ "captcha_code": {+ "type": "string"+ },+ "captcha_id": {+ "description": "captcha_id",+ "type": "string"+ },"is_cancel": {"description": "is cancel","type": "boolean"diff --git a/docs/swagger.json b/docs/swagger.jsonindex dc60d471..a7a91bc9 100644--- a/docs/swagger.json+++ b/docs/swagger.json@@ -1729,6 +1729,45 @@}}},+ "/answer/admin/api/users": {+ "post": {+ "security": [+ {+ "ApiKeyAuth": []+ }+ ],+ "description": "add users",+ "consumes": [+ "application/json"+ ],+ "produces": [+ "application/json"+ ],+ "tags": [+ "admin"+ ],+ "summary": "add users",+ "parameters": [+ {+ "description": "user",+ "name": "data",+ "in": "body",+ "required": true,+ "schema": {+ "$ref": "#/definitions/schema.AddUserReq"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "OK",+ "schema": {+ "$ref": "#/definitions/handler.RespBody"+ }+ }+ }+ }+ },"/answer/admin/api/users/activation": {"post": {"security": [@@ -4503,7 +4542,39 @@"type": "object","properties": {"data": {- "$ref": "#/definitions/schema.SearchListResp"+ "$ref": "#/definitions/schema.SearchResp"+ }+ }+ }+ ]+ }+ }+ }+ }+ },+ "/answer/api/v1/search/desc": {+ "get": {+ "description": "get search description",+ "produces": [+ "application/json"+ ],+ "tags": [+ "Search"+ ],+ "summary": "get search description",+ "responses": {+ "200": {+ "description": "OK",+ "schema": {+ "allOf": [+ {+ "$ref": "#/definitions/handler.RespBody"+ },+ {+ "type": "object",+ "properties": {+ "data": {+ "$ref": "#/definitions/schema.SearchResp"}}}@@ -5394,7 +5465,7 @@"in": "body","required": true,"schema": {- "$ref": "#/definitions/schema.UserEmailLogin"+ "$ref": "#/definitions/schema.UserEmailLoginReq"}}],@@ -6334,6 +6405,13 @@"original_text"],"properties": {+ "captcha_code": {+ "type": "string"+ },+ "captcha_id": {+ "description": "captcha_id",+ "type": "string"+ },"mention_username_list": {"description": "@ user id list","type": "array",@@ -6364,6 +6442,13 @@"report_type"],"properties": {+ "captcha_code": {+ "type": "string"+ },+ "captcha_id": {+ "description": "captcha_id",+ "type": "string"+ },"content": {"description": "report content","type": "string",@@ -6468,6 +6553,12 @@"content"],"properties": {+ "captcha_code": {+ "type": "string"+ },+ "captcha_id": {+ "type": "string"+ },"content": {"type": "string","maxLength": 65535,@@ -6484,6 +6575,12 @@"content"],"properties": {+ "captcha_code": {+ "type": "string"+ },+ "captcha_id": {+ "type": "string"+ },"content": {"type": "string","maxLength": 65535,@@ -6914,6 +7011,7 @@"type": "integer"},"have_password": {+ "description": "user have password","type": "boolean"},"id": {@@ -7690,6 +7788,13 @@"title"],"properties": {+ "captcha_code": {+ "type": "string"+ },+ "captcha_id": {+ "description": "captcha_id",+ "type": "string"+ },"content": {"description": "content","type": "string",@@ -7725,6 +7830,13 @@"maxLength": 65535,"minLength": 6},+ "captcha_code": {+ "type": "string"+ },+ "captcha_id": {+ "description": "captcha_id",+ "type": "string"+ },"content": {"description": "content","type": "string",@@ -7886,6 +7998,13 @@"title"],"properties": {+ "captcha_code": {+ "type": "string"+ },+ "captcha_id": {+ "description": "captcha_id",+ "type": "string"+ },"content": {"description": "content","type": "string",@@ -7927,6 +8046,13 @@"id"],"properties": {+ "captcha_code": {+ "type": "string"+ },+ "captcha_id": {+ "description": "captcha_id",+ "type": "string"+ },"id": {"type": "string"},@@ -7944,8 +8070,13 @@"id"],"properties": {+ "captcha_code": {+ "type": "string"+ },+ "captcha_id": {+ "type": "string"+ },"id": {- "description": "answer id","type": "string"}}@@ -7956,6 +8087,13 @@"comment_id"],"properties": {+ "captcha_code": {+ "type": "string"+ },+ "captcha_id": {+ "description": "captcha_id",+ "type": "string"+ },"comment_id": {"description": "comment id","type": "string"@@ -7968,6 +8106,13 @@"id"],"properties": {+ "captcha_code": {+ "type": "string"+ },+ "captcha_id": {+ "description": "captcha_id",+ "type": "string"+ },"id": {"description": "question id","type": "string"@@ -8029,24 +8174,6 @@}}},- "schema.SearchListResp": {- "type": "object",- "properties": {- "count": {- "type": "integer"- },- "extra": {- "description": "extra fields"- },- "list": {- "description": "search response",- "type": "array",- "items": {- "$ref": "#/definitions/schema.SearchResp"- }- }- }- },"schema.SearchObject": {"type": "object","properties": {@@ -8096,6 +8223,21 @@}},"schema.SearchResp": {+ "type": "object",+ "properties": {+ "count": {+ "type": "integer"+ },+ "list": {+ "description": "search response",+ "type": "array",+ "items": {+ "$ref": "#/definitions/schema.SearchResult"+ }+ }+ }+ },+ "schema.SearchResult": {"type": "object","properties": {"object": {@@ -8717,6 +8859,13 @@"original_text"],"properties": {+ "captcha_code": {+ "type": "string"+ },+ "captcha_id": {+ "description": "captcha_id",+ "type": "string"+ },"comment_id": {"description": "comment id","type": "string"@@ -8992,39 +9141,30 @@"type": "object","properties": {"avatar": {- "description": "avatar","type": "string"},"display_name": {- "description": "display_name","type": "string"},"id": {- "description": "user_id","type": "string"},"ip_info": {- "description": "ip info","type": "string"},"location": {- "description": "location","type": "string"},"rank": {- "description": "rank","type": "integer"},"status": {- "description": "status","type": "string"},"username": {- "description": "name","type": "string"},"website": {- "description": "website","type": "string"}}@@ -9066,7 +9206,7 @@}}},- "schema.UserEmailLogin": {+ "schema.UserEmailLoginReq": {"type": "object","required": ["e_mail",@@ -9074,20 +9214,16 @@],"properties": {"captcha_code": {- "description": "captcha_code","type": "string"},"captcha_id": {- "description": "captcha_id","type": "string"},"e_mail": {- "description": "e_mail","type": "string","maxLength": 500},"pass": {- "description": "password","type": "string","maxLength": 32,"minLength": 8@@ -9297,12 +9433,10 @@],"properties": {"code": {- "description": "code","type": "string","maxLength": 100},"pass": {- "description": "Password","type": "string","maxLength": 32}@@ -9317,25 +9451,20 @@],"properties": {"captcha_code": {- "description": "captcha_code","type": "string"},"captcha_id": {- "description": "captcha_id","type": "string"},"e_mail": {- "description": "email","type": "string","maxLength": 500},"name": {- "description": "name","type": "string","maxLength": 30},"pass": {- "description": "password","type": "string","maxLength": 32,"minLength": 8@@ -9349,15 +9478,12 @@],"properties": {"captcha_code": {- "description": "captcha_code","type": "string"},"captcha_id": {- "description": "captcha_id","type": "string"},"e_mail": {- "description": "e_mail","type": "string","maxLength": 500}@@ -9369,6 +9495,13 @@"object_id"],"properties": {+ "captcha_code": {+ "type": "string"+ },+ "captcha_id": {+ "description": "captcha_id",+ "type": "string"+ },"is_cancel": {"description": "is cancel","type": "boolean"diff --git a/docs/swagger.yaml b/docs/swagger.yamlindex 5781165d..b7408b43 100644--- a/docs/swagger.yaml+++ b/docs/swagger.yaml@@ -146,6 +146,11 @@ definitions:type: objectschema.AddCommentReq:properties:+ captcha_code:+ type: string+ captcha_id:+ description: captcha_id+ type: stringmention_username_list:description: '@ user id list'items:@@ -168,6 +173,11 @@ definitions:type: objectschema.AddReportReq:properties:+ captcha_code:+ type: string+ captcha_id:+ description: captcha_id+ type: stringcontent:description: report contentmaxLength: 500@@ -243,6 +253,10 @@ definitions:type: objectschema.AnswerAddReq:properties:+ captcha_code:+ type: string+ captcha_id:+ type: stringcontent:maxLength: 65535minLength: 6@@ -254,6 +268,10 @@ definitions:type: objectschema.AnswerUpdateReq:properties:+ captcha_code:+ type: string+ captcha_id:+ type: stringcontent:maxLength: 65535minLength: 6@@ -559,6 +577,7 @@ definitions:description: follow counttype: integerhave_password:+ description: user have passwordtype: booleanid:description: user id@@ -1104,6 +1123,11 @@ definitions:type: objectschema.QuestionAdd:properties:+ captcha_code:+ type: string+ captcha_id:+ description: captcha_id+ type: stringcontent:description: contentmaxLength: 65535@@ -1130,6 +1154,11 @@ definitions:maxLength: 65535minLength: 6type: string+ captcha_code:+ type: string+ captcha_id:+ description: captcha_id+ type: stringcontent:description: contentmaxLength: 65535@@ -1244,6 +1273,11 @@ definitions:type: objectschema.QuestionUpdate:properties:+ captcha_code:+ type: string+ captcha_id:+ description: captcha_id+ type: stringcontent:description: contentmaxLength: 65535@@ -1277,6 +1311,11 @@ definitions:type: objectschema.QuestionUpdateInviteUser:properties:+ captcha_code:+ type: string+ captcha_id:+ description: captcha_id+ type: stringid:type: stringinvite_user:@@ -1288,14 +1327,22 @@ definitions:type: objectschema.RemoveAnswerReq:properties:+ captcha_code:+ type: string+ captcha_id:+ type: stringid:- description: answer idtype: stringrequired:- idtype: objectschema.RemoveCommentReq:properties:+ captcha_code:+ type: string+ captcha_id:+ description: captcha_id+ type: stringcomment_id:description: comment idtype: string@@ -1304,6 +1351,11 @@ definitions:type: objectschema.RemoveQuestionReq:properties:+ captcha_code:+ type: string+ captcha_id:+ description: captcha_id+ type: stringid:description: question idtype: string@@ -1347,18 +1399,6 @@ definitions:- id- operationtype: object- schema.SearchListResp:- properties:- count:- type: integer- extra:- description: extra fields- list:- description: search response- items:- $ref: '#/definitions/schema.SearchResp'- type: array- type: objectschema.SearchObject:properties:accepted:@@ -1391,6 +1431,16 @@ definitions:type: integertype: objectschema.SearchResp:+ properties:+ count:+ type: integer+ list:+ description: search response+ items:+ $ref: '#/definitions/schema.SearchResult'+ type: array+ type: object+ schema.SearchResult:properties:object:allOf:@@ -1813,6 +1863,11 @@ definitions:type: objectschema.UpdateCommentReq:properties:+ captcha_code:+ type: string+ captcha_id:+ description: captcha_id+ type: stringcomment_id:description: comment idtype: string@@ -2009,31 +2064,22 @@ definitions:schema.UserBasicInfo:properties:avatar:- description: avatartype: stringdisplay_name:- description: display_nametype: stringid:- description: user_idtype: stringip_info:- description: ip infotype: stringlocation:- description: locationtype: stringrank:- description: ranktype: integerstatus:- description: statustype: stringusername:- description: nametype: stringwebsite:- description: websitetype: stringtype: objectschema.UserChangeEmailSendCodeReq:@@ -2062,20 +2108,16 @@ definitions:required:- codetype: object- schema.UserEmailLogin:+ schema.UserEmailLoginReq:properties:captcha_code:- description: captcha_codetype: stringcaptcha_id:- description: captcha_idtype: stringe_mail:- description: e_mailmaxLength: 500type: stringpass:- description: passwordmaxLength: 32minLength: 8type: string@@ -2226,11 +2268,9 @@ definitions:schema.UserRePassWordRequest:properties:code:- description: codemaxLength: 100type: stringpass:- description: PasswordmaxLength: 32type: stringrequired:@@ -2240,21 +2280,16 @@ definitions:schema.UserRegisterReq:properties:captcha_code:- description: captcha_codetype: stringcaptcha_id:- description: captcha_idtype: stringe_mail:- description: emailmaxLength: 500type: stringname:- description: namemaxLength: 30type: stringpass:- description: passwordmaxLength: 32minLength: 8type: string@@ -2266,13 +2301,10 @@ definitions:schema.UserRetrievePassWordRequest:properties:captcha_code:- description: captcha_codetype: stringcaptcha_id:- description: captcha_idtype: stringe_mail:- description: e_mailmaxLength: 500type: stringrequired:@@ -2280,6 +2312,11 @@ definitions:type: objectschema.VoteReq:properties:+ captcha_code:+ type: string+ captcha_id:+ description: captcha_id+ type: stringis_cancel:description: is canceltype: boolean@@ -3344,6 +3381,30 @@ paths:summary: update usertags:- 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.AddUserReq'+ 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@@ -5038,13 +5099,31 @@ paths:- $ref: '#/definitions/handler.RespBody'- properties:data:- $ref: '#/definitions/schema.SearchListResp'+ $ref: '#/definitions/schema.SearchResp'type: objectsecurity:- ApiKeyAuth: []summary: search objecttags:- 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@@ -5582,7 +5661,7 @@ paths:name: datarequired: trueschema:- $ref: '#/definitions/schema.UserEmailLogin'+ $ref: '#/definitions/schema.UserEmailLoginReq'produces:- application/jsonresponses: