| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- <?php
- namespace App\Http\Controllers\Admin;
- use App\Services\Common\AgentService;
- /**
- * 代理管理控制器
- */
- class AgentController extends Backend
- {
- /**
- * 获取代理列表
- */
- public function index()
- {
- $agentService = new AgentService();
- $pageSize = request()->get('limit', 15);
- return $agentService->getDataList(request()->all(), $pageSize);
- }
- /**
- * 获取代理详情
- */
- public function info()
- {
- $id = request()->get('id');
- if (!$id) {
- return ['code' => 1, 'msg' => '参数错误'];
- }
- $agentService = new AgentService();
- return $agentService->getInfo($id);
- }
- /**
- * 删除代理
- */
- public function delete()
- {
- $agentService = new AgentService();
- return $agentService->delete();
- }
- /**
- * 更新状态(禁用/启用)
- */
- public function status()
- {
- $agentService = new AgentService();
- return $agentService->status();
- }
- /**
- * 审核代理
- */
- public function audit()
- {
- $agentService = new AgentService();
- return $agentService->audit();
- }
- /**
- * 冻结/解冻代理
- */
- public function freeze()
- {
- $agentService = new AgentService();
- return $agentService->freeze();
- }
- }
|