12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- <?php
- namespace app\api\validate\report;
- use app\api\validate\report\Report;
- use app\api\validate\report\SaveReport;
- use app\api\response\ZskkErrorResponse;
- class ReportValidate {
- public static function check($params) {
- # code...
- $validate = new Report;
- if (!$validate->check($params)) {
- $msg = $validate->getError();
- ZskkErrorResponse::throwParamsError(2001,$msg);
- }
- }
- public static function checkSave($params) {
- # code...
- $validate = new SaveReport;
- if (!$validate->check($params)) {
- $msg = $validate->getError();
- ZskkErrorResponse::throwParamsError(2001,$msg);
- }
- }
- public static function checkConfirm($params)
- {
- $validate = new ConfirmReport;
- if (!$validate->check($params)) {
- $msg = $validate->getError();
- ZskkErrorResponse::throwParamsError(2001,$msg);
- }
- }
- public static function stageConfirm($params)
- {
- $validate = new StageReport;
- if (!$validate->check($params)) {
- $msg = $validate->getError();
- ZskkErrorResponse::throwParamsError(2001,$msg);
- }
- }
- public static function checkPrint($params)
- {
- $validate = new PrintReport;
- if (!$validate->check($params)) {
- $msg = $validate->getError();
- ZskkErrorResponse::throwParamsError(2001,$msg);
- }
- }
- public static function checkVideo($params)
- {
- $validate = new SaveVideo();
- if (!$validate->check($params)) {
- $msg = $validate->getError();
- ZskkErrorResponse::throwParamsError(2001,$msg);
- }
- }
- }
|