DMS Format 1711944865 1712040264
DMS Format 1711944865 1712040264
DMS Format 1711944865 1712040264
let dataParam = {
"folderId": fldrId,
};
Create a object for service calling
this.commonserveice.getFoldersSingle(dataParam).subscribe({
next: (response) => {
If the request token and generated token matched then will allow to enter the api.
public function getUserDetail()
{
$allData = json_decode(file_get_contents('php://input'));
if (hashRequestMatch($allData)) {
$request = json_decode(base64_decode($allData->REQUEST_DATA));
//decrypt data with base64
$requestc = (array)$request;
try {
$validate = Validator::make($requestc, [
'userId' => 'required|numeric|min:1',
]);
if ($validate->fails()) {
$respArr = array(
'status' => 400,
'message' => $validate->errors(),
'result' => ''
);
} else {
$userId = $request->userId;
DB::beginTransaction();
$userData = DB::table('dms_user_master as
a')->select('a.userId', 'a.userFullName', 'a.userMailId', 'a.roleId',
'a.desgId', 'a.deletedFlag', 'b.roleId as rid', 'b.roleName', 'c.desgId as
sid', 'c.desgName')->join('dms_role_master as b', 'a.roleId', '=',
'b.roleId')->join('dms_desg_master as c', 'c.desgId', '=',
'a.desgId')->where('a.userId', $userId)->where('a.deletedFlag',
'0')->get()->toArray();
if (!empty($userData)) {
$res = array(
'userId' => $userData[0]->userId,
'userFullName' => $userData[0]->userFullName,
'userMailId' => $userData[0]->userMailId,
'roleId' => $userData[0]->roleId,
'desgId' => $userData[0]->desgId,
'deletedFlag' => $userData[0]->deletedFlag,
'rid' => $userData[0]->rid,
'roleName' => $userData[0]->roleName,
'sid' => $userData[0]->sid,
'desgName' => $userData[0]->desgName
);
$respArr = array(
'status' => 200,
'message' => 'Data Found Successfully',
'result' => $res
);
} else {
$respArr = array(
'status' => 400,
'message' => 'No User Found',
'result' => ''
);
}
DB::commit();
}
} catch (\Exception $e) {
DB::rollBack();
$respArr = array(
'status' => 500,
'message' => $e->getMessage(),
'result' => ''
);
}
} else {
$rtnSts = 500;
$respArr = array("status" => $rtnSts, "message" => ' ',
"result" => ' ');
}
return $respArr;
}
$base64EncodedArr = base64_encode(json_encode($respArr));
$hasedData = hash_hmac('sha256', $base64EncodedArr,
‘22CSMTOOL2022’);
$responseData = array('RESPONSE_DATA' => $base64EncodedArr,
'RESPONSE_TOKEN' => $hasedData);
echo json_encode($responseData);
}