Files
zzp-server/app/adminapi/controller/user/UserTronController.php
2026-01-19 14:19:22 +08:00

150 lines
3.5 KiB
PHP

<?php
namespace app\adminapi\controller\user;
use app\adminapi\controller\BaseAdminController;
use app\adminapi\lists\user\UserTronLists;
use app\adminapi\logic\user\UserTronLogic;
use app\adminapi\validate\user\UserTronValidate;
/**
* 波场钱包控制器
* Class UserTronController
* @package app\adminapi\controller\user
*/
class UserTronController extends BaseAdminController
{
/**
* @notes 获取波场钱包列表
* @return \think\response\Json
* @author BD
* @date 2024/05/04 23:38
*/
public function lists()
{
return $this->dataLists(new UserTronLists());
}
/**
* @notes 创建波场钱包
* @return \think\response\Json
* @author BD
* @date 2024/05/04 23:38
*/
public function add()
{
$result = UserTronLogic::add();
if (true === $result) {
return $this->success('创建成功', [], 1, 1);
}
return $this->fail(UserTronLogic::getError());
}
/**
* @notes 编辑波场钱包
* @return \think\response\Json
* @author BD
* @date 2024/05/04 23:38
*/
public function edit()
{
$params = (new UserTronValidate())->post()->goCheck('edit');
$result = UserTronLogic::edit($params);
if (true === $result) {
return $this->success('编辑成功', [], 1, 1);
}
return $this->fail(UserTronLogic::getError());
}
/**
* @notes 删除波场钱包
* @return \think\response\Json
* @author BD
* @date 2024/05/04 23:38
*/
public function delete()
{
$params = (new UserTronValidate())->post()->goCheck('delete');
UserTronLogic::delete($params);
return $this->success('删除成功', [], 1, 1);
}
/**
* @notes 获取波场钱包详情
* @return \think\response\Json
* @author BD
* @date 2024/05/04 23:38
*/
public function detail()
{
$params = (new UserTronValidate())->goCheck('detail');
$result = UserTronLogic::detail($params);
return $this->data($result);
}
/**
* @notes 更新排序
* @return \think\response\Json
* @author BD
* @date 2024/05/04 23:38
*/
public function updateSort()
{
$params = $this->request->post();
UserTronLogic::updateSort($params);
return $this->success('更新成功', [], 1, 1);
}
/**
* @notes 更新金额
* @return \think\response\Json
* @author BD
* @date 2024/05/04 23:38
*/
public function updateMoney()
{
$params = $this->request->post();
UserTronLogic::updateMoney($params);
return $this->success('更新成功', [], 1, 1);
}
/**
* @notes 转账
* @return \think\response\Json
* @author BD
* @date 2024/05/04 23:38
*/
public function tran()
{
$params = (new UserTronValidate())->post()->goCheck('tran');
$res = UserTronLogic::tran($params);
if (true === $res) {
return $this->success('转账成功', [], 1, 1);
}
return $this->fail($res);
}
/**
* @notes 资金归集
* @return \think\response\Json
* @author BD
* @date 2024/05/04 23:38
*/
public function tranAll()
{
$params = (new UserTronValidate())->post()->goCheck('tranAll');
$res = UserTronLogic::tranAll($params);
if (true === $res) {
return $this->success('归集完成', [], 1, 1);
}
return $this->fail($res);
}
}