-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add service for history identity link log
- Loading branch information
1 parent
f6027d9
commit 1d2d531
Showing
4 changed files
with
111 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |