-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
198 additions
and
0 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
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,63 @@ | ||
<?php | ||
/** | ||
* Create by PhpStorm | ||
* User: dovechen | ||
* Date: 2020/5/28 | ||
* Time: 10:07 | ||
*/ | ||
|
||
namespace dovechen\yii2\weWork\src\dataStructure; | ||
|
||
use dovechen\yii2\weWork\components\Utils; | ||
|
||
/** | ||
* Class CheckSingleAgree | ||
* | ||
* @property string userid 内部成员的userid | ||
* @property string exteranalopenid 外部成员的externalopenid | ||
* | ||
* @package dovechen\yii2\weWork\src\dataStructure | ||
*/ | ||
class CheckSingleAgree | ||
{ | ||
/** | ||
* @param $arr | ||
* | ||
* @return CheckSingleAgree | ||
*/ | ||
public static function parseFromArray ($arr) | ||
{ | ||
$checkSingleAgree = new self(); | ||
|
||
$checkSingleAgree->userid = Utils::arrayGet($arr, 'userid'); | ||
$checkSingleAgree->exteranalopenid = Utils::arrayGet($arr, 'exteranalopenid'); | ||
|
||
return $checkSingleAgree; | ||
} | ||
|
||
/** | ||
* @param CheckSingleAgree $checkSingleAgree | ||
* | ||
* @return array | ||
*/ | ||
public static function ToArray ($checkSingleAgree) | ||
{ | ||
$args = []; | ||
|
||
Utils::setIfNotNull($checkSingleAgree->userid, 'userid', $args); | ||
Utils::setIfNotNull($checkSingleAgree->exteranalopenid, 'exteranalopenid', $args); | ||
|
||
return $args; | ||
} | ||
|
||
/** | ||
* @param CheckSingleAgree $checkSingleAgree | ||
* | ||
* @throws \ParameterError | ||
*/ | ||
public static function CheckArgs ($checkSingleAgree) | ||
{ | ||
Utils::checkNotEmptyStr($checkSingleAgree->userid, 'userid'); | ||
Utils::checkNotEmptyStr($checkSingleAgree->exteranalopenid, 'exteranalopenid'); | ||
} | ||
} |
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,103 @@ | ||
<?php | ||
/** | ||
* Create by PhpStorm | ||
* User: dovechen | ||
* Date: 2020/5/28 | ||
* Time: 09:52 | ||
*/ | ||
|
||
namespace dovechen\yii2\weWork\src\dataStructure; | ||
|
||
use dovechen\yii2\weWork\components\Utils; | ||
use SebastianBergmann\CodeCoverage\Util; | ||
|
||
/** | ||
* Class MsgAudit | ||
* | ||
* @property array info 待查询的会话信息,数组 | ||
* @property string roomid 待查询的roomid | ||
* | ||
* @package dovechen\yii2\weWork\src\dataStructure | ||
*/ | ||
class MsgAuditCheckAgree | ||
{ | ||
/** | ||
* @param $arr | ||
* | ||
* @return MsgAuditCheckAgree | ||
*/ | ||
public static function parseFromArray ($arr) | ||
{ | ||
$msgAuditCheckAgree = new self(); | ||
|
||
$checkSingle = Utils::arrayGet($arr, 'info'); | ||
if (!is_null($checkSingle)) { | ||
$msgAuditCheckAgree->info = []; | ||
foreach ($checkSingle as $singleInfo) { | ||
array_push($msgAuditCheckAgree->info, CheckSingleAgree::parseFromArray($singleInfo)); | ||
} | ||
} | ||
|
||
$checkRoom = Utils::arrayGet($arr, 'roomid'); | ||
if (!is_null($checkRoom)) { | ||
$msgAuditCheckAgree->roomid = $checkRoom; | ||
} | ||
|
||
return $msgAuditCheckAgree; | ||
} | ||
|
||
/** | ||
* @param MsgAuditCheckAgree $msgAuditCheckAgree | ||
* | ||
* @return array | ||
*/ | ||
public static function SetSingleAgreeArgs ($msgAuditCheckAgree) | ||
{ | ||
$args = [ | ||
'info' => [] | ||
]; | ||
|
||
foreach ($msgAuditCheckAgree->info as $item) { | ||
array_push($args['info'], CheckSingleAgree::ToArray($item)); | ||
} | ||
|
||
return $args; | ||
} | ||
|
||
/** | ||
* @param MsgAuditCheckAgree $msgAuditCheckAgree | ||
* | ||
* @throws \ParameterError | ||
*/ | ||
public static function CheckSingleAgreeArgs ($msgAuditCheckAgree) | ||
{ | ||
Utils::checkNotEmptyArray($msgAuditCheckAgree->info, 'info'); | ||
foreach ($msgAuditCheckAgree->info as $info) { | ||
CheckSingleAgree::CheckArgs($info); | ||
} | ||
} | ||
|
||
/** | ||
* @param MsgAuditCheckAgree $msgAuditCheckAgree | ||
* | ||
* @return array | ||
*/ | ||
public static function SetRoomAgreeArgs ($msgAuditCheckAgree) | ||
{ | ||
$args = []; | ||
|
||
Utils::setIfNotNull($msgAuditCheckAgree->roomid, 'roomid', $args); | ||
|
||
return $args; | ||
} | ||
|
||
/** | ||
* @param MsgAuditCheckAgree $msgAuditCheckAgree | ||
* | ||
* @throws \ParameterError | ||
*/ | ||
public static function CheckRoomAgreeArgs ($msgAuditCheckAgree) | ||
{ | ||
Utils::checkNotEmptyStr($msgAuditCheckAgree->roomid, 'roomid'); | ||
} | ||
} |