Se agrega metodo DELETE para FILES MANAGER. Se agregan validaciones en PROJECT USERS. se agrega la clase USER.
This commit is contained in:
@@ -13,7 +13,7 @@ class FilesManager extends Api
|
||||
{
|
||||
/**
|
||||
* @param string $prjUid {@min 32} {@max 32}
|
||||
* @param string $path {@choice templates,folder,}
|
||||
* @param string $path
|
||||
*
|
||||
* @url GET /:prjUid/process-file-manager
|
||||
*/
|
||||
@@ -42,7 +42,7 @@ class FilesManager extends Api
|
||||
|
||||
/**
|
||||
* @param string $prjUid {@min 32} {@max 32}
|
||||
* @param string $path {@choice templates,folder,}
|
||||
* @param string $path
|
||||
*
|
||||
* @url GET /:prjUid/process-file-manager-download
|
||||
*/
|
||||
@@ -105,17 +105,18 @@ class FilesManager extends Api
|
||||
|
||||
/**
|
||||
* @param string $prjUid {@min 32} {@max 32}
|
||||
* @param ProcessFilesManagerStructure $request_data
|
||||
* @param string $path
|
||||
* @param ProcessFilesManagerStructure1 $request_data
|
||||
*
|
||||
* @url PUT /:prjUid/process-file-manager-upload
|
||||
* @url PUT /:prjUid/process-file-manager1
|
||||
*/
|
||||
public function doPutProcessFilesManagerUpload($prjUid, ProcessFilesManagerStructure $request_data)
|
||||
public function doPutProcessFilesManager($prjUid, ProcessFilesManagerStructure1 $request_data, $path)
|
||||
{
|
||||
try {
|
||||
$userUid = $this->getUserId();
|
||||
$request_data = (array)($request_data);
|
||||
$filesManager = new \BusinessModel\FilesManager();
|
||||
$arrayData = $filesManager->updateProcessFilesManager($prjUid, $userUid, $request_data);
|
||||
$arrayData = $filesManager->updateProcessFilesManager($prjUid, $userUid, $request_data, $path);
|
||||
//Response
|
||||
$response = $arrayData;
|
||||
} catch (\Exception $e) {
|
||||
@@ -126,14 +127,15 @@ class FilesManager extends Api
|
||||
}
|
||||
/**
|
||||
* @param string $prjUid {@min 32} {@max 32}
|
||||
* @param string $path
|
||||
*
|
||||
* @url DELETE /:prjUid/process-file-manager-delete
|
||||
* @url DELETE /:prjUid/process-file-manager
|
||||
*/
|
||||
public function doDeleteProcessFilesManager($prjUid)
|
||||
public function doDeleteProcessFilesManager($prjUid, $path)
|
||||
{
|
||||
try {
|
||||
$filesManager = new \BusinessModel\FilesManager();
|
||||
$arrayData = $filesManager->deleteProcessFilesManager($prjUid);
|
||||
$arrayData = $filesManager->deleteProcessFilesManager($prjUid, $path);
|
||||
//Response
|
||||
$response = $arrayData;
|
||||
} catch (\Exception $e) {
|
||||
@@ -156,6 +158,19 @@ class ProcessFilesManagerStructure
|
||||
*/
|
||||
public $path;
|
||||
|
||||
/**
|
||||
* @var string {@from body}
|
||||
*/
|
||||
public $content;
|
||||
}
|
||||
|
||||
class ProcessFilesManagerStructure1
|
||||
{
|
||||
/**
|
||||
* @var string {@from body}
|
||||
*/
|
||||
public $file_name;
|
||||
|
||||
/**
|
||||
* @var string {@from body}
|
||||
*/
|
||||
|
||||
@@ -12,15 +12,15 @@ use \Luracast\Restler\RestException;
|
||||
class ProjectUsers extends Api
|
||||
{
|
||||
/**
|
||||
* @param string $prjUid {@min 32} {@max 32}
|
||||
* @param string $prj_uid {@min 32} {@max 32}
|
||||
*
|
||||
* @url GET /:prjUid/users
|
||||
* @url GET /:prj_uid/users
|
||||
*/
|
||||
public function doGetProjectUsers($prjUid)
|
||||
public function doGetProjectUsers($prj_uid)
|
||||
{
|
||||
try {
|
||||
$users = new \BusinessModel\ProjectUser();
|
||||
$arrayData = $users->getProjectUsers($prjUid);
|
||||
$arrayData = $users->getProjectUsers($prj_uid);
|
||||
//Response
|
||||
$response = $arrayData;
|
||||
} catch (\Exception $e) {
|
||||
@@ -51,15 +51,15 @@ class ProjectUsers extends Api
|
||||
|
||||
/**
|
||||
* @param string $prjUid {@min 32} {@max 32}
|
||||
* @param string $usrUid {@min 32} {@max 32}
|
||||
* @param string $usr_uid {@min 32} {@max 32}
|
||||
*
|
||||
* @url GET /:prjUid/user/:usrUid/starting-tasks
|
||||
* @url GET /:prjUid/user/:usr_uid/starting-tasks
|
||||
*/
|
||||
public function doGetProjectStartingTaskUsers($prjUid, $usrUid)
|
||||
public function doGetProjectStartingTaskUsers($prjUid, $usr_uid)
|
||||
{
|
||||
try {
|
||||
$startingTasks = new \BusinessModel\ProjectUser();
|
||||
$arrayData = $startingTasks->getProjectStartingTaskUsers($prjUid, $usrUid);
|
||||
$arrayData = $startingTasks->getProjectStartingTaskUsers($prjUid, $usr_uid);
|
||||
//Response
|
||||
$response = $arrayData;
|
||||
} catch (\Exception $e) {
|
||||
|
||||
113
workflow/engine/src/Services/Api/ProcessMaker/User.php
Normal file
113
workflow/engine/src/Services/Api/ProcessMaker/User.php
Normal file
@@ -0,0 +1,113 @@
|
||||
<?php
|
||||
namespace Services\Api\ProcessMaker;
|
||||
|
||||
use \ProcessMaker\Services\Api;
|
||||
use \Luracast\Restler\RestException;
|
||||
|
||||
/**
|
||||
* User Api Controller
|
||||
*
|
||||
* @protected
|
||||
*/
|
||||
class User extends Api
|
||||
{
|
||||
/**
|
||||
* @url GET
|
||||
*/
|
||||
public function index($filter = '', $start = null, $limit = null)
|
||||
{
|
||||
try {
|
||||
$user = new \BusinessModel\User();
|
||||
$response = $user->getUsers($filter, null, null, $start, $limit);
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @url GET /:usr_uid
|
||||
*
|
||||
* @param string $usr_uid {@min 32}{@max 32}
|
||||
*/
|
||||
public function doGet($usr_uid)
|
||||
{
|
||||
try {
|
||||
$user = new \BusinessModel\User();
|
||||
$response = $user->getUser($usr_uid);
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @url POST
|
||||
*
|
||||
* @param array $request_data
|
||||
* @param string $grp_title {@from body}{@required true}
|
||||
* @param string $grp_status {@from body}{@choice ACTIVE,INACTIVE}{@required true}
|
||||
*
|
||||
* @status 201
|
||||
*/
|
||||
public function doPost(
|
||||
$request_data,
|
||||
$grp_title = "",
|
||||
$grp_status = "ACTIVE"
|
||||
) {
|
||||
try {
|
||||
$group = new \BusinessModel\Group();
|
||||
$group->setFormatFieldNameInUppercase(false);
|
||||
|
||||
$arrayData = $group->create($request_data);
|
||||
|
||||
$response = $arrayData;
|
||||
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @url PUT /:grp_uid
|
||||
*
|
||||
* @param string $grp_uid {@min 32}{@max 32}
|
||||
* @param array $request_data
|
||||
* @param string $grp_title {@from body}
|
||||
* @param string $grp_status {@from body}{@choice ACTIVE,INACTIVE}
|
||||
*/
|
||||
public function doPut(
|
||||
$grp_uid,
|
||||
$request_data,
|
||||
$grp_title = "",
|
||||
$grp_status = "ACTIVE"
|
||||
) {
|
||||
try {
|
||||
$group = new \BusinessModel\Group();
|
||||
$group->setFormatFieldNameInUppercase(false);
|
||||
|
||||
$arrayData = $group->update($grp_uid, $request_data);
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @url DELETE /:grp_uid
|
||||
*
|
||||
* @param string $grp_uid {@min 32}{@max 32}
|
||||
*/
|
||||
public function doDelete($grp_uid)
|
||||
{
|
||||
try {
|
||||
$group = new \BusinessModel\Group();
|
||||
$group->setFormatFieldNameInUppercase(false);
|
||||
|
||||
$group->delete($grp_uid);
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,3 +42,8 @@ debug = 1
|
||||
[alias: groups]
|
||||
group = "Services\Api\ProcessMaker\Group"
|
||||
|
||||
[alias: user]
|
||||
user = "Services\Api\ProcessMaker\User"
|
||||
|
||||
[alias: users]
|
||||
user = "Services\Api\ProcessMaker\User"
|
||||
|
||||
Reference in New Issue
Block a user