{"id":400151,"date":"2024-06-29T15:05:14","date_gmt":"2024-06-29T15:05:14","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=400151"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=400151","title":{"rendered":"<span>RPC \u2014 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044f<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0421\u0432\u043e\u044e \u043f\u0435\u0440\u0432\u0443\u044e \u0430\u043f\u0438\u0448\u043a\u0443 \u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u043b\u0435\u0442 7-8 \u043d\u0430\u0437\u0430\u0434 \u0438 \u044d\u0442\u043e \u0431\u044b\u043b \u043f\u0435\u0440\u0432\u044b\u0439 \u0431\u043b\u0438\u043d. \u0412 \u0446\u0435\u043b\u043e\u043c \u044d\u0442\u043e\u0442 \u0431\u043b\u0438\u043d \u043f\u0440\u043e\u0448\u0435\u043b \u043a\u0443\u0447\u0443 \u0438\u0441\u043f\u044b\u0442\u0430\u043d\u0438\u0439 \u0438 \u043c\u043e\u0434\u0435\u0440\u043d\u0438\u0437\u0430\u0446\u0438\u0439 \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u0442\u043e \u0432\u043f\u043e\u043b\u043d\u0435 \u0432\u043c\u0435\u043d\u044f\u0435\u043c\u043e\u0435. \u0414\u0430\u0436\u0435 \u0441\u0435\u0439\u0447\u0430\u0441 \u044f \u043f\u043e\u043d\u0438\u043c\u0430\u044e, \u0447\u0442\u043e \u044d\u0442\u043e \u044f\u0434\u0440\u043e \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e \u0438 \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0442\u044c \u0434\u0430\u043b\u044c\u0448\u0435 \u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a \u0442\u0435\u043a\u0443\u0449\u0438\u043c \u0440\u0435\u0430\u043b\u0438\u044f\u043c (\u043f\u043e\u043a\u0430 \u043d\u0435\u0442 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430).<\/p>\n<p>\u041a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0433\u0430\u0434\u0430\u0442\u044c\u0441\u044f \u044d\u0442\u043e \u0431\u044b\u043b\u043e RPC. \u041d\u0430\u0432\u0435\u0440\u043d\u043e \u0441\u0442\u043e\u0438\u0442 \u043d\u0430\u0447\u0430\u0442\u044c \u0441 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u044f \u0432\u044b\u0434\u0435\u043b\u0438\u043b \u0440\u044f\u0434 \u0441\u043b\u043e\u0435\u0432 (\u043a\u0430\u043a\u0438\u0435 \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c, \u043a\u0430\u043a\u0438\u0435 \u0442\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c).<\/p>\n<ul>\n<li>\n<p>\u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0432 \u0442\u0435\u043a\u0441\u0442<\/p>\n<\/li>\n<li>\n<p>\u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u044f \u0442\u0435\u043a\u0441\u0442\u0430 \u0432 \u0430\u0441\u0441\u043e\u0446\u0438\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432<\/p>\n<\/li>\n<li>\n<p>\u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u044f \u0430\u0441\u0441\u043e\u0446\u0438\u0430\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0432 \u043a\u043b\u0430\u0441\u0441 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 (\u043f\u043e\u043d\u044f\u0442\u044c \u0438\u043c\u044f \u043c\u0435\u0442\u043e\u0434\u0430, \u0434\u0430\u043d\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u0430, \u0442\u043e\u043a\u0435\u043d \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0434\u043e\u043f. \u0434\u0430\u043d\u043d\u044b\u0435 (\u044f\u0437\u044b\u043a, \u0432\u0435\u0440\u0441\u0438\u044f, &#8230;))<\/p>\n<\/li>\n<li>\n<p>\u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044f \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u0430<\/p>\n<\/li>\n<li>\n<p>\u043f\u0440\u0430\u0432\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 <em>(\u043d\u0435 \u0434\u043e\u0434\u0435\u043b\u0430\u043b)<\/em><\/p>\n<\/li>\n<li>\n<p>\u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044f (\u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043e\u0431\u044a\u0435\u043a\u0442)<\/p>\n<\/li>\n<li>\n<p>DI \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 <em>(\u043d\u0435 \u0434\u043e\u0434\u0435\u043b\u0430\u043b \u043d\u0430 php)<\/em><\/p>\n<\/li>\n<li>\n<p>\u043b\u043e\u0433\u0438\u043a\u0430 \u043c\u0435\u0442\u043e\u0434\u0430 (\u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u0442\u0430\u0442\u0443\u0441 \u043e\u0442\u0432\u0435\u0442\u0430 \u0438 \u0434\u0430\u043d\u043d\u044b\u0435)<\/p>\n<\/li>\n<li>\n<p>\u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0441\u0442\u0430\u0442\u0443\u0441 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043e\u0442\u0432\u0435\u0442\u0430<\/p>\n<\/li>\n<li>\n<p>\u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u044b\u0432\u0430\u0435\u043c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043e\u0442\u0432\u0435\u0442\u0430 \u0432 \u0442\u0435\u043a\u0441\u0442<\/p>\n<\/li>\n<\/ul>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0443 \u043d\u0430\u0441 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c 10 \u0441\u043b\u043e\u0435\u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u043c \u043d\u0430\u0434\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u043c \u043a\u0430\u0436\u0443\u0442\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u0441\u043b\u043e\u0436\u043d\u044b\u043c\u0438 (\u043d\u0430\u0432\u0435\u0440\u043d\u043e \u043f\u043e \u044d\u0442\u043e\u0439 \u043f\u0440\u0438\u0447\u0438\u043d\u0435 RPC \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u0441\u043b\u043e\u0436\u043d\u043e\u0439 \u0438 \u044d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u0441\u0438\u043b\u044c\u043d\u043e \u043e\u0442\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u0435\u0442). \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0436\u0435 \u0434\u0435\u043b\u0435 \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u044d\u0442\u0438\u0445 \u0441\u043b\u043e\u0435\u0432 \u0443\u0445\u043e\u0434\u0438\u0442 \u0432 \u044f\u0434\u0440\u043e \u0438 \u0432\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0438\u0445 \u0442\u0440\u043e\u0433\u0430\u0442\u044c. \u0412 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434, \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0445\u0435\u043c\u0443 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 (\u0438\u043d\u043e\u0433\u0434\u0430 \u0434\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f) \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0430\u043c\u0443 \u043b\u043e\u0433\u0438\u043a\u0443. \u0414\u043e \u0441\u0445\u0435\u043c\u044b \u043e\u0442\u0432\u0435\u0442\u0430, \u043e\u0431\u044b\u0447\u043d\u043e \u0440\u0443\u043a\u0438 \u0434\u043e\u0445\u043e\u0434\u044f\u0442 \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442&#8230;<\/p>\n<p>\u041e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c \u0441\u043b\u043e\u0435\u043c \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u0444\u0430\u0439\u043b\u0430\u043c\u0438, \u0438\u0445 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044e. \u0423 \u043c\u0435\u043d\u044f \u044d\u0442\u043e\u0442 \u043a\u0435\u0439\u0441 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u043b \u043d\u0435 \u0442\u0430\u043a \u0447\u0430\u0441\u0442\u043e, \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u0438\u0434\u0435\u043c \u0434\u0430\u043b\u044c\u0448\u0435.<\/p>\n<h2>\u041f\u0440\u0438\u043c\u0435\u0440\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u0432<\/h2>\n<details class=\"spoiler\">\n<summary>\u041f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043c\u0435\u0442\u043e\u0434\u0430 \u043d\u0430 Go<\/summary>\n<div class=\"spoiler__content\">\n<p>\u042f \u043d\u0435 \u044f\u0432\u043b\u044f\u044e\u0441\u044c \u0441\u0443\u043f\u0435\u0440 go \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u043c \u0438 \u0442\u0443\u0442 \u0431\u044b\u043b\u043e \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043e RPC \u044f\u0434\u0440\u043e \u0441 php \u043d\u0430 go \u0437\u0430 \u043d\u0435\u0434\u0435\u043b\u044e. \u041d\u0430\u0440\u043e\u0434 \u043d\u0430 go \u043e\u0447\u0435\u043d\u044c \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u044b\u0439 \u0438 \u044f \u043d\u0435 \u0434\u0443\u043c\u0430\u044e \u043f\u043e\u0439\u043c\u0430\u0442\u044c \u0431\u0443\u0440\u044e \u0430\u043f\u043b\u043e\u0434\u0438\u0441\u043c\u0435\u043d\u0442\u043e\u0432, \u043d\u043e \u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u0443\u043c\u0430\u044e \u0441\u0442\u043e\u0438\u0442 \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c.<\/p>\n<pre><code class=\"go\">package methodGroup2  import (     \"project-my-test\/example\/rpcApp\/methodRequestShemaItem\"     \"project-my-test\/src\/rpc\"     \"project-my-test\/src\/rpc\/rpcInterface\"     \"project-my-test\/src\/rpc\/rpcStruct\" )  type MethodMyTest struct {     rpc.RpcMethod     Data struct {         Name  *string         Email *string     }     Logger rpcInterface.Logger }  func (r *MethodMyTest) GetRequestSchema() map[string]rpcStruct.ReformSchema {     rs := make(map[string]rpcStruct.ReformSchema)          rs[\"Name\"]  = methodRequestShemaItem.GROUP2_NAME()     rs[\"Email\"] = methodRequestShemaItem.GROUP2_EMAIL()     return rs }  func (r *MethodMyTest) Run() rpcInterface.Response {          r.Logger.Info(\"test Info\")     r.Logger.Warning(\"test Warning\")     r.Logger.Error(\"test Error\")     r.Logger.Debug(\"test Debug\")          r.Response.SetData(\"test::string\", \"string\")     r.Response.SetData(\"test::int\", 20)        r.Response.SetData(\"test::Name\", r.Data.Name)     r.Response.SetData(\"test::Email\", r.Data.Email)        r.Response.GetError().SetCode(\"ERROR\")     return r.Response } <\/code><\/pre>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u041f\u0440\u0438\u043c\u0435\u0440 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0430 php<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"php\">&lt;?php  namespace CustomRpc\\Method\\RpcUser;  class RpcUserAuth extends \\Oploshka\\Rpc\\Method {    public static function description(){     return &lt;&lt;&lt;DESCRIPTION \u0410\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f (\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u044c \u043f\u043e\u0447\u0442\u0443!) \u041f\u0440\u0438\u043c\u0435\u0440 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 auth { \"login\": \"test@mail.ru\", \"password\": \"12345678\" } \u041f\u0440\u0438 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u043c \u043e\u0442\u0432\u0435\u0442\u0435 \u0432\u0435\u0440\u043d\u0435\u0442\u0441\u044f session. DESCRIPTION;   }    public static function validate(){     return [       'auth' => ['type' => 'array', 'req' => true, 'validate' => [         'login'     => ['type' => 'string'  , 'validate' => [], 'req' => true ],         'password'  => ['type' => 'string', 'validate' => [], 'req' => true ],       ] ],     ];   }    public function run(){      $RpcUser = \\CustomRpc\\EntityQuery\\RpcUserQuery::auth($this->Data['auth']['login'], $this->Data['auth']['password']);      if(!$RpcUser){       \/\/ TODO: add error auth count       $this->Response->setError('ERROR_LOGIN_PASSWORD'); return;     }      $userSessionToken = \\CustomRpc\\EntityQuery\\RpcUserSessionQuery::addNewUserSession($RpcUser);      $this->Response->setData('session', $userSessionToken);     $this->Response->setError('ERROR_NO');   }    public static function return(){     return [       'session'     => ['type' => 'string'  , 'validate' => [], 'req' => true ],     ];   }  } <\/code><\/pre>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u041f\u0440\u0438\u043c\u0435\u0440 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"php\">&lt;?php  namespace CustomRpc\\Method\\RpcUser;  class RpcUserInfoUpdate extends \\Oploshka\\Rpc\\Method {    public static function description(){     return &lt;&lt;&lt;DESCRIPTION \u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0432\u043e\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 gender = 'NULL' 'MALE' 'FEMALE' dateOfBirth = date format YYYY-MM-DD  region - \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0439 regionId image - \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c multipart \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u043c \u043f\u043e\u043b\u0435 (\u043e\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u0430), \u0432 \u0431\u0438\u043d\u0430\u0440\u043d\u043e\u043c \u0432\u0438\u0434\u0435. DESCRIPTION;   }    public static function validate(){     return [       'session'       => ['type' => 'rpcUserSession'  , 'validate' => [], 'req' => true ],       'nickname'      => ['type' => 'string'    , 'validate' => [], 'req' => false ],       'region'        => ['type' => 'region'    , 'validate' => [], 'req' => false ],       'gender'        => ['type' => 'string'    , 'validate' => [], 'req' => false ],       'dateOfBirth'   => ['type' => 'string'    , 'validate' => [], 'req' => false ],       'aboutUs'       => ['type' => 'string'    , 'validate' => [], 'req' => false ],     ];   }    public function run(){     $RpcUser = $this->Data['session'];      $updateField = [];       if( $this->Data['nickname'] ){       \/\/ \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0441\u0442\u044c nickname       if ( \\CustomRpc\\EntityQuery\\RpcUserQuery::checkRegisteredNickname( $this->Data['nickname'] ) ) {         $this->Response->setError('ERROR_NICKNAME_REGISTERED'); return;       }       $updateField['nickname'] = $this->Data['nickname'];     }      $this->Data['region']       &amp;&amp; $updateField['region_id']      = $this->Data['region']->id;     $this->Data['gender']       &amp;&amp; $updateField['gender']         = $this->Data['gender'];     $this->Data['dateOfBirth']  &amp;&amp; $updateField['date_of_birth']  = $this->Data['dateOfBirth'];     $this->Data['aboutUs']      &amp;&amp; $updateField['about_us']       = $this->Data['aboutUs'];      $file = \\CustomRpc\\Entity\\RpcUserHelper::loadAndSaveImage('image');     $file &amp;&amp; $updateField['image_id'] = $file->id();      \\CustomRpc\\EntityQuery\\RpcUserQuery::update($RpcUser, $updateField);     $this->Response->setError('ERROR_NO');   }    public static function return(){     return [];   }  } <\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u0412\u0435\u0441\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f RPC \u043c\u0435\u0442\u043e\u0434\u0430 \u0441\u0432\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u043a \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0441 (\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 go), \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0445\u0435\u043c\u0443 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 (\u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u043c \u043a\u043b\u0430\u0441\u0441\u0435 \u0438\u043b\u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0432 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043a\u043b\u0430\u0441\u0441) \u0438 \u0441\u0430\u043c\u0443 \u043b\u043e\u0433\u0438\u043a\u0443.<\/p>\n<p>\u0411\u044b\u043b\u0438 \u0438\u0434\u0435\u0438, \u0447\u0442\u043e RPC \u044f\u0434\u0440\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0447\u0438\u0441\u0442\u0443\u044e \u043b\u043e\u0433\u0438\u043a\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0437\u043d\u0430\u0435\u0442 \u043f\u0440\u043e api, \u043d\u043e \u043e\u0431\u044b\u0447\u043d\u043e, \u0432 \u044d\u0442\u043e\u043c \u043d\u0435 \u0431\u044b\u043b\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u0441\u043c\u044b\u0441\u043b\u0430 (\u044d\u0442\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u043b\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u043e\u0434\u0430, \u0430 \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u0430\u043a \u0442\u0430\u043a\u043e\u0432\u043e\u0433\u043e \u043d\u0435 \u0431\u044b\u043b\u043e)<\/p>\n<p>\u041f\u043e \u0438\u0442\u043e\u0433\u0443 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c:<\/p>\n<ul>\n<li>\n<p>\u0433\u0438\u0431\u043a\u043e\u0441\u0442\u044c. \u041c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0438 \u043e\u0442\u0434\u0430\u0432\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441 \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u0444\u043e\u0440\u043c\u0430\u0442\u0430\u0445 (\u043d\u0430 \u043b\u043e\u0433\u0438\u043a\u0443, \u044d\u0442\u043e \u043d\u0435 \u0432\u043b\u0438\u044f\u0435\u0442)<\/p>\n<\/li>\n<li>\n<p>\u0445\u043e\u0440\u043e\u0448\u0443\u044e \u043e\u0442\u043a\u0430\u0437\u043e\u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u043e\u0441\u0442\u044c. \u041e\u0448\u0438\u0431\u043a\u0438 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u044f\u0434\u0440\u043e\u043c RPC \u0438 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u043f\u0430\u0434\u0435\u043d\u0438\u044f \u0441\u0432\u0435\u0434\u0435\u043d\u0430 \u043a \u043c\u0438\u043d\u0438\u043c\u0443. \u0412 \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443\/\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443, \u043d\u0435 \u043c\u0435\u043d\u044f\u044f \u043a\u043e\u0434 \u043c\u0435\u0442\u043e\u0434\u043e\u0432.<\/p>\n<\/li>\n<li>\n<p>\u043f\u0440\u043e\u0441\u0442\u043e\u0442\u0443 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u041d\u0435 \u043d\u0443\u0436\u043d\u043e \u0434\u0435\u0440\u0433\u0430\u0442\u044c \u0441\u0435\u0442\u0435\u0432\u043e\u0439 \u0441\u043b\u043e\u0439. \u0415\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043e\u0431\u0449\u0438\u0435 \u0442\u0435\u0441\u0442\u044b \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432. \u0421\u0430\u043c \u043c\u0435\u0442\u043e\u0434 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u043f\u0435\u0440\u0435\u0434\u0430\u0432 \u0441\u044b\u0440\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u043b\u0438 \u0436\u0435 \u0432\u0430\u043b\u0438\u0434\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442.<\/p>\n<\/li>\n<li>\n<p>\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f RPC \u043c\u0435\u0442\u043e\u0434\u043e\u0432. \u0412 \u0446\u0435\u043b\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0430\u0434\u0430\u043f\u0442\u0435\u0440 \u0434\u043b\u044f swager&#8217;a \u0438\u043b\u0438 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u0435\u043d\u044c\u043a\u0438\u0439 html (\u044f \u0432\u044b\u0431\u0440\u0430\u043b \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435).<\/p>\n<\/li>\n<\/ul>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>\u042f \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u043b \u043f\u0440\u0438\u043c\u0435\u0440 RPC \u0440\u0430\u0437\u043d\u044b\u043c \u043b\u044e\u0434\u044f\u043c, \u043a\u043e\u043c\u0443 \u0442\u043e \u0442\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043d\u0440\u0430\u0432\u0438\u0442\u044c\u0441\u044f, \u043a\u043e\u043c\u0443 \u0442\u043e \u043d\u0435\u0442, \u043a\u0442\u043e \u0442\u043e \u043f\u044b\u0442\u0430\u043b\u0441\u044f \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0435. \u0412 \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0435\u0441\u0442\u044c \u043a\u0443\u0434\u0430 \u0440\u0430\u0441\u0442\u0438 \u0438 \u0435\u0441\u0442\u044c \u0438\u0434\u0435\u0438 \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438. \u041f\u0440\u0438\u043c\u0435\u0440\u044b \u043d\u0435 \u0442\u044f\u043d\u0443\u0442 \u043d\u0430 \u043e\u0441\u043a\u0430\u0440 \u0438 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u044e\u0442 \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043f\u0438\u0441\u0430\u0442\u044c. RPC \u044f\u0434\u0440\u043e \u043d\u0430 go \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c <a href=\"https:\/\/github.com\/oploshka\/go-rpc\" rel=\"noopener noreferrer nofollow\">\u0442\u0443\u0442<\/a>, \u043d\u0430 php <a href=\"https:\/\/github.com\/oploshka\/RpcCore\" rel=\"noopener noreferrer nofollow\">\u0442\u0443\u0442<\/a> (develop \u0431\u043e\u043b\u0435\u0435 \u0441\u0432\u0435\u0436\u0435\u0435).<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/594825\/\"> https:\/\/habr.com\/ru\/articles\/594825\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0421\u0432\u043e\u044e \u043f\u0435\u0440\u0432\u0443\u044e \u0430\u043f\u0438\u0448\u043a\u0443 \u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u043b\u0435\u0442 7-8 \u043d\u0430\u0437\u0430\u0434 \u0438 \u044d\u0442\u043e \u0431\u044b\u043b \u043f\u0435\u0440\u0432\u044b\u0439 \u0431\u043b\u0438\u043d. \u0412 \u0446\u0435\u043b\u043e\u043c \u044d\u0442\u043e\u0442 \u0431\u043b\u0438\u043d \u043f\u0440\u043e\u0448\u0435\u043b \u043a\u0443\u0447\u0443 \u0438\u0441\u043f\u044b\u0442\u0430\u043d\u0438\u0439 \u0438 \u043c\u043e\u0434\u0435\u0440\u043d\u0438\u0437\u0430\u0446\u0438\u0439 \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u0442\u043e \u0432\u043f\u043e\u043b\u043d\u0435 \u0432\u043c\u0435\u043d\u044f\u0435\u043c\u043e\u0435. \u0414\u0430\u0436\u0435 \u0441\u0435\u0439\u0447\u0430\u0441 \u044f \u043f\u043e\u043d\u0438\u043c\u0430\u044e, \u0447\u0442\u043e \u044d\u0442\u043e \u044f\u0434\u0440\u043e \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e \u0438 \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0442\u044c \u0434\u0430\u043b\u044c\u0448\u0435 \u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a \u0442\u0435\u043a\u0443\u0449\u0438\u043c \u0440\u0435\u0430\u043b\u0438\u044f\u043c (\u043f\u043e\u043a\u0430 \u043d\u0435\u0442 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430).<\/p>\n<p>\u041a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0433\u0430\u0434\u0430\u0442\u044c\u0441\u044f \u044d\u0442\u043e \u0431\u044b\u043b\u043e RPC. \u041d\u0430\u0432\u0435\u0440\u043d\u043e \u0441\u0442\u043e\u0438\u0442 \u043d\u0430\u0447\u0430\u0442\u044c \u0441 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u044f \u0432\u044b\u0434\u0435\u043b\u0438\u043b \u0440\u044f\u0434 \u0441\u043b\u043e\u0435\u0432 (\u043a\u0430\u043a\u0438\u0435 \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c, \u043a\u0430\u043a\u0438\u0435 \u0442\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c).<\/p>\n<ul>\n<li>\n<p>\u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0432 \u0442\u0435\u043a\u0441\u0442<\/p>\n<\/li>\n<li>\n<p>\u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u044f \u0442\u0435\u043a\u0441\u0442\u0430 \u0432 \u0430\u0441\u0441\u043e\u0446\u0438\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432<\/p>\n<\/li>\n<li>\n<p>\u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u044f \u0430\u0441\u0441\u043e\u0446\u0438\u0430\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0432 \u043a\u043b\u0430\u0441\u0441 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 (\u043f\u043e\u043d\u044f\u0442\u044c \u0438\u043c\u044f \u043c\u0435\u0442\u043e\u0434\u0430, \u0434\u0430\u043d\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u0430, \u0442\u043e\u043a\u0435\u043d \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0434\u043e\u043f. \u0434\u0430\u043d\u043d\u044b\u0435 (\u044f\u0437\u044b\u043a, \u0432\u0435\u0440\u0441\u0438\u044f, &#8230;))<\/p>\n<\/li>\n<li>\n<p>\u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044f \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u0430<\/p>\n<\/li>\n<li>\n<p>\u043f\u0440\u0430\u0432\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 <em>(\u043d\u0435 \u0434\u043e\u0434\u0435\u043b\u0430\u043b)<\/em><\/p>\n<\/li>\n<li>\n<p>\u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044f (\u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043e\u0431\u044a\u0435\u043a\u0442)<\/p>\n<\/li>\n<li>\n<p>DI \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 <em>(\u043d\u0435 \u0434\u043e\u0434\u0435\u043b\u0430\u043b \u043d\u0430 php)<\/em><\/p>\n<\/li>\n<li>\n<p>\u043b\u043e\u0433\u0438\u043a\u0430 \u043c\u0435\u0442\u043e\u0434\u0430 (\u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u0442\u0430\u0442\u0443\u0441 \u043e\u0442\u0432\u0435\u0442\u0430 \u0438 \u0434\u0430\u043d\u043d\u044b\u0435)<\/p>\n<\/li>\n<li>\n<p>\u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0441\u0442\u0430\u0442\u0443\u0441 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043e\u0442\u0432\u0435\u0442\u0430<\/p>\n<\/li>\n<li>\n<p>\u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u044b\u0432\u0430\u0435\u043c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043e\u0442\u0432\u0435\u0442\u0430 \u0432 \u0442\u0435\u043a\u0441\u0442<\/p>\n<\/li>\n<\/ul>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0443 \u043d\u0430\u0441 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c 10 \u0441\u043b\u043e\u0435\u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u043c \u043d\u0430\u0434\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u043c \u043a\u0430\u0436\u0443\u0442\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u0441\u043b\u043e\u0436\u043d\u044b\u043c\u0438 (\u043d\u0430\u0432\u0435\u0440\u043d\u043e \u043f\u043e \u044d\u0442\u043e\u0439 \u043f\u0440\u0438\u0447\u0438\u043d\u0435 RPC \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u0441\u043b\u043e\u0436\u043d\u043e\u0439 \u0438 \u044d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u0441\u0438\u043b\u044c\u043d\u043e \u043e\u0442\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u0435\u0442). \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0436\u0435 \u0434\u0435\u043b\u0435 \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u044d\u0442\u0438\u0445 \u0441\u043b\u043e\u0435\u0432 \u0443\u0445\u043e\u0434\u0438\u0442 \u0432 \u044f\u0434\u0440\u043e \u0438 \u0432\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0438\u0445 \u0442\u0440\u043e\u0433\u0430\u0442\u044c. \u0412 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434, \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0445\u0435\u043c\u0443 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 (\u0438\u043d\u043e\u0433\u0434\u0430 \u0434\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f) \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0430\u043c\u0443 \u043b\u043e\u0433\u0438\u043a\u0443. \u0414\u043e \u0441\u0445\u0435\u043c\u044b \u043e\u0442\u0432\u0435\u0442\u0430, \u043e\u0431\u044b\u0447\u043d\u043e \u0440\u0443\u043a\u0438 \u0434\u043e\u0445\u043e\u0434\u044f\u0442 \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442&#8230;<\/p>\n<p>\u041e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c \u0441\u043b\u043e\u0435\u043c \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u0444\u0430\u0439\u043b\u0430\u043c\u0438, \u0438\u0445 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044e. \u0423 \u043c\u0435\u043d\u044f \u044d\u0442\u043e\u0442 \u043a\u0435\u0439\u0441 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u043b \u043d\u0435 \u0442\u0430\u043a \u0447\u0430\u0441\u0442\u043e, \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u0438\u0434\u0435\u043c \u0434\u0430\u043b\u044c\u0448\u0435.<\/p>\n<h2>\u041f\u0440\u0438\u043c\u0435\u0440\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u0432<\/h2>\n<details class=\"spoiler\">\n<summary>\u041f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043c\u0435\u0442\u043e\u0434\u0430 \u043d\u0430 Go<\/summary>\n<div class=\"spoiler__content\">\n<p>\u042f \u043d\u0435 \u044f\u0432\u043b\u044f\u044e\u0441\u044c \u0441\u0443\u043f\u0435\u0440 go \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u043c \u0438 \u0442\u0443\u0442 \u0431\u044b\u043b\u043e \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043e RPC \u044f\u0434\u0440\u043e \u0441 php \u043d\u0430 go \u0437\u0430 \u043d\u0435\u0434\u0435\u043b\u044e. \u041d\u0430\u0440\u043e\u0434 \u043d\u0430 go \u043e\u0447\u0435\u043d\u044c \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u044b\u0439 \u0438 \u044f \u043d\u0435 \u0434\u0443\u043c\u0430\u044e \u043f\u043e\u0439\u043c\u0430\u0442\u044c \u0431\u0443\u0440\u044e \u0430\u043f\u043b\u043e\u0434\u0438\u0441\u043c\u0435\u043d\u0442\u043e\u0432, \u043d\u043e \u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u0443\u043c\u0430\u044e \u0441\u0442\u043e\u0438\u0442 \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c.<\/p>\n<pre><code class=\"go\">package methodGroup2  import (     \"project-my-test\/example\/rpcApp\/methodRequestShemaItem\"     \"project-my-test\/src\/rpc\"     \"project-my-test\/src\/rpc\/rpcInterface\"     \"project-my-test\/src\/rpc\/rpcStruct\" )  type MethodMyTest struct {     rpc.RpcMethod     Data struct {         Name  *string         Email *string     }     Logger rpcInterface.Logger }  func (r *MethodMyTest) GetRequestSchema() map[string]rpcStruct.ReformSchema {     rs := make(map[string]rpcStruct.ReformSchema)          rs[\"Name\"]  = methodRequestShemaItem.GROUP2_NAME()     rs[\"Email\"] = methodRequestShemaItem.GROUP2_EMAIL()     return rs }  func (r *MethodMyTest) Run() rpcInterface.Response {          r.Logger.Info(\"test Info\")     r.Logger.Warning(\"test Warning\")     r.Logger.Error(\"test Error\")     r.Logger.Debug(\"test Debug\")          r.Response.SetData(\"test::string\", \"string\")     r.Response.SetData(\"test::int\", 20)        r.Response.SetData(\"test::Name\", r.Data.Name)     r.Response.SetData(\"test::Email\", r.Data.Email)        r.Response.GetError().SetCode(\"ERROR\")     return r.Response } <\/code><\/pre>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u041f\u0440\u0438\u043c\u0435\u0440 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0430 php<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"php\">&lt;?php  namespace CustomRpc\\Method\\RpcUser;  class RpcUserAuth extends \\Oploshka\\Rpc\\Method {    public static function description(){     return &lt;&lt;&lt;DESCRIPTION \u0410\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f (\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u044c \u043f\u043e\u0447\u0442\u0443!) \u041f\u0440\u0438\u043c\u0435\u0440 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 auth { \"login\": \"test@mail.ru\", \"password\": \"12345678\" } \u041f\u0440\u0438 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u043c \u043e\u0442\u0432\u0435\u0442\u0435 \u0432\u0435\u0440\u043d\u0435\u0442\u0441\u044f session. DESCRIPTION;   }    public static function validate(){     return [       'auth' => ['type' => 'array', 'req' => true, 'validate' => [         'login'     => ['type' => 'string'  , 'validate' => [], 'req' => true ],         'password'  => ['type' => 'string', 'validate' => [], 'req' => true ],       ] ],     ];   }    public function run(){      $RpcUser = \\CustomRpc\\EntityQuery\\RpcUserQuery::auth($this->Data['auth']['login'], $this->Data['auth']['password']);      if(!$RpcUser){       \/\/ TODO: add error auth count       $this->Response->setError('ERROR_LOGIN_PASSWORD'); return;     }      $userSessionToken = \\CustomRpc\\EntityQuery\\RpcUserSessionQuery::addNewUserSession($RpcUser);      $this->Response->setData('session', $userSessionToken);     $this->Response->setError('ERROR_NO');   }    public static function return(){     return [       'session'     => ['type' => 'string'  , 'validate' => [], 'req' => true ],     ];   }  } <\/code><\/pre>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u041f\u0440\u0438\u043c\u0435\u0440 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"php\">&lt;?php  namespace CustomRpc\\Method\\RpcUser;  class RpcUserInfoUpdate extends \\Oploshka\\Rpc\\Method {    public static function description(){     return &lt;&lt;&lt;DESCRIPTION \u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0432\u043e\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 gender = 'NULL' 'MALE' 'FEMALE' dateOfBirth = date format YYYY-MM-DD  region - \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0439 regionId image - \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c multipart \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u043c \u043f\u043e\u043b\u0435 (\u043e\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u0430), \u0432 \u0431\u0438\u043d\u0430\u0440\u043d\u043e\u043c \u0432\u0438\u0434\u0435. DESCRIPTION;   }    public static function validate(){     return [       'session'       => ['type' => 'rpcUserSession'  , 'validate' => [], 'req' => true ],       'nickname'      => ['type' => 'string'    , 'validate' => [], 'req' => false ],       'region'        => ['type' => 'region'    , 'validate' => [], 'req' => false ],       'gender'        => ['type' => 'string'    , 'validate' => [], 'req' => false ],       'dateOfBirth'   => ['type' => 'string'    , 'validate' => [], 'req' => false ],       'aboutUs'       => ['type' => 'string'    , 'validate' => [], 'req' => false ],     ];   }    public function run(){     $RpcUser = $this->Data['session'];      $updateField = [];       if( $this->Data['nickname'] ){       \/\/ \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0441\u0442\u044c nickname       if ( \\CustomRpc\\EntityQuery\\RpcUserQuery::checkRegisteredNickname( $this->Data['nickname'] ) ) {         $this->Response->setError('ERROR_NICKNAME_REGISTERED'); return;       }       $updateField['nickname'] = $this->Data['nickname'];     }      $this->Data['region']       &amp;&amp; $updateField['region_id']      = $this->Data['region']->id;     $this->Data['gender']       &amp;&amp; $updateField['gender']         = $this->Data['gender'];     $this->Data['dateOfBirth']  &amp;&amp; $updateField['date_of_birth']  = $this->Data['dateOfBirth'];     $this->Data['aboutUs']      &amp;&amp; $updateField['about_us']       = $this->Data['aboutUs'];      $file = \\CustomRpc\\Entity\\RpcUserHelper::loadAndSaveImage('image');     $file &amp;&amp; $updateField['image_id'] = $file->id();      \\CustomRpc\\EntityQuery\\RpcUserQuery::update($RpcUser, $updateField);     $this->Response->setError('ERROR_NO');   }    public static function return(){     return [];   }  } <\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u0412\u0435\u0441\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f RPC \u043c\u0435\u0442\u043e\u0434\u0430 \u0441\u0432\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u043a \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0441 (\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 go), \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0445\u0435\u043c\u0443 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 (\u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u043c \u043a\u043b\u0430\u0441\u0441\u0435 \u0438\u043b\u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0432 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043a\u043b\u0430\u0441\u0441) \u0438 \u0441\u0430\u043c\u0443 \u043b\u043e\u0433\u0438\u043a\u0443.<\/p>\n<p>\u0411\u044b\u043b\u0438 \u0438\u0434\u0435\u0438, \u0447\u0442\u043e RPC \u044f\u0434\u0440\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0447\u0438\u0441\u0442\u0443\u044e \u043b\u043e\u0433\u0438\u043a\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0437\u043d\u0430\u0435\u0442 \u043f\u0440\u043e api, \u043d\u043e \u043e\u0431\u044b\u0447\u043d\u043e, \u0432 \u044d\u0442\u043e\u043c \u043d\u0435 \u0431\u044b\u043b\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u0441\u043c\u044b\u0441\u043b\u0430 (\u044d\u0442\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u043b\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u043e\u0434\u0430, \u0430 \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u0430\u043a \u0442\u0430\u043a\u043e\u0432\u043e\u0433\u043e \u043d\u0435 \u0431\u044b\u043b\u043e)<\/p>\n<p>\u041f\u043e \u0438\u0442\u043e\u0433\u0443 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c:<\/p>\n<ul>\n<li>\n<p>\u0433\u0438\u0431\u043a\u043e\u0441\u0442\u044c. \u041c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0438 \u043e\u0442\u0434\u0430\u0432\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441 \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u0444\u043e\u0440\u043c\u0430\u0442\u0430\u0445 (\u043d\u0430 \u043b\u043e\u0433\u0438\u043a\u0443, \u044d\u0442\u043e \u043d\u0435 \u0432\u043b\u0438\u044f\u0435\u0442)<\/p>\n<\/li>\n<li>\n<p>\u0445\u043e\u0440\u043e\u0448\u0443\u044e \u043e\u0442\u043a\u0430\u0437\u043e\u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u043e\u0441\u0442\u044c. \u041e\u0448\u0438\u0431\u043a\u0438 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u044f\u0434\u0440\u043e\u043c RPC \u0438 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u043f\u0430\u0434\u0435\u043d\u0438\u044f \u0441\u0432\u0435\u0434\u0435\u043d\u0430 \u043a \u043c\u0438\u043d\u0438\u043c\u0443. \u0412 \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443\/\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443, \u043d\u0435 \u043c\u0435\u043d\u044f\u044f \u043a\u043e\u0434 \u043c\u0435\u0442\u043e\u0434\u043e\u0432.<\/p>\n<\/li>\n<li>\n<p>\u043f\u0440\u043e\u0441\u0442\u043e\u0442\u0443 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u041d\u0435 \u043d\u0443\u0436\u043d\u043e \u0434\u0435\u0440\u0433\u0430\u0442\u044c \u0441\u0435\u0442\u0435\u0432\u043e\u0439 \u0441\u043b\u043e\u0439. \u0415\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043e\u0431\u0449\u0438\u0435 \u0442\u0435\u0441\u0442\u044b \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432. \u0421\u0430\u043c \u043c\u0435\u0442\u043e\u0434 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u043f\u0435\u0440\u0435\u0434\u0430\u0432 \u0441\u044b\u0440\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u043b\u0438 \u0436\u0435 \u0432\u0430\u043b\u0438\u0434\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442.<\/p>\n<\/li>\n<li>\n<p>\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f RPC \u043c\u0435\u0442\u043e\u0434\u043e\u0432. \u0412 \u0446\u0435\u043b\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0430\u0434\u0430\u043f\u0442\u0435\u0440 \u0434\u043b\u044f swager&#8217;a \u0438\u043b\u0438 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u0435\u043d\u044c\u043a\u0438\u0439 html (\u044f \u0432\u044b\u0431\u0440\u0430\u043b \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435).<\/p>\n<\/li>\n<\/ul>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>\u042f \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u043b \u043f\u0440\u0438\u043c\u0435\u0440 RPC \u0440\u0430\u0437\u043d\u044b\u043c \u043b\u044e\u0434\u044f\u043c, \u043a\u043e\u043c\u0443 \u0442\u043e \u0442\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043d\u0440\u0430\u0432\u0438\u0442\u044c\u0441\u044f, \u043a\u043e\u043c\u0443 \u0442\u043e \u043d\u0435\u0442, \u043a\u0442\u043e \u0442\u043e \u043f\u044b\u0442\u0430\u043b\u0441\u044f \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0435. \u0412 \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0435\u0441\u0442\u044c \u043a\u0443\u0434\u0430 \u0440\u0430\u0441\u0442\u0438 \u0438 \u0435\u0441\u0442\u044c \u0438\u0434\u0435\u0438 \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438. \u041f\u0440\u0438\u043c\u0435\u0440\u044b \u043d\u0435 \u0442\u044f\u043d\u0443\u0442 \u043d\u0430 \u043e\u0441\u043a\u0430\u0440 \u0438 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u044e\u0442 \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043f\u0438\u0441\u0430\u0442\u044c. RPC \u044f\u0434\u0440\u043e \u043d\u0430 go \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c <a href=\"https:\/\/github.com\/oploshka\/go-rpc\" rel=\"noopener noreferrer nofollow\">\u0442\u0443\u0442<\/a>, \u043d\u0430 php <a href=\"https:\/\/github.com\/oploshka\/RpcCore\" rel=\"noopener noreferrer nofollow\">\u0442\u0443\u0442<\/a> (develop \u0431\u043e\u043b\u0435\u0435 \u0441\u0432\u0435\u0436\u0435\u0435).<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/594825\/\"> https:\/\/habr.com\/ru\/articles\/594825\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-400151","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/400151","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=400151"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/400151\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=400151"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=400151"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=400151"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}