modify plugin name

This commit is contained in:
2022-06-17 19:00:56 +08:00
parent b515f04c97
commit 4a7d4165f8
20 changed files with 1510 additions and 0 deletions
+11
View File
@@ -0,0 +1,11 @@
{
"name": "game-worker/kiri-grpc-server",
"autoload": {
"psr-4": {
"Kiri\\Grpc\\": "src/"
}
},
"require": {
"google/protobuf": "^v3.3.0"
}
}
Binary file not shown.
@@ -0,0 +1,58 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: user.service.proto
namespace User;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;
/**
* Generated from protobuf message <code>user.UserDetailRequest</code>
*/
class UserDetailRequest extends \Google\Protobuf\Internal\Message
{
/**
* Generated from protobuf field <code>int64 userId = 1;</code>
*/
protected $userId = 0;
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type int|string $userId
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\UserService::initOnce();
parent::__construct($data);
}
/**
* Generated from protobuf field <code>int64 userId = 1;</code>
* @return int|string
*/
public function getUserId()
{
return $this->userId;
}
/**
* Generated from protobuf field <code>int64 userId = 1;</code>
* @param int|string $var
* @return $this
*/
public function setUserId($var)
{
GPBUtil::checkInt64($var);
$this->userId = $var;
return $this;
}
}
@@ -0,0 +1,85 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: user.service.proto
namespace User;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;
/**
* Generated from protobuf message <code>user.UserDetailResponse</code>
*/
class UserDetailResponse extends \Google\Protobuf\Internal\Message
{
/**
* Generated from protobuf field <code>int64 code = 1;</code>
*/
protected $code = 0;
/**
* Generated from protobuf field <code>bytes params = 2;</code>
*/
protected $params = '';
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type int|string $code
* @type string $params
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\UserService::initOnce();
parent::__construct($data);
}
/**
* Generated from protobuf field <code>int64 code = 1;</code>
* @return int|string
*/
public function getCode()
{
return $this->code;
}
/**
* Generated from protobuf field <code>int64 code = 1;</code>
* @param int|string $var
* @return $this
*/
public function setCode($var)
{
GPBUtil::checkInt64($var);
$this->code = $var;
return $this;
}
/**
* Generated from protobuf field <code>bytes params = 2;</code>
* @return string
*/
public function getParams()
{
return $this->params;
}
/**
* Generated from protobuf field <code>bytes params = 2;</code>
* @param string $var
* @return $this
*/
public function setParams($var)
{
GPBUtil::checkString($var, False);
$this->params = $var;
return $this;
}
}
@@ -0,0 +1,58 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: user.service.proto
namespace User;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;
/**
* Generated from protobuf message <code>user.UserJwtCheckRequest</code>
*/
class UserJwtCheckRequest extends \Google\Protobuf\Internal\Message
{
/**
* Generated from protobuf field <code>string token = 1;</code>
*/
protected $token = '';
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type string $token
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\UserService::initOnce();
parent::__construct($data);
}
/**
* Generated from protobuf field <code>string token = 1;</code>
* @return string
*/
public function getToken()
{
return $this->token;
}
/**
* Generated from protobuf field <code>string token = 1;</code>
* @param string $var
* @return $this
*/
public function setToken($var)
{
GPBUtil::checkString($var, True);
$this->token = $var;
return $this;
}
}
@@ -0,0 +1,85 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: user.service.proto
namespace User;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;
/**
* Generated from protobuf message <code>user.UserJwtCheckResponse</code>
*/
class UserJwtCheckResponse extends \Google\Protobuf\Internal\Message
{
/**
* Generated from protobuf field <code>int64 code = 1;</code>
*/
protected $code = 0;
/**
* Generated from protobuf field <code>int64 userId = 2;</code>
*/
protected $userId = 0;
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type int|string $code
* @type int|string $userId
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\UserService::initOnce();
parent::__construct($data);
}
/**
* Generated from protobuf field <code>int64 code = 1;</code>
* @return int|string
*/
public function getCode()
{
return $this->code;
}
/**
* Generated from protobuf field <code>int64 code = 1;</code>
* @param int|string $var
* @return $this
*/
public function setCode($var)
{
GPBUtil::checkInt64($var);
$this->code = $var;
return $this;
}
/**
* Generated from protobuf field <code>int64 userId = 2;</code>
* @return int|string
*/
public function getUserId()
{
return $this->userId;
}
/**
* Generated from protobuf field <code>int64 userId = 2;</code>
* @param int|string $var
* @return $this
*/
public function setUserId($var)
{
GPBUtil::checkInt64($var);
$this->userId = $var;
return $this;
}
}
@@ -0,0 +1,58 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: user.service.proto
namespace User;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;
/**
* Generated from protobuf message <code>user.UserKickRequest</code>
*/
class UserKickRequest extends \Google\Protobuf\Internal\Message
{
/**
* Generated from protobuf field <code>int64 userId = 1;</code>
*/
protected $userId = 0;
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type int|string $userId
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\UserService::initOnce();
parent::__construct($data);
}
/**
* Generated from protobuf field <code>int64 userId = 1;</code>
* @return int|string
*/
public function getUserId()
{
return $this->userId;
}
/**
* Generated from protobuf field <code>int64 userId = 1;</code>
* @param int|string $var
* @return $this
*/
public function setUserId($var)
{
GPBUtil::checkInt64($var);
$this->userId = $var;
return $this;
}
}
@@ -0,0 +1,85 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: user.service.proto
namespace User;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;
/**
* Generated from protobuf message <code>user.UserKickResponse</code>
*/
class UserKickResponse extends \Google\Protobuf\Internal\Message
{
/**
* Generated from protobuf field <code>int64 code = 1;</code>
*/
protected $code = 0;
/**
* Generated from protobuf field <code>string message = 2;</code>
*/
protected $message = '';
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type int|string $code
* @type string $message
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\UserService::initOnce();
parent::__construct($data);
}
/**
* Generated from protobuf field <code>int64 code = 1;</code>
* @return int|string
*/
public function getCode()
{
return $this->code;
}
/**
* Generated from protobuf field <code>int64 code = 1;</code>
* @param int|string $var
* @return $this
*/
public function setCode($var)
{
GPBUtil::checkInt64($var);
$this->code = $var;
return $this;
}
/**
* Generated from protobuf field <code>string message = 2;</code>
* @return string
*/
public function getMessage()
{
return $this->message;
}
/**
* Generated from protobuf field <code>string message = 2;</code>
* @param string $var
* @return $this
*/
public function setMessage($var)
{
GPBUtil::checkString($var, True);
$this->message = $var;
return $this;
}
}
@@ -0,0 +1,85 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: user.service.proto
namespace User;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;
/**
* Generated from protobuf message <code>user.UserLockRequest</code>
*/
class UserLockRequest extends \Google\Protobuf\Internal\Message
{
/**
* Generated from protobuf field <code>int64 userId = 1;</code>
*/
protected $userId = 0;
/**
* Generated from protobuf field <code>int64 day = 2;</code>
*/
protected $day = 0;
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type int|string $userId
* @type int|string $day
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\UserService::initOnce();
parent::__construct($data);
}
/**
* Generated from protobuf field <code>int64 userId = 1;</code>
* @return int|string
*/
public function getUserId()
{
return $this->userId;
}
/**
* Generated from protobuf field <code>int64 userId = 1;</code>
* @param int|string $var
* @return $this
*/
public function setUserId($var)
{
GPBUtil::checkInt64($var);
$this->userId = $var;
return $this;
}
/**
* Generated from protobuf field <code>int64 day = 2;</code>
* @return int|string
*/
public function getDay()
{
return $this->day;
}
/**
* Generated from protobuf field <code>int64 day = 2;</code>
* @param int|string $var
* @return $this
*/
public function setDay($var)
{
GPBUtil::checkInt64($var);
$this->day = $var;
return $this;
}
}
@@ -0,0 +1,85 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: user.service.proto
namespace User;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;
/**
* Generated from protobuf message <code>user.UserLockResponse</code>
*/
class UserLockResponse extends \Google\Protobuf\Internal\Message
{
/**
* Generated from protobuf field <code>int64 code = 1;</code>
*/
protected $code = 0;
/**
* Generated from protobuf field <code>string message = 2;</code>
*/
protected $message = '';
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type int|string $code
* @type string $message
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\UserService::initOnce();
parent::__construct($data);
}
/**
* Generated from protobuf field <code>int64 code = 1;</code>
* @return int|string
*/
public function getCode()
{
return $this->code;
}
/**
* Generated from protobuf field <code>int64 code = 1;</code>
* @param int|string $var
* @return $this
*/
public function setCode($var)
{
GPBUtil::checkInt64($var);
$this->code = $var;
return $this;
}
/**
* Generated from protobuf field <code>string message = 2;</code>
* @return string
*/
public function getMessage()
{
return $this->message;
}
/**
* Generated from protobuf field <code>string message = 2;</code>
* @param string $var
* @return $this
*/
public function setMessage($var)
{
GPBUtil::checkString($var, True);
$this->message = $var;
return $this;
}
}
@@ -0,0 +1,58 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: user.service.proto
namespace User;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;
/**
* Generated from protobuf message <code>user.UserOfflineRequest</code>
*/
class UserOfflineRequest extends \Google\Protobuf\Internal\Message
{
/**
* Generated from protobuf field <code>int64 userId = 1;</code>
*/
protected $userId = 0;
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type int|string $userId
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\UserService::initOnce();
parent::__construct($data);
}
/**
* Generated from protobuf field <code>int64 userId = 1;</code>
* @return int|string
*/
public function getUserId()
{
return $this->userId;
}
/**
* Generated from protobuf field <code>int64 userId = 1;</code>
* @param int|string $var
* @return $this
*/
public function setUserId($var)
{
GPBUtil::checkInt64($var);
$this->userId = $var;
return $this;
}
}
@@ -0,0 +1,85 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: user.service.proto
namespace User;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;
/**
* Generated from protobuf message <code>user.UserOfflineResponse</code>
*/
class UserOfflineResponse extends \Google\Protobuf\Internal\Message
{
/**
* Generated from protobuf field <code>int64 code = 1;</code>
*/
protected $code = 0;
/**
* Generated from protobuf field <code>string message = 2;</code>
*/
protected $message = '';
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type int|string $code
* @type string $message
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\UserService::initOnce();
parent::__construct($data);
}
/**
* Generated from protobuf field <code>int64 code = 1;</code>
* @return int|string
*/
public function getCode()
{
return $this->code;
}
/**
* Generated from protobuf field <code>int64 code = 1;</code>
* @param int|string $var
* @return $this
*/
public function setCode($var)
{
GPBUtil::checkInt64($var);
$this->code = $var;
return $this;
}
/**
* Generated from protobuf field <code>string message = 2;</code>
* @return string
*/
public function getMessage()
{
return $this->message;
}
/**
* Generated from protobuf field <code>string message = 2;</code>
* @param string $var
* @return $this
*/
public function setMessage($var)
{
GPBUtil::checkString($var, True);
$this->message = $var;
return $this;
}
}
@@ -0,0 +1,87 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: user.service.proto
namespace User;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;
/**
* User 服务的各个接口的请求/响应结构
*
* Generated from protobuf message <code>user.UserOnlineRequest</code>
*/
class UserOnlineRequest extends \Google\Protobuf\Internal\Message
{
/**
* Generated from protobuf field <code>string token = 1;</code>
*/
protected $token = '';
/**
* Generated from protobuf field <code>string LastInnerIp = 2;</code>
*/
protected $LastInnerIp = '';
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type string $token
* @type string $LastInnerIp
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\UserService::initOnce();
parent::__construct($data);
}
/**
* Generated from protobuf field <code>string token = 1;</code>
* @return string
*/
public function getToken()
{
return $this->token;
}
/**
* Generated from protobuf field <code>string token = 1;</code>
* @param string $var
* @return $this
*/
public function setToken($var)
{
GPBUtil::checkString($var, True);
$this->token = $var;
return $this;
}
/**
* Generated from protobuf field <code>string LastInnerIp = 2;</code>
* @return string
*/
public function getLastInnerIp()
{
return $this->LastInnerIp;
}
/**
* Generated from protobuf field <code>string LastInnerIp = 2;</code>
* @param string $var
* @return $this
*/
public function setLastInnerIp($var)
{
GPBUtil::checkString($var, True);
$this->LastInnerIp = $var;
return $this;
}
}
@@ -0,0 +1,176 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: user.service.proto
namespace User;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;
/**
* Generated from protobuf message <code>user.UserOnlineResponse</code>
*/
class UserOnlineResponse extends \Google\Protobuf\Internal\Message
{
/**
* Generated from protobuf field <code>int64 code = 1;</code>
*/
protected $code = 0;
/**
* Generated from protobuf field <code>string message = 2;</code>
*/
protected $message = '';
/**
* Generated from protobuf field <code>int64 userId = 3;</code>
*/
protected $userId = 0;
/**
* Generated from protobuf field <code>int64 appId = 4;</code>
*/
protected $appId = 0;
/**
* Generated from protobuf field <code>.user.UserStatus status = 5;</code>
*/
protected $status = null;
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type int|string $code
* @type string $message
* @type int|string $userId
* @type int|string $appId
* @type \User\UserStatus $status
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\UserService::initOnce();
parent::__construct($data);
}
/**
* Generated from protobuf field <code>int64 code = 1;</code>
* @return int|string
*/
public function getCode()
{
return $this->code;
}
/**
* Generated from protobuf field <code>int64 code = 1;</code>
* @param int|string $var
* @return $this
*/
public function setCode($var)
{
GPBUtil::checkInt64($var);
$this->code = $var;
return $this;
}
/**
* Generated from protobuf field <code>string message = 2;</code>
* @return string
*/
public function getMessage()
{
return $this->message;
}
/**
* Generated from protobuf field <code>string message = 2;</code>
* @param string $var
* @return $this
*/
public function setMessage($var)
{
GPBUtil::checkString($var, True);
$this->message = $var;
return $this;
}
/**
* Generated from protobuf field <code>int64 userId = 3;</code>
* @return int|string
*/
public function getUserId()
{
return $this->userId;
}
/**
* Generated from protobuf field <code>int64 userId = 3;</code>
* @param int|string $var
* @return $this
*/
public function setUserId($var)
{
GPBUtil::checkInt64($var);
$this->userId = $var;
return $this;
}
/**
* Generated from protobuf field <code>int64 appId = 4;</code>
* @return int|string
*/
public function getAppId()
{
return $this->appId;
}
/**
* Generated from protobuf field <code>int64 appId = 4;</code>
* @param int|string $var
* @return $this
*/
public function setAppId($var)
{
GPBUtil::checkInt64($var);
$this->appId = $var;
return $this;
}
/**
* Generated from protobuf field <code>.user.UserStatus status = 5;</code>
* @return \User\UserStatus|null
*/
public function getStatus()
{
return isset($this->status) ? $this->status : null;
}
public function hasStatus()
{
return isset($this->status);
}
public function clearStatus()
{
unset($this->status);
}
/**
* Generated from protobuf field <code>.user.UserStatus status = 5;</code>
* @param \User\UserStatus $var
* @return $this
*/
public function setStatus($var)
{
GPBUtil::checkMessage($var, \User\UserStatus::class);
$this->status = $var;
return $this;
}
}
@@ -0,0 +1,58 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: user.service.proto
namespace User;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;
/**
* Generated from protobuf message <code>user.UserShieldRequest</code>
*/
class UserShieldRequest extends \Google\Protobuf\Internal\Message
{
/**
* Generated from protobuf field <code>int64 userId = 1;</code>
*/
protected $userId = 0;
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type int|string $userId
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\UserService::initOnce();
parent::__construct($data);
}
/**
* Generated from protobuf field <code>int64 userId = 1;</code>
* @return int|string
*/
public function getUserId()
{
return $this->userId;
}
/**
* Generated from protobuf field <code>int64 userId = 1;</code>
* @param int|string $var
* @return $this
*/
public function setUserId($var)
{
GPBUtil::checkInt64($var);
$this->userId = $var;
return $this;
}
}
@@ -0,0 +1,85 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: user.service.proto
namespace User;
use Google\Protobuf\Internal\Message;
use Google\Protobuf\Internal\GPBUtil;
use GPBMetadata\UserService;
/**
* Generated from protobuf message <code>user.UserShieldResponse</code>
*/
class UserShieldResponse extends Message
{
/**
* Generated from protobuf field <code>int64 code = 1;</code>
*/
protected $code = 0;
/**
* Generated from protobuf field <code>string message = 2;</code>
*/
protected $message = '';
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type int|string $code
* @type string $message
* }
*/
public function __construct($data = NULL) {
UserService::initOnce();
parent::__construct($data);
}
/**
* Generated from protobuf field <code>int64 code = 1;</code>
* @return int|string
*/
public function getCode()
{
return $this->code;
}
/**
* Generated from protobuf field <code>int64 code = 1;</code>
* @param int|string $var
* @return $this
*/
public function setCode($var)
{
GPBUtil::checkInt64($var);
$this->code = $var;
return $this;
}
/**
* Generated from protobuf field <code>string message = 2;</code>
* @return string
*/
public function getMessage()
{
return $this->message;
}
/**
* Generated from protobuf field <code>string message = 2;</code>
* @param string $var
* @return $this
*/
public function setMessage($var)
{
GPBUtil::checkString($var, True);
$this->message = $var;
return $this;
}
}
+166
View File
@@ -0,0 +1,166 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: user.service.proto
namespace User;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;
/**
* Generated from protobuf message <code>user.UserStatus</code>
*/
class UserStatus extends \Google\Protobuf\Internal\Message
{
/**
* Generated from protobuf field <code>int64 isLock = 1;</code>
*/
protected $isLock = 0;
/**
* Generated from protobuf field <code>int64 isShield = 2;</code>
*/
protected $isShield = 0;
/**
* Generated from protobuf field <code>string nickname = 3;</code>
*/
protected $nickname = '';
/**
* Generated from protobuf field <code>string avatar = 4;</code>
*/
protected $avatar = '';
/**
* Generated from protobuf field <code>string sex = 5;</code>
*/
protected $sex = '';
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type int|string $isLock
* @type int|string $isShield
* @type string $nickname
* @type string $avatar
* @type string $sex
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\UserService::initOnce();
parent::__construct($data);
}
/**
* Generated from protobuf field <code>int64 isLock = 1;</code>
* @return int|string
*/
public function getIsLock()
{
return $this->isLock;
}
/**
* Generated from protobuf field <code>int64 isLock = 1;</code>
* @param int|string $var
* @return $this
*/
public function setIsLock($var)
{
GPBUtil::checkInt64($var);
$this->isLock = $var;
return $this;
}
/**
* Generated from protobuf field <code>int64 isShield = 2;</code>
* @return int|string
*/
public function getIsShield()
{
return $this->isShield;
}
/**
* Generated from protobuf field <code>int64 isShield = 2;</code>
* @param int|string $var
* @return $this
*/
public function setIsShield($var)
{
GPBUtil::checkInt64($var);
$this->isShield = $var;
return $this;
}
/**
* Generated from protobuf field <code>string nickname = 3;</code>
* @return string
*/
public function getNickname()
{
return $this->nickname;
}
/**
* Generated from protobuf field <code>string nickname = 3;</code>
* @param string $var
* @return $this
*/
public function setNickname($var)
{
GPBUtil::checkString($var, True);
$this->nickname = $var;
return $this;
}
/**
* Generated from protobuf field <code>string avatar = 4;</code>
* @return string
*/
public function getAvatar()
{
return $this->avatar;
}
/**
* Generated from protobuf field <code>string avatar = 4;</code>
* @param string $var
* @return $this
*/
public function setAvatar($var)
{
GPBUtil::checkString($var, True);
$this->avatar = $var;
return $this;
}
/**
* Generated from protobuf field <code>string sex = 5;</code>
* @return string
*/
public function getSex()
{
return $this->sex;
}
/**
* Generated from protobuf field <code>string sex = 5;</code>
* @param string $var
* @return $this
*/
public function setSex($var)
{
GPBUtil::checkString($var, True);
$this->sex = $var;
return $this;
}
}
@@ -0,0 +1,58 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: user.service.proto
namespace User;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;
/**
* Generated from protobuf message <code>user.UserUnLockRequest</code>
*/
class UserUnLockRequest extends \Google\Protobuf\Internal\Message
{
/**
* Generated from protobuf field <code>int64 userId = 1;</code>
*/
protected $userId = 0;
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type int|string $userId
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\UserService::initOnce();
parent::__construct($data);
}
/**
* Generated from protobuf field <code>int64 userId = 1;</code>
* @return int|string
*/
public function getUserId()
{
return $this->userId;
}
/**
* Generated from protobuf field <code>int64 userId = 1;</code>
* @param int|string $var
* @return $this
*/
public function setUserId($var)
{
GPBUtil::checkInt64($var);
$this->userId = $var;
return $this;
}
}
@@ -0,0 +1,85 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: user.service.proto
namespace User;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;
/**
* Generated from protobuf message <code>user.UserUnLockResponse</code>
*/
class UserUnLockResponse extends \Google\Protobuf\Internal\Message
{
/**
* Generated from protobuf field <code>int64 code = 1;</code>
*/
protected $code = 0;
/**
* Generated from protobuf field <code>string message = 2;</code>
*/
protected $message = '';
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type int|string $code
* @type string $message
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\UserService::initOnce();
parent::__construct($data);
}
/**
* Generated from protobuf field <code>int64 code = 1;</code>
* @return int|string
*/
public function getCode()
{
return $this->code;
}
/**
* Generated from protobuf field <code>int64 code = 1;</code>
* @param int|string $var
* @return $this
*/
public function setCode($var)
{
GPBUtil::checkInt64($var);
$this->code = $var;
return $this;
}
/**
* Generated from protobuf field <code>string message = 2;</code>
* @return string
*/
public function getMessage()
{
return $this->message;
}
/**
* Generated from protobuf field <code>string message = 2;</code>
* @param string $var
* @return $this
*/
public function setMessage($var)
{
GPBUtil::checkString($var, True);
$this->message = $var;
return $this;
}
}
+42
View File
@@ -0,0 +1,42 @@
<?php
namespace Kiri\Grpc;
use Google\Protobuf\Internal\GPBUtil;
use GPBMetadata\UserService;
use Kiri\Abstracts\Component;
use Kiri\Di\ContainerInterface;
use Swoole\Server;
class GrpcServer extends Component
{
/**
* @param ContainerInterface $container
* @param array $config
* @throws \Exception
*/
public function __construct(
public ContainerInterface $container,
array $config = [])
{
parent::__construct($config);
}
/**
* @param Server $server
* @param int $fd
* @param int $reactor_id
* @param string $data
* @return void
*/
public function onReceive(Server $server, int $fd, int $reactor_id, string $data): void
{
UserService::initOnce();
}
}