<?php

namespace App\Http\Controllers\Share;

use App\Http\Controllers\Controller;
use App\Http\Controllers\Core\Auth;
use App\Managers\LikeManager;

class LikemeController extends Controller
{
    /**
     * 检验邀请
     * @param  int  $invite_id
     * @return array
     * @throws \Exception
     * @deprecated Share/LikeMeCheck
     */
    public function check(int $invite_id)
    {
        $uid = Auth::auth();
        $lms = new LikeManager();
        $data = $lms->check($uid, $invite_id);
        return array(
            'code' => 200,
            'message' => 'success',
            'data' => $data
        );
    }

    /**
     * 获取某个邀请的助力历史
     * @param  int  $invite_id
     * @return array
     * @deprecated Share/LikeMeHistory
     */
    public function history(int $invite_id)
    {
        $lms = new LikeManager();
        $data = $lms->history($invite_id);
        return array(
            'code' => 200,
            'message' => 'success',
            'data' => $data
        );
    }

    /**
     * 获取分享详情
     * @param  int  $invite_id
     * @return array
     * @deprecated Share/LikeMe
     */
    public function get(int $invite_id)
    {
        $lms = new LikeManager();
        $data = $lms->get($invite_id);
        return array(
            'code' => 200,
            'message' => 'success',
            'data' => $data
        );
    }
}
