AgentController.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. namespace App\Http\Controllers\Client;
  3. use App\Http\Controllers\Controller;
  4. use App\Services\Client\AgentService;
  5. use Illuminate\Http\Request;
  6. /**
  7. * @group 用户端-代理商管理
  8. *
  9. * 代理商相关的API接口
  10. */
  11. class AgentController extends Controller
  12. {
  13. protected AgentService $service;
  14. public function __construct(AgentService $service)
  15. {
  16. $this->service = $service;
  17. }
  18. /**
  19. * 获取代理商配置
  20. */
  21. public function getConfig(Request $request)
  22. {
  23. $agentId = $request->input('agent_id');
  24. return $this->service->getAgentConfig($agentId);
  25. }
  26. /**
  27. * 获取代理商
  28. */
  29. public function getAgent(Request $request)
  30. {
  31. $areaCode = $request->input('area_code');
  32. return $this->service->getAgent($areaCode);
  33. }
  34. /**
  35. * 获取代理商项目列表
  36. */
  37. public function getProjectList(Request $request)
  38. {
  39. $categoryId = $request->input('category_id');
  40. $agentId = $request->input('agent_id');
  41. return $this->service->getProjectList($categoryId, $agentId);
  42. }
  43. /**
  44. * 获取代理商项目详情
  45. */
  46. public function getProjectDetail(Request $request)
  47. {
  48. $projectId = $request->input('project_id');
  49. $agentId = $request->input('agent_id');
  50. return $this->service->getProjectDetail($projectId, $agentId);
  51. }
  52. }