Додавання процедур

Версія 2.1 додана 2024/05/09 19:37 автором Ashterix

текст

ExampleApi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php
namespace App\Api\Procedures;

use App\Api\DTO\FormDTO;
use App\CQRS\Query\FormQuery;
use App\VO\FormObject;
use Symfony\Component\Validator\Constraints as Assert;
use Ufo\JsonRpcBundle\ApiMethod\Interfaces\IRpcService;
use Ufo\RpcObject\RPC;

class ExampleApi implements IRpcService
{
   public function __construct(
       // connecting some dependencies to retrieve data
   ) {}
   
   public function getUserNameByUuid(string $userId): string
    {
       // some logic get user info by id
       return 'some result';
    }
   
   public function sendEmail(string $email, string $subject, string $text): bool
    {
       // some logic send email
       return true;
    }
}