<?php

namespace App\Jobs\GrowingIO;

use App\Models\User\UserModel;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;

class UserVipReportJob extends BaseReportJob implements ShouldQueue
{
    use Dispatchable;
    use InteractsWithQueue;
    use Queueable;
    use SerializesModels;

    protected $user;
    protected $open;
    protected $platform;

    public function __construct(UserModel $user, $open, $platform)
    {
        $this->user = $user;
        $this->open = $open;
        $this->platform = $platform;
    }

    /**
     * Execute the job.
     *
     * @return void
     */
    public function doHandle()
    {
        $this->doReport(self::VIP_EVENT, $this->user->uid, [
            'status' => $this->open ? '激活' : '失效',
            'device' => $this->platform,
            'location' => $this->user->address,
            'gender' => $this->transformGender($this->user->sex),
//            会员状态 字符串 ：激活、失效
//
//
//
//用户性别 字符串 ： 男生、女生
//
//
//
//定位城市 字符串 ： 具体城市名称
//
//
//
//用户系统 字符串 ： ios、android
        ]);
    }
}
