<?php

namespace app\extra\tools;

use yzh52521\EasyHttp\Http;

class XcJob
{



    /**
     * 默认header
     * @var string[]
     */
    protected array $header = [
        "content-type"  => "application/json"
    ];

    public function token(): static
    {
        $this->header = [
            "cookie" => $this->getCookie()
        ];
        return $this;
    }

    /**
     * @param string $jobId
     * @return array
     */
    public function getJobDetail(string $jobId = ""): array
    {
        return Http::withHeaders($this->header)->get("https://www.xingtu.cn/gw/api/task/provider_get_project_detail",['project_id' => $jobId])->array();
    }


    protected function getCookie(): string
    {
        return "passport_csrf_token=dc2c5075e29c15785b2433afb8d9dd10; passport_csrf_token_default=dc2c5075e29c15785b2433afb8d9dd10; is_staff_user=false; has_biz_token=false; x-web-secsdk-uid=f676fb7e-81a3-42e2-b9e1-73c0ea919aea; csrf_session_id=5499e75e3f1f76a628c1efa81b7c89b3; tt_webid=7637860647254296090; Hm_lvt_5d77c979053345c4bd8db63329f818ec=1778328034; HMACCOUNT=DE9169EBCCD81810; Hm_lpvt_5d77c979053345c4bd8db63329f818ec=1778328167; passport_auth_status=93b289d15b8bb4866b32877a48a3b4b6%2C3a1cc997a270fa7b4f4fb3c3a79939fd; passport_auth_status_ss=93b289d15b8bb4866b32877a48a3b4b6%2C3a1cc997a270fa7b4f4fb3c3a79939fd; sid_guard=2cf53e24db19ce7e1d9094d82a7e0a15%7C1778328219%7C5184002%7CWed%2C+08-Jul-2026+12%3A03%3A41+GMT; uid_tt=b918d45f40210fd4799129be8d1e7ae1; uid_tt_ss=b918d45f40210fd4799129be8d1e7ae1; sid_tt=2cf53e24db19ce7e1d9094d82a7e0a15; sessionid=2cf53e24db19ce7e1d9094d82a7e0a15; sessionid_ss=2cf53e24db19ce7e1d9094d82a7e0a15; session_tlb_tag=sttt%7C15%7CLPU-JNsZzn4dkJTYKn4KFf_________SootvJEGr4tH2rLd7KSvG3gY4xtecQgysyxyTbEgz9BA%3D; sid_ucp_v1=1.0.0-KDlkNjI4ZDI4NTI2OTEyMzJiYWNjYTQwYzIyNmZlOWM5OTA0MjU3MjkKFwiUv5Cvv8yyBxCbxfzPBhj6EzgCQPEHGgJscSIgMmNmNTNlMjRkYjE5Y2U3ZTFkOTA5NGQ4MmE3ZTBhMTU; ssid_ucp_v1=1.0.0-KDlkNjI4ZDI4NTI2OTEyMzJiYWNjYTQwYzIyNmZlOWM5OTA0MjU3MjkKFwiUv5Cvv8yyBxCbxfzPBhj6EzgCQPEHGgJscSIgMmNmNTNlMjRkYjE5Y2U3ZTFkOTA5NGQ4MmE3ZTBhMTU; star_sessionid=d56971486bfb11538b9640768581fe1a";
    }
}