Util.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. <?php
  2. /**
  3. *
  4. * SDK配置类
  5. *
  6. */
  7. require_once(dirname(__FILE__) . '/sdk/param/' . 'ParamSwitcher.php');
  8. require_once(dirname(__FILE__) . '/sdk/http/' . 'HttpHeader.php');
  9. require_once(dirname(__FILE__) . '/sdk/http/' . 'HttpConnection.php');
  10. require_once(dirname(__FILE__) . '/sdk/http/' . 'HttpParameter.php');
  11. require_once(dirname(__FILE__) . '/sdk/http/' . 'HttpMethod.php');
  12. require_once(dirname(__FILE__) . '/sdk/http/' . 'HttpClient.php');
  13. require_once(dirname(__FILE__) . '/sdk/utils/' . 'CryptUtils.php');
  14. require_once(dirname(__FILE__) . '/sdk/' . 'SDKClient.php');
  15. require_once(dirname(__FILE__) . '/sdk/request/' . 'SdkRequest.php');
  16. require_once(dirname(__FILE__) . '/sdk/' . 'SaaSSdkClient.php');
  17. require_once(dirname(__FILE__) . '/sdk/bean/' . "Action.php");
  18. require_once(dirname(__FILE__) . '/sdk/bean/' . "Attachment.php");
  19. require_once(dirname(__FILE__) . '/sdk/bean/' . "Audit.php");
  20. require_once(dirname(__FILE__) . '/sdk/bean/' . "Category.php");
  21. require_once(dirname(__FILE__) . '/sdk/bean/' . "Company.php");
  22. require_once(dirname(__FILE__) . '/sdk/bean/' . "Contract.php");
  23. require_once(dirname(__FILE__) . '/sdk/bean/' . "CopySendReceiver.php");
  24. require_once(dirname(__FILE__) . '/sdk/bean/' . "Document.php");
  25. require_once(dirname(__FILE__) . '/sdk/bean/' . "Employee.php");
  26. require_once(dirname(__FILE__) . '/sdk/bean/' . "Seal.php");
  27. require_once(dirname(__FILE__) . '/sdk/bean/' . "Signatory.php");
  28. require_once(dirname(__FILE__) . '/sdk/bean/' . "Stamper.php");
  29. require_once(dirname(__FILE__) . '/sdk/bean/' . "Template.php");
  30. require_once(dirname(__FILE__) . '/sdk/bean/' . "TemplateParam.php");
  31. require_once(dirname(__FILE__) . '/sdk/bean/' . "User.php");
  32. require_once(dirname(__FILE__) . '/sdk/bean/' . "UserAuth.php");
  33. require_once(dirname(__FILE__) . '/sdk/bean/' . "SealImageInfo.php");
  34. require_once(dirname(__FILE__) . '/sdk/bean/' . "UserAuthInfo.php");
  35. require_once(dirname(__FILE__) . '/sdk/bean/' . "Watermark.php");
  36. require_once(dirname(__FILE__) . '/sdk/bean/' . "ContractCustomField.php");
  37. require_once(dirname(__FILE__) . '/sdk/request/' . "AttachmentDownloadRequest.php");
  38. require_once(dirname(__FILE__) . '/sdk/request/' . "CategoryDetailRequest.php");
  39. require_once(dirname(__FILE__) . '/sdk/request/' . "CategoryListRequest.php");
  40. require_once(dirname(__FILE__) . '/sdk/request/' . "CompanyAuthH5PageRequest.php");
  41. require_once(dirname(__FILE__) . '/sdk/request/' . "CompanyAuthLicenseH5PageRequest.php");
  42. require_once(dirname(__FILE__) . '/sdk/request/' . "CompanyAuthLicensePCPageRequest.php");
  43. require_once(dirname(__FILE__) . '/sdk/request/' . "CompanyAuthPCPageRequest.php");
  44. require_once(dirname(__FILE__) . '/sdk/request/' . "CompanyAuthResultRequest.php");
  45. require_once(dirname(__FILE__) . '/sdk/request/' . "CompanyDetailRequest.php");
  46. require_once(dirname(__FILE__) . '/sdk/request/' . "CompanyLicenseDownloadRequest.php");
  47. require_once(dirname(__FILE__) . '/sdk/request/' . "ContractAuditRequest.php");
  48. require_once(dirname(__FILE__) . '/sdk/request/' . "ContractCompanySignRequest.php");
  49. require_once(dirname(__FILE__) . '/sdk/request/' . "ContractSignUserRequest.php");
  50. require_once(dirname(__FILE__) . '/sdk/request/' . "ContractCopySendRequest.php");
  51. require_once(dirname(__FILE__) . '/sdk/request/' . "ContractDetailRequest.php");
  52. require_once(dirname(__FILE__) . '/sdk/request/' . "ContractDownloadRequest.php");
  53. require_once(dirname(__FILE__) . '/sdk/request/' . "ContractDraftRequest.php");
  54. require_once(dirname(__FILE__) . '/sdk/request/' . "ContractInvalidRequest.php");
  55. require_once(dirname(__FILE__) . '/sdk/request/' . "ContractListRequest.php");
  56. require_once(dirname(__FILE__) . '/sdk/request/' . "ContractLpSignRequest.php");
  57. require_once(dirname(__FILE__) . '/sdk/request/' . "ContractNoticeRequest.php");
  58. require_once(dirname(__FILE__) . '/sdk/request/' . "ContractPageRequest.php");
  59. require_once(dirname(__FILE__) . '/sdk/request/' . "ContractSendRequest.php");
  60. require_once(dirname(__FILE__) . '/sdk/request/' . "ContractShorturlRequest.php");
  61. require_once(dirname(__FILE__) . '/sdk/request/' . "ContractSignInvalidRequest.php");
  62. require_once(dirname(__FILE__) . '/sdk/request/' . "ContractViewPageRequest.php");
  63. require_once(dirname(__FILE__) . '/sdk/request/' . "DocumentAddByFileRequest.php");
  64. require_once(dirname(__FILE__) . '/sdk/request/' . "DocumentAddByMultipleFileRequest.php");
  65. require_once(dirname(__FILE__) . '/sdk/request/' . "DocumentAddByTemplateRequest.php");
  66. require_once(dirname(__FILE__) . '/sdk/request/' . "DocumentDownloadRequest.php");
  67. require_once(dirname(__FILE__) . '/sdk/request/' . "EmployeeCreateRequest.php");
  68. require_once(dirname(__FILE__) . '/sdk/request/' . "EmployeeListRequest.php");
  69. require_once(dirname(__FILE__) . '/sdk/request/' . "EmployeeRemoveRequest.php");
  70. require_once(dirname(__FILE__) . '/sdk/request/' . "EmployeeUpdateRequest.php");
  71. require_once(dirname(__FILE__) . '/sdk/request/' . "PlatformInfoRequest.php");
  72. require_once(dirname(__FILE__) . '/sdk/request/' . "SealImageRequest.php");
  73. require_once(dirname(__FILE__) . '/sdk/request/' . "SealListRequest.php");
  74. require_once(dirname(__FILE__) . '/sdk/request/' . "SignatoryAddRequest.php");
  75. require_once(dirname(__FILE__) . '/sdk/request/' . "SignatoryEditRequest.php");
  76. require_once(dirname(__FILE__) . '/sdk/request/' . "SignatoryIdentityRequest.php");
  77. require_once(dirname(__FILE__) . '/sdk/request/' . "SignatoryInfoRequest.php");
  78. require_once(dirname(__FILE__) . '/sdk/request/' . "SubCompanyListRequest.php");
  79. require_once(dirname(__FILE__) . '/sdk/request/' . "TemplateDetailRequest.php");
  80. require_once(dirname(__FILE__) . '/sdk/request/' . "TemplateListRequest.php");
  81. require_once(dirname(__FILE__) . '/sdk/request/' . "TemplatePageRequest.php");
  82. require_once(dirname(__FILE__) . '/sdk/request/' . "UserAuthPageRequest.php");
  83. require_once(dirname(__FILE__) . '/sdk/request/' . "UserAuthResultRequest.php");
  84. require_once(dirname(__FILE__) . '/sdk/request/' . "VerifierRequest.php");
  85. require_once(dirname(__FILE__) . '/sdk/request/' . "SealAutoCreateRequest.php");
  86. require_once(dirname(__FILE__) . '/sdk/request/' . "InvalidByFileRequest.php");
  87. require_once(dirname(__FILE__) . '/sdk/request/' . "InvalidByTemplateRequest.php");
  88. require_once(dirname(__FILE__) . '/sdk/request/' . "SealDetailRequest.php");
  89. require_once(dirname(__FILE__) . '/sdk/request/' . "EmployeeSealImageRequest.php");
  90. require_once(dirname(__FILE__) . '/sdk/request/' . "ContractAppointPageRequest.php");
  91. require_once(dirname(__FILE__) . '/sdk/request/' . "EmployeeDetailRequest.php");
  92. require_once(dirname(__FILE__) . '/sdk/request/' . "CompanyAuthMiniappTicketRequest.php");
  93. require_once(dirname(__FILE__) . '/sdk/request/' . "UserAuthMiniappTicketRequest.php");
  94. require_once(dirname(__FILE__) . '/sdk/request/' . "ContractMiniappTicketRequest.php");
  95. require_once(dirname(__FILE__) . '/sdk/request/' . "CustomerAddRequest.php");
  96. require_once(dirname(__FILE__) . '/sdk/request/' . "AddEndSignAttachmentRequest.php");
  97. require_once(dirname(__FILE__) . '/sdk/request/' . "ContractForceEndRequest.php");
  98. require_once(dirname(__FILE__) . '/sdk/request/' . "ContractAddWatermarkRequest.php");
  99. require_once(dirname(__FILE__) . '/sdk/request/' . "RoleManagementRequest.php");
  100. require_once(dirname(__FILE__) . '/sdk/request/' . "SealCreatebyImageRequest.php");
  101. require_once(dirname(__FILE__) . '/sdk/request/' . "SealEditRequest.php");
  102. require_once(dirname(__FILE__) . '/sdk/request/' . "SealRemoveRequest.php");
  103. require_once(dirname(__FILE__) . '/sdk/request/' . "SealStatusManageRequest.php");
  104. require_once(dirname(__FILE__) . '/sdk/request/' . "TemplateCreateByWordRequest.php");
  105. require_once(dirname(__FILE__) . '/sdk/request/' . "TemplateEditRequest.php");
  106. require_once(dirname(__FILE__) . '/sdk/request/' . "TemplateDownloadRequest.php");
  107. require_once(dirname(__FILE__) . '/sdk/request/' . "TemplateRemoveRequest.php");
  108. require_once(dirname(__FILE__) . '/sdk/request/' . "TemplateStatusManageRequest.php");
  109. require_once(dirname(__FILE__) . '/sdk/request/' . "CompanyAuthLicenseMiniappTicketRequest.php");
  110. require_once(dirname(__FILE__) . '/sdk/request/' . "SubCompanyInviteRequest.php");
  111. require_once(dirname(__FILE__) . '/sdk/request/' . "SubCompanyRemoveRequest.php");
  112. require_once(dirname(__FILE__) . '/sdk/request/' . "SaaSAppAccessControlRequest.php");
  113. require_once(dirname(__FILE__) . '/sdk/request/' . "SaasApplyAppRequest.php");
  114. require_once(dirname(__FILE__) . '/sdk/request/' . "SaaSBindingRequest.php");
  115. require_once(dirname(__FILE__) . '/sdk/request/' . "SaaSCompanyAccessControlRequest.php");
  116. require_once(dirname(__FILE__) . '/sdk/request/' . "SaasCompanyAuthPageUrlRequest.php");
  117. require_once(dirname(__FILE__) . '/sdk/request/' . "SaaSCompanyAuthUrlRequest.php");
  118. require_once(dirname(__FILE__) . '/sdk/request/' . "SaaSCompanyDetailRequest.php");
  119. require_once(dirname(__FILE__) . '/sdk/request/' . "SaaSPersonalAccessControlRequest.php");
  120. require_once(dirname(__FILE__) . '/sdk/request/' . "SaasPrivilegeUrlRequest.php");
  121. require_once(dirname(__FILE__) . '/sdk/request/' . "SaasPrivilegeDetailRequest.php");
  122. require_once(dirname(__FILE__) . '/sdk/request/' . "SaaSResetTokenRequest.php");
  123. require_once(dirname(__FILE__) . '/sdk/request/' . "SaasCompanyAuthResultRequest.php");
  124. require_once(dirname(__FILE__) . '/sdk/request/' . "SaaSCompanyAuthMiniappTicketRequest.php");
  125. require_once(dirname(__FILE__) . '/sdk/request/' . "OpenSSOPrivilegeUrlRequest.php");
  126. class Util {
  127. const url = "https://openapi.qiyuesuo.cn";
  128. const accessKey = "dxp6Uttttz";
  129. const accessSecret = "UmpDowMmKmvOe3aYBzhhiDyKG0gOd9";
  130. public static function getSDk() {
  131. $url = self::url;
  132. $accessKey = self::accessKey;
  133. $accessSecret = self::accessSecret;
  134. $SDk = new SDKClient($accessKey, $accessSecret, $url);
  135. return $SDk;
  136. }
  137. }
  138. class SaasUtil {
  139. const serverUrl = "https://openapi.qiyuesuo.cn";
  140. const accessKey = "替换为真实accessKey";
  141. const accessSecret = "替换为真实accessSecret";
  142. const agentToken = "替换为真实agentToken";
  143. const agentSecret = "替换为真实agentSecret";
  144. public static function getSaasSDk() {
  145. $agentToken = self::agentToken;
  146. $agentSecret = self::agentSecret;
  147. $accessKey = self::accessKey;
  148. $accessSecret = self::accessSecret;
  149. $serverUrl = self::serverUrl;
  150. $saasSdk = new SaaSSdkClient($agentToken, $agentSecret, $accessKey, $accessSecret, $serverUrl);
  151. return $saasSdk;
  152. }
  153. public static function getSaasOnlyClient() {
  154. $agentToken = self::agentToken;
  155. $agentSecret = self::agentSecret;
  156. $serverUrl = self::serverUrl;
  157. $onlyClient = new SaaSSdkClient($agentToken, $agentSecret, $serverUrl);
  158. return $onlyClient;
  159. }
  160. }