<?php

namespace App\Domains\Stats\Http\Controllers;

use Illuminate\Http\Request;
use App\Domains\Stats\Services\RenewalService;

/**
 * 续费率统计
 */
class RenewalController extends Controller
{
    protected $request;
    protected $renewalService;

    /**
     * 构造函数，自动注入.
     */
    public function __construct(Request $request, RenewalService $renewalService)
    {
        $this->request = $request;
        $this->renewalService = $renewalService;
    }

    /**
     * 列表.
     *
     * @return \Illuminate\Http\Response
     */
    public function index()
    {
        $conditions = $this->request->all();

        $res = $this->renewalService->index($conditions);

        return res($res, '续费率统计', 201);
    }
}
