diff --git a/docs/docs.go b/docs/docs.go index 85abcbb8..9ee5856d 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -1,4 +1,5 @@ -// Package docs Code generated by swaggo/swag. DO NOT EDIT +// Code generated by swaggo/swag. DO NOT EDIT. + package docs import "github.com/swaggo/swag" @@ -4335,7 +4336,7 @@ const docTemplate = `{ } } }, - "/answer/api/v1/report/": { + "/answer/api/v1/report/review": { "put": { "security": [ { @@ -4345,7 +4346,7 @@ const docTemplate = `{ "ApiKeyAuth": [] } ], - "description": "handle flag", + "description": "review report", "consumes": [ "application/json" ], @@ -4355,7 +4356,7 @@ const docTemplate = `{ "tags": [ "Report" ], - "summary": "handle flag", + "summary": "review report", "parameters": [ { "description": "flag", @@ -4363,7 +4364,7 @@ const docTemplate = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/schema.ReportHandleReq" + "$ref": "#/definitions/schema.ReviewReportReq" } } ], @@ -4377,17 +4378,14 @@ const docTemplate = `{ } } }, - "/answer/api/v1/reports/page": { + "/answer/api/v1/report/unreviewed/post": { "get": { "security": [ - { - "ApiKeyAuth": [] - }, { "ApiKeyAuth": [] } ], - "description": "list report records", + "description": "get unreviewed report post page", "consumes": [ "application/json" ], @@ -4397,43 +4395,82 @@ const docTemplate = `{ "tags": [ "Report" ], - "summary": "list report page", + "summary": "get unreviewed report post page", "parameters": [ - { - "enum": [ - "pending", - "completed" - ], - "type": "string", - "description": "status", - "name": "status", - "in": "query", - "required": true - }, - { - "enum": [ - "all", - "question", - "answer", - "comment" - ], - "type": "string", - "description": "object_type", - "name": "object_type", - "in": "query", - "required": true - }, { "type": "integer", - "description": "page size", + "description": "page", "name": "page", "in": "query" - }, - { - "type": "integer", - "description": "page size", - "name": "page_size", - "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/handler.RespBody" + }, + { + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/definitions/pager.PageModel" + }, + { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/schema.GetReportListPageResp" + } + } + } + } + ] + } + } + } + ] + } + } + } + } + }, + "/answer/api/v1/review/pending/post": { + "put": { + "security": [ + { + "ApiKeyAuth": [] + }, + { + "ApiKeyAuth": [] + } + ], + "description": "update review", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Review" + ], + "summary": "update review", + "parameters": [ + { + "description": "review", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/schema.UpdateReviewReq" + } } ], "responses": { @@ -4446,6 +4483,69 @@ const docTemplate = `{ } } }, + "/answer/api/v1/review/pending/post/page": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get unreviewed post page", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Review" + ], + "summary": "get unreviewed post page", + "parameters": [ + { + "type": "integer", + "description": "page", + "name": "page", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/handler.RespBody" + }, + { + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/definitions/pager.PageModel" + }, + { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/schema.GetUnreviewedPostPageResp" + } + } + } + } + ] + } + } + } + ] + } + } + } + } + }, "/answer/api/v1/reviewing/type": { "get": { "security": [ @@ -7717,6 +7817,59 @@ const docTemplate = `{ } } }, + "schema.GetReportListPageResp": { + "type": "object", + "properties": { + "_": { + "type": "string" + }, + "answer_id": { + "type": "string" + }, + "comment_id": { + "type": "string" + }, + "content": { + "type": "string" + }, + "created_at": { + "type": "integer" + }, + "excerpt": { + "type": "string" + }, + "flagged_content": { + "type": "string" + }, + "flagged_reason": { + "$ref": "#/definitions/schema.ReasonItem" + }, + "id": { + "type": "string" + }, + "object_type": { + "type": "string" + }, + "question_id": { + "type": "string" + }, + "reason": { + "$ref": "#/definitions/schema.ReasonItem" + }, + "report_user": { + "$ref": "#/definitions/schema.UserBasicInfo" + }, + "reported_user": { + "$ref": "#/definitions/schema.UserBasicInfo" + }, + "title": { + "type": "string" + }, + "updated_at": { + "type": "integer" + } + } + }, "schema.GetReviewingTypeResp": { "type": "object", "properties": { @@ -7967,6 +8120,52 @@ const docTemplate = `{ } } }, + "schema.GetUnreviewedPostPageResp": { + "type": "object", + "properties": { + "author_user_id": { + "type": "string" + }, + "created_at": { + "type": "integer" + }, + "object_id": { + "type": "string" + }, + "object_type": { + "type": "string", + "enum": [ + "question", + "answer", + "comment" + ] + }, + "parsed_text": { + "type": "string" + }, + "review_id": { + "type": "string" + }, + "submit_at": { + "type": "integer" + }, + "submitter_display_name": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "$ref": "#/definitions/schema.TagResp" + } + }, + "title": { + "type": "string" + }, + "user_info": { + "$ref": "#/definitions/schema.UserBasicInfo" + } + } + }, "schema.GetUnreviewedRevisionResp": { "type": "object", "properties": { @@ -8531,6 +8730,26 @@ const docTemplate = `{ } } }, + "schema.ReasonItem": { + "type": "object", + "properties": { + "content_type": { + "type": "string" + }, + "description": { + "type": "string" + }, + "name": { + "type": "string" + }, + "placeholder": { + "type": "string" + }, + "reason_type": { + "type": "integer" + } + } + }, "schema.RecoverAnswerReq": { "type": "object", "required": [ @@ -8628,21 +8847,47 @@ const docTemplate = `{ } } }, - "schema.ReportHandleReq": { + "schema.ReviewReportReq": { "type": "object", "required": [ - "flagged_type", - "id" + "operation_type", + "report_id" ], "properties": { - "flagged_content": { + "close_msg": { "type": "string" }, - "flagged_type": { + "close_type": { "type": "integer" }, - "id": { + "content": { + "type": "string", + "maxLength": 65535, + "minLength": 6 + }, + "operation_type": { + "type": "string", + "enum": [ + "edit_post", + "close_post", + "delete_post", + "unlist_post", + "ignore_report" + ] + }, + "report_id": { "type": "string" + }, + "tags": { + "type": "array", + "items": { + "$ref": "#/definitions/schema.TagItem" + } + }, + "title": { + "type": "string", + "maxLength": 150, + "minLength": 6 } } }, @@ -9369,9 +9614,15 @@ const docTemplate = `{ "content": { "type": "string" }, + "created_at": { + "type": "integer" + }, "html": { "type": "string" }, + "object_creator_user_id": { + "type": "string" + }, "object_id": { "type": "string" }, @@ -9505,6 +9756,25 @@ const docTemplate = `{ } } }, + "schema.UpdateReviewReq": { + "type": "object", + "required": [ + "review_id", + "status" + ], + "properties": { + "review_id": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "approve", + "reject" + ] + } + } + }, "schema.UpdateSMTPConfigReq": { "type": "object", "properties": { diff --git a/docs/swagger.json b/docs/swagger.json index 41858d60..4429af0b 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -4324,7 +4324,7 @@ } } }, - "/answer/api/v1/report/": { + "/answer/api/v1/report/review": { "put": { "security": [ { @@ -4334,7 +4334,7 @@ "ApiKeyAuth": [] } ], - "description": "handle flag", + "description": "review report", "consumes": [ "application/json" ], @@ -4344,7 +4344,7 @@ "tags": [ "Report" ], - "summary": "handle flag", + "summary": "review report", "parameters": [ { "description": "flag", @@ -4352,7 +4352,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/schema.ReportHandleReq" + "$ref": "#/definitions/schema.ReviewReportReq" } } ], @@ -4366,17 +4366,14 @@ } } }, - "/answer/api/v1/reports/page": { + "/answer/api/v1/report/unreviewed/post": { "get": { "security": [ - { - "ApiKeyAuth": [] - }, { "ApiKeyAuth": [] } ], - "description": "list report records", + "description": "get unreviewed report post page", "consumes": [ "application/json" ], @@ -4386,43 +4383,82 @@ "tags": [ "Report" ], - "summary": "list report page", + "summary": "get unreviewed report post page", "parameters": [ - { - "enum": [ - "pending", - "completed" - ], - "type": "string", - "description": "status", - "name": "status", - "in": "query", - "required": true - }, - { - "enum": [ - "all", - "question", - "answer", - "comment" - ], - "type": "string", - "description": "object_type", - "name": "object_type", - "in": "query", - "required": true - }, { "type": "integer", - "description": "page size", + "description": "page", "name": "page", "in": "query" - }, - { - "type": "integer", - "description": "page size", - "name": "page_size", - "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/handler.RespBody" + }, + { + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/definitions/pager.PageModel" + }, + { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/schema.GetReportListPageResp" + } + } + } + } + ] + } + } + } + ] + } + } + } + } + }, + "/answer/api/v1/review/pending/post": { + "put": { + "security": [ + { + "ApiKeyAuth": [] + }, + { + "ApiKeyAuth": [] + } + ], + "description": "update review", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Review" + ], + "summary": "update review", + "parameters": [ + { + "description": "review", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/schema.UpdateReviewReq" + } } ], "responses": { @@ -4435,6 +4471,69 @@ } } }, + "/answer/api/v1/review/pending/post/page": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get unreviewed post page", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Review" + ], + "summary": "get unreviewed post page", + "parameters": [ + { + "type": "integer", + "description": "page", + "name": "page", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/handler.RespBody" + }, + { + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/definitions/pager.PageModel" + }, + { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/schema.GetUnreviewedPostPageResp" + } + } + } + } + ] + } + } + } + ] + } + } + } + } + }, "/answer/api/v1/reviewing/type": { "get": { "security": [ @@ -7706,6 +7805,59 @@ } } }, + "schema.GetReportListPageResp": { + "type": "object", + "properties": { + "_": { + "type": "string" + }, + "answer_id": { + "type": "string" + }, + "comment_id": { + "type": "string" + }, + "content": { + "type": "string" + }, + "created_at": { + "type": "integer" + }, + "excerpt": { + "type": "string" + }, + "flagged_content": { + "type": "string" + }, + "flagged_reason": { + "$ref": "#/definitions/schema.ReasonItem" + }, + "id": { + "type": "string" + }, + "object_type": { + "type": "string" + }, + "question_id": { + "type": "string" + }, + "reason": { + "$ref": "#/definitions/schema.ReasonItem" + }, + "report_user": { + "$ref": "#/definitions/schema.UserBasicInfo" + }, + "reported_user": { + "$ref": "#/definitions/schema.UserBasicInfo" + }, + "title": { + "type": "string" + }, + "updated_at": { + "type": "integer" + } + } + }, "schema.GetReviewingTypeResp": { "type": "object", "properties": { @@ -7956,6 +8108,52 @@ } } }, + "schema.GetUnreviewedPostPageResp": { + "type": "object", + "properties": { + "author_user_id": { + "type": "string" + }, + "created_at": { + "type": "integer" + }, + "object_id": { + "type": "string" + }, + "object_type": { + "type": "string", + "enum": [ + "question", + "answer", + "comment" + ] + }, + "parsed_text": { + "type": "string" + }, + "review_id": { + "type": "string" + }, + "submit_at": { + "type": "integer" + }, + "submitter_display_name": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "$ref": "#/definitions/schema.TagResp" + } + }, + "title": { + "type": "string" + }, + "user_info": { + "$ref": "#/definitions/schema.UserBasicInfo" + } + } + }, "schema.GetUnreviewedRevisionResp": { "type": "object", "properties": { @@ -8520,6 +8718,26 @@ } } }, + "schema.ReasonItem": { + "type": "object", + "properties": { + "content_type": { + "type": "string" + }, + "description": { + "type": "string" + }, + "name": { + "type": "string" + }, + "placeholder": { + "type": "string" + }, + "reason_type": { + "type": "integer" + } + } + }, "schema.RecoverAnswerReq": { "type": "object", "required": [ @@ -8617,21 +8835,47 @@ } } }, - "schema.ReportHandleReq": { + "schema.ReviewReportReq": { "type": "object", "required": [ - "flagged_type", - "id" + "operation_type", + "report_id" ], "properties": { - "flagged_content": { + "close_msg": { "type": "string" }, - "flagged_type": { + "close_type": { "type": "integer" }, - "id": { + "content": { + "type": "string", + "maxLength": 65535, + "minLength": 6 + }, + "operation_type": { + "type": "string", + "enum": [ + "edit_post", + "close_post", + "delete_post", + "unlist_post", + "ignore_report" + ] + }, + "report_id": { "type": "string" + }, + "tags": { + "type": "array", + "items": { + "$ref": "#/definitions/schema.TagItem" + } + }, + "title": { + "type": "string", + "maxLength": 150, + "minLength": 6 } } }, @@ -9358,9 +9602,15 @@ "content": { "type": "string" }, + "created_at": { + "type": "integer" + }, "html": { "type": "string" }, + "object_creator_user_id": { + "type": "string" + }, "object_id": { "type": "string" }, @@ -9494,6 +9744,25 @@ } } }, + "schema.UpdateReviewReq": { + "type": "object", + "required": [ + "review_id", + "status" + ], + "properties": { + "review_id": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "approve", + "reject" + ] + } + } + }, "schema.UpdateSMTPConfigReq": { "type": "object", "properties": { diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 40331dcf..ae4ed789 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -819,6 +819,41 @@ definitions: description: url title type: string type: object + schema.GetReportListPageResp: + properties: + _: + type: string + answer_id: + type: string + comment_id: + type: string + content: + type: string + created_at: + type: integer + excerpt: + type: string + flagged_content: + type: string + flagged_reason: + $ref: '#/definitions/schema.ReasonItem' + id: + type: string + object_type: + type: string + question_id: + type: string + reason: + $ref: '#/definitions/schema.ReasonItem' + report_user: + $ref: '#/definitions/schema.UserBasicInfo' + reported_user: + $ref: '#/definitions/schema.UserBasicInfo' + title: + type: string + updated_at: + type: integer + type: object schema.GetReviewingTypeResp: properties: label: @@ -991,6 +1026,37 @@ definitions: $ref: '#/definitions/schema.TagSynonym' type: array type: object + schema.GetUnreviewedPostPageResp: + properties: + author_user_id: + type: string + created_at: + type: integer + object_id: + type: string + object_type: + enum: + - question + - answer + - comment + type: string + parsed_text: + type: string + review_id: + type: string + submit_at: + type: integer + submitter_display_name: + type: string + tags: + items: + $ref: '#/definitions/schema.TagResp' + type: array + title: + type: string + user_info: + $ref: '#/definitions/schema.UserBasicInfo' + type: object schema.GetUnreviewedRevisionResp: properties: info: @@ -1387,6 +1453,19 @@ definitions: required: - id type: object + schema.ReasonItem: + properties: + content_type: + type: string + description: + type: string + name: + type: string + placeholder: + type: string + reason_type: + type: integer + type: object schema.RecoverAnswerReq: properties: answer_id: @@ -1451,17 +1530,37 @@ definitions: question_id: type: string type: object - schema.ReportHandleReq: + schema.ReviewReportReq: properties: - flagged_content: + close_msg: type: string - flagged_type: + close_type: type: integer - id: + content: + maxLength: 65535 + minLength: 6 + type: string + operation_type: + enum: + - edit_post + - close_post + - delete_post + - unlist_post + - ignore_report + type: string + report_id: + type: string + tags: + items: + $ref: '#/definitions/schema.TagItem' + type: array + title: + maxLength: 150 + minLength: 6 type: string required: - - flagged_type - - id + - operation_type + - report_id type: object schema.RevisionAuditReq: properties: @@ -1956,8 +2055,12 @@ definitions: properties: content: type: string + created_at: + type: integer html: type: string + object_creator_user_id: + type: string object_id: type: string tags: @@ -2048,6 +2151,19 @@ definitions: required: - level type: object + schema.UpdateReviewReq: + properties: + review_id: + type: string + status: + enum: + - approve + - reject + type: string + required: + - review_id + - status + type: object schema.UpdateSMTPConfigReq: properties: encryption: @@ -5097,18 +5213,18 @@ paths: summary: add report tags: - Report - /answer/api/v1/report/: + /answer/api/v1/report/review: put: consumes: - application/json - description: handle flag + description: review report parameters: - description: flag in: body name: data required: true schema: - $ref: '#/definitions/schema.ReportHandleReq' + $ref: '#/definitions/schema.ReviewReportReq' produces: - application/json responses: @@ -5119,41 +5235,55 @@ paths: security: - ApiKeyAuth: [] - ApiKeyAuth: [] - summary: handle flag + summary: review report tags: - Report - /answer/api/v1/reports/page: + /answer/api/v1/report/unreviewed/post: get: consumes: - application/json - description: list report records + description: get unreviewed report post page parameters: - - description: status - enum: - - pending - - completed - in: query - name: status - required: true - type: string - - description: object_type - enum: - - all - - question - - answer - - comment - in: query - name: object_type - required: true - type: string - - description: page size + - description: page 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.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: @@ -5164,9 +5294,43 @@ paths: security: - ApiKeyAuth: [] - ApiKeyAuth: [] - summary: list report page + summary: update review tags: - - Report + - 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 + 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