代码初始化

This commit is contained in:
2025-08-07 20:21:47 +08:00
commit 50f3a2dbb0
2191 changed files with 374790 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
<?php
namespace Yzh\Model\Custom;
use Yzh\Model\BaseRequest;
/*
* 自定义请求
*/
class CustomRequest extends BaseRequest
{
public function __construct($params = array())
{
foreach (array_keys(get_object_vars($this)) as $property) {
if (isset($params[$property])) {
$this->{$property} = $params[$property];
}
}
}
}

View File

@@ -0,0 +1,47 @@
<?php
namespace Yzh\Model\Custom;
use Yzh\Model\BaseResponse;
use Yzh\Model\ResponseInterface;
/**
* 自定义返回
*/
class CustomResponse extends BaseResponse implements ResponseInterface
{
/**
* @var Object $customer_data 响应 data 数据
*/
protected $customer_data;
/**
* 写入 data 数据
* @param $data
* @return $this|ResponseInterface
*/
public function setData($data)
{
$this->data = $data;
return $this;
}
/**
* data 数据解析
* @param $response
* @return void
*/
public function setCustomerData($response) {
$class = get_class($response);
$this->customer_data = new $class($this->data);
}
/**
* 响应 data 数据
* @return Object
*/
public function getData()
{
return $this->customer_data;
}
}

View File

@@ -0,0 +1,13 @@
<?php
namespace Yzh\Model\Custom;
use Yzh\Model\BaseModel;
use Yzh\Model\ResponseDataInterface;
/**
* 自定义响应 data 数据
*/
class CustomResponseData extends BaseModel implements ResponseDataInterface
{
}