You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
322 lines
8.3 KiB
322 lines
8.3 KiB
<?php
|
|
|
|
namespace app\home\controller;
|
|
|
|
use app\home\service\UserService;
|
|
use Psr\SimpleCache\InvalidArgumentException;
|
|
use think\response\Json;
|
|
|
|
class User extends HomeBaseController
|
|
{
|
|
|
|
/**
|
|
* @desc 获取用户信息
|
|
* @return Json
|
|
*/
|
|
public function getUserInfo(): Json
|
|
{
|
|
$returnData = (new UserService())->getUserInfo($this->request->userId);
|
|
return json($returnData);
|
|
}
|
|
|
|
// 用户购买VIP
|
|
public function purchaseVip(): Json
|
|
{
|
|
$returnData = (new UserService())->purchaseVip($this->request->userId);
|
|
return json($returnData);
|
|
}
|
|
// 用户购买vip记录列表
|
|
public function purchaseVipLog(): Json
|
|
{
|
|
$returnData = (new UserService())->purchaseVipLog($this->request->userId, $this->request->post());
|
|
return json($returnData);
|
|
}
|
|
|
|
public function getAnchorForAgent(): Json
|
|
{
|
|
$returnData = (new UserService())->getAnchorForAgent($this->request->userId);
|
|
return json($returnData);
|
|
}
|
|
|
|
/**
|
|
* @desc 设置用户国家
|
|
* @return Json
|
|
*/
|
|
public function setCountry(): Json
|
|
{
|
|
$returnData = (new UserService())->setCountry($this->request->userId, $this->request->post());
|
|
return json($returnData);
|
|
}
|
|
|
|
/**
|
|
* @desc 更新用户头像
|
|
* @return Json
|
|
*/
|
|
public function updateHeadImg(): Json
|
|
{
|
|
$returnData = (new UserService())->updateHeadImg($this->request->userId, $this->request->post());
|
|
return json($returnData);
|
|
}
|
|
|
|
/**
|
|
* @desc 设置 昵称 姓名 性别
|
|
* @return Json
|
|
*/
|
|
public function updateInfo(): Json
|
|
{
|
|
$returnData = (new UserService())->updateInfo($this->request->userId, $this->request->post());
|
|
return json($returnData);
|
|
}
|
|
|
|
/**
|
|
* @desc 登陆状态获取邮件
|
|
* @return Json
|
|
*/
|
|
public function sendEmail(): Json
|
|
{
|
|
$returnData = (new UserService())->sendEmail($this->request->userId, $this->request->post());
|
|
return json($returnData);
|
|
}
|
|
|
|
/**
|
|
* @desc 登陆后发送短信
|
|
* @return Json
|
|
*/
|
|
public function sendSms(): Json
|
|
{
|
|
$returnData = (new UserService())->sendSms($this->request->userId, $this->request->post());
|
|
return json($returnData);
|
|
}
|
|
|
|
/**
|
|
* @desc 通过邮箱 设置取款密码
|
|
* @return Json
|
|
*/
|
|
public function setPayPasswordByEmail(): Json
|
|
{
|
|
$returnData = (new UserService())->setPayPasswordByEmail($this->request->userId, $this->request->post());
|
|
return json($returnData);
|
|
}
|
|
|
|
/**
|
|
* @desc 通过短信 设置取款密码
|
|
* @return Json
|
|
*/
|
|
public function setPayPasswordBySms(): Json
|
|
{
|
|
$returnData = (new UserService())->setPayPasswordBySms($this->request->userId, $this->request->post());
|
|
return json($returnData);
|
|
}
|
|
|
|
/**
|
|
* @desc 通过短信修改交易密码
|
|
* @return Json
|
|
*/
|
|
public function updatePayPasswordBySms()
|
|
{
|
|
$returnData = (new UserService())->updatePayPasswordBySms($this->request->userId, $this->request->post());
|
|
return json($returnData);
|
|
}
|
|
|
|
/**
|
|
* @desc 通过邮箱修改交易密码
|
|
* @return Json
|
|
*/
|
|
public function updatePayPasswordByEmail()
|
|
{
|
|
$returnData = (new UserService())->updatePayPasswordByEmail($this->request->userId, $this->request->post());
|
|
return json($returnData);
|
|
}
|
|
|
|
/**
|
|
* @desc 短信重新设置交易密码
|
|
* @return Json
|
|
* @throws InvalidArgumentException
|
|
*/
|
|
public function resetPayPasswordBySms()
|
|
{
|
|
$returnData = (new UserService())->resetPayPasswordBySms($this->request->userId, $this->request->post());
|
|
return json($returnData);
|
|
}
|
|
|
|
/**
|
|
* @desc 通过邮箱重新设置交易密码
|
|
* @return Json
|
|
* @throws InvalidArgumentException
|
|
*/
|
|
public function resetPayPasswordByEmail()
|
|
{
|
|
$returnData = (new UserService())->resetPayPasswordByEmail($this->request->userId, $this->request->post());
|
|
return json($returnData);
|
|
}
|
|
|
|
/**
|
|
* @desc 短信修改登陆密码
|
|
* @return Json
|
|
*/
|
|
public function updatePasswordBySms()
|
|
{
|
|
$returnData = (new UserService())->updatePasswordBySms($this->request->userId, $this->request->post());
|
|
return json($returnData);
|
|
}
|
|
|
|
/**
|
|
* @desc 邮箱修改登陆密码
|
|
* @return Json
|
|
* @throws InvalidArgumentException
|
|
*/
|
|
public function updatePasswordByEmail()
|
|
{
|
|
$returnData = (new UserService())->updatePasswordByEmail($this->request->userId, $this->request->post());
|
|
return json($returnData);
|
|
}
|
|
|
|
/**
|
|
* @desc 短信重新设置登陆密码
|
|
* @return Json
|
|
*/
|
|
public function resetPasswordBySms()
|
|
{
|
|
$returnData = (new UserService())->resetPasswordBySms($this->request->userId, $this->request->post());
|
|
return json($returnData);
|
|
}
|
|
|
|
/**
|
|
* @desc 邮箱设置登陆密码
|
|
* @return Json
|
|
*/
|
|
public function resetPasswordByEmail()
|
|
{
|
|
$returnData = (new UserService())->resetPasswordByEmail($this->request->userId, $this->request->post());
|
|
return json($returnData);
|
|
}
|
|
|
|
|
|
/**
|
|
* @desc 绑定邮箱
|
|
* @return Json
|
|
*/
|
|
public function bindEmail(): Json
|
|
{
|
|
$returnData = (new UserService())->bindEmail($this->request->userId, $this->request->post());
|
|
return json($returnData);
|
|
}
|
|
|
|
/**
|
|
* @desc 修改已经绑定的邮箱
|
|
* @return Json
|
|
* @throws InvalidArgumentException
|
|
*/
|
|
public function updateEmail(): Json
|
|
{
|
|
$returnData = (new UserService())->updateEmail($this->request->userId, $this->request->post());
|
|
return json($returnData);
|
|
}
|
|
|
|
|
|
/**
|
|
* @desc 绑定手机号
|
|
* @return Json
|
|
*/
|
|
public function bindPhone(): Json
|
|
{
|
|
$returnData = (new UserService())->bindPhone($this->request->userId, $this->request->post());
|
|
return json($returnData);
|
|
}
|
|
|
|
/**
|
|
* @desc
|
|
* @return Json
|
|
* @throws InvalidArgumentException
|
|
*/
|
|
public function updatePhone(): Json
|
|
{
|
|
$returnData = (new UserService())->updatePhone($this->request->userId, $this->request->post());
|
|
return json($returnData);
|
|
}
|
|
|
|
|
|
/**
|
|
* @desc
|
|
* @return Json
|
|
* @throws InvalidArgumentException
|
|
*/
|
|
public function apply_loan(): Json
|
|
{
|
|
$returnData = (new UserService())->apply_loan($this->request->userId, $this->request->post());
|
|
return json($returnData);
|
|
}
|
|
|
|
|
|
/**
|
|
* @desc
|
|
* @return Json
|
|
* @throws InvalidArgumentException
|
|
*/
|
|
public function loan(): Json
|
|
{
|
|
$returnData = (new UserService())->loan($this->request->userId, $this->request->post());
|
|
return json($returnData);
|
|
}
|
|
|
|
/**
|
|
* @desc 退出登陆
|
|
* @return Json
|
|
*/
|
|
public function logout(): Json
|
|
{
|
|
$returnData = (new UserService())->logout($this->request->userId);
|
|
return json($returnData);
|
|
}
|
|
|
|
/**
|
|
* @desc 获取登陆信息
|
|
* @return Json
|
|
*/
|
|
public function loginLog(): Json
|
|
{
|
|
$returnData = (new UserService())->loginLog($this->request->userId);
|
|
return json($returnData);
|
|
}
|
|
|
|
/**
|
|
* 获取时间
|
|
* @return Json
|
|
*/
|
|
public function getTime()
|
|
{
|
|
return json(['code' => '0',
|
|
'message' => 'SUCCESS',
|
|
'data' => ['time' => 259200]]);
|
|
}
|
|
|
|
/**
|
|
* @desc 杠杆状态
|
|
* @return Json
|
|
*/
|
|
public function leverApply(): Json
|
|
{
|
|
$returnData = (new UserService())->leverApply($this->request->userId);
|
|
return json($returnData);
|
|
}
|
|
public function applyTest(): Json
|
|
{
|
|
$returnData = (new UserService())->applyTestAccount($this->request->userId);
|
|
return json($returnData);
|
|
}
|
|
public function applyTestMoney(): Json
|
|
{
|
|
$returnData = (new UserService())->applyTestMoney($this->request->userId,$this->request->post());
|
|
return json($returnData);
|
|
}
|
|
public function testLogin(): Json
|
|
{
|
|
$returnData = (new UserService())->testLogin($this->request->userId);
|
|
return json($returnData);
|
|
}
|
|
public function formalLogin(): Json
|
|
{
|
|
$returnData = (new UserService())->formalLogin($this->request->userId);
|
|
return json($returnData);
|
|
}
|
|
}
|