Rename: oznaciBesedilo -> oznaciBesediloAsync

This commit is contained in:
Kikimanox
2022-09-01 17:34:16 +02:00
parent 93aba45e6a
commit 0da8332426
6 changed files with 20 additions and 20 deletions
+1 -1
View File
@@ -51,7 +51,7 @@
} }
} }
}, },
"/oznaciBesedilo": { "/oznaciBesediloAsync": {
"post": { "post": {
"tags": [ "tags": [
"marktext" "marktext"
@@ -1,7 +1,7 @@
import connexion import connexion
import six 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 import util
from swagger_server.classla import cl_utils from swagger_server.classla import cl_utils
from swagger_server.requets_db.models.vrsta import (Job, JobManager) from swagger_server.requets_db.models.vrsta import (Job, JobManager)
@@ -18,7 +18,7 @@ def get_text(body): # noqa: E501
:rtype: str :rtype: str
""" """
if connexion.request.is_json: 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) # conllu = cl_utils.raw_text_to_conllu(body.besedilo)
# return conllu # return conllu
job, is_old_job = JobManager.create_job(1, body.besedilo) job, is_old_job = JobManager.create_job(1, body.besedilo)
+1 -1
View File
@@ -4,7 +4,7 @@
from __future__ import absolute_import from __future__ import absolute_import
# import models into model package # import models into model package
from swagger_server.models.izlusci_body import IzlusciBody 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.terminoloski_kandidat import TerminoloskiKandidat
from swagger_server.models.job_response import JobResponse from swagger_server.models.job_response import JobResponse
from swagger_server.models.datoteka_v_besedilo_body import DatotekaVBesediloBody from swagger_server.models.datoteka_v_besedilo_body import DatotekaVBesediloBody
@@ -9,15 +9,15 @@ from swagger_server.models.base_model_ import Model
from swagger_server import util from swagger_server import util
class OznaciBesediloBody(Model): class OznaciBesediloAsyncBody(Model):
"""NOTE: This class is auto generated by the swagger code generator program. """NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. Do not edit the class manually.
""" """
def __init__(self, besedilo: str=None): # noqa: E501 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 :type besedilo: str
""" """
self.swagger_types = { self.swagger_types = {
@@ -30,32 +30,32 @@ class OznaciBesediloBody(Model):
self._besedilo = besedilo self._besedilo = besedilo
@classmethod @classmethod
def from_dict(cls, dikt) -> 'OznaciBesediloBody': def from_dict(cls, dikt) -> 'OznaciBesediloAsyncBody':
"""Returns the dict as a model """Returns the dict as a model
:param dikt: A dict. :param dikt: A dict.
:type: dict :type: dict
:return: The oznaciBesedilo_body of this OznaciBesediloBody. # noqa: E501 :return: The oznaciBesediloAsync_body of this OznaciBesediloAsyncBody. # noqa: E501
:rtype: OznaciBesediloBody :rtype: OznaciBesediloAsyncBody
""" """
return util.deserialize_model(dikt, cls) return util.deserialize_model(dikt, cls)
@property @property
def besedilo(self) -> str: 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 :rtype: str
""" """
return self._besedilo return self._besedilo
@besedilo.setter @besedilo.setter
def besedilo(self, besedilo: str): 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 :type besedilo: str
""" """
+3 -3
View File
@@ -38,7 +38,7 @@ paths:
schema: schema:
$ref: '#/components/schemas/JobResponse' $ref: '#/components/schemas/JobResponse'
x-openapi-router-controller: swagger_server.controllers.jobs_controller x-openapi-router-controller: swagger_server.controllers.jobs_controller
/oznaciBesedilo: /oznaciBesediloAsync:
post: post:
tags: tags:
- marktext - marktext
@@ -49,7 +49,7 @@ paths:
content: content:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/oznaciBesedilo_body' $ref: '#/components/schemas/oznaciBesediloAsync_body'
required: true required: true
responses: responses:
"200": "200":
@@ -578,7 +578,7 @@ components:
estimated_completion: 2000-01-23T04:56:07.000+00:00 estimated_completion: 2000-01-23T04:56:07.000+00:00
job_result: job_result job_result: job_result
finished_job: true finished_job: true
oznaciBesedilo_body: oznaciBesediloAsync_body:
type: object type: object
properties: properties:
besedilo: besedilo:
@@ -5,7 +5,7 @@ from __future__ import absolute_import
from flask import json from flask import json
from six import BytesIO 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 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 Označi besedilo s classlo/stanzo z uporabo slovenskih modelov ter vrne conll-u format
""" """
body = OznaciBesediloBody() body = OznaciBesediloAsyncBody()
response = self.client.open( response = self.client.open(
'/oznaciBesedilo', '/oznaciBesediloAsync',
method='POST', method='POST',
data=json.dumps(body), data=json.dumps(body),
content_type='application/json') content_type='application/json')