| 
									
										
										
										
											2024-02-06 13:21:13 +08:00
										 |  |  | from flask import request | 
					
						
							| 
									
										
										
										
											2025-05-06 11:58:49 +08:00
										 |  |  | from flask_login import current_user | 
					
						
							|  |  |  | from flask_restful import Resource, marshal, marshal_with, reqparse | 
					
						
							| 
									
										
										
										
											2024-02-06 13:21:13 +08:00
										 |  |  | from werkzeug.exceptions import Forbidden | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-12-18 13:10:05 +08:00
										 |  |  | from controllers.console import api | 
					
						
							|  |  |  | from controllers.console.app.error import NoFileUploadedError | 
					
						
							|  |  |  | from controllers.console.datasets.error import TooManyFilesError | 
					
						
							| 
									
										
										
										
											2024-11-01 15:51:22 +08:00
										 |  |  | from controllers.console.wraps import ( | 
					
						
							|  |  |  |     account_initialization_required, | 
					
						
							|  |  |  |     cloud_edition_billing_resource_check, | 
					
						
							|  |  |  |     setup_required, | 
					
						
							|  |  |  | ) | 
					
						
							| 
									
										
										
										
											2023-12-18 13:10:05 +08:00
										 |  |  | from extensions.ext_redis import redis_client | 
					
						
							| 
									
										
										
										
											2024-02-06 13:21:13 +08:00
										 |  |  | from fields.annotation_fields import ( | 
					
						
							|  |  |  |     annotation_fields, | 
					
						
							|  |  |  |     annotation_hit_history_fields, | 
					
						
							|  |  |  | ) | 
					
						
							| 
									
										
										
										
											2023-12-18 13:10:05 +08:00
										 |  |  | from libs.login import login_required | 
					
						
							|  |  |  | from services.annotation_service import AppAnnotationService | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class AnnotationReplyActionApi(Resource): | 
					
						
							|  |  |  |     @setup_required | 
					
						
							|  |  |  |     @login_required | 
					
						
							|  |  |  |     @account_initialization_required | 
					
						
							| 
									
										
										
										
											2024-08-26 15:29:10 +08:00
										 |  |  |     @cloud_edition_billing_resource_check("annotation") | 
					
						
							| 
									
										
										
										
											2023-12-18 13:10:05 +08:00
										 |  |  |     def post(self, app_id, action): | 
					
						
							| 
									
										
										
										
											2024-08-05 04:55:55 +00:00
										 |  |  |         if not current_user.is_editor: | 
					
						
							| 
									
										
										
										
											2023-12-18 13:10:05 +08:00
										 |  |  |             raise Forbidden() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         app_id = str(app_id) | 
					
						
							|  |  |  |         parser = reqparse.RequestParser() | 
					
						
							| 
									
										
										
										
											2024-08-26 15:29:10 +08:00
										 |  |  |         parser.add_argument("score_threshold", required=True, type=float, location="json") | 
					
						
							|  |  |  |         parser.add_argument("embedding_provider_name", required=True, type=str, location="json") | 
					
						
							|  |  |  |         parser.add_argument("embedding_model_name", required=True, type=str, location="json") | 
					
						
							| 
									
										
										
										
											2023-12-18 13:10:05 +08:00
										 |  |  |         args = parser.parse_args() | 
					
						
							| 
									
										
										
										
											2024-08-26 15:29:10 +08:00
										 |  |  |         if action == "enable": | 
					
						
							| 
									
										
										
										
											2023-12-18 13:10:05 +08:00
										 |  |  |             result = AppAnnotationService.enable_app_annotation(args, app_id) | 
					
						
							| 
									
										
										
										
											2024-08-26 15:29:10 +08:00
										 |  |  |         elif action == "disable": | 
					
						
							| 
									
										
										
										
											2023-12-18 13:10:05 +08:00
										 |  |  |             result = AppAnnotationService.disable_app_annotation(app_id) | 
					
						
							|  |  |  |         else: | 
					
						
							| 
									
										
										
										
											2024-08-26 15:29:10 +08:00
										 |  |  |             raise ValueError("Unsupported annotation reply action") | 
					
						
							| 
									
										
										
										
											2023-12-18 13:10:05 +08:00
										 |  |  |         return result, 200 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class AppAnnotationSettingDetailApi(Resource): | 
					
						
							|  |  |  |     @setup_required | 
					
						
							|  |  |  |     @login_required | 
					
						
							|  |  |  |     @account_initialization_required | 
					
						
							|  |  |  |     def get(self, app_id): | 
					
						
							| 
									
										
										
										
											2024-08-05 04:55:55 +00:00
										 |  |  |         if not current_user.is_editor: | 
					
						
							| 
									
										
										
										
											2023-12-18 13:10:05 +08:00
										 |  |  |             raise Forbidden() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         app_id = str(app_id) | 
					
						
							|  |  |  |         result = AppAnnotationService.get_app_annotation_setting_by_app_id(app_id) | 
					
						
							|  |  |  |         return result, 200 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class AppAnnotationSettingUpdateApi(Resource): | 
					
						
							|  |  |  |     @setup_required | 
					
						
							|  |  |  |     @login_required | 
					
						
							|  |  |  |     @account_initialization_required | 
					
						
							|  |  |  |     def post(self, app_id, annotation_setting_id): | 
					
						
							| 
									
										
										
										
											2024-08-05 04:55:55 +00:00
										 |  |  |         if not current_user.is_editor: | 
					
						
							| 
									
										
										
										
											2023-12-18 13:10:05 +08:00
										 |  |  |             raise Forbidden() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         app_id = str(app_id) | 
					
						
							|  |  |  |         annotation_setting_id = str(annotation_setting_id) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         parser = reqparse.RequestParser() | 
					
						
							| 
									
										
										
										
											2024-08-26 15:29:10 +08:00
										 |  |  |         parser.add_argument("score_threshold", required=True, type=float, location="json") | 
					
						
							| 
									
										
										
										
											2023-12-18 13:10:05 +08:00
										 |  |  |         args = parser.parse_args() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         result = AppAnnotationService.update_app_annotation_setting(app_id, annotation_setting_id, args) | 
					
						
							|  |  |  |         return result, 200 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class AnnotationReplyActionStatusApi(Resource): | 
					
						
							|  |  |  |     @setup_required | 
					
						
							|  |  |  |     @login_required | 
					
						
							|  |  |  |     @account_initialization_required | 
					
						
							| 
									
										
										
										
											2024-08-26 15:29:10 +08:00
										 |  |  |     @cloud_edition_billing_resource_check("annotation") | 
					
						
							| 
									
										
										
										
											2023-12-18 13:10:05 +08:00
										 |  |  |     def get(self, app_id, job_id, action): | 
					
						
							| 
									
										
										
										
											2024-08-05 04:55:55 +00:00
										 |  |  |         if not current_user.is_editor: | 
					
						
							| 
									
										
										
										
											2023-12-18 13:10:05 +08:00
										 |  |  |             raise Forbidden() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         job_id = str(job_id) | 
					
						
							| 
									
										
										
										
											2024-08-26 15:29:10 +08:00
										 |  |  |         app_annotation_job_key = "{}_app_annotation_job_{}".format(action, str(job_id)) | 
					
						
							| 
									
										
										
										
											2023-12-18 13:10:05 +08:00
										 |  |  |         cache_result = redis_client.get(app_annotation_job_key) | 
					
						
							|  |  |  |         if cache_result is None: | 
					
						
							| 
									
										
										
										
											2025-04-14 10:24:01 +08:00
										 |  |  |             raise ValueError("The job does not exist.") | 
					
						
							| 
									
										
										
										
											2023-12-18 13:10:05 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |         job_status = cache_result.decode() | 
					
						
							| 
									
										
										
										
											2024-08-26 15:29:10 +08:00
										 |  |  |         error_msg = "" | 
					
						
							|  |  |  |         if job_status == "error": | 
					
						
							|  |  |  |             app_annotation_error_key = "{}_app_annotation_error_{}".format(action, str(job_id)) | 
					
						
							| 
									
										
										
										
											2023-12-18 13:10:05 +08:00
										 |  |  |             error_msg = redis_client.get(app_annotation_error_key).decode() | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-08-26 15:29:10 +08:00
										 |  |  |         return {"job_id": job_id, "job_status": job_status, "error_msg": error_msg}, 200 | 
					
						
							| 
									
										
										
										
											2023-12-18 13:10:05 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class AnnotationListApi(Resource): | 
					
						
							|  |  |  |     @setup_required | 
					
						
							|  |  |  |     @login_required | 
					
						
							|  |  |  |     @account_initialization_required | 
					
						
							|  |  |  |     def get(self, app_id): | 
					
						
							| 
									
										
										
										
											2024-08-05 04:55:55 +00:00
										 |  |  |         if not current_user.is_editor: | 
					
						
							| 
									
										
										
										
											2023-12-18 13:10:05 +08:00
										 |  |  |             raise Forbidden() | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-08-26 15:29:10 +08:00
										 |  |  |         page = request.args.get("page", default=1, type=int) | 
					
						
							|  |  |  |         limit = request.args.get("limit", default=20, type=int) | 
					
						
							| 
									
										
										
										
											2024-12-24 18:38:51 +08:00
										 |  |  |         keyword = request.args.get("keyword", default="", type=str) | 
					
						
							| 
									
										
										
										
											2023-12-18 13:10:05 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |         app_id = str(app_id) | 
					
						
							|  |  |  |         annotation_list, total = AppAnnotationService.get_annotation_list_by_app_id(app_id, page, limit, keyword) | 
					
						
							|  |  |  |         response = { | 
					
						
							| 
									
										
										
										
											2024-08-26 15:29:10 +08:00
										 |  |  |             "data": marshal(annotation_list, annotation_fields), | 
					
						
							|  |  |  |             "has_more": len(annotation_list) == limit, | 
					
						
							|  |  |  |             "limit": limit, | 
					
						
							|  |  |  |             "total": total, | 
					
						
							|  |  |  |             "page": page, | 
					
						
							| 
									
										
										
										
											2023-12-18 13:10:05 +08:00
										 |  |  |         } | 
					
						
							|  |  |  |         return response, 200 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class AnnotationExportApi(Resource): | 
					
						
							|  |  |  |     @setup_required | 
					
						
							|  |  |  |     @login_required | 
					
						
							|  |  |  |     @account_initialization_required | 
					
						
							|  |  |  |     def get(self, app_id): | 
					
						
							| 
									
										
										
										
											2024-08-05 04:55:55 +00:00
										 |  |  |         if not current_user.is_editor: | 
					
						
							| 
									
										
										
										
											2023-12-18 13:10:05 +08:00
										 |  |  |             raise Forbidden() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         app_id = str(app_id) | 
					
						
							|  |  |  |         annotation_list = AppAnnotationService.export_annotation_list_by_app_id(app_id) | 
					
						
							| 
									
										
										
										
											2024-08-26 15:29:10 +08:00
										 |  |  |         response = {"data": marshal(annotation_list, annotation_fields)} | 
					
						
							| 
									
										
										
										
											2023-12-18 13:10:05 +08:00
										 |  |  |         return response, 200 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class AnnotationCreateApi(Resource): | 
					
						
							|  |  |  |     @setup_required | 
					
						
							|  |  |  |     @login_required | 
					
						
							|  |  |  |     @account_initialization_required | 
					
						
							| 
									
										
										
										
											2024-08-26 15:29:10 +08:00
										 |  |  |     @cloud_edition_billing_resource_check("annotation") | 
					
						
							| 
									
										
										
										
											2023-12-18 13:10:05 +08:00
										 |  |  |     @marshal_with(annotation_fields) | 
					
						
							|  |  |  |     def post(self, app_id): | 
					
						
							| 
									
										
										
										
											2024-08-05 04:55:55 +00:00
										 |  |  |         if not current_user.is_editor: | 
					
						
							| 
									
										
										
										
											2023-12-18 13:10:05 +08:00
										 |  |  |             raise Forbidden() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         app_id = str(app_id) | 
					
						
							|  |  |  |         parser = reqparse.RequestParser() | 
					
						
							| 
									
										
										
										
											2024-08-26 15:29:10 +08:00
										 |  |  |         parser.add_argument("question", required=True, type=str, location="json") | 
					
						
							|  |  |  |         parser.add_argument("answer", required=True, type=str, location="json") | 
					
						
							| 
									
										
										
										
											2023-12-18 13:10:05 +08:00
										 |  |  |         args = parser.parse_args() | 
					
						
							|  |  |  |         annotation = AppAnnotationService.insert_app_annotation_directly(args, app_id) | 
					
						
							|  |  |  |         return annotation | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class AnnotationUpdateDeleteApi(Resource): | 
					
						
							|  |  |  |     @setup_required | 
					
						
							|  |  |  |     @login_required | 
					
						
							|  |  |  |     @account_initialization_required | 
					
						
							| 
									
										
										
										
											2024-08-26 15:29:10 +08:00
										 |  |  |     @cloud_edition_billing_resource_check("annotation") | 
					
						
							| 
									
										
										
										
											2023-12-18 13:10:05 +08:00
										 |  |  |     @marshal_with(annotation_fields) | 
					
						
							|  |  |  |     def post(self, app_id, annotation_id): | 
					
						
							| 
									
										
										
										
											2024-08-05 04:55:55 +00:00
										 |  |  |         if not current_user.is_editor: | 
					
						
							| 
									
										
										
										
											2023-12-18 13:10:05 +08:00
										 |  |  |             raise Forbidden() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         app_id = str(app_id) | 
					
						
							|  |  |  |         annotation_id = str(annotation_id) | 
					
						
							|  |  |  |         parser = reqparse.RequestParser() | 
					
						
							| 
									
										
										
										
											2024-08-26 15:29:10 +08:00
										 |  |  |         parser.add_argument("question", required=True, type=str, location="json") | 
					
						
							|  |  |  |         parser.add_argument("answer", required=True, type=str, location="json") | 
					
						
							| 
									
										
										
										
											2023-12-18 13:10:05 +08:00
										 |  |  |         args = parser.parse_args() | 
					
						
							|  |  |  |         annotation = AppAnnotationService.update_app_annotation_directly(args, app_id, annotation_id) | 
					
						
							|  |  |  |         return annotation | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     @setup_required | 
					
						
							|  |  |  |     @login_required | 
					
						
							|  |  |  |     @account_initialization_required | 
					
						
							|  |  |  |     def delete(self, app_id, annotation_id): | 
					
						
							| 
									
										
										
										
											2024-08-05 04:55:55 +00:00
										 |  |  |         if not current_user.is_editor: | 
					
						
							| 
									
										
										
										
											2023-12-18 13:10:05 +08:00
										 |  |  |             raise Forbidden() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         app_id = str(app_id) | 
					
						
							|  |  |  |         annotation_id = str(annotation_id) | 
					
						
							|  |  |  |         AppAnnotationService.delete_app_annotation(app_id, annotation_id) | 
					
						
							| 
									
										
										
										
											2025-04-27 12:12:46 +08:00
										 |  |  |         return {"result": "success"}, 204 | 
					
						
							| 
									
										
										
										
											2023-12-18 13:10:05 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class AnnotationBatchImportApi(Resource): | 
					
						
							|  |  |  |     @setup_required | 
					
						
							|  |  |  |     @login_required | 
					
						
							|  |  |  |     @account_initialization_required | 
					
						
							| 
									
										
										
										
											2024-08-26 15:29:10 +08:00
										 |  |  |     @cloud_edition_billing_resource_check("annotation") | 
					
						
							| 
									
										
										
										
											2023-12-18 13:10:05 +08:00
										 |  |  |     def post(self, app_id): | 
					
						
							| 
									
										
										
										
											2024-08-05 04:55:55 +00:00
										 |  |  |         if not current_user.is_editor: | 
					
						
							| 
									
										
										
										
											2023-12-18 13:10:05 +08:00
										 |  |  |             raise Forbidden() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         app_id = str(app_id) | 
					
						
							|  |  |  |         # get file from request | 
					
						
							| 
									
										
										
										
											2024-08-26 15:29:10 +08:00
										 |  |  |         file = request.files["file"] | 
					
						
							| 
									
										
										
										
											2023-12-18 13:10:05 +08:00
										 |  |  |         # check file | 
					
						
							| 
									
										
										
										
											2024-08-26 15:29:10 +08:00
										 |  |  |         if "file" not in request.files: | 
					
						
							| 
									
										
										
										
											2023-12-18 13:10:05 +08:00
										 |  |  |             raise NoFileUploadedError() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         if len(request.files) > 1: | 
					
						
							|  |  |  |             raise TooManyFilesError() | 
					
						
							|  |  |  |         # check file type | 
					
						
							| 
									
										
										
										
											2025-06-11 01:01:33 +08:00
										 |  |  |         if not file.filename or not file.filename.endswith(".csv"): | 
					
						
							| 
									
										
										
										
											2023-12-18 13:10:05 +08:00
										 |  |  |             raise ValueError("Invalid file type. Only CSV files are allowed") | 
					
						
							|  |  |  |         return AppAnnotationService.batch_import_app_annotations(app_id, file) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class AnnotationBatchImportStatusApi(Resource): | 
					
						
							|  |  |  |     @setup_required | 
					
						
							|  |  |  |     @login_required | 
					
						
							|  |  |  |     @account_initialization_required | 
					
						
							| 
									
										
										
										
											2024-08-26 15:29:10 +08:00
										 |  |  |     @cloud_edition_billing_resource_check("annotation") | 
					
						
							| 
									
										
										
										
											2023-12-18 13:10:05 +08:00
										 |  |  |     def get(self, app_id, job_id): | 
					
						
							| 
									
										
										
										
											2024-08-05 04:55:55 +00:00
										 |  |  |         if not current_user.is_editor: | 
					
						
							| 
									
										
										
										
											2023-12-18 13:10:05 +08:00
										 |  |  |             raise Forbidden() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         job_id = str(job_id) | 
					
						
							| 
									
										
										
										
											2024-08-26 15:29:10 +08:00
										 |  |  |         indexing_cache_key = "app_annotation_batch_import_{}".format(str(job_id)) | 
					
						
							| 
									
										
										
										
											2023-12-18 13:10:05 +08:00
										 |  |  |         cache_result = redis_client.get(indexing_cache_key) | 
					
						
							|  |  |  |         if cache_result is None: | 
					
						
							| 
									
										
										
										
											2025-04-14 10:24:01 +08:00
										 |  |  |             raise ValueError("The job does not exist.") | 
					
						
							| 
									
										
										
										
											2023-12-18 13:10:05 +08:00
										 |  |  |         job_status = cache_result.decode() | 
					
						
							| 
									
										
										
										
											2024-08-26 15:29:10 +08:00
										 |  |  |         error_msg = "" | 
					
						
							|  |  |  |         if job_status == "error": | 
					
						
							|  |  |  |             indexing_error_msg_key = "app_annotation_batch_import_error_msg_{}".format(str(job_id)) | 
					
						
							| 
									
										
										
										
											2023-12-18 13:10:05 +08:00
										 |  |  |             error_msg = redis_client.get(indexing_error_msg_key).decode() | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-08-26 15:29:10 +08:00
										 |  |  |         return {"job_id": job_id, "job_status": job_status, "error_msg": error_msg}, 200 | 
					
						
							| 
									
										
										
										
											2023-12-18 13:10:05 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class AnnotationHitHistoryListApi(Resource): | 
					
						
							|  |  |  |     @setup_required | 
					
						
							|  |  |  |     @login_required | 
					
						
							|  |  |  |     @account_initialization_required | 
					
						
							|  |  |  |     def get(self, app_id, annotation_id): | 
					
						
							| 
									
										
										
										
											2024-08-05 04:55:55 +00:00
										 |  |  |         if not current_user.is_editor: | 
					
						
							| 
									
										
										
										
											2023-12-18 13:10:05 +08:00
										 |  |  |             raise Forbidden() | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-08-26 15:29:10 +08:00
										 |  |  |         page = request.args.get("page", default=1, type=int) | 
					
						
							|  |  |  |         limit = request.args.get("limit", default=20, type=int) | 
					
						
							| 
									
										
										
										
											2023-12-18 13:10:05 +08:00
										 |  |  |         app_id = str(app_id) | 
					
						
							|  |  |  |         annotation_id = str(annotation_id) | 
					
						
							| 
									
										
										
										
											2024-08-26 15:29:10 +08:00
										 |  |  |         annotation_hit_history_list, total = AppAnnotationService.get_annotation_hit_histories( | 
					
						
							|  |  |  |             app_id, annotation_id, page, limit | 
					
						
							|  |  |  |         ) | 
					
						
							| 
									
										
										
										
											2023-12-18 13:10:05 +08:00
										 |  |  |         response = { | 
					
						
							| 
									
										
										
										
											2024-08-26 15:29:10 +08:00
										 |  |  |             "data": marshal(annotation_hit_history_list, annotation_hit_history_fields), | 
					
						
							|  |  |  |             "has_more": len(annotation_hit_history_list) == limit, | 
					
						
							|  |  |  |             "limit": limit, | 
					
						
							|  |  |  |             "total": total, | 
					
						
							|  |  |  |             "page": page, | 
					
						
							| 
									
										
										
										
											2023-12-18 13:10:05 +08:00
										 |  |  |         } | 
					
						
							|  |  |  |         return response | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-08-26 15:29:10 +08:00
										 |  |  | api.add_resource(AnnotationReplyActionApi, "/apps/<uuid:app_id>/annotation-reply/<string:action>") | 
					
						
							|  |  |  | api.add_resource( | 
					
						
							|  |  |  |     AnnotationReplyActionStatusApi, "/apps/<uuid:app_id>/annotation-reply/<string:action>/status/<uuid:job_id>" | 
					
						
							|  |  |  | ) | 
					
						
							|  |  |  | api.add_resource(AnnotationListApi, "/apps/<uuid:app_id>/annotations") | 
					
						
							|  |  |  | api.add_resource(AnnotationExportApi, "/apps/<uuid:app_id>/annotations/export") | 
					
						
							|  |  |  | api.add_resource(AnnotationUpdateDeleteApi, "/apps/<uuid:app_id>/annotations/<uuid:annotation_id>") | 
					
						
							|  |  |  | api.add_resource(AnnotationBatchImportApi, "/apps/<uuid:app_id>/annotations/batch-import") | 
					
						
							|  |  |  | api.add_resource(AnnotationBatchImportStatusApi, "/apps/<uuid:app_id>/annotations/batch-import-status/<uuid:job_id>") | 
					
						
							|  |  |  | api.add_resource(AnnotationHitHistoryListApi, "/apps/<uuid:app_id>/annotations/<uuid:annotation_id>/hit-histories") | 
					
						
							|  |  |  | api.add_resource(AppAnnotationSettingDetailApi, "/apps/<uuid:app_id>/annotation-setting") | 
					
						
							|  |  |  | api.add_resource(AppAnnotationSettingUpdateApi, "/apps/<uuid:app_id>/annotation-settings/<uuid:annotation_setting_id>") |