<?php

namespace App\Http\Controllers\Client;

use App\Http\Controllers\Controller;
use App\Services\Client\AgentService;
use Illuminate\Http\Request;

class AgentController extends Controller
{
    protected AgentService $service;

    public function __construct(AgentService $service)
    {
        $this->service = $service;
    }

    /**
     * 获取代理商配置
     */
    public function getConfig(Request $request)
    {
        $agentId = $request->input('agent_id');
        return $this->service->getAgentConfig($agentId);
    }

    /**
     * 获取代理商
     */
    public function getAgent(Request $request)
    {
        $areaCode = $request->input('area_code');
        return $this->service->getAgent($areaCode);
    }

    /**
     * 获取代理商项目列表
     */
    public function getProjectList(Request $request)
    {
        $categoryId = $request->input('category_id');
        $agentId = $request->input('agent_id');
        return $this->service->getProjectList($categoryId, $agentId);
    }

    /**
     * 获取代理商项目详情
     */
    public function getProjectDetail(Request $request)
    {
        $projectId = $request->input('project_id');
        $agentId = $request->input('agent_id');
        return $this->service->getProjectDetail($projectId, $agentId);
    }
} 