<?php




namespace ln\jobs;


use app\common\repositories\user\UserRepository;
use ln\interfaces\JobInterface;

class AutoUserPosterJob implements JobInterface
{
    public function fire($job, $uid)
    {
        $userRepository = app()->make(UserRepository::class);
        $user = $userRepository->get($uid);
        if (!$user)
            $job->delete();
        try {
            $userRepository->routineSpreadImage($user);
        } catch (\Exception $e) {
        };
        try {
            $userRepository->wxSpreadImage($user);
        } catch (\Exception $e) {
        };
        $job->delete();
    }

    public function failed($data)
    {
        // TODO: Implement failed() method.
    }
}
