|
|
|
@ -102,6 +102,9 @@ class TextProcessingApiController extends OCSController {
|
|
|
|
#[AnonRateLimit(limit: 5, period: 120)]
|
|
|
|
#[AnonRateLimit(limit: 5, period: 120)]
|
|
|
|
#[ApiRoute(verb: 'POST', url: '/schedule', root: '/textprocessing')]
|
|
|
|
#[ApiRoute(verb: 'POST', url: '/schedule', root: '/textprocessing')]
|
|
|
|
public function schedule(string $input, string $type, string $appId, string $identifier = ''): DataResponse {
|
|
|
|
public function schedule(string $input, string $type, string $appId, string $identifier = ''): DataResponse {
|
|
|
|
|
|
|
|
if (strlen($input) > 64_000) {
|
|
|
|
|
|
|
|
return new DataResponse(['message' => $this->l->t('Input text is too long')], Http::STATUS_BAD_REQUEST);
|
|
|
|
|
|
|
|
}
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
$task = new Task($type, $input, $appId, $this->userId, $identifier);
|
|
|
|
$task = new Task($type, $input, $appId, $this->userId, $identifier);
|
|
|
|
} catch (InvalidArgumentException) {
|
|
|
|
} catch (InvalidArgumentException) {
|
|
|
|
|