196 行
4.5 KiB
PHP
196 行
4.5 KiB
PHP
|
<?php
|
||
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
||
|
# source: demo1/proto/user.proto
|
||
|
|
||
|
namespace Proto;
|
||
|
|
||
|
use Google\Protobuf\Internal\GPBType;
|
||
|
use Google\Protobuf\Internal\RepeatedField;
|
||
|
use Google\Protobuf\Internal\GPBUtil;
|
||
|
|
||
|
/**
|
||
|
* 定义 RegisterRequest 消息, 包含 username, password, email, mobile 四个字段
|
||
|
*
|
||
|
* Generated from protobuf message <code>proto.RegisterRequest</code>
|
||
|
*/
|
||
|
class RegisterRequest extends \Google\Protobuf\Internal\Message
|
||
|
{
|
||
|
/**
|
||
|
* Generated from protobuf field <code>string username = 1;</code>
|
||
|
*/
|
||
|
protected $username = '';
|
||
|
/**
|
||
|
* Generated from protobuf field <code>string password = 2;</code>
|
||
|
*/
|
||
|
protected $password = '';
|
||
|
/**
|
||
|
* Generated from protobuf field <code>string email = 3;</code>
|
||
|
*/
|
||
|
protected $email = '';
|
||
|
/**
|
||
|
* Generated from protobuf field <code>string mobile = 4;</code>
|
||
|
*/
|
||
|
protected $mobile = '';
|
||
|
/**
|
||
|
* Generated from protobuf field <code>.proto.Sex sex = 5;</code>
|
||
|
*/
|
||
|
protected $sex = 0;
|
||
|
/**
|
||
|
* Generated from protobuf field <code>repeated string hobbies = 6;</code>
|
||
|
*/
|
||
|
private $hobbies;
|
||
|
|
||
|
/**
|
||
|
* Constructor.
|
||
|
*
|
||
|
* @param array $data {
|
||
|
* Optional. Data for populating the Message object.
|
||
|
*
|
||
|
* @type string $username
|
||
|
* @type string $password
|
||
|
* @type string $email
|
||
|
* @type string $mobile
|
||
|
* @type int $sex
|
||
|
* @type array<string>|\Google\Protobuf\Internal\RepeatedField $hobbies
|
||
|
* }
|
||
|
*/
|
||
|
public function __construct($data = NULL) {
|
||
|
\GPBMetadata\Demo1\Proto\User::initOnce();
|
||
|
parent::__construct($data);
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Generated from protobuf field <code>string username = 1;</code>
|
||
|
* @return string
|
||
|
*/
|
||
|
public function getUsername()
|
||
|
{
|
||
|
return $this->username;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Generated from protobuf field <code>string username = 1;</code>
|
||
|
* @param string $var
|
||
|
* @return $this
|
||
|
*/
|
||
|
public function setUsername($var)
|
||
|
{
|
||
|
GPBUtil::checkString($var, True);
|
||
|
$this->username = $var;
|
||
|
|
||
|
return $this;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Generated from protobuf field <code>string password = 2;</code>
|
||
|
* @return string
|
||
|
*/
|
||
|
public function getPassword()
|
||
|
{
|
||
|
return $this->password;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Generated from protobuf field <code>string password = 2;</code>
|
||
|
* @param string $var
|
||
|
* @return $this
|
||
|
*/
|
||
|
public function setPassword($var)
|
||
|
{
|
||
|
GPBUtil::checkString($var, True);
|
||
|
$this->password = $var;
|
||
|
|
||
|
return $this;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Generated from protobuf field <code>string email = 3;</code>
|
||
|
* @return string
|
||
|
*/
|
||
|
public function getEmail()
|
||
|
{
|
||
|
return $this->email;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Generated from protobuf field <code>string email = 3;</code>
|
||
|
* @param string $var
|
||
|
* @return $this
|
||
|
*/
|
||
|
public function setEmail($var)
|
||
|
{
|
||
|
GPBUtil::checkString($var, True);
|
||
|
$this->email = $var;
|
||
|
|
||
|
return $this;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Generated from protobuf field <code>string mobile = 4;</code>
|
||
|
* @return string
|
||
|
*/
|
||
|
public function getMobile()
|
||
|
{
|
||
|
return $this->mobile;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Generated from protobuf field <code>string mobile = 4;</code>
|
||
|
* @param string $var
|
||
|
* @return $this
|
||
|
*/
|
||
|
public function setMobile($var)
|
||
|
{
|
||
|
GPBUtil::checkString($var, True);
|
||
|
$this->mobile = $var;
|
||
|
|
||
|
return $this;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Generated from protobuf field <code>.proto.Sex sex = 5;</code>
|
||
|
* @return int
|
||
|
*/
|
||
|
public function getSex()
|
||
|
{
|
||
|
return $this->sex;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Generated from protobuf field <code>.proto.Sex sex = 5;</code>
|
||
|
* @param int $var
|
||
|
* @return $this
|
||
|
*/
|
||
|
public function setSex($var)
|
||
|
{
|
||
|
GPBUtil::checkEnum($var, \Proto\Sex::class);
|
||
|
$this->sex = $var;
|
||
|
|
||
|
return $this;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Generated from protobuf field <code>repeated string hobbies = 6;</code>
|
||
|
* @return \Google\Protobuf\Internal\RepeatedField
|
||
|
*/
|
||
|
public function getHobbies()
|
||
|
{
|
||
|
return $this->hobbies;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Generated from protobuf field <code>repeated string hobbies = 6;</code>
|
||
|
* @param array<string>|\Google\Protobuf\Internal\RepeatedField $var
|
||
|
* @return $this
|
||
|
*/
|
||
|
public function setHobbies($var)
|
||
|
{
|
||
|
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
|
||
|
$this->hobbies = $arr;
|
||
|
|
||
|
return $this;
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|