AgentController.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. class AgentController extends Controller
  7. {
  8. protected AgentService $service;
  9. public function __construct(AgentService $service)
  10. {
  11. $this->service = $service;
  12. }
  13. /**
  14. * 获取代理商配置
  15. */
  16. public function getConfig(Request $request)
  17. {
  18. $agentId = $request->input('agent_id');
  19. return $this->service->getAgentConfig($agentId);
  20. }
  21. /**
  22. * 获取代理商
  23. */
  24. public function getAgent(Request $request)
  25. {
  26. $areaCode = $request->input('area_code');
  27. return $this->service->getAgent($areaCode);
  28. }
  29. /**
  30. * 获取代理商项目列表
  31. */
  32. public function getProjectList(Request $request)
  33. {
  34. $categoryId = $request->input('category_id');
  35. $agentId = $request->input('agent_id');
  36. return $this->service->getProjectList($categoryId, $agentId);
  37. }
  38. /**
  39. * 获取代理商项目详情
  40. */
  41. public function getProjectDetail(Request $request)
  42. {
  43. $projectId = $request->input('project_id');
  44. $agentId = $request->input('agent_id');
  45. return $this->service->getProjectDetail($projectId, $agentId);
  46. }
  47. }