From 9ec7f550460892dd7ca180e00b6c12463f8d7aee Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Thu, 18 Jul 2024 12:03:15 -0400 Subject: [PATCH] Job stats --- wrenchboard/src/include/wrenchboard_api.h | 2 ++ wrenchboard/src/shared_tool/jobs.cc | 17 ++++++++++++++++- www-api/app/Config/RoutesV1.php | 2 +- www-api/app/Controllers/WrenchJobs.php | 11 +++++++++++ www-api/public/svs/user/constants.php | 1 + 5 files changed, 31 insertions(+), 2 deletions(-) diff --git a/wrenchboard/src/include/wrenchboard_api.h b/wrenchboard/src/include/wrenchboard_api.h index 02e2e9c2..f9f795e5 100644 --- a/wrenchboard/src/include/wrenchboard_api.h +++ b/wrenchboard/src/include/wrenchboard_api.h @@ -333,6 +333,8 @@ enum { PARTNER_STRIPE }; #define WRENCHBOARD_JOB_JOBGROUPADD 13046 #define WRENCHBOARD_JOB_REPORT 13047 +#define WRENCHBOARD_JOB_STATS_INTEREST 13048 + #define WRENCHBOARD_JOBS_END 13999 //************************************************************** diff --git a/wrenchboard/src/shared_tool/jobs.cc b/wrenchboard/src/shared_tool/jobs.cc index 952b9fae..6137f8f0 100644 --- a/wrenchboard/src/shared_tool/jobs.cc +++ b/wrenchboard/src/shared_tool/jobs.cc @@ -33,7 +33,7 @@ long WrenchSendJobsOfferCreateAssign(CVars in, CVars &out); long WrenchJobsOfferInterestList(CVars in, CVars &out); long WrenchUserJobsInterestList(CVars in, CVars &out); long WrenchJobsGroupList(CVars in, CVars &out); - +long WrenchJobsInterestStats(CVars in, CVars &out); long jobs_calls(CVars in, CVars &out) { logfmt(logINFO, "jobs_calls()"); @@ -131,6 +131,10 @@ long jobs_calls(CVars in, CVars &out) { return WrenchJobsOfferInterest(in, out); break; + case WRENCHBOARD_JOB_STATS_INTEREST: + return WrenchJobsInterestStats(in, out); + break; + case WRENCHBOARD_JOB_PROC_INTEREST: return WrenchJobsProcessInterest(in, out); break; @@ -500,6 +504,17 @@ long WrenchUserJobsInterestList(CVars in, CVars &out) { } +long WrenchJobsInterestStats(CVars in, CVars &out) { + long ret = PHP_API_BAD_PARAM; + char vname[30]; + out = in; + + + ret = PHP_CREATED_OK; + + return ret; + } + long WrenchJobsOfferInterestList(CVars in, CVars &out) { long ret = PHP_API_BAD_PARAM; char vname[30]; diff --git a/www-api/app/Config/RoutesV1.php b/www-api/app/Config/RoutesV1.php index e2f43608..cc8d466a 100644 --- a/www-api/app/Config/RoutesV1.php +++ b/www-api/app/Config/RoutesV1.php @@ -141,7 +141,7 @@ $routes->post('/en/wrench/api/v1/sendmoney', 'WrenchWallet::sendMoney') $routes->post('/en/wrench/api/v1/sendinterest', 'WrenchApi::apigate'); $routes->post('/en/wrench/api/v1/waitinginterest', 'WrenchApi::apigate'); - +$routes->post('/en/wrench/api/v1/intereststats', 'WrenchJobs::interestStats'); $routes->post('/en/wrench/api/v1/sendmoneyfee', 'WrenchApi::apigate'); $routes->post('/en/wrench/api/v1/getpendingjobs', 'WrenchApi::apigate'); diff --git a/www-api/app/Controllers/WrenchJobs.php b/www-api/app/Controllers/WrenchJobs.php index f973c8ef..08758e5e 100644 --- a/www-api/app/Controllers/WrenchJobs.php +++ b/www-api/app/Controllers/WrenchJobs.php @@ -12,6 +12,17 @@ class WrenchJobs extends BaseController $this->request = $request = \Config\Services::request(); } + public function interestStats(){ + $raw_json = file_get_contents('php://input'); + $in = json_decode($raw_json, true); + $in["action"] = WRENCHBOARD_JOB_STATS_INTEREST; + $out=[]; + $ret = $this->wrenchboard->wrenchboard_api($in, $out); + $out['internal_return'] = $ret; + log_message('critical', "***** ***** WrenchJobs::interestStats Ret = ".$ret ); + return $this->respond( $this->summaryReturnData($in,$out), 200); + } + public function contractHx(){ $raw_json = file_get_contents('php://input'); $in = json_decode($raw_json, true); diff --git a/www-api/public/svs/user/constants.php b/www-api/public/svs/user/constants.php index 108b9516..3e032010 100755 --- a/www-api/public/svs/user/constants.php +++ b/www-api/public/svs/user/constants.php @@ -165,6 +165,7 @@ define('WRENCHBOARD_JOB_OFFER_CONCLUDE',13035); define('WRENCHBOARD_JOB_SEND_QUESTION',13036); define('WRENCHBOARD_JOB_MRKTINT_QUEST',13037); define('WRENCHBOARD_JOB_REPLY_QUESTION',13038); +const WRENCHBOARD_JOB_STATS_INTEREST = 13048; //define('WRENCHBOARD_JOB_REPLY_QUESTION',13038); define('WRENCHBOARD_JOB_EXTEND_EXPIRE' ,13041);