Rename: oznaciBesedilo -> oznaciBesediloAsync
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import connexion
|
||||
import six
|
||||
|
||||
from swagger_server.models.oznaci_besedilo_body import OznaciBesediloBody # noqa: E501
|
||||
from swagger_server.models.oznaci_besedilo_async_body import OznaciBesediloAsyncBody # noqa: E501
|
||||
from swagger_server import util
|
||||
from swagger_server.classla import cl_utils
|
||||
from swagger_server.requets_db.models.vrsta import (Job, JobManager)
|
||||
@@ -18,7 +18,7 @@ def get_text(body): # noqa: E501
|
||||
:rtype: str
|
||||
"""
|
||||
if connexion.request.is_json:
|
||||
body = OznaciBesediloBody.from_dict(connexion.request.get_json()) # noqa: E501
|
||||
body = OznaciBesediloAsyncBody.from_dict(connexion.request.get_json()) # noqa: E501
|
||||
# conllu = cl_utils.raw_text_to_conllu(body.besedilo)
|
||||
# return conllu
|
||||
job, is_old_job = JobManager.create_job(1, body.besedilo)
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
from __future__ import absolute_import
|
||||
# import models into model package
|
||||
from swagger_server.models.izlusci_body import IzlusciBody
|
||||
from swagger_server.models.oznaci_besedilo_body import OznaciBesediloBody
|
||||
from swagger_server.models.oznaci_besedilo_async_body import OznaciBesediloAsyncBody
|
||||
from swagger_server.models.terminoloski_kandidat import TerminoloskiKandidat
|
||||
from swagger_server.models.job_response import JobResponse
|
||||
from swagger_server.models.datoteka_v_besedilo_body import DatotekaVBesediloBody
|
||||
|
||||
+10
-10
@@ -9,15 +9,15 @@ from swagger_server.models.base_model_ import Model
|
||||
from swagger_server import util
|
||||
|
||||
|
||||
class OznaciBesediloBody(Model):
|
||||
class OznaciBesediloAsyncBody(Model):
|
||||
"""NOTE: This class is auto generated by the swagger code generator program.
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
def __init__(self, besedilo: str=None): # noqa: E501
|
||||
"""OznaciBesediloBody - a model defined in Swagger
|
||||
"""OznaciBesediloAsyncBody - a model defined in Swagger
|
||||
|
||||
:param besedilo: The besedilo of this OznaciBesediloBody. # noqa: E501
|
||||
:param besedilo: The besedilo of this OznaciBesediloAsyncBody. # noqa: E501
|
||||
:type besedilo: str
|
||||
"""
|
||||
self.swagger_types = {
|
||||
@@ -30,32 +30,32 @@ class OznaciBesediloBody(Model):
|
||||
self._besedilo = besedilo
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, dikt) -> 'OznaciBesediloBody':
|
||||
def from_dict(cls, dikt) -> 'OznaciBesediloAsyncBody':
|
||||
"""Returns the dict as a model
|
||||
|
||||
:param dikt: A dict.
|
||||
:type: dict
|
||||
:return: The oznaciBesedilo_body of this OznaciBesediloBody. # noqa: E501
|
||||
:rtype: OznaciBesediloBody
|
||||
:return: The oznaciBesediloAsync_body of this OznaciBesediloAsyncBody. # noqa: E501
|
||||
:rtype: OznaciBesediloAsyncBody
|
||||
"""
|
||||
return util.deserialize_model(dikt, cls)
|
||||
|
||||
@property
|
||||
def besedilo(self) -> str:
|
||||
"""Gets the besedilo of this OznaciBesediloBody.
|
||||
"""Gets the besedilo of this OznaciBesediloAsyncBody.
|
||||
|
||||
|
||||
:return: The besedilo of this OznaciBesediloBody.
|
||||
:return: The besedilo of this OznaciBesediloAsyncBody.
|
||||
:rtype: str
|
||||
"""
|
||||
return self._besedilo
|
||||
|
||||
@besedilo.setter
|
||||
def besedilo(self, besedilo: str):
|
||||
"""Sets the besedilo of this OznaciBesediloBody.
|
||||
"""Sets the besedilo of this OznaciBesediloAsyncBody.
|
||||
|
||||
|
||||
:param besedilo: The besedilo of this OznaciBesediloBody.
|
||||
:param besedilo: The besedilo of this OznaciBesediloAsyncBody.
|
||||
:type besedilo: str
|
||||
"""
|
||||
|
||||
@@ -38,7 +38,7 @@ paths:
|
||||
schema:
|
||||
$ref: '#/components/schemas/JobResponse'
|
||||
x-openapi-router-controller: swagger_server.controllers.jobs_controller
|
||||
/oznaciBesedilo:
|
||||
/oznaciBesediloAsync:
|
||||
post:
|
||||
tags:
|
||||
- marktext
|
||||
@@ -49,7 +49,7 @@ paths:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/oznaciBesedilo_body'
|
||||
$ref: '#/components/schemas/oznaciBesediloAsync_body'
|
||||
required: true
|
||||
responses:
|
||||
"200":
|
||||
@@ -578,7 +578,7 @@ components:
|
||||
estimated_completion: 2000-01-23T04:56:07.000+00:00
|
||||
job_result: job_result
|
||||
finished_job: true
|
||||
oznaciBesedilo_body:
|
||||
oznaciBesediloAsync_body:
|
||||
type: object
|
||||
properties:
|
||||
besedilo:
|
||||
|
||||
@@ -5,7 +5,7 @@ from __future__ import absolute_import
|
||||
from flask import json
|
||||
from six import BytesIO
|
||||
|
||||
from swagger_server.models.oznaci_besedilo_body import OznaciBesediloBody # noqa: E501
|
||||
from swagger_server.models.oznaci_besedilo_async_body import OznaciBesediloAsyncBody # noqa: E501
|
||||
from swagger_server.test import BaseTestCase
|
||||
|
||||
|
||||
@@ -17,9 +17,9 @@ class TestMarktextController(BaseTestCase):
|
||||
|
||||
Označi besedilo s classlo/stanzo z uporabo slovenskih modelov ter vrne conll-u format
|
||||
"""
|
||||
body = OznaciBesediloBody()
|
||||
body = OznaciBesediloAsyncBody()
|
||||
response = self.client.open(
|
||||
'/oznaciBesedilo',
|
||||
'/oznaciBesediloAsync',
|
||||
method='POST',
|
||||
data=json.dumps(body),
|
||||
content_type='application/json')
|
||||
|
||||
Reference in New Issue
Block a user