Skip to content

Commit

Permalink
history identity link log service
Browse files Browse the repository at this point in the history
add service for history identity link log
  • Loading branch information
HunterXuan committed Dec 16, 2017
1 parent f6027d9 commit 1d2d531
Show file tree
Hide file tree
Showing 4 changed files with 111 additions and 2 deletions.
32 changes: 32 additions & 0 deletions src/Entity/Request/History/IdentityLinkRequest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php
/**
* Your file description
*
* @version 0.1.0
* @author xuansw
* @date 2017/12/16
* @since 2017/12/16 description
*/

namespace Camunda\Entity\Request\History;

use Camunda\Entity\Request\BasicRequest;

class IdentityLinkRequest extends BasicRequest
{
protected $fields = [
'type',
'userId',
'groupId',
'dateBefore',
'dateAfter',
'taskId',
'processDefinitionId',
'processDefinitionKey',
'operationType',
'assignerId',
'tenantIdIn',
'sortBy',
'sortOrder'
];
}
39 changes: 39 additions & 0 deletions src/Service/History/IdentityLinkService.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php
/**
* Your file description
*
* @version 0.1.0
* @author xuansw
* @date 2017/12/16
* @since 2017/12/16 description
*/

namespace Camunda\Service\History;

use Camunda\Service\BasicService;
use Camunda\Entity\Request\History\IdentityLinkRequest;

class IdentityLinkService extends BasicService
{
public function getList(IdentityLinkRequest $identityRequest = null)
{
$this->setRequestUrl('/history/identity-link-log')
->setRequestMethod('GET')
->setRequestContentType('QUERY')
->setRequestObject($identityRequest)
->run();

return $this->getResponseContents();
}

public function getListCount(IdentityLinkRequest $identityRequest = null)
{
$this->setRequestUrl('/history/identity-link-log/count')
->setRequestMethod('GET')
->setRequestContentType('QUERY')
->setRequestObject($identityRequest)
->run();

return $this->getResponseContents();
}
}
4 changes: 2 additions & 2 deletions tests/Service/DeploymentServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ public function testCreate()
$files = new FileCollection();

$files->addFile('power35', file_get_contents('./testProcess.bpmn'), 'testProcess.bpmn');
$files->addFile('start', file_get_contents("./startForm.form"), 'startForm.form');
//$files->addFile('start', file_get_contents("./startForm.form"), 'startForm.form');

$deploymentRequest = new DeploymentRequest();
$deploymentRequest->set('deployment-name', '测试')
->set('files', $files);
//var_dump($deploymentService->create($deploymentRequest));
var_dump($deploymentService->create($deploymentRequest));
}

public function testDelete()
Expand Down
38 changes: 38 additions & 0 deletions tests/Service/History/IdentityLinkServiceTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php
/**
* Created by PhpStorm.
* User: xuansw
* Date: 2017/12/16
* Time: 13:52
*/

namespace Camunda\Service\History;

use Camunda\Entity\Request\History\IdentityLinkRequest;

class IdentityLinkServiceTest extends \PHPUnit_Framework_TestCase
{
const CAMUNDA_REST_HOST = 'http://localhost:8080/engine-rest';

public function testGetList()
{
$identityLinkRequest = new IdentityLinkRequest();
$identityLinkService = new IdentityLinkService(self::CAMUNDA_REST_HOST);
$identityLinkRequest->set('type', 'assignee')
->set('taskId', 'ff3e4da2-e191-11e7-a72e-005056c00008');

$result = $identityLinkService->getList($identityLinkRequest);
var_dump($result);
}

public function testGetListCount()
{
$identityLinkRequest = new IdentityLinkRequest();
$identityLinkService = new IdentityLinkService(self::CAMUNDA_REST_HOST);
$identityLinkRequest->set('type', 'assignee')
->set('taskId', 'ff3e4da2-e191-11e7-a72e-005056c00008');

$result = $identityLinkService->getListCount($identityLinkRequest);
var_dump($result);
}
}

0 comments on commit 1d2d531

Please sign in to comment.