2024-12-24 10:38:51 +00:00
|
|
|
from flask_restful import Resource # type: ignore
|
2023-05-15 00:51:32 +00:00
|
|
|
|
|
|
|
|
from controllers.console import api
|
2024-10-14 09:26:04 +00:00
|
|
|
from controllers.console.datasets.hit_testing_base import DatasetsHitTestingBase
|
2024-11-01 07:51:22 +00:00
|
|
|
from controllers.console.wraps import account_initialization_required, setup_required
|
2024-01-12 04:34:01 +00:00
|
|
|
from libs.login import login_required
|
2023-05-15 00:51:32 +00:00
|
|
|
|
|
|
|
|
|
2024-10-14 09:26:04 +00:00
|
|
|
class HitTestingApi(Resource, DatasetsHitTestingBase):
|
2023-05-15 00:51:32 +00:00
|
|
|
@setup_required
|
|
|
|
|
@login_required
|
|
|
|
|
@account_initialization_required
|
|
|
|
|
def post(self, dataset_id):
|
|
|
|
|
dataset_id_str = str(dataset_id)
|
|
|
|
|
|
2024-10-14 09:26:04 +00:00
|
|
|
dataset = self.get_and_validate_dataset(dataset_id_str)
|
|
|
|
|
args = self.parse_args()
|
|
|
|
|
self.hit_testing_args_check(args)
|
2023-05-15 00:51:32 +00:00
|
|
|
|
2024-10-14 09:26:04 +00:00
|
|
|
return self.perform_hit_testing(dataset, args)
|
2023-05-15 00:51:32 +00:00
|
|
|
|
|
|
|
|
|
2024-08-26 07:29:10 +00:00
|
|
|
api.add_resource(HitTestingApi, "/datasets/<uuid:dataset_id>/hit-testing")
|