| POST | /api/v1/internal/users/register |
|---|
<?php namespace dtos;
use DateTime;
use Exception;
use DateInterval;
use JsonSerializable;
use ServiceStack\{IReturn,IReturnVoid,IGet,IPost,IPut,IDelete,IPatch,IMeta,IHasSessionId,IHasBearerToken,IHasVersion};
use ServiceStack\{ICrud,ICreateDb,IUpdateDb,IPatchDb,IDeleteDb,ISaveDb,AuditBase,QueryDb,QueryDb2,QueryData,QueryData2,QueryResponse};
use ServiceStack\{ResponseStatus,ResponseError,EmptyResponse,IdResponse,ArrayList,KeyValuePair2,StringResponse,StringsResponse,Tuple2,Tuple3,ByteArray};
use ServiceStack\{JsonConverters,Returns,TypeContext};
class InternalRegister implements JsonSerializable
{
public function __construct(
/** @var int */
public int $id=0,
/** @var string */
public string $userName='',
/** @var string */
public string $password='',
/** @var string */
public string $email='',
/** @var string */
public string $phone='',
/** @var string */
public string $address='',
/** @var string */
public string $fullName='',
/** @var bool|null */
public ?bool $isActiveEmail=null,
/** @var bool|null */
public ?bool $phoneConfirm=null,
/** @var int */
public int $isActive=0,
/** @var int */
public int $isBlock=0,
/** @var string */
public string $iP_Mask='',
/** @var string */
public string $netbar_IP='',
/** @var DateTime */
public DateTime $registeredDate=new DateTime(),
/** @var int */
public int $money1=0,
/** @var int */
public int $money2=0,
/** @var int */
public int $moneyForVip=0,
/** @var int */
public int $totalMoney=0,
/** @var string */
public string $idNumber='',
/** @var DateTime|null */
public ?DateTime $idRegDate=null,
/** @var DateTime|null */
public ?DateTime $dob=null,
/** @var bool|null */
public ?bool $useTwoFA=null,
/** @var string */
public string $twoFASecurityCode='',
/** @var int */
public int $twoFAStatus=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['id'])) $this->id = $o['id'];
if (isset($o['userName'])) $this->userName = $o['userName'];
if (isset($o['password'])) $this->password = $o['password'];
if (isset($o['email'])) $this->email = $o['email'];
if (isset($o['phone'])) $this->phone = $o['phone'];
if (isset($o['address'])) $this->address = $o['address'];
if (isset($o['fullName'])) $this->fullName = $o['fullName'];
if (isset($o['isActiveEmail'])) $this->isActiveEmail = $o['isActiveEmail'];
if (isset($o['phoneConfirm'])) $this->phoneConfirm = $o['phoneConfirm'];
if (isset($o['isActive'])) $this->isActive = $o['isActive'];
if (isset($o['isBlock'])) $this->isBlock = $o['isBlock'];
if (isset($o['iP_Mask'])) $this->iP_Mask = $o['iP_Mask'];
if (isset($o['netbar_IP'])) $this->netbar_IP = $o['netbar_IP'];
if (isset($o['registeredDate'])) $this->registeredDate = JsonConverters::from('DateTime', $o['registeredDate']);
if (isset($o['money1'])) $this->money1 = $o['money1'];
if (isset($o['money2'])) $this->money2 = $o['money2'];
if (isset($o['moneyForVip'])) $this->moneyForVip = $o['moneyForVip'];
if (isset($o['totalMoney'])) $this->totalMoney = $o['totalMoney'];
if (isset($o['idNumber'])) $this->idNumber = $o['idNumber'];
if (isset($o['idRegDate'])) $this->idRegDate = JsonConverters::from('DateTime', $o['idRegDate']);
if (isset($o['dob'])) $this->dob = JsonConverters::from('DateTime', $o['dob']);
if (isset($o['useTwoFA'])) $this->useTwoFA = $o['useTwoFA'];
if (isset($o['twoFASecurityCode'])) $this->twoFASecurityCode = $o['twoFASecurityCode'];
if (isset($o['twoFAStatus'])) $this->twoFAStatus = $o['twoFAStatus'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->id)) $o['id'] = $this->id;
if (isset($this->userName)) $o['userName'] = $this->userName;
if (isset($this->password)) $o['password'] = $this->password;
if (isset($this->email)) $o['email'] = $this->email;
if (isset($this->phone)) $o['phone'] = $this->phone;
if (isset($this->address)) $o['address'] = $this->address;
if (isset($this->fullName)) $o['fullName'] = $this->fullName;
if (isset($this->isActiveEmail)) $o['isActiveEmail'] = $this->isActiveEmail;
if (isset($this->phoneConfirm)) $o['phoneConfirm'] = $this->phoneConfirm;
if (isset($this->isActive)) $o['isActive'] = $this->isActive;
if (isset($this->isBlock)) $o['isBlock'] = $this->isBlock;
if (isset($this->iP_Mask)) $o['iP_Mask'] = $this->iP_Mask;
if (isset($this->netbar_IP)) $o['netbar_IP'] = $this->netbar_IP;
if (isset($this->registeredDate)) $o['registeredDate'] = JsonConverters::to('DateTime', $this->registeredDate);
if (isset($this->money1)) $o['money1'] = $this->money1;
if (isset($this->money2)) $o['money2'] = $this->money2;
if (isset($this->moneyForVip)) $o['moneyForVip'] = $this->moneyForVip;
if (isset($this->totalMoney)) $o['totalMoney'] = $this->totalMoney;
if (isset($this->idNumber)) $o['idNumber'] = $this->idNumber;
if (isset($this->idRegDate)) $o['idRegDate'] = JsonConverters::to('DateTime', $this->idRegDate);
if (isset($this->dob)) $o['dob'] = JsonConverters::to('DateTime', $this->dob);
if (isset($this->useTwoFA)) $o['useTwoFA'] = $this->useTwoFA;
if (isset($this->twoFASecurityCode)) $o['twoFASecurityCode'] = $this->twoFASecurityCode;
if (isset($this->twoFAStatus)) $o['twoFAStatus'] = $this->twoFAStatus;
return empty($o) ? new class(){} : $o;
}
}
class BannerListResponse implements JsonSerializable
{
public function __construct(
/** @var int */
public int $id=0,
/** @var string */
public string $title='',
/** @var string */
public string $image='',
/** @var string */
public string $url='',
/** @var bool|null */
public ?bool $publish=null,
/** @var DateTime */
public DateTime $publishDate=new DateTime(),
/** @var int */
public int $orderIndex=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['id'])) $this->id = $o['id'];
if (isset($o['title'])) $this->title = $o['title'];
if (isset($o['image'])) $this->image = $o['image'];
if (isset($o['url'])) $this->url = $o['url'];
if (isset($o['publish'])) $this->publish = $o['publish'];
if (isset($o['publishDate'])) $this->publishDate = JsonConverters::from('DateTime', $o['publishDate']);
if (isset($o['orderIndex'])) $this->orderIndex = $o['orderIndex'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->id)) $o['id'] = $this->id;
if (isset($this->title)) $o['title'] = $this->title;
if (isset($this->image)) $o['image'] = $this->image;
if (isset($this->url)) $o['url'] = $this->url;
if (isset($this->publish)) $o['publish'] = $this->publish;
if (isset($this->publishDate)) $o['publishDate'] = JsonConverters::to('DateTime', $this->publishDate);
if (isset($this->orderIndex)) $o['orderIndex'] = $this->orderIndex;
return empty($o) ? new class(){} : $o;
}
}
/**
* @template T
*/
class BaseResponse implements IResponseRequest, JsonSerializable
{
public array $genericArgs = [];
public static function create(array $genericArgs=[]): BaseResponse {
$to = new BaseResponse();
$to->genericArgs = $genericArgs;
return $to;
}
public function __construct(
/** @var int */
public mixed $code=0,
/** @var string|null */
public mixed $message=null,
/** @var array<BannerListResponse>|null */
public mixed $data=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['code'])) $this->code = $o['code'];
if (isset($o['message'])) $this->message = $o['message'];
if (isset($o['data'])) $this->data = JsonConverters::fromArray('BannerListResponse', $o['data']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->code)) $o['code'] = $this->code;
if (isset($this->message)) $o['message'] = $this->message;
if (isset($this->data)) $o['data'] = JsonConverters::toArray('BannerListResponse', $this->data);
return empty($o) ? new class(){} : $o;
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /api/v1/internal/users/register HTTP/1.1
Host: efun-id-api-sandbox.efun.vn
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<InternalRegister xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/efun.id.api.ServiceModel">
<Address>String</Address>
<DOB>0001-01-01T00:00:00</DOB>
<Email>String</Email>
<FullName>String</FullName>
<IP_Mask>String</IP_Mask>
<Id>0</Id>
<IdNumber>String</IdNumber>
<IdRegDate>0001-01-01T00:00:00</IdRegDate>
<IsActive>0</IsActive>
<IsActiveEmail>false</IsActiveEmail>
<IsBlock>0</IsBlock>
<Money1>0</Money1>
<Money2>0</Money2>
<MoneyForVip>0</MoneyForVip>
<Netbar_IP>String</Netbar_IP>
<Password>String</Password>
<Phone>String</Phone>
<PhoneConfirm>false</PhoneConfirm>
<RegisteredDate>0001-01-01T00:00:00</RegisteredDate>
<TotalMoney>0</TotalMoney>
<TwoFASecurityCode>String</TwoFASecurityCode>
<TwoFAStatus>0</TwoFAStatus>
<UseTwoFA>false</UseTwoFA>
<UserName>String</UserName>
</InternalRegister>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<BaseResponseOfUserRegisterResponsee8XEboS6 xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/efun.id.api.ServiceModel">
<Code>0</Code>
<Data>
<created_at>0001-01-01T00:00:00</created_at>
<email>String</email>
<first_name>String</first_name>
<full_name>String</full_name>
<id>0</id>
<is_play_now>0</is_play_now>
<last_name>String</last_name>
<phone_number>String</phone_number>
<status>0</status>
<updated_at>0001-01-01T00:00:00</updated_at>
<username>String</username>
</Data>
<Message>String</Message>
</BaseResponseOfUserRegisterResponsee8XEboS6>