ExtendApi class
This commit is contained in:
@@ -0,0 +1,43 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Services;
|
||||||
|
|
||||||
|
use GuzzleHttp\Client as HTTPClient;
|
||||||
|
|
||||||
|
class CoreServiceApi
|
||||||
|
{
|
||||||
|
|
||||||
|
public static function NodeServiceApi($url_path, $data){
|
||||||
|
|
||||||
|
$ch = curl_init();
|
||||||
|
|
||||||
|
curl_setopt($ch, CURLOPT_URL, 'http://10.20.30.26:8000/api/v1/'.($url_path);
|
||||||
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||||
|
curl_setopt($ch, CURLOPT_POST, 1);
|
||||||
|
// curl_setopt($ch, CURLOPT_POSTFIELDS, "{'username':'$username','password':'$password',\"sessionid\":\"DUMMYSESSION\"}");
|
||||||
|
curl_setopt($ch, CURLOPT_POSTFIELDS, "{\"username\":\"$username\",\"password\":\"$password\",\"sessionid\":\"DUMMYSESSION\"}");
|
||||||
|
curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');
|
||||||
|
|
||||||
|
$headers = array();
|
||||||
|
$headers[] = 'X-Devicetoken: ';
|
||||||
|
$headers[] = 'X-Float-Device-Location-Latitude: 0';
|
||||||
|
$headers[] = 'Authorization: Token 99dfe35fcb7de1ee';
|
||||||
|
$headers[] = 'Content-Type: application/json';
|
||||||
|
$headers[] = 'Accept: application/json, text/plain, */*';
|
||||||
|
$headers[] = 'X-Float-Device-Location-Longitude: 0';
|
||||||
|
$headers[] = 'Referer: http://10.0.0.252:8100/';
|
||||||
|
$headers[] = 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36';
|
||||||
|
$headers[] = 'X-Session-Id: ';
|
||||||
|
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
|
||||||
|
|
||||||
|
$result = curl_exec($ch);
|
||||||
|
if (curl_errno($ch)) {
|
||||||
|
echo 'Error:' . curl_error($ch);
|
||||||
|
}
|
||||||
|
curl_close($ch);
|
||||||
|
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -3,8 +3,9 @@
|
|||||||
namespace App\Services;
|
namespace App\Services;
|
||||||
|
|
||||||
use GuzzleHttp\Client as HTTPClient;
|
use GuzzleHttp\Client as HTTPClient;
|
||||||
|
use CoreServiceApi;
|
||||||
|
|
||||||
class FloatLogin
|
class FloatLogin extends CoreServiceApi
|
||||||
{
|
{
|
||||||
public static function floatLoginUser($username,$password)
|
public static function floatLoginUser($username,$password)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Services;
|
||||||
|
|
||||||
|
use GuzzleHttp\Client as HTTPClient;
|
||||||
|
use CoreServiceApi;
|
||||||
|
|
||||||
|
class ResetPassword extends CoreServiceApi
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -3,8 +3,9 @@
|
|||||||
namespace App\Services;
|
namespace App\Services;
|
||||||
|
|
||||||
use GuzzleHttp\Client as HTTPClient;
|
use GuzzleHttp\Client as HTTPClient;
|
||||||
|
use CoreServiceApi;
|
||||||
|
|
||||||
class UserProfile
|
class UserProfile extends CoreServiceApi
|
||||||
{
|
{
|
||||||
public static function floatUserProfile($token)
|
public static function floatUserProfile($token)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user