增加测试代码
This commit is contained in:
@@ -117,11 +117,11 @@ trait ApiResponse
|
||||
|
||||
/**
|
||||
* 成功的返回
|
||||
* @Author :<C.Jason>
|
||||
* @Date :2018-05-22
|
||||
* @param [type] $data [description]
|
||||
* @param string $status [description]
|
||||
* @return [type] [description]
|
||||
* @Author :<C.Jason>
|
||||
* @Date :2018-05-22
|
||||
* @param [type] $data [description]
|
||||
* @param string $log
|
||||
* @return [type] [description]
|
||||
*/
|
||||
public function success($data, $log = '')
|
||||
{
|
||||
|
||||
@@ -258,4 +258,48 @@ class TestController
|
||||
return number_format(microtime(true) - request()->server('REQUEST_TIME_FLOAT'), $decimals) . ' s';
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 测试签名
|
||||
* @Author: 玄尘
|
||||
* @Date : 2020/12/30 11:47
|
||||
* @param \Illuminate\Http\Request $request
|
||||
*/
|
||||
public function getSign(Request $request)
|
||||
{
|
||||
|
||||
// $data = 'SMyBpCxqBnxAGr/Fk9LOB851Glkgc3ruZnu1Y0ft/R+Ng26ooLXok1Oi1SrwhSJaQ9U75zy3tI7fq3YfTLQxITwUmt4jBiShpeK1whMaYrI=';
|
||||
// $addcode = '1234567812345678';
|
||||
//
|
||||
// return [
|
||||
// 'sign' => $this->keysign($data, $addcode),
|
||||
// 'server_id' => $this->user->server_id,
|
||||
// 'server_key' => $this->user->server_key,
|
||||
// 'data' => $data,
|
||||
// 'addcode' => $addcode,
|
||||
// ];
|
||||
|
||||
$server_id = $request->server_id;
|
||||
$redemptionCode = $request->redemptionCode;
|
||||
$total = $request->total;
|
||||
$outletId = $request->outletId;
|
||||
|
||||
$this->user = User::whereNull('parent_id')
|
||||
->where('server_id', $server_id)
|
||||
->first();
|
||||
if (!$this->user) {
|
||||
return $this->error('未查到到渠道');
|
||||
}
|
||||
$ret = [
|
||||
'redemptionCode' => $redemptionCode,
|
||||
'total' => $total,
|
||||
'outletId' => $outletId,
|
||||
];
|
||||
|
||||
return json_encode($ret);
|
||||
info(json_encode($ret));
|
||||
|
||||
return $this->success($ret);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user