Web Api clean up
This commit is contained in:
@@ -94,4 +94,108 @@ abstract class BaseController extends Controller
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getSiteConfigurations($config_item){
|
||||||
|
$wrenchboard = new \App\Models\BackendModel();
|
||||||
|
return $wrenchboard->cfgReadChar($config_item);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function endPointList(){
|
||||||
|
|
||||||
|
$endpoints = [
|
||||||
|
'apigate' => ['POST'],
|
||||||
|
'generics' => ['POST'],
|
||||||
|
'createuser' => ['POST'],
|
||||||
|
'homebanners' => ['POST'],
|
||||||
|
'verifysignuplink' => ['POST'],
|
||||||
|
'completesignuplink' => ['POST'],
|
||||||
|
'createmobileuser' => ['POST'],
|
||||||
|
'completemobileuser' => ['POST'],
|
||||||
|
'startresetpasword' => ['POST'],
|
||||||
|
'stepresetpass' => ['POST'],
|
||||||
|
'userlogin' => ['POST'],
|
||||||
|
'authlogin' => ['POST'],
|
||||||
|
'startjoblist' => ['POST'],
|
||||||
|
'dashdata' => ['POST'],
|
||||||
|
'getjobsdata' => ['POST'],
|
||||||
|
'offerslist' => ['POST'],
|
||||||
|
'offersresponse' => ['POST'],
|
||||||
|
'activejoblist' => ['POST'],
|
||||||
|
'loadprofile' => ['POST'],
|
||||||
|
'updateprofile' => ['POST'],
|
||||||
|
'account' => ['POST'],
|
||||||
|
'message' => ['POST'],
|
||||||
|
'pendingjob' => ['POST'],
|
||||||
|
'paymenthx' => ['POST'],
|
||||||
|
'purchasehx' => ['POST'],
|
||||||
|
'getjob' => ['POST'],
|
||||||
|
'mybanklist' => ['POST'],
|
||||||
|
'countrybanks' =>['POST'],
|
||||||
|
'sendmoney' => ['POST'],
|
||||||
|
'sendinterest' => ['POST'],
|
||||||
|
'waitinginterest' => ['POST'],
|
||||||
|
'sendmoneyfee' => ['POST'],
|
||||||
|
'getpendingjobs' => ['POST'],
|
||||||
|
'taskmessage' => ['POST'],
|
||||||
|
'sendtaskmessage' => ['POST'],
|
||||||
|
'activejobmsglist' => ['POST'],
|
||||||
|
'getwallets' => ['POST'],
|
||||||
|
'sitecontact' => ['POST'],
|
||||||
|
'signupcountry' => ['POST'],
|
||||||
|
'userscards' => ['POST'],
|
||||||
|
'blogdata' => ['POST'],
|
||||||
|
'blogitem' => ['POST'],
|
||||||
|
'couponhx' => ['POST'],
|
||||||
|
'couponpending' => ['POST'],
|
||||||
|
'couponredeem' => ['POST'],
|
||||||
|
'sendinterestmessage' => ['POST'],
|
||||||
|
'replyinterestmessage' => ['POST'],
|
||||||
|
'disableaccount' => ['POST'],
|
||||||
|
'myjobs' => ['POST'],
|
||||||
|
'recipients' => ['POST'],
|
||||||
|
'addrecipient' => ['POST'],
|
||||||
|
'sendreferral' => ['POST'],
|
||||||
|
'refferhx' => ['POST'],
|
||||||
|
'accounttypes' => ['POST'],
|
||||||
|
'jobmanageragree' => ['POST'],
|
||||||
|
'jobmanagerlist' => ['POST'],
|
||||||
|
'jobmanageroffers'=> ['POST'],
|
||||||
|
'jobmanageractive'=> ['POST'],
|
||||||
|
'jobmanagercreatejob'=> ['POST'],
|
||||||
|
'jobmanagerupdatejob'=> ['POST'],
|
||||||
|
'jobmanagerdeletejob'=> ['POST'],
|
||||||
|
'activetaskslist' => ['POST'],
|
||||||
|
'profilepasschange' => ['POST'],
|
||||||
|
'starttopup' => ['POST'],
|
||||||
|
'familylist' => ['POST'],
|
||||||
|
'familyadd' => ['POST'],
|
||||||
|
'familyupdate' => ['POST'],
|
||||||
|
'familymanage' => ['POST'],
|
||||||
|
'pendingjobextend' => ['POST'],
|
||||||
|
'pendingjobsendtome' => ['POST'],
|
||||||
|
'pendingjobcancel' => ['POST'],
|
||||||
|
'assigntask' => ['POST'],
|
||||||
|
'resources'=> ['POST'],
|
||||||
|
'uploads'=> ['POST'],
|
||||||
|
'marketmessage'=> ['POST'],
|
||||||
|
'marketinterest'=> ['POST'],
|
||||||
|
'activejobstatus'=> ['POST'],
|
||||||
|
'activetaskstatus'=> ['POST'],
|
||||||
|
'offersinterestlist' => ['POST'],
|
||||||
|
'offersinterestproc' => ['POST'],
|
||||||
|
'offerinterestmsg' => ['POST'],
|
||||||
|
'offerinterestlistmsg' => ['POST'],
|
||||||
|
'payprevcard' => ['POST'],
|
||||||
|
'paynewcard' => ['POST'],
|
||||||
|
'paylistcard' => ['POST'],
|
||||||
|
'payremcard' => ['POST'],
|
||||||
|
'mynotifications' => ['POST'],
|
||||||
|
'familysampletasks' => ['POST'],
|
||||||
|
'familysuggesttasks' => ['POST'],
|
||||||
|
'familysuggestlist' => ['POST'],
|
||||||
|
'familywaitingtasks' => ['POST'],
|
||||||
|
];
|
||||||
|
return $endpoints;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,124 +7,18 @@ use CodeIgniter\API\ResponseTrait;
|
|||||||
|
|
||||||
class WrenchApi extends BaseController
|
class WrenchApi extends BaseController
|
||||||
{
|
{
|
||||||
|
|
||||||
use ResponseTrait;
|
use ResponseTrait;
|
||||||
protected $request;
|
protected $request;
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->request = $request = \Config\Services::request();
|
$this->request = $request = \Config\Services::request();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$data['envID'] = getenv('ENV_ID');
|
$data['envID'] = getenv('ENV_ID');
|
||||||
$data['home_background'] = getenv('HOME_PAGE_BACKGROUND');
|
$data['home_background'] = getenv('HOME_PAGE_BACKGROUND');
|
||||||
return view('welcome_message',$data);
|
return view('welcome_message',$data);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function endPointList(){
|
|
||||||
|
|
||||||
$endpoints = [
|
|
||||||
'apigate' => ['POST'],
|
|
||||||
'generics' => ['POST'],
|
|
||||||
'createuser' => ['POST'],
|
|
||||||
'homebanners' => ['POST'],
|
|
||||||
'verifysignuplink' => ['POST'],
|
|
||||||
'completesignuplink' => ['POST'],
|
|
||||||
'createmobileuser' => ['POST'],
|
|
||||||
'completemobileuser' => ['POST'],
|
|
||||||
'startresetpasword' => ['POST'],
|
|
||||||
'stepresetpass' => ['POST'],
|
|
||||||
'userlogin' => ['POST'],
|
|
||||||
'authlogin' => ['POST'],
|
|
||||||
'startjoblist' => ['POST'],
|
|
||||||
'dashdata' => ['POST'],
|
|
||||||
'getjobsdata' => ['POST'],
|
|
||||||
'offerslist' => ['POST'],
|
|
||||||
'offersresponse' => ['POST'],
|
|
||||||
'activejoblist' => ['POST'],
|
|
||||||
'loadprofile' => ['POST'],
|
|
||||||
'updateprofile' => ['POST'],
|
|
||||||
'account' => ['POST'],
|
|
||||||
'message' => ['POST'],
|
|
||||||
'pendingjob' => ['POST'],
|
|
||||||
'paymenthx' => ['POST'],
|
|
||||||
'purchasehx' => ['POST'],
|
|
||||||
'getjob' => ['POST'],
|
|
||||||
'mybanklist' => ['POST'],
|
|
||||||
'countrybanks' =>['POST'],
|
|
||||||
'sendmoney' => ['POST'],
|
|
||||||
'sendinterest' => ['POST'],
|
|
||||||
'waitinginterest' => ['POST'],
|
|
||||||
'sendmoneyfee' => ['POST'],
|
|
||||||
'getpendingjobs' => ['POST'],
|
|
||||||
'taskmessage' => ['POST'],
|
|
||||||
'sendtaskmessage' => ['POST'],
|
|
||||||
'activejobmsglist' => ['POST'],
|
|
||||||
'getwallets' => ['POST'],
|
|
||||||
'sitecontact' => ['POST'],
|
|
||||||
'signupcountry' => ['POST'],
|
|
||||||
'userscards' => ['POST'],
|
|
||||||
'blogdata' => ['POST'],
|
|
||||||
'blogitem' => ['POST'],
|
|
||||||
'couponhx' => ['POST'],
|
|
||||||
'couponpending' => ['POST'],
|
|
||||||
'couponredeem' => ['POST'],
|
|
||||||
'sendinterestmessage' => ['POST'],
|
|
||||||
'replyinterestmessage' => ['POST'],
|
|
||||||
'disableaccount' => ['POST'],
|
|
||||||
'myjobs' => ['POST'],
|
|
||||||
'recipients' => ['POST'],
|
|
||||||
'addrecipient' => ['POST'],
|
|
||||||
'sendreferral' => ['POST'],
|
|
||||||
'refferhx' => ['POST'],
|
|
||||||
'accounttypes' => ['POST'],
|
|
||||||
'jobmanageragree' => ['POST'],
|
|
||||||
'jobmanagerlist' => ['POST'],
|
|
||||||
'jobmanageroffers'=> ['POST'],
|
|
||||||
'jobmanageractive'=> ['POST'],
|
|
||||||
'jobmanagercreatejob'=> ['POST'],
|
|
||||||
'jobmanagerupdatejob'=> ['POST'],
|
|
||||||
'jobmanagerdeletejob'=> ['POST'],
|
|
||||||
'activetaskslist' => ['POST'],
|
|
||||||
'profilepasschange' => ['POST'],
|
|
||||||
'starttopup' => ['POST'],
|
|
||||||
'familylist' => ['POST'],
|
|
||||||
'familyadd' => ['POST'],
|
|
||||||
'familyupdate' => ['POST'],
|
|
||||||
'familymanage' => ['POST'],
|
|
||||||
'pendingjobextend' => ['POST'],
|
|
||||||
'pendingjobsendtome' => ['POST'],
|
|
||||||
'pendingjobcancel' => ['POST'],
|
|
||||||
'assigntask' => ['POST'],
|
|
||||||
'resources'=> ['POST'],
|
|
||||||
'uploads'=> ['POST'],
|
|
||||||
'marketmessage'=> ['POST'],
|
|
||||||
'marketinterest'=> ['POST'],
|
|
||||||
'activejobstatus'=> ['POST'],
|
|
||||||
'activetaskstatus'=> ['POST'],
|
|
||||||
'offersinterestlist' => ['POST'],
|
|
||||||
'offersinterestproc' => ['POST'],
|
|
||||||
'offerinterestmsg' => ['POST'],
|
|
||||||
'offerinterestlistmsg' => ['POST'],
|
|
||||||
'payprevcard' => ['POST'],
|
|
||||||
'paynewcard' => ['POST'],
|
|
||||||
'paylistcard' => ['POST'],
|
|
||||||
'payremcard' => ['POST'],
|
|
||||||
'mynotifications' => ['POST'],
|
|
||||||
'familysampletasks' => ['POST'],
|
|
||||||
'familysuggesttasks' => ['POST'],
|
|
||||||
'familysuggestlist' => ['POST'],
|
|
||||||
'familywaitingtasks' => ['POST'],
|
|
||||||
];
|
|
||||||
return $endpoints;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private function prepareEndPointData($endpoint, $in, &$call_backend=true,&$local_out=[]){
|
private function prepareEndPointData($endpoint, $in, &$call_backend=true,&$local_out=[]){
|
||||||
switch ($endpoint) {
|
switch ($endpoint) {
|
||||||
case 'mynotifications':
|
case 'mynotifications':
|
||||||
@@ -595,7 +489,6 @@ class WrenchApi extends BaseController
|
|||||||
return json_encode( ( new \App\Models\ResultFormatter() )->processOutJson($in, $out));
|
return json_encode( ( new \App\Models\ResultFormatter() )->processOutJson($in, $out));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function doCacheStep($in, $out){
|
private function doCacheStep($in, $out){
|
||||||
|
|
||||||
switch ($in["action"]) {
|
switch ($in["action"]) {
|
||||||
@@ -671,11 +564,6 @@ class WrenchApi extends BaseController
|
|||||||
|
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
private function getSiteConfigurations($config_item){
|
|
||||||
$wrenchboard = new \App\Models\BackendModel();
|
|
||||||
return $wrenchboard->cfgReadChar($config_item);
|
|
||||||
}
|
|
||||||
|
|
||||||
private function dummyData($raw_array)
|
private function dummyData($raw_array)
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Controllers;
|
||||||
|
use CodeIgniter\API\ResponseTrait;
|
||||||
|
|
||||||
|
class WrenchOauth extends BaseController
|
||||||
|
{
|
||||||
|
protected $db;
|
||||||
|
public $con_name = 'wrench_blog';
|
||||||
|
use ResponseTrait;
|
||||||
|
protected $request;
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->request = $request = \Config\Services::request();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function index()
|
||||||
|
{
|
||||||
|
$envID = getenv('ENV_ID');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function apigate(){
|
||||||
|
log_message('critical', "Oauth-Gate");
|
||||||
|
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user