lh hai 1 semana
achega
6bad7c8cca
Modificáronse 100 ficheiros con 13820 adicións e 0 borrados
  1. 18 0
      .editorconfig
  2. 52 0
      .env.example
  3. 10 0
      .gitattributes
  4. 16 0
      .gitignore
  5. 14 0
      .styleci.yml
  6. 8 0
      README.md
  7. 56 0
      app/Cache/CacheKeys.php
  8. 94 0
      app/Cache/FinanceCache.php
  9. 235 0
      app/Cache/StatisticCache.php
  10. 271 0
      app/Cache/UserCache.php
  11. 55 0
      app/Client/Site.php
  12. 39 0
      app/Console/Kernel.php
  13. 75 0
      app/Console/Test/RegisterUserCommand.php
  14. 111 0
      app/Console/Test/TestCommand.php
  15. 80 0
      app/Console/TikTok/AccessTokenManage.php
  16. 79 0
      app/Console/TikTok/ClientTokenManage.php
  17. 84 0
      app/Consts/BaseConst.php
  18. 84 0
      app/Consts/ErrorConst.php
  19. 8 0
      app/Consts/SysConst.php
  20. 19 0
      app/Exceptions/ApiException.php
  21. 96 0
      app/Exceptions/Handler.php
  22. 24 0
      app/Facade/Site.php
  23. 63 0
      app/Http/Controllers/Account/AccountController.php
  24. 38 0
      app/Http/Controllers/Book/BookController.php
  25. 13 0
      app/Http/Controllers/Controller.php
  26. 38 0
      app/Http/Controllers/DeepSeek/DeepSeekController.php
  27. 38 0
      app/Http/Controllers/Webhook/WebhookController.php
  28. 73 0
      app/Http/Kernel.php
  29. 21 0
      app/Http/Middleware/Authenticate.php
  30. 29 0
      app/Http/Middleware/BindExportToken.php
  31. 28 0
      app/Http/Middleware/BindToken.php
  32. 92 0
      app/Http/Middleware/CheckBook.php
  33. 28 0
      app/Http/Middleware/CheckLogin.php
  34. 71 0
      app/Http/Middleware/CheckSign.php
  35. 30 0
      app/Http/Middleware/CheckTokenTrait.php
  36. 17 0
      app/Http/Middleware/EncryptCookies.php
  37. 62 0
      app/Http/Middleware/ExternalSignCheck.php
  38. 17 0
      app/Http/Middleware/PreventRequestsDuringMaintenance.php
  39. 32 0
      app/Http/Middleware/RedirectIfAuthenticated.php
  40. 19 0
      app/Http/Middleware/TrimStrings.php
  41. 20 0
      app/Http/Middleware/TrustHosts.php
  42. 28 0
      app/Http/Middleware/TrustProxies.php
  43. 17 0
      app/Http/Middleware/VerifyCsrfToken.php
  44. 41 0
      app/Libs/AliOSS.php
  45. 86 0
      app/Libs/AliSMS.php
  46. 185 0
      app/Libs/ApiResponse.php
  47. 60 0
      app/Libs/BatchUpdateTrait.php
  48. 1707 0
      app/Libs/Helpers.php
  49. 195 0
      app/Libs/OSS.php
  50. 183 0
      app/Libs/Pays/AliPaySdk/aop/AlipayConfig.php
  51. 188 0
      app/Libs/Pays/AliPaySdk/aop/AlipayMobilePublicMultiMediaClient.php
  52. 115 0
      app/Libs/Pays/AliPaySdk/aop/AlipayMobilePublicMultiMediaExecute.php
  53. 1303 0
      app/Libs/Pays/AliPaySdk/aop/AopCertClient.php
  54. 527 0
      app/Libs/Pays/AliPaySdk/aop/AopCertification.php
  55. 1334 0
      app/Libs/Pays/AliPaySdk/aop/AopClient.php
  56. 78 0
      app/Libs/Pays/AliPaySdk/aop/AopEncrypt.php
  57. 18 0
      app/Libs/Pays/AliPaySdk/aop/EncryptParseItem.php
  58. 16 0
      app/Libs/Pays/AliPaySdk/aop/EncryptResponseData.php
  59. 77 0
      app/Libs/Pays/AliPaySdk/aop/NewAopEncrypt.php
  60. 15 0
      app/Libs/Pays/AliPaySdk/aop/SignData.php
  61. 118 0
      app/Libs/Pays/AliPaySdk/aop/request/AftAifinFireeyeOcrImageQueryRequest.php
  62. 103 0
      app/Libs/Pays/AliPaySdk/aop/request/AftAifinNewtestQueryRequest.php
  63. 118 0
      app/Libs/Pays/AliPaySdk/aop/request/AftFinsecureRiskplusSecurityPolicyQueryRequest.php
  64. 118 0
      app/Libs/Pays/AliPaySdk/aop/request/AliosOpenAutoInfoQueryRequest.php
  65. 118 0
      app/Libs/Pays/AliPaySdk/aop/request/AlipayAccountCashpoolAccountBindRequest.php
  66. 118 0
      app/Libs/Pays/AliPaySdk/aop/request/AlipayAccountCashpoolAllocateruleCreateRequest.php
  67. 118 0
      app/Libs/Pays/AliPaySdk/aop/request/AlipayAccountCashpoolAllocaterulePayRequest.php
  68. 118 0
      app/Libs/Pays/AliPaySdk/aop/request/AlipayAccountCashpoolBasicQueryRequest.php
  69. 118 0
      app/Libs/Pays/AliPaySdk/aop/request/AlipayAccountCashpoolCreateRequest.php
  70. 118 0
      app/Libs/Pays/AliPaySdk/aop/request/AlipayAccountCashpoolDeleteRequest.php
  71. 118 0
      app/Libs/Pays/AliPaySdk/aop/request/AlipayAccountCashpoolDetailQueryRequest.php
  72. 118 0
      app/Libs/Pays/AliPaySdk/aop/request/AlipayAccountCashpoolRuleModifyRequest.php
  73. 118 0
      app/Libs/Pays/AliPaySdk/aop/request/AlipayAccountCashpoolRulegroupCreateRequest.php
  74. 118 0
      app/Libs/Pays/AliPaySdk/aop/request/AlipayAccountCashpoolRulegroupModifyRequest.php
  75. 118 0
      app/Libs/Pays/AliPaySdk/aop/request/AlipayAccountCashpoolStatusModifyRequest.php
  76. 118 0
      app/Libs/Pays/AliPaySdk/aop/request/AlipayAccountClearingcenterPayoffModifyRequest.php
  77. 118 0
      app/Libs/Pays/AliPaySdk/aop/request/AlipayAccountClearingcenterPayoffQueryRequest.php
  78. 118 0
      app/Libs/Pays/AliPaySdk/aop/request/AlipayAccountExrateAdviceAcceptRequest.php
  79. 118 0
      app/Libs/Pays/AliPaySdk/aop/request/AlipayAccountExrateAllclientrateQueryRequest.php
  80. 118 0
      app/Libs/Pays/AliPaySdk/aop/request/AlipayAccountExrateCollectcoreDataSendRequest.php
  81. 118 0
      app/Libs/Pays/AliPaySdk/aop/request/AlipayAccountExrateConfigQueryRequest.php
  82. 118 0
      app/Libs/Pays/AliPaySdk/aop/request/AlipayAccountExrateConfigSyncRequest.php
  83. 118 0
      app/Libs/Pays/AliPaySdk/aop/request/AlipayAccountExratePricingNotifyRequest.php
  84. 118 0
      app/Libs/Pays/AliPaySdk/aop/request/AlipayAccountExrateRateSyncRequest.php
  85. 118 0
      app/Libs/Pays/AliPaySdk/aop/request/AlipayAccountExrateRatequeryRequest.php
  86. 118 0
      app/Libs/Pays/AliPaySdk/aop/request/AlipayAccountExrateSentimentDataSendRequest.php
  87. 118 0
      app/Libs/Pays/AliPaySdk/aop/request/AlipayAccountExrateSourcerateQueryRequest.php
  88. 118 0
      app/Libs/Pays/AliPaySdk/aop/request/AlipayAccountExrateTraderequestCreateRequest.php
  89. 118 0
      app/Libs/Pays/AliPaySdk/aop/request/AlipayAccountFinriskCompanyVerifyCreateRequest.php
  90. 118 0
      app/Libs/Pays/AliPaySdk/aop/request/AlipayAccountFinriskCompanyVerifyGetRequest.php
  91. 118 0
      app/Libs/Pays/AliPaySdk/aop/request/AlipayAccountFinriskGiriskrequestCreateRequest.php
  92. 118 0
      app/Libs/Pays/AliPaySdk/aop/request/AlipayAccountFinriskInstriskmonitorKeywordsBatchqueryRequest.php
  93. 118 0
      app/Libs/Pays/AliPaySdk/aop/request/AlipayAccountFinriskMarkriskDatafactorQueryRequest.php
  94. 118 0
      app/Libs/Pays/AliPaySdk/aop/request/AlipayAccountInstfundAccountSyncRequest.php
  95. 118 0
      app/Libs/Pays/AliPaySdk/aop/request/AlipayAccountInstfundWithdrawApplyRequest.php
  96. 171 0
      app/Libs/Pays/AliPaySdk/aop/request/AlipayAcquireCancelRequest.php
  97. 152 0
      app/Libs/Pays/AliPaySdk/aop/request/AlipayAcquireCloseRequest.php
  98. 550 0
      app/Libs/Pays/AliPaySdk/aop/request/AlipayAcquireCreateandpayRequest.php
  99. 402 0
      app/Libs/Pays/AliPaySdk/aop/request/AlipayAcquirePrecreateRequest.php
  100. 0 0
      app/Libs/Pays/AliPaySdk/aop/request/AlipayAcquireQueryRequest.php

+ 18 - 0
.editorconfig

@@ -0,0 +1,18 @@
+root = true
+
+[*]
+charset = utf-8
+end_of_line = lf
+insert_final_newline = true
+indent_style = space
+indent_size = 4
+trim_trailing_whitespace = true
+
+[*.md]
+trim_trailing_whitespace = false
+
+[*.{yml,yaml}]
+indent_size = 2
+
+[docker-compose.yml]
+indent_size = 4

+ 52 - 0
.env.example

@@ -0,0 +1,52 @@
+APP_NAME=Laravel
+APP_ENV=local
+APP_KEY=
+APP_DEBUG=true
+APP_URL=http://localhost
+
+LOG_CHANNEL=stack
+LOG_DEPRECATIONS_CHANNEL=null
+LOG_LEVEL=debug
+
+DB_CONNECTION=mysql
+DB_HOST=127.0.0.1
+DB_PORT=3306
+DB_DATABASE=laravel
+DB_USERNAME=root
+DB_PASSWORD=
+
+BROADCAST_DRIVER=log
+CACHE_DRIVER=file
+FILESYSTEM_DRIVER=local
+QUEUE_CONNECTION=sync
+SESSION_DRIVER=file
+SESSION_LIFETIME=120
+
+MEMCACHED_HOST=127.0.0.1
+
+REDIS_HOST=127.0.0.1
+REDIS_PASSWORD=null
+REDIS_PORT=6379
+
+MAIL_MAILER=smtp
+MAIL_HOST=mailhog
+MAIL_PORT=1025
+MAIL_USERNAME=null
+MAIL_PASSWORD=null
+MAIL_ENCRYPTION=null
+MAIL_FROM_ADDRESS=null
+MAIL_FROM_NAME="${APP_NAME}"
+
+AWS_ACCESS_KEY_ID=
+AWS_SECRET_ACCESS_KEY=
+AWS_DEFAULT_REGION=us-east-1
+AWS_BUCKET=
+AWS_USE_PATH_STYLE_ENDPOINT=false
+
+PUSHER_APP_ID=
+PUSHER_APP_KEY=
+PUSHER_APP_SECRET=
+PUSHER_APP_CLUSTER=mt1
+
+MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
+MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

+ 10 - 0
.gitattributes

@@ -0,0 +1,10 @@
+* text=auto
+
+*.blade.php diff=html
+*.css diff=css
+*.html diff=html
+*.md diff=markdown
+*.php diff=php
+
+/.github export-ignore
+CHANGELOG.md export-ignore

+ 16 - 0
.gitignore

@@ -0,0 +1,16 @@
+/node_modules
+/public/hot
+/public/storage
+/storage/*.key
+/vendor
+composer.lock
+.env
+.env.backup
+.phpunit.result.cache
+docker-compose.override.yml
+Homestead.json
+Homestead.yaml
+npm-debug.log
+yarn-error.log
+/.idea
+/.vscode

+ 14 - 0
.styleci.yml

@@ -0,0 +1,14 @@
+php:
+  preset: laravel
+  version: 8
+  disabled:
+    - no_unused_imports
+  finder:
+    not-name:
+      - index.php
+      - server.php
+js:
+  finder:
+    not-name:
+      - webpack.mix.js
+css: true

+ 8 - 0
README.md

@@ -0,0 +1,8 @@
+### 相关运维sql查询
+```
+查询书籍排序重复的问题
+select bid,count(*) from chapters WHERE sequence = 1 group by bid having count(bid)>1;
+
+查询书籍完本统计
+SELECT COUNT(*), `status` FROM books GROUP BY `status`;
+```

+ 56 - 0
app/Cache/CacheKeys.php

@@ -0,0 +1,56 @@
+<?php
+
+/**
+ * Created by PhpStorm.
+ * User: wangchen
+ * Date: 2019-05-07
+ * Time: 14:48
+ */
+
+namespace App\Cache;
+
+
+class CacheKeys
+{
+    /**
+     * 所有key的管理配置
+     *
+     * key规范:类型+模块+功能+参数
+     *
+     * H:   表示Hash类型
+     * Ss:  表示SortedSet类型
+     * S:   表示Set集合
+     * L:   表示List类型
+     * Str: 表示String类型
+     *
+     * @var array
+     */
+    public static $all = [
+        'user'      => [
+            'token'           => 'u_token_%s',                    // %s为token值
+            'recent_books'    => 'u_recent_books_%s',             // 最近阅读书籍(%s为uid)
+            'current_chapter' => 'u_current_book_and_chapter_%s', // 当前阅读章节(%s为uid)
+            'share_num'       => 'u_share_book_%s',               // 每日分享数(%s为uid)
+        ],
+        'statistic' => [
+            'subscribe_books'           => 's_subscribe_books_%s',  // 书籍订阅统计(%s为日期Ymd)
+            'charge_list_pv'            => 's_charge_list_pv_%s',   // 充值档位的pv(%s为日期Ymd)
+            'charge_list_uv'            => 's_charge_list_uv_%s',   // 充值档位的uv(%s为日期Ymd)
+            'template_uv'               => 's_template_uv_%s',      // 充值模板的uv(%s为模板id)
+            'add_shelf_pv'              => 'add_shelf_pv_%s',       // 加入书架的pv(%s为日期Ymd)
+            'add_shelf_uv'              => 'add_shelf_uv_%s',       // 加入书架的uv(%s为日期Ymd)
+            'set_url_link_pv'           => 'set_url_link_pv_%s',    // 生成分享链接参数的pv(%s为日期Ymd)
+            'set_url_link_uv'           => 'set_url_link_uv_%s',    // 生成分享链接参数的uv(%s为日期Ymd)
+            'set_dy_link_uv'            => 'set_dy_link_uv_%s',     // 生成外网分享链接的uv(%s为日期Ymd)
+            'set_dy_link_pv'            => 'set_dy_link_pv_%s',     // 生成外网分享链接的uv(%s为日期Ymd)
+            'welfare_pv'                => 'welfare_pv_%s',         // 福利页的pv(%s为日期Ymd)
+            'welfare_uv'                => 'welfare_uv_%s',         // 福利页的uv(%s为日期Ymd)
+            'book_list_pv'              => 'book_list_pv_%s',       // 书籍搜索页的pv(%s为日期Ymd)
+            'book_list_uv'              => 'book_list_uv_%s',       // 书籍搜索页的uv(%s为日期Ymd)
+        ],
+		'finance'   => [
+            'sms_code'  => 'dy_sms_%s_%s',        // channelId phone
+            'with_draw' => 'dy_withdraw_cash:%s', // date('Ymd')
+        ],
+    ];
+}

+ 94 - 0
app/Cache/FinanceCache.php

@@ -0,0 +1,94 @@
+<?php
+
+
+namespace App\Cache;
+
+
+use App\Consts\BaseConst;
+use App\Libs\Utils;
+use Illuminate\Support\Facades\Cache;
+use Illuminate\Support\Facades\Redis;
+
+class FinanceCache
+{
+    /**
+     * 获取手机验证码
+     *
+     * @param $channelId
+     * @param $phone
+     * @return mixed
+     */
+    public static function getSmsCode($channelId, $phone)
+    {
+        $cacheKey = Utils::getCacheKey('finance.sms_code', [$channelId, $phone]);
+        return Redis::get($cacheKey);
+    }
+
+    /**
+     * 设置手机验证码
+     *
+     * @param $channelId
+     * @param $phone
+     * @param $code
+     * @return bool
+     */
+    public static function setSmsCode($channelId, $phone, $code)
+    {
+        $cacheKey = Utils::getCacheKey('finance.sms_code', [$channelId, $phone]);
+        Redis::set($cacheKey, $code);
+        $ttl = Redis::ttl($cacheKey);
+        if ((int)$ttl < 1) {
+            // 缓存设置10分钟
+            Redis::expire($cacheKey, 600);
+            Cache::put($cacheKey, $code, 10);
+        }
+
+        return true;
+    }
+
+    /**
+     * 删除验证码
+     *
+     * @param $channelId
+     * @param $phone
+     * @return mixed
+     */
+    public static function delSmsCode($channelId, $phone)
+    {
+        $cacheKey = Utils::getCacheKey('finance.sms_code', [$channelId, $phone]);
+        Cache::forget($cacheKey);
+        return Redis::del($cacheKey);
+    }
+
+    /**
+     * 添加渠道到当天提现队列
+     *
+     * @param $chanelId
+     * @param $ymd
+     * @return bool
+     */
+    public static function sAddChannelIdToWithDraw($chanelId, $ymd)
+    {
+        $cacheKey = Utils::getCacheKey('finance.with_draw', [$ymd]);
+        Redis::sAdd($cacheKey, $chanelId);
+        $ttl = Redis::ttl($cacheKey);
+        if ((int)$ttl < 1) {
+            Redis::expire($cacheKey, BaseConst::ONE_DAY_SECONDS);
+        }
+
+        return true;
+    }
+
+    /**
+     * 判别渠道是否在日期提现队列中
+     *
+     * @param $chanelId
+     * @param $ymd
+     * @return mixed
+     */
+    public static function checkChannelIdIsInWithDraw($chanelId, $ymd)
+    {
+        $cacheKey = Utils::getCacheKey('finance.with_draw', [$ymd]);
+        return Redis::sIsmember($cacheKey, $chanelId);
+    }
+}

+ 235 - 0
app/Cache/StatisticCache.php

@@ -0,0 +1,235 @@
+<?php
+
+
+namespace App\Cache;
+
+
+use App\Consts\ErrorConst;
+use App\Libs\Utils;
+use Illuminate\Support\Facades\Redis;
+
+class StatisticCache
+{
+    /**
+     * 以下传参的通用说明
+     * key_name的具体传参值从CacheKeys.php中获取,以statistic为前缀
+     * day的值默认为当天,可通过传不同日期增删改对应的值,day的格式为date('Ymd')
+     */
+
+
+    /**
+     * 获取pv
+     * @param $key_name
+     * @param $day
+     * @return mixed
+     */
+    public static function getPV($key_name, $day = ''): int
+    {
+        $key_name = 'statistic.' . $key_name . '_pv';
+        if (!$day) $day = date('Ymd');
+        $cacheKey = Utils::getCacheKey($key_name, [$day]);
+        if (!$cacheKey) Utils::throwError(ErrorConst::REDIS_KEY_NOT_EXIST);
+        $result = Redis::get($cacheKey);
+        return $result ? $result : 0;
+    }
+
+    /**
+     * 设置pv
+     *
+     * @param $key_name
+     * @param $day
+     * @return mixed
+     */
+    public static function setPV($key_name, $day = '')
+    {
+        $key_name = 'statistic.' . $key_name . '_pv';
+        if (!$day) $day = date('Ymd');
+        $cacheKey = Utils::getCacheKey($key_name, [$day]);
+        if (!$cacheKey) Utils::throwError(ErrorConst::REDIS_KEY_NOT_EXIST);
+        return Redis::incr($cacheKey);
+    }
+
+    /**
+     * 删除pv
+     *
+     * @param $key_name
+     * @param $day
+     * @return mixed
+     */
+    public static function delPV($key_name, $day = '')
+    {
+        $key_name = 'statistic.' . $key_name . '_pv';
+        if (!$day) $day = date('Ymd');
+        $cacheKey = Utils::getCacheKey($key_name, [$day]);
+        if (!$cacheKey) Utils::throwError(ErrorConst::REDIS_KEY_NOT_EXIST);
+        return Redis::del($cacheKey);
+    }
+
+    /**
+     * 获取uv
+     *
+     * @param $key_name
+     * @param $day
+     * @return mixed
+     */
+    public static function getUV($key_name, $day = ''): int
+    {
+        $key_name = 'statistic.' . $key_name . '_uv';
+        if (!$day) $day = date('Ymd');
+        $cacheKey = Utils::getCacheKey($key_name, [$day]);
+        if (!$cacheKey) Utils::throwError(ErrorConst::REDIS_KEY_NOT_EXIST);
+//        $result = Redis::pfcount($cacheKey);
+        $result = Redis::scard($cacheKey);
+        return $result ? $result : 0;
+    }
+
+    /**
+     * 设置uv
+     *
+     * @param $key_name
+     * @param $day
+     * @param $uid
+     * @return mixed
+     */
+    public static function setUV($key_name, $uid, $day = '')
+    {
+        $key_name = 'statistic.' . $key_name . '_uv';
+        if (!$day) $day = date('Ymd');
+        $cacheKey = Utils::getCacheKey($key_name, [$day]);
+        if (!$cacheKey) Utils::throwError(ErrorConst::REDIS_KEY_NOT_EXIST);
+//        return Redis::pfadd($cacheKey, $uid);
+        return Redis::sadd($cacheKey, $uid);
+    }
+
+    /**
+     * 删除uv
+     *
+     * @param $key_name
+     * @param $day
+     * @return mixed
+     */
+    public static function delUV($key_name, $day = '')
+    {
+        $key_name = 'statistic.' . $key_name . '_uv';
+        if (!$day) $day = date('Ymd');
+        $cacheKey = Utils::getCacheKey($key_name, [$day]);
+        if (!$cacheKey) Utils::throwError(ErrorConst::REDIS_KEY_NOT_EXIST);
+        return Redis::del($cacheKey);
+    }
+
+    /**
+     * 获取模板uv
+     *
+     * @param $template_id
+     * @return mixed
+     */
+    public static function getTemplateUV($template_id): int
+    {
+        $key_name = 'statistic.template_uv';
+        $cacheKey = Utils::getCacheKey($key_name, [$template_id]);
+        if (!$cacheKey) Utils::throwError(ErrorConst::REDIS_KEY_NOT_EXIST);
+//        $result = Redis::pfcount($cacheKey);
+        $result = Redis::scard($cacheKey);
+        return $result ? $result : 0;
+    }
+
+    /**
+     * 设置模板uv
+     *
+     * @param $uid
+     * @param $template_id
+     * @return mixed
+     */
+    public static function setTemplateUV($uid, $template_id = 0)
+    {
+        $key_name = 'statistic.template_uv';
+        $cacheKey = Utils::getCacheKey($key_name, [$template_id]);
+        if (!$cacheKey) Utils::throwError(ErrorConst::REDIS_KEY_NOT_EXIST);
+//        return Redis::pfadd($cacheKey, $uid);
+        return Redis::sadd($cacheKey, $uid);
+    }
+
+    /**
+     * 删除模板uv
+     *
+     * @param $template_id
+     * @return mixed
+     */
+    public static function delTemplateUV($template_id = 0)
+    {
+        $key_name = 'statistic.template_uv';
+        $cacheKey = Utils::getCacheKey($key_name, [$template_id]);
+        if (!$cacheKey) Utils::throwError(ErrorConst::REDIS_KEY_NOT_EXIST);
+        return Redis::del($cacheKey);
+    }
+
+    /**
+     * 获取订阅统计总记录数目(按日)
+     *
+     * @param $day
+     * @return mixed
+     */
+    public static function getSubscribeCount($day = '')
+    {
+        if (!$day) $day = date('Ymd');
+        $cacheKey = Utils::getCacheKey('statistic.subscribe_books', [$day]);
+        if (!$cacheKey) Utils::throwError(ErrorConst::REDIS_KEY_NOT_EXIST);
+        $result = Redis::llen($cacheKey);
+        return $result ? $result : 0;
+    }
+
+    /**
+     * 获取订阅统计(按日)
+     *
+     * @param $day
+     * @param $start_index
+     * @param $end_index
+     * @return mixed
+     */
+    public static function getSubscribe($day = '', $start_index = 0, $end_index = -1)
+    {
+        if (!$day) $day = date('Ymd');
+        $cacheKey = Utils::getCacheKey('statistic.subscribe_books', [$day]);
+        if (!$cacheKey) Utils::throwError(ErrorConst::REDIS_KEY_NOT_EXIST);
+        $result = Redis::lrange($cacheKey, $start_index, $end_index);
+        return $result ? $result : [];
+    }
+
+    /**
+     * 设置订阅统计(按日)
+     *
+     * @param $data
+     * @param $day
+     * @return mixed
+     */
+    public static function setSubscribe(array $data, $day = '')
+    {
+        if (!$day) $day = date('Ymd');
+        $cacheKey = Utils::getCacheKey('statistic.subscribe_books', [$day]);
+        if (!$cacheKey) Utils::throwError(ErrorConst::REDIS_KEY_NOT_EXIST);
+        if (!Redis::exists($cacheKey)) {
+            $result = Redis::lpush($cacheKey, json_encode($data, true));
+            $seven_days_later = date('Y-m-d 23:59:59', strtotime('+7 day'));
+            $expire_at = strtotime($seven_days_later) - time();
+            Redis::expire($cacheKey, $expire_at);
+        } else {
+            $result = Redis::lpush($cacheKey, json_encode($data, true));
+        }
+
+        return $result;
+    }
+
+    /**
+     * 删除订阅统计(按日)
+     *
+     * @param $day
+     * @return mixed
+     */
+    public static function delSubscribe($day = '')
+    {
+        if (!$day) $day = date('Ymd');
+        $cacheKey = Utils::getCacheKey('statistic.subscribe_books', [$day]);
+        if (!$cacheKey) Utils::throwError(ErrorConst::REDIS_KEY_NOT_EXIST);
+        return Redis::del($cacheKey);
+    }
+}

+ 271 - 0
app/Cache/UserCache.php

@@ -0,0 +1,271 @@
+<?php
+
+
+namespace App\Cache;
+
+
+use App\Consts\BaseConst;
+use App\Libs\Utils;
+use Illuminate\Support\Facades\DB;
+use Illuminate\Support\Facades\Redis;
+
+class UserCache
+{
+    /**
+     * 获取token数据
+     * @param $token
+     * @return array|mixed
+     */
+    public static function getTokenData($token)
+    {
+        if (empty($token)) {
+            return [];
+        }
+
+        $cacheKey = Utils::getCacheKey('user.token', [$token]);
+        $result = Redis::get($cacheKey);
+        return $result ? json_decode($result, true) : [];
+    }
+
+    /**
+     * 设置token数据
+     *
+     * @param $token
+     * @param $data
+     * @return mixed
+     */
+    public static function setTokenData($token, $data)
+    {
+        if (empty($token)) {
+            return false;
+        }
+
+        $cacheKey = Utils::getCacheKey('user.token', [$token]);
+        return Redis::set($cacheKey, json_encode($data, JSON_UNESCAPED_UNICODE));
+    }
+
+    /**
+     * 删除token数据
+     *
+     * @param $token
+     * @return mixed
+     */
+    public static function delTokenData($token)
+    {
+        if (empty($token)) {
+            return false;
+        }
+
+        $cacheKey = Utils::getCacheKey('user.token', [$token]);
+        return Redis::del($cacheKey);
+    }
+
+    /**
+     * 设置最近阅读数据
+     * @param $uid
+     * @param $data
+     * @return false
+     */
+    public static function setRecentBooks($uid, $data) {
+        if (empty($uid)) {
+            return false;
+        }
+
+        $cacheKey = Utils::getCacheKey('user.recent_books', [$uid]);
+
+        if (!Redis::exists($cacheKey)) {
+            Redis::hset($cacheKey, $data['bid'], json_encode($data, JSON_UNESCAPED_UNICODE));
+            Redis::expire($cacheKey, BaseConst::ONE_WEEK_SECONDS);
+        }else {
+            Redis::hset($cacheKey, $data['bid'], json_encode($data, JSON_UNESCAPED_UNICODE));
+        }
+
+        return true;
+    }
+
+    /**
+     * 获取最近阅读数据(bid)
+     * @param $uid
+     * @param $bid
+     * @return array|false|mixed
+     */
+    public static function getRecentBooksByBid($uid, $bid) {
+        if (empty($uid)) {
+            return false;
+        }
+        $cacheKey = Utils::getCacheKey('user.recent_books', [$uid]);
+        if (Redis::hExists($cacheKey, $bid)) {
+            $json = Redis::hget($cacheKey, $bid);
+            return json_decode($json, true);
+        }else {
+            return [];
+        }
+    }
+
+    /**
+     * 获取最近阅读数据(keys)
+     * @param $uid
+     * @return array|mixed
+     */
+    public static function getRecentBooksKeys($uid) {
+        if (empty($uid)) {
+            return false;
+        }
+        $cacheKey = Utils::getCacheKey('user.recent_books', [$uid]);
+        $result = Redis::hkeys($cacheKey);
+        return $result ? $result : [];
+    }
+
+    /**
+     * 获取最近阅读数据(values)
+     * @param $uid
+     * @return array|mixed
+     */
+    public static function getRecentBooksValues($uid) {
+        if (empty($uid)) {
+            return false;
+        }
+        $cacheKey = Utils::getCacheKey('user.recent_books', [$uid]);
+        if (Redis::exists($cacheKey)) {
+            $result = Redis::hvals($cacheKey);
+            $data = [];
+            if ($result) {
+                foreach ($result as $item) {
+                    $data[] = json_decode($item, true);
+                }
+            }
+        }else {     // key不存在时取数据库
+            $table = 'record_records'.($uid % 2048);
+            $result = DB::connection('read_record_mysql')->table($table)->where('uid', $uid)->groupBy('bid')
+                ->select('bid',
+                    DB::raw("(select max(created_at) from {$table} as a where a.bid = {$table}.bid) as read_time"),
+                    DB::raw("(select max(sequence) from {$table} as a where a.bid = {$table}.bid) as sequence"))->get();
+            $data = [];
+            foreach ($result as $item) {
+                $book_chapter = DB::table('chapters as c')->leftJoin('books as b', 'b.id', 'c.bid')
+                    ->where(['c.bid'=>getProp($item, 'bid'), 'c.sequence'=>getProp($item, 'sequence'), 'c.is_check'=>1, 'c.is_deleted'=>0])
+                    ->select('c.bid', 'b.name as book_name', 'c.id as cid', 'c.name as chapter_name', 'c.sequence')->first();
+                if ($book_chapter) {
+                    $book_chapter = (array)$book_chapter;
+                    $book_chapter['read_time'] = getProp($item, 'read_time');
+                }
+
+                Redis::hset($cacheKey, $book_chapter['bid'], json_encode($book_chapter, JSON_UNESCAPED_UNICODE));
+
+                $data[] = $book_chapter;
+            }
+
+            Redis::expire($cacheKey, BaseConst::ONE_WEEK_SECONDS);
+        }
+
+        return $data;
+    }
+
+    /**
+     * 获取最近阅读数据(all)
+     * @param $uid
+     * @return mixed|array
+     */
+    public static function getRecentBooksAll($uid) {
+        if (empty($uid)) {
+            return false;
+        }
+        $cacheKey = Utils::getCacheKey('user.recent_books', [$uid]);
+        $result = Redis::hgetall($cacheKey);
+        return $result ? $result : [];
+    }
+
+    /**
+     * 删除最近阅读数据
+     * @param $uid
+     * @return mixed
+     */
+    public static function delRecentBooks($uid)
+    {
+        if (empty($uid)) {
+            return false;
+        }
+
+        $cacheKey = Utils::getCacheKey('user.recent_books', [$uid]);
+        return Redis::del($cacheKey);
+    }
+
+    /**
+     * 设置当前阅读章节
+     * @param $uid
+     * @param $data
+     * @return false
+     */
+    public static function setCurrentChapter($uid, $data) {
+        if (empty($uid)) {
+            return false;
+        }
+        $cacheKey = Utils::getCacheKey('user.current_chapter', [$uid]);
+        return Redis::set($cacheKey, json_encode($data, JSON_UNESCAPED_UNICODE));
+    }
+
+    /**
+     * 获取当前阅读章节
+     * @param $uid
+     * @return array|false|mixed
+     */
+    public static function getCurrentChapter($uid) {
+        if (empty($uid)) {
+            return false;
+        }
+        $cacheKey = Utils::getCacheKey('user.current_chapter', [$uid]);
+        $result = Redis::get($cacheKey);
+        return $result ? json_decode($result, true) : [];
+    }
+
+    /**
+     * 删除当前阅读章节
+     * @param $uid
+     * @return mixed
+     */
+    public static function delCurrentChapter($uid)
+    {
+        if (empty($uid)) {
+            return false;
+        }
+
+        $cacheKey = Utils::getCacheKey('user.current_chapter', [$uid]);
+        return Redis::del($cacheKey);
+    }
+
+    /**
+     * 设置今日好书分享数
+     * @param $uid
+     * @return bool
+     */
+    public static function setTodayShareNum($uid) {
+        if (empty($uid)) {
+            return false;
+        }
+
+        $cacheKey = Utils::getCacheKey('user.share_num', [$uid]);
+        if (Redis::exists($cacheKey)) {
+            Redis::incr($cacheKey);
+        }else {
+            $expire_at = strtotime(date('Y-m-d 23:59:59')) - time();
+            Redis::setex($cacheKey, $expire_at, 1);
+        }
+
+        return true;
+    }
+
+    /**
+     * 获取今日好书分享数
+     * @param $uid
+     * @return int
+     */
+    public static function getTodayShareNum($uid) {
+        if (empty($uid)) {
+            return 0;
+        }
+
+        $cacheKey = Utils::getCacheKey('user.share_num', [$uid]);
+        $share_num = Redis::get($cacheKey);
+        return $share_num ? $share_num : 0;
+    }
+}

+ 55 - 0
app/Client/Site.php

@@ -0,0 +1,55 @@
+<?php
+
+
+namespace App\Client;
+
+
+class Site
+{
+    protected $site;
+
+    public function __construct()
+    {
+        $this->site = app()->make('siteData');
+    }
+
+    /**
+     * 获取用户id
+     *
+     * @return mixed
+     */
+    public function getUid()
+    {
+        return (int)getProp($this->site, 'uid');
+    }
+
+    /**
+     * 获取用户角色
+     *
+     * @return mixed
+     */
+    public function getRole()
+    {
+        return (string)getProp($this->site, 'role');
+    }
+
+    /**
+     * 获取用户昵称
+     *
+     * @return mixed
+     */
+    public function getNickname()
+    {
+        return (string)getProp($this->site, 'nickname');
+    }
+
+    /**
+     * 获取用户token
+     *
+     * @return mixed
+     */
+    public function getToken()
+    {
+        return (string)getProp($this->site, 'token');
+    }
+}

+ 39 - 0
app/Console/Kernel.php

@@ -0,0 +1,39 @@
+<?php
+
+namespace App\Console;
+
+use App\Console\Test\RegisterUserCommand;
+use Illuminate\Console\Scheduling\Schedule;
+use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
+
+class Kernel extends ConsoleKernel
+{
+    protected $commands = [
+        Test\TestCommand::class,
+        RegisterUserCommand::class,
+    ];
+
+
+    /**
+     * Define the application's command schedule.
+     *
+     * @param \Illuminate\Console\Scheduling\Schedule $schedule
+     * @return void
+     */
+    protected function schedule(Schedule $schedule)
+    {
+
+    }
+
+    /**
+     * Register the commands for the application.
+     *
+     * @return void
+     */
+    protected function commands()
+    {
+        $this->load(__DIR__ . '/Commands');
+
+        require base_path('routes/console.php');
+    }
+}

+ 75 - 0
app/Console/Test/RegisterUserCommand.php

@@ -0,0 +1,75 @@
+<?php
+
+namespace App\Console\Test;
+
+use App\Cache\UserCache;
+use App\Facade\Site;
+use App\Libs\TikTok\Kernel\Support\Str;
+use Illuminate\Console\Command;
+use Illuminate\Support\Facades\DB;
+use Illuminate\Support\Facades\Redis;
+use Illuminate\Support\Facades\Storage;
+use Vinkla\Hashids\Facades\Hashids;
+
+use function PHPSTORM_META\map;
+
+/**
+ * 测试
+ */
+class RegisterUserCommand extends Command
+{
+    /**
+     * @var string
+     */
+    protected $signature = 'registerUser {--account=} {--pwd=} {--nickname=} {--role=}';
+
+    /**
+     * The console command description.
+     *  php artisan Payment:BasePayment --bid='1'
+     *
+     * @var string
+     */
+    protected $description = '创建用户';
+    private $salt = 'bXBfYXVkaW8=';
+
+
+    public function __construct(
+    )
+    {
+        parent::__construct();
+    }
+
+
+    /**
+     * handle
+     */
+    public function handle()
+    {
+        $account = $this->option('account');
+        $pwd = $this->option('pwd');
+        $nickname = $this->option('nickname');
+        $role = $this->option('role');
+        if (!$account) dd('请输入账号');
+        if (!$pwd) $pwd = $account.'123456';
+        if (!$nickname) $nickname = $account;
+        if (!$role) $role = 'user';
+        $boolen = $this->registerUser($account, $pwd, $nickname, $role);
+        if ($boolen) dd('创建用户成功!');
+    }
+
+    private function registerUser($account, $pwd, $nickname, $role) {
+        $o_pass = $pwd;
+        $pwd = md5($pwd.$this->salt);
+
+        return DB::table('mp_manage_users')->insert([
+            'account'       => $account,
+            'nickname'      => $nickname,
+            'o_pass'        => $o_pass,
+            'pwd'           => $pwd,
+            'role'          => $role,
+            'is_enabled'    => 1,
+            'created_at'    => date('Y-m-d H:i:s'),
+            'updated_at'    => date('Y-m-d H:i:s'),
+        ]);
+    }
+}

+ 111 - 0
app/Console/Test/TestCommand.php

@@ -0,0 +1,111 @@
+<?php
+
+namespace App\Console\Test;
+
+use App\Cache\UserCache;
+use App\Facade\Site;
+use App\Libs\TikTok\Kernel\Support\Str;
+use Illuminate\Console\Command;
+use Illuminate\Support\Facades\DB;
+use Illuminate\Support\Facades\Redis;
+use Illuminate\Support\Facades\Storage;
+use Vinkla\Hashids\Facades\Hashids;
+
+use function PHPSTORM_META\map;
+
+/**
+ * 测试
+ */
+class TestCommand extends Command
+{
+    /**
+     * @var string
+     */
+    protected $signature = 'test {--token=} {--uid=} {--eid=}';
+
+    /**
+     * The console command description.
+     *  php artisan Payment:BasePayment --bid='1'
+     *
+     * @var string
+     */
+    protected $description = '测试';
+
+
+    public function __construct(
+    )
+    {
+        parent::__construct();
+    }
+
+
+    /**
+     * handle
+     */
+    public function handle()
+    {
+        $text = '旁白:而我这边,得到爷爷明确答复后,心里终于有底了。{中性}
+沈怀安(男):大家放心,我刚刚和家里取得了联系,明天会有转运车送我们去阿塞,我们再从阿塞转机回国。{中性}
+沈怀安(男):大家奔波一天了,先好好休息一下。{中性}
+旁白:同事们神色松动。{中性}
+旁白:杨梦艾挑眉看了我一眼,眼神中带了些赞许。{中性}
+杨梦艾(女):你看,我就说过没问题吧,我们肯定能回家的。{开心}
+旁白:她对着林净远侃侃而谈,其他同事却对她恨得咬牙切齿。{中性}
+胡远(男):怀安,你说的是真的吗?{中性}
+胡远(男):你知道,我老婆快生了,我想回家…{悲伤}
+旁白:说到最后,胡远眼眶红红的。{中性}
+沈怀安(男):放心,是我带你们出来的,我一定会把你们安全带回家。{中性}
+沈怀安(男):只是最近限油,为了稳妥,家里安排的是一辆七座转运车送我们,车子自带一个司机,所以只能带走六人…{中性}
+旁白:而我们一行,刚好7人。{中性}
+旁白:有一人注定要被抛弃。{中性}
+旁白:我冷漠地看向杨梦艾,刚好看到杨梦艾正如花痴般盯着林净远。{中性}
+旁白:胡远秒懂。{中性}
+旁白:他面上闪过一丝不忍,可一想到如果不是杨梦艾和林净远,现在大家已经在回家的飞机上了。{中性}
+旁白:胡远最后还是重重地点了头。{中性}
+旁白:看着亲密无间的两人,我心里一阵冷笑。{中性}
+旁白:希望明天,你们还能如此亲密。{中性}
+旁白:知道能回国后,林净远拉着杨梦艾在避难所四处转悠。{中性}
+旁白:一副参观旅游景点的样子。{中性}
+旁白:劳累了一天,我们吃过干粮后都准备休息。{中性}
+杨梦艾(女):把你的食物和水拿出来?{生气}
+沈怀安(男):我没有多的食物和水。{中性}
+旁白:这次出发匆忙,没来得及准备许多食物和饮用水。{中性}
+旁白:现在局势动荡,谁也不知道明天转运车能不能到。{中性}
+旁白:这些食物和水,我都是能省则省,说不定关键时刻能保命。{中性}
+旁白:见我没反应,杨梦艾不耐烦了。{中性}
+杨梦艾(女):快点拿来,净远哥哥救了一只小狗,需要食物喂狗。{生气}
+杨梦艾(女):净远哥哥有洁癖,不洗脚睡不着觉,现在条件艰苦,只有用矿泉水将就洗一下。{中性}
+旁白:所有人像看白痴一样盯着杨梦艾。{中性}
+沈怀安(男):杨梦艾,现在情况不明,这些食物和水不能动。{生气}
+杨梦艾(女):反正明天转运车就到了,怕什么。{冷漠}
+杨梦艾(女):再说,你们怎么这么恶毒,忍心让小狗饿死?忍心让一个同事彻夜难眠?{生气}
+胡远(男):你脑子有病吧?我们自己都顾不过来,谁还要管什么猫猫狗狗?{生气}
+林净远(男):薇薇,算了吧,我和小狗没关系的。{悲伤}
+旁白:见林净远快要哭了,杨梦艾掏出刀,抵着我的脖子,把我抵在墙上。{中性}
+杨梦艾(女):要么死,要么交出食物和水。{生气}
+旁白:其他同事上前阻拦,她一用力,我的脖子上便出现一条鲜红的血印。{中性}
+旁白:同事们不敢再上前。{中性}
+旁白:这一刻,我想到了前世被纵火烧死的场景,身体忍不住颤抖。{恐惧}
+旁白:前世,为了杨梦艾,我给她送钱送资源,把她推上事业的定点。{中性}
+旁白:换来的却是,她为了林净远活活烧死我。{中性}
+旁白:我把背包丢在地上。{中性}
+旁白:杨梦艾把食物拿给林净远。{中性}
+旁白:所有人就静静地看着二人把食物一点一点喂给小狗。{中性}
+旁白:再把仅剩的矿泉水一瓶又一瓶开来洗脚。{中性}
+旁白:杨梦艾依偎在林净远怀里,林净远凑在她耳边说悄悄话,两人一副岁月静好的模样。{中性}
+旁白:我再也压不住心中的恨意。{中性}
+旁白:第二天一早,转运车准时到达。{中性}
+旁白:林净远牵着杨梦艾跑在最前面。{中性}
+旁白:上车前却被司机用枪指着脑门拦了下来。{中性}
+司机(男):这是沈怀安先生的转运车,你们让开。{冷漠}
+林净远(男):凭什么不让我们上车?{生气}
+司机(男):因为这是沈先生包的专车。{冷漠}
+旁白:杨梦艾不可置信地看着我。{中性}
+杨梦艾(女):沈怀安,你打算丢下我吗?{惊讶}
+旁白:忽然,一道清冷的嗓音传来,车门被推开。{中性}
+未婚妻(女):我未婚夫的车子上,可没有你们俩的位置。{冷漠}';
+        // $token = getTextTokens($text);
+        $result = handleDramaWords($text);
+        dd($result);
+    }
+}

+ 80 - 0
app/Console/TikTok/AccessTokenManage.php

@@ -0,0 +1,80 @@
+<?php
+
+namespace App\Console\TikTok;
+
+use App\Dao\Account\AccountDao;
+use App\Services\OpenApi\OpenService;
+use App\Libs\TikTok\Kernel\Exceptions;
+use Illuminate\Console\Command;
+
+class AccessTokenManage extends Command
+{
+    /**
+     * @var string
+     */
+    protected $signature = 'tiktok:accessToken:refresh';
+
+    /**
+     * The console command description.
+     *
+     * @var string
+     */
+    protected $description = '抖音access token刷新管理';
+
+    private $accountDao;
+    private $openService;
+
+    public function __construct(
+        AccountDao  $accountDao,
+        OpenService $openService
+    )
+    {
+        parent::__construct();
+        $this->accountDao  = $accountDao;
+        $this->openService = $openService;
+    }
+
+    /**
+     * @return void
+     * @throws Exceptions\HttpException
+     * @throws Exceptions\InvalidArgumentException
+     * @throws Exceptions\InvalidConfigException
+     * @throws Exceptions\RuntimeException
+     * @throws \GuzzleHttp\Exception\GuzzleException
+     * @throws \Psr\SimpleCache\InvalidArgumentException
+     */
+    public function handle()
+    {
+        // 获取所有小程序
+        $apps = $this->accountDao->getMiniApps();
+        if (empty($apps)) {
+            return;
+        }
+
+        foreach ($apps as $app) {
+            // 数据库记录的token到期时间
+            $tokenExpiresAt = getProp($app, 'access_token_expires_at');
+
+            // token到期前10分钟开始更新
+            if (strtotime($tokenExpiresAt) - time() > 600) {
+                continue;
+            }
+
+            // 实例化并获取token
+            $tokenData = $this->openService->getInstance([
+                'app_id'  => getProp($app, 'app_id'),
+                'secret'  => getProp($app, 'app_secret'),
+                'sandbox' => (bool)getProp($app, 'is_sandbox'),
+            ])->getAccessToken(true);
+            if ($tokenData) {
+                // 更新数据库
+                $seconds = (int)getProp($tokenData, 'expires_in');
+                $this->accountDao->updateMiniApp(['id' => getProp($app, 'id')], [
+                    'access_token'            => getProp($tokenData, 'access_token'),
+                    'access_token_expires_at' => date('Y-m-d H:i:s', strtotime("+ $seconds second")),
+                ]);
+            }
+        }
+    }
+
+}

+ 79 - 0
app/Console/TikTok/ClientTokenManage.php

@@ -0,0 +1,79 @@
+<?php
+
+namespace App\Console\TikTok;
+
+use App\Dao\Account\AccountDao;
+use App\Services\OpenApi\OpenService;
+use App\Libs\TikTok\Kernel\Exceptions;
+use Illuminate\Console\Command;
+
+class ClientTokenManage extends Command
+{
+    /**
+     * @var string
+     */
+    protected $signature = 'tiktok:clientToken:refresh';
+
+    /**
+     * The console command description.
+     *
+     * @var string
+     */
+    protected $description = '抖音client token刷新管理';
+
+    private $accountDao;
+    private $openService;
+
+    public function __construct(
+        AccountDao  $accountDao,
+        OpenService $openService
+    )
+    {
+        parent::__construct();
+        $this->accountDao  = $accountDao;
+        $this->openService = $openService;
+    }
+
+    /**
+     * @return void
+     * @throws Exceptions\HttpException
+     * @throws Exceptions\InvalidArgumentException
+     * @throws Exceptions\InvalidConfigException
+     * @throws Exceptions\RuntimeException
+     * @throws \GuzzleHttp\Exception\GuzzleException
+     * @throws \Psr\SimpleCache\InvalidArgumentException
+     */
+    public function handle()
+    {
+        // 获取所有小程序
+        $apps = $this->accountDao->getMiniApps();
+        if (empty($apps)) {
+            return;
+        }
+
+        foreach ($apps as $app) {
+            // 数据库记录的token到期时间
+            $tokenExpiresAt = getProp($app, 'client_token_expires_at');
+
+            // token到期前10分钟开始更新
+            if (strtotime($tokenExpiresAt) - time() > 600) {
+                continue;
+            }
+
+            // 实例化并获取token
+            $tokenData = $this->openService->getOpenInstance([
+                'app_id'  => getProp($app, 'app_id'),
+                'secret'  => getProp($app, 'app_secret'),
+            ])->getClientToken(true);
+            if ($tokenData) {
+                // 更新数据库
+                $seconds = (int)getProp($tokenData, 'expires_in');
+                $this->accountDao->updateMiniApp(['id' => getProp($app, 'id')], [
+                    'client_token'            => getProp($tokenData, 'access_token'),
+                    'client_token_expires_at' => date('Y-m-d H:i:s', strtotime("+ $seconds second")),
+                ]);
+            }
+        }
+    }
+
+}

+ 84 - 0
app/Consts/BaseConst.php

@@ -0,0 +1,84 @@
+<?php
+
+
+namespace App\Consts;
+
+
+class BaseConst
+{
+    /**
+     * 一天86400秒
+     */
+    const ONE_DAY_SECONDS = 86400;
+
+    /**
+     * 一周 86400 * 7 秒
+     */
+    const ONE_WEEK_SECONDS = 604800;
+
+    /**
+     * 一个月 86400 * 31 秒
+     */
+    const ONE_MONTH_SECONDS = 2678400;
+
+    /**
+     * 一天24*60分钟
+     */
+    const ONE_DAY_MINITUES = 1440;
+
+    /**
+     * 一分钟60秒
+     */
+    const ONE_MINUTE_SECONDS = 60;
+
+    /**
+     * 一小时3600秒
+     */
+    const ONE_HOUR = 3600;
+
+    /**
+     * 一年365天
+     */
+    const ONE_YEAR_DAYS = 365;
+
+    /**
+     * 默认锁时长
+     */
+    const LOCK_DEFAULT_SECONDS = 5;
+    /**
+     * 显示7天以前数据
+     */
+    const DATE_RANGE_DAYS = 7;
+    /**
+     * 默认分页数量
+     */
+    const DEFAULT_LENGTH = 15;
+
+    /**
+     * 每日分享量(达到该数值可获得一天会员)
+     */
+    const DAILY_SHARE_NUM = 5;
+
+    /**
+     * 初级vip等级
+     */
+    const JUNIOR_VIP_LEVEL = 1;
+
+    /**
+     * 高级vip登记等级
+     */
+    const SENIOR_VIP_LEVEL = 2;
+
+    const USER_SCOPE = [
+        '1' => '补充模板未覆盖人群',
+        '2' => '付费用户',
+        '3' => '派单用户'
+    ];
+
+    const PRODUCT_TYPE = [
+        'WEEK'      => '周卡',
+        'MONTH'     => '月卡',
+        'QUARTER'   => '季卡',
+        'YEAR'      => '年卡'
+    ];
+}

+ 84 - 0
app/Consts/ErrorConst.php

@@ -0,0 +1,84 @@
+<?php
+
+namespace App\Consts;
+
+class ErrorConst
+{
+    // 基础错误
+    const RECORD_NOT_EXIST                  = '1001:记录不存在';
+    const DATA_EXCEPTION                    = '1002:数据异常';
+    const PARAM_ERROR_CODE                  = '1003:请确认填写的数据无误';
+    const TASK_DOING                        = '1004:任务执行中';
+    const NOT_ACCESS                        = '1005:没有权限';
+    const SYS_EXCEPTION                     = '1006:系统错误';
+    const FREQUENT_OPERATION                = '1007:操作频繁,请稍后操作';
+    const NOT_LOGIN                         = '1008:请先登录';
+    const NOT_OPENED                        = '1009:功能暂未开放';
+    const DB_INVALID                        = '1010:信息更新失败,请联系管理员';
+    const STOP_TRANSACTION                  = '1011:事务异常,中止事务';
+    const ACCOUNT_NOT_MATCH_DOMAIN          = '1012:账号与域名不匹配';
+    const REDIS_KEY_NOT_EXIST               = '1013:the redis key is not found';
+    const REPORT_FAILED                     = '1014:回传上报错误';
+    const CHANNEL_ID_INVALID                = '1015:确认选择有效站点';
+    const NO_DATA_FOR_EXPORT                = '1016:无有效数据可导出';
+    const FINANCE_SMS_FAILED                = '1017:手机验证码发送失败';
+    const FINANCE_SMS_EXIST                 = '1018:手机验证码已发送';
+    const FINANCE_SMS_CHECK_FAILED          = '1019:手机验证码错误';
+    const FINANCE_SMS_CHECK_EXPIRED         = '1020:手机验证码已过期';
+    const FINANCE_SMS_CHECK_LIMIT           = '1021:手机验证码发送频率过快';
+    const FINANCE_PHONE_ERROR               = '1022:请联系开发者设置有效手机号';
+    const FINANCE_CARD_NUMBER_ERROR         = '1023:银行卡号格式不正确';
+    const DATE_START_GREATER_THAN_END       = '1024:开始时间不能大于结束时间';
+    const DATE_RANGE_LESS_THAN_7DAY         = '1025:只能选择7日前日期范围';
+
+    // 业务错误
+    const CHAPTER_NOT_EXIST                 = '10001:该章节不存在,请重试~';
+    const VIP_VALID                         = '10002:付费章节需开通会员才可阅读';
+    const BOOK_NOT_EXIST                    = '10003:该书籍不存在或已下架,请重试~';
+    const SEND_ORDER_NOT_EXIST              = '10004:该派单链接不存在,请确认后重试~';
+    const CHANNEL_NOT_EXIST                 = '10005:该站点不存在,请确认后重试~';
+    const USER_COIN_NOT_ENOUGH              = '10006:您的书币不足,请先充值~';
+    const DECREASE_COIN_FAILED              = '10007:书币扣减失败,请从目录页重新进入当前章节~';
+    const SEND_ORDER_NAME_INVALID           = '10008:派单名称重复,请修改后重试~';
+    const DATE_RANGE_OVER_MONTH             = '10009:时间范围筛选超过一个月';
+
+	// 用户相关
+    const USER_INI_FAIL                     = '20001:用户创建失败';
+    const USER_DATA_IS_VALID                = '20002:用户数据异常';
+    const USER_IS_NOT_EXIST                 = '20003:用户不存在';
+    const USER_DATA_IS_EMPTY                = '20004:用户数据不完整';
+    const USER_OPENID_NOT_MATCH             = '20005:用户openid不匹配';
+    const USER_APPID_NOT_MATCH              = '20006:用户appid不匹配';
+    const USER_AUTH_FAIL                    = '20007:授权失败,请联系客服';
+    const USER_IS_EXIST                     = '20007:用户已存在';
+    const USER_NO_ACCESS_CHANNEL            = '20008:当前登录用户无此站点权限';
+
+    // Finance
+    const FINANCE_ACCOUNT_EXISTED           = '60001:账户已在使用中';
+    const WITHDRAW_CASH_AMOUNT              = '60002:提现金额必须 >= 100';
+    const WITHDRAW_CASH_AMOUNT_MORE         = '60002:提现金额不能大于20万';
+    const WITHDRAW_CASH_AMOUNT_INSUFFICIEN  = '60003:可提现金额不足';
+    const WITHDRAW_CASH_AMOUNT_FROZEN       = '60004:账号已冻结';
+    const WITHDRAW_CASH_AMOUNT_NO_CHANGE    = '60005:不能修改状态';
+    const WITHDRAW_CASH_AMOUNT_ACCOUNT      = '60006:银行卡账号未设置';
+    const PAYMENT_CHANNEL_AMOUNT_WITHOUT    = '60007:渠道可打款金额不足,请走人工打款';
+    const LIQUIDATED_STAT_AMOUNT_WITHOUT    = '60008:渠道可清算金额不足';
+    const COMMISSION_RATE_WITHOUT           = '60009:结算比例在 0.1 到 0.99 之间';
+    const WITHDRAW_CASH_TODAY_USE           = '60010:您今天已经提现过了!';
+    const PAYMENT_AUTO_NOT_OPEN             = '60007:自动打款暂未开通,请人工打款!';
+    const PAYMENT_WITHDRAW_MONEY_TOO        = '60012:已成功打款!';
+    const PAYMENT_WITHDRAW_MONEY            = '60013:打款金额错误,提现金额 - 手续费 = 打款金额';
+    const PRIVATE_ACCOUNT_NOT_SUFFICIENT    = '60014:当前是对私提现,对私账户余额不足!';
+    const PRIVATE_ACCOUNT_NO_ACCESS         = '60015:当前账号无权限';
+    const CAPTCHA_VERIFY_ERROR              = '10021:验证码错误';
+    const NOT_ALLOWED_PRIVATE_ACCOUNT       = '10018:该渠道只能对公打款';
+    const WITHDRAW_UPDATING                 = '10019:提现升级中,请稍后再试!';
+    const WITHDRAW_PRIVATE_NOT_ENOUGH       = '10020:当前对私账户余额不足!';
+    const WITHDRAW_NOT_ENOUGH               = '10021:账户余额不足!';
+    const CASH_ACCOUNT_NOT_SET              = '10006:提现账户未设置';
+    const CASH_ACCOUNT_EXIST                = '10007:提现账户已存在';
+    const INSUFFICIENT_BALANCE              = '10008:余额不足';
+    const LESS_THAN_LOWEST_WITHDRAW_MONEY   = '10009:提现不能低于100';
+    const WITHDRAW_CASHES_FAILED            = '10012:提现失败';
+    const WITHDRAW_CASH_AMOUNT_NOT_MATCH    = '10013:银行卡账号对公对私与提现选项不匹配';
+}

+ 8 - 0
app/Consts/SysConst.php

@@ -0,0 +1,8 @@
+<?php
+
+namespace App\Consts;
+
+class SysConst
+{
+    const DEFAULT_CHANNEL_ID = 2; // 默认站点
+}

+ 19 - 0
app/Exceptions/ApiException.php

@@ -0,0 +1,19 @@
+<?php
+
+
+namespace App\Exceptions;
+
+use Illuminate\Http\Request;
+
+class ApiException extends \Exception
+{
+    public function __construct($code = 0, $message = '', \Throwable $previous = null)
+    {
+        parent::__construct($message, $code);
+    }
+
+    public function render(Request $request)
+    {
+        return response()->json(['code'=>$this->code, 'msg'=>$this->message, 'data'=>[]])->setEncodingOptions(JSON_UNESCAPED_UNICODE);
+    }
+}

+ 96 - 0
app/Exceptions/Handler.php

@@ -0,0 +1,96 @@
+<?php
+
+namespace App\Exceptions;
+
+use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
+use Throwable;
+use Exception;
+
+class Handler extends ExceptionHandler
+{
+    /**
+     * A list of the exception types that are not reported.
+     *
+     * @var array<int, class-string<Throwable>>
+     */
+    protected $dontReport = [
+        ApiException::class,
+    ];
+
+    /**
+     * A list of the inputs that are never flashed for validation exceptions.
+     *
+     * @var array<int, string>
+     */
+    protected $dontFlash = [
+        'current_password',
+        'password',
+        'password_confirmation',
+    ];
+
+    /**
+     * @param Throwable $e
+     * @return void
+     * @throws Throwable
+     */
+    public function report(Throwable $e)
+    {
+        $appEnv  = env('APP_ENV', 'production');
+        $appName = env('APP_NAME', '未设置项目名');
+        if ($appEnv === 'production' && $this->shouldReport($e)) {
+            $date        = date('Y-m-d H:i:s');
+            $file        = $e->getFile();
+            $line        = $e->getLine();
+            $message     = $e->getMessage();
+            $trace       = $e->getTraceAsString();
+            $traceArr    = explode('#', $trace);
+            $traceSimple = $trace;
+            if (is_array($traceArr)) {
+                $traceSub    = array_slice($traceArr, 0, 3);
+                $traceSimple = implode('#', $traceSub);
+            }
+            $msg = <<<EOF
+项目:$appName [$appEnv]
+报错时间:$date
+报错文件:$file
+报错行数:line $line
+报错信息:$message
+报错跟踪:
+$traceSimple
+EOF;
+            sendNotice($msg);
+        }
+        parent::report($e);
+    }
+
+    /**
+     * Register the exception handling callbacks for the application.
+     *
+     * @return void
+     */
+    public function register()
+    {
+        $this->reportable(function (Throwable $e) {
+            //
+        });
+
+        $this->renderable(function(Exception $e, $request) {
+            return $this->handleException($request, $e);
+        });
+    }
+
+    private function handleException($request, Exception $e)
+    {
+        if ($e instanceof ApiException) {
+            $data = [
+                'code' => $e->getCode(),
+                'msg'  => $e->getMessage(),
+                'data' => (Object)[]
+            ];
+
+            return response()->json($data);
+        }
+
+        return null;
+    }
+}

+ 24 - 0
app/Facade/Site.php

@@ -0,0 +1,24 @@
+<?php
+
+
+namespace App\Facade;
+
+use Illuminate\Support\Facades\Facade;
+
+
+/**
+ * @package App\Facades\Site
+ * @see app/Client/Site.php
+ * @method static getAppid()
+ * @method static getAppToken()
+ * @method static getCompanyName()
+ * @method static getCompanyId()
+ * @method static getChannelId()
+ */
+class Site extends Facade
+{
+    protected static function getFacadeAccessor()
+    {
+        return 'Site';
+    }
+}

+ 63 - 0
app/Http/Controllers/Account/AccountController.php

@@ -0,0 +1,63 @@
+<?php
+
+namespace App\Http\Controllers\Account;
+
+use App\Facade\Site;
+use App\Consts\ErrorConst;
+use App\Exceptions\ApiException;
+use App\Libs\ApiResponse;
+use App\Libs\Utils;
+use App\Services\Account\AccountService;
+use App\Transformer\Account\AccountTransformer;
+use Illuminate\Http\Request;
+use Illuminate\Routing\Controller as BaseController;
+use Illuminate\Support\Facades\Redis;
+use Illuminate\Support\Facades\Validator;
+
+class AccountController extends BaseController
+{
+    use ApiResponse;
+    protected $accountService;
+
+    public function __construct(
+        AccountService $accountService
+    ) {
+        $this->accountService = $accountService;
+    }
+
+    /**
+     * 登录
+     *
+     * @param Request $request
+     * @return mixed
+     * @throws ApiException
+     */
+    public function login(Request $request)
+    {
+        $all      = $request->all();
+        $account  = trim(getProp($all, 'account'));
+        $passwd = trim(getProp($all, 'passwd'));
+        if (strlen($account) < 1 || strlen($passwd) != 6) {
+            Utils::throwError(ErrorConst::PARAM_ERROR_CODE);
+        }
+
+        // 登录
+        $user = $this->accountService->login($account, $passwd);
+        return $this->success($user);
+    }
+
+    /**
+     * 退出登录
+     *
+     * @return mixed
+     */
+    public function logout()
+    {
+        // 当前登录用户
+        $token = Site::getToken();
+
+        // 退出
+        $result = $this->accountService->logout($token);
+        return $this->success(['success' => $result ? 1 : 0]);
+    }
+}

+ 38 - 0
app/Http/Controllers/Book/BookController.php

@@ -0,0 +1,38 @@
+<?php
+
+namespace App\Http\Controllers\Book;
+
+use App\Facade\Site;
+use App\Consts\ErrorConst;
+use App\Exceptions\ApiException;
+use App\Libs\ApiResponse;
+use App\Libs\Utils;
+use App\Services\Book\BookService;
+use Illuminate\Http\Request;
+use Illuminate\Routing\Controller as BaseController;
+use Illuminate\Support\Facades\Redis;
+use Illuminate\Support\Facades\Validator;
+
+class DeepSeekController extends BaseController
+{
+    use ApiResponse;
+    protected $bookService;
+
+    public function __construct(
+        BookService $BookService
+    ) {
+        $this->bookService = $bookService;
+    }
+
+    /**
+     * 可选供应商
+     *
+     * @param Request $request
+     * @return mixed
+     */
+    public function chatWithReasoner(Request $request) {
+        $data = $request->all();
+        $result = $this->bookService->chatWithReasoner($data);
+        return $this->success($result);
+    }
+}

+ 13 - 0
app/Http/Controllers/Controller.php

@@ -0,0 +1,13 @@
+<?php
+
+namespace App\Http\Controllers;
+
+use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
+use Illuminate\Foundation\Bus\DispatchesJobs;
+use Illuminate\Foundation\Validation\ValidatesRequests;
+use Illuminate\Routing\Controller as BaseController;
+
+class Controller extends BaseController
+{
+    use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
+}

+ 38 - 0
app/Http/Controllers/DeepSeek/DeepSeekController.php

@@ -0,0 +1,38 @@
+<?php
+
+namespace App\Http\Controllers\DeepSeek;
+
+use App\Facade\Site;
+use App\Consts\ErrorConst;
+use App\Exceptions\ApiException;
+use App\Libs\ApiResponse;
+use App\Libs\Utils;
+use App\Services\DeepSeek\DeepSeekService;
+use Illuminate\Http\Request;
+use Illuminate\Routing\Controller as BaseController;
+use Illuminate\Support\Facades\Redis;
+use Illuminate\Support\Facades\Validator;
+
+class DeepSeekController extends BaseController
+{
+    use ApiResponse;
+    protected $deepseekService;
+
+    public function __construct(
+        DeepSeekService $deepseekService
+    ) {
+        $this->deepseekService = $deepseekService;
+    }
+
+    /**
+     * 可选供应商
+     *
+     * @param Request $request
+     * @return mixed
+     */
+    public function chatWithReasoner(Request $request) {
+        $data = $request->all();
+        $result = $this->deepseekService->chatWithReasoner($data);
+        return $this->success($result);
+    }
+}

+ 38 - 0
app/Http/Controllers/Webhook/WebhookController.php

@@ -0,0 +1,38 @@
+<?php
+
+namespace App\Http\Controllers\Webhook;
+
+use App\Services\Webhook\WebhookService;
+use Illuminate\Http\Request;
+use Illuminate\Http\JsonResponse;
+use Illuminate\Routing\Controller as BaseController;
+
+class WebhookController extends BaseController
+{
+    private $webhookService;
+
+    public function __construct(
+        WebhookService $webhookService
+    )
+    {
+        $this->webhookService = $webhookService;
+    }
+
+    /**
+     * 抖音im回调
+     *
+     * @param Request $request
+     * @return JsonResponse
+     * @throws \GuzzleHttp\Exception\GuzzleException
+     */
+    public function douYinIm(Request $request)
+    {
+        $data = $request->all();
+        dLog('webhook')->info('douYinIm-params', $data);
+
+        // 根据event事件区分
+        $event  = trim(getProp($data, 'event'));
+        $result = $this->webhookService->handleDouYinEvent($event, $data);
+        return response()->json($result);
+    }
+}

+ 73 - 0
app/Http/Kernel.php

@@ -0,0 +1,73 @@
+<?php
+
+namespace App\Http;
+
+use Illuminate\Foundation\Http\Kernel as HttpKernel;
+
+class Kernel extends HttpKernel
+{
+    /**
+     * The application's global HTTP middleware stack.
+     *
+     * These middleware are run during every request to your application.
+     *
+     * @var array<int, class-string|string>
+     */
+    protected $middleware = [
+        // \App\Http\Middleware\TrustHosts::class,
+        \App\Http\Middleware\TrustProxies::class,
+        \Fruitcake\Cors\HandleCors::class,
+        \App\Http\Middleware\PreventRequestsDuringMaintenance::class,
+        \Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
+        \App\Http\Middleware\TrimStrings::class,
+        \Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
+    ];
+
+    /**
+     * The application's route middleware groups.
+     *
+     * @var array<string, array<int, class-string|string>>
+     */
+    protected $middlewareGroups = [
+        'web' => [
+            \App\Http\Middleware\EncryptCookies::class,
+            \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
+            \Illuminate\Session\Middleware\StartSession::class,
+            // \Illuminate\Session\Middleware\AuthenticateSession::class,
+            \Illuminate\View\Middleware\ShareErrorsFromSession::class,
+            \App\Http\Middleware\VerifyCsrfToken::class,
+            \Illuminate\Routing\Middleware\SubstituteBindings::class,
+        ],
+
+        'api' => [
+            // \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class,
+            'throttle:api',
+            \Illuminate\Routing\Middleware\SubstituteBindings::class,
+        ],
+    ];
+
+    /**
+     * The application's route middleware.
+     *
+     * These middleware may be assigned to groups or used individually.
+     *
+     * @var array<string, class-string|string>
+     */
+    protected $routeMiddleware = [
+        'auth'             => \App\Http\Middleware\Authenticate::class,
+        'auth.basic'       => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
+        'cache.headers'    => \Illuminate\Http\Middleware\SetCacheHeaders::class,
+        'can'              => \Illuminate\Auth\Middleware\Authorize::class,
+        'guest'            => \App\Http\Middleware\RedirectIfAuthenticated::class,
+        'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class,
+        'signed'           => \Illuminate\Routing\Middleware\ValidateSignature::class,
+        'throttle'         => \Illuminate\Routing\Middleware\ThrottleRequests::class,
+        'verified'         => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
+        'checkLogin'       => \App\Http\Middleware\CheckLogin::class,
+        'checkBook'        => \App\Http\Middleware\CheckBook::class,
+        'bindToken'        => \App\Http\Middleware\BindToken::class,
+        'bindExportToken'  => \App\Http\Middleware\BindExportToken::class,
+        'checkSign'        => \App\Http\Middleware\CheckSign::class,
+        'externalSignCheck' => \App\Http\Middleware\ExternalSignCheck::class,
+    ];
+}

+ 21 - 0
app/Http/Middleware/Authenticate.php

@@ -0,0 +1,21 @@
+<?php
+
+namespace App\Http\Middleware;
+
+use Illuminate\Auth\Middleware\Authenticate as Middleware;
+
+class Authenticate extends Middleware
+{
+    /**
+     * Get the path the user should be redirected to when they are not authenticated.
+     *
+     * @param  \Illuminate\Http\Request  $request
+     * @return string|null
+     */
+    protected function redirectTo($request)
+    {
+        if (! $request->expectsJson()) {
+            return route('login');
+        }
+    }
+}

+ 29 - 0
app/Http/Middleware/BindExportToken.php

@@ -0,0 +1,29 @@
+<?php
+
+
+namespace App\Http\Middleware;
+
+use Closure;
+use App\Exceptions\ApiException;
+
+class BindExportToken
+{
+    use CheckTokenTrait;
+
+    /**
+     * @param         $request
+     * @param Closure $next
+     * @return mixed
+     * @throws ApiException
+     */
+    public function handle($request, Closure $next)
+    {
+        // 接口中的token(如有则绑定token到全局)
+        $all       = $request->all();
+        $token     = getProp($all, 'd_token');
+        if ($token) {
+            $this->checkTokenTrait($token);
+        }
+        return $next($request);
+    }
+}

+ 28 - 0
app/Http/Middleware/BindToken.php

@@ -0,0 +1,28 @@
+<?php
+
+
+namespace App\Http\Middleware;
+
+use Closure;
+use App\Exceptions\ApiException;
+
+class BindToken
+{
+    use CheckTokenTrait;
+
+    /**
+     * @param         $request
+     * @param Closure $next
+     * @return mixed
+     * @throws ApiException
+     */
+    public function handle($request, Closure $next)
+    {
+        // 接口中的token(如有则绑定token到全局)
+        $token     = $request->header('d-token', '');
+        if ($token) {
+            $this->checkTokenTrait($token);
+        }
+        return $next($request);
+    }
+}

+ 92 - 0
app/Http/Middleware/CheckBook.php

@@ -0,0 +1,92 @@
+<?php
+
+
+namespace App\Http\Middleware;
+
+use App\Consts\ErrorConst;
+use App\Facade\Site;
+use App\Libs\Utils;
+use Closure;
+use App\Exceptions\ApiException;
+use Illuminate\Support\Facades\DB;
+use Illuminate\Support\Facades\Route;
+use Vinkla\Hashids\Facades\Hashids;
+
+class CheckBook
+{
+    /**
+     * @param         $request
+     * @param Closure $next
+     * @return mixed
+     * @throws ApiException
+     */
+    public function handle($request, Closure $next)
+    {
+        $params = $request->all();
+        $cid = getProp($params, 'cid');
+        $bid = getProp($params, 'bid');
+        if ($bid) {
+            if (mb_strlen($bid) === 32) {
+                $bid = Hashids::decode($bid)[0];
+                if (!$bid) {    // 无法解密的是数据异常
+                    Utils::throwError(ErrorConst::DATA_EXCEPTION);
+                }
+            }
+
+            $isOnShelf = (int)DB::table('book_configs')->where('bid', $bid)->value('is_on_shelf');
+            if (!in_array($isOnShelf, [1, 2])) {
+                Utils::throwError(ErrorConst::BOOK_NOT_EXIST);
+            }
+        }
+
+        if (!$cid) return $next($request);
+        if (mb_strlen($cid) === 32) {
+            $cid = Hashids::decode($cid)[0];
+            if (!$cid) {    // 无法解密的是数据异常
+                Utils::throwError(ErrorConst::DATA_EXCEPTION);
+            }
+        }
+
+        // 获取章节信息
+        $chapter_info = DB::table('chapters')->leftJoin('book_configs', 'chapters.bid', 'book_configs.bid')
+            ->whereIn('book_configs.is_on_shelf', [1, 2])->where('chapters.id', $cid)
+            ->select('chapters.is_vip', 'chapters.sequence')->first();
+        if (!$chapter_info) {
+            Utils::throwError(ErrorConst::DATA_EXCEPTION);
+        }
+
+        $uid = Site::getUid();
+
+        // 获取站点信息
+        $distribution_channel_id = Site::getChannelId();
+        $distribution_channel_info = DB::table('distribution_channels')->where('id', $distribution_channel_id)->first();
+        $channel_type = getProp($distribution_channel_info, 'channel_type');
+
+        switch ($channel_type) {
+            case 'PERIOD':      // 时间周期(会员制)
+                // 用户未登录不可看第10章以后的章节
+                if (!$uid && getProp($chapter_info, 'sequence') > 10) {
+                    Utils::throwError(ErrorConst::NOT_LOGIN);
+                }
+
+                // 验证收费章节是否可以阅读
+                if ($uid && getProp($chapter_info, 'is_vip')) {
+                    $vip_limit_date = DB::table('users')->where('id', $uid)->value('vip_limit_date');
+                    $vip_limit_date = transDate($vip_limit_date, 'Y-m-d');
+                    if (!$vip_limit_date || $vip_limit_date < date('Y-m-d')) {
+                        Utils::throwError(ErrorConst::VIP_VALID);
+                    }
+                }
+                break;
+            case 'FREE':        // 全免费
+                //TODO 全免费站点无需检验章节内容
+                break;
+            case 'RECHARGE':    // 充值
+                //TODO 预留逻辑(后续开发充值类型的章节判断)
+                break;
+            default:
+                break;
+        }
+        return $next($request);
+    }
+}

+ 28 - 0
app/Http/Middleware/CheckLogin.php

@@ -0,0 +1,28 @@
+<?php
+
+
+namespace App\Http\Middleware;
+
+use App\Cache\UserCache;
+use App\Consts\ErrorConst;
+use App\Facade\Site;
+use App\Libs\Utils;
+use Closure;
+use App\Exceptions\ApiException;
+
+class CheckLogin
+{
+    /**
+     * @param         $request
+     * @param Closure $next
+     * @return mixed
+     * @throws ApiException
+     */
+    public function handle($request, Closure $next)
+    {
+        $uid = Site::getUid();
+        if (!$uid)  Utils::throwError(ErrorConst::NOT_LOGIN);
+
+        return $next($request);
+    }
+}

+ 71 - 0
app/Http/Middleware/CheckSign.php

@@ -0,0 +1,71 @@
+<?php
+
+
+namespace App\Http\Middleware;
+
+use App\Cache\UserCache;
+use App\Consts\ErrorConst;
+use App\Libs\Utils;
+use App\Models\Channel\Channel;
+use Closure;
+use App\Exceptions\ApiException;
+use Illuminate\Support\Facades\Log;
+
+class CheckSign
+{
+    /**
+     * @param         $request
+     * @param Closure $next
+     * @return mixed
+     * @throws ApiException
+     */
+    public function handle($request, Closure $next)
+    {
+        $params = $request->all();
+        $token = $request->header('d-token', '');
+        $token_data = UserCache::getTokenData($token);
+        // 未登录跳过验签
+        if (!getProp($token_data, 'uid')) return $next($request);
+        $uid = getProp($token_data, 'uid');
+        // 老用户跳过验签
+        if ($uid <= 479) return $next($request);
+
+        $referer_url = '';
+        if (isset($params['_url'])) {
+            $referer_url = $params['_url'];
+            unset($params['_url']);
+        }
+        // 先验签(非本地模式需要验签)
+        if (env('CHECK_SIGN') && $params) {
+            $param_sign = getProp($params, 'sign');
+            $timestamp = getProp($params, 'timestamp');
+            if (!getProp($params, 'nonce_str') || !$timestamp) {
+                Log::info('验签失败, 请求参数不正确;传参: '.json_encode($params, 256));
+                Utils::throwError('1002:数据异常,请求参数不正确');
+            }
+            if (time() - $timestamp > 300) {
+                Log::info('验签失败, 签名5分钟内有效;传参: '.json_encode($params, 256));
+                Utils::throwError('1002:数据异常,请求参数不正确');
+            }
+
+            foreach ($params as $k=>$v) {
+                if (!$v) unset($params[$k]);
+            }
+
+            unset($params['sign']);
+            ksort($params);
+            $str = strtoupper(http_build_query($params));
+            $sign = md5($str.'&key='.env('SIGN_SALT'));
+            if ($param_sign != $sign) {
+                $params['_url'] = $referer_url;
+                $params['sign'] = $param_sign;
+                $params['check_sign'] = $sign;
+                $params['check_str'] = $str.'&key='.env('SIGN_SALT');
+                Log::info('验签失败, 签名不正确;传参: '.json_encode($params, 256));
+                Utils::throwError('1002:数据异常,请求参数不正确');
+            }
+        }
+
+        return $next($request);
+    }
+}

+ 30 - 0
app/Http/Middleware/CheckTokenTrait.php

@@ -0,0 +1,30 @@
+<?php
+
+namespace App\Http\Middleware;
+
+use App\Consts\ErrorConst;
+use App\Libs\Utils;
+use App\Models\Channel\Channel;
+use App\Models\Channel\ChannelUser;
+use Illuminate\Support\Facades\DB;
+
+trait CheckTokenTrait
+{
+    public function checkTokenTrait($token)
+    {
+        // 获取用户信息
+        $user = DB::table('bd_manage_users')->where('token', $token)->first();
+        $uid  = (int)getProp($user, 'id');
+        if (!$uid) {
+            Utils::throwError(ErrorConst::NOT_LOGIN);
+        }
+
+        // 将数据绑定到全局
+        $site           = app('siteData');
+        $site->uid      = $uid;
+        $site->role     = getProp($user, 'role');
+        $site->mobile    = getProp($user, 'mobile');
+        $site->nickname = getProp($user, 'nickname');
+        $site->token    = $token;
+    }
+}

+ 17 - 0
app/Http/Middleware/EncryptCookies.php

@@ -0,0 +1,17 @@
+<?php
+
+namespace App\Http\Middleware;
+
+use Illuminate\Cookie\Middleware\EncryptCookies as Middleware;
+
+class EncryptCookies extends Middleware
+{
+    /**
+     * The names of the cookies that should not be encrypted.
+     *
+     * @var array<int, string>
+     */
+    protected $except = [
+        //
+    ];
+}

+ 62 - 0
app/Http/Middleware/ExternalSignCheck.php

@@ -0,0 +1,62 @@
+<?php
+/**
+ * Created by PhpStorm.
+ * User: hardyx
+ * Date: 2019/8/29
+ * Time: 10:52
+ */
+
+
+namespace App\Http\Middleware;
+
+
+use App\Libs\Utils;
+use Closure;
+use Illuminate\Support\Facades\DB;
+
+class ExternalSignCheck
+{
+    /**
+     * 外部通用 判断签名是否正确.
+     */
+    public function handle($request, Closure $next)
+    {
+        $data = $request->all();
+        \Log::info('对外API入参: '.json_encode($data, 256));
+        $appid = getProp($data, 'appid', '');
+        $company = DB::table('companies')->where('appid', $appid)->where('is_enable', 1)->first();
+        if (!$company) {
+            Utils::throwError('1001: 您的appid不合法!');
+        }
+        $timestamp  = getProp($data, 'timestamp', time());
+        $sign = getProp($data, 'sign', '');
+        $app_token = getProp($company, 'app_token');
+
+        $params = [
+            'appid'         => $appid,
+            'timestamp'     => $timestamp,
+        ];
+        ksort($params);
+        $str = strtolower(http_build_query($params));
+        $checkSign = md5($str.'&key='.$app_token);
+        \Log::info('ExternalSignCheck: str: '.$str.'; checkSign: '. $checkSign .'; paramSign: '.$sign);
+
+        if ($checkSign != $sign) {
+            Utils::throwError('1002: 您的签名不正确!');
+        }
+
+        $company_id = getProp($company, 'id');
+        $distribution_channel_ids = DB::table('channel_users as cu')->leftJoin('distribution_channels as dc', 'dc.channel_user_id', 'cu.id')
+            ->where('cu.company_id', $company_id)->where('cu.is_enabled', 1)->select('dc.id')->get()->pluck('id')->toArray();
+
+        // 将数据绑定到全局
+        $site                       = app('siteData');
+        $site->appid                = $appid;
+        $site->app_token            = getProp($company, 'app_token');
+        $site->company_name         = getProp($company, 'name');
+        $site->company_id           = $company_id;
+        $site->channel_id           = $distribution_channel_ids;
+
+        return $next($request);
+    }
+}

+ 17 - 0
app/Http/Middleware/PreventRequestsDuringMaintenance.php

@@ -0,0 +1,17 @@
+<?php
+
+namespace App\Http\Middleware;
+
+use Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance as Middleware;
+
+class PreventRequestsDuringMaintenance extends Middleware
+{
+    /**
+     * The URIs that should be reachable while maintenance mode is enabled.
+     *
+     * @var array<int, string>
+     */
+    protected $except = [
+        //
+    ];
+}

+ 32 - 0
app/Http/Middleware/RedirectIfAuthenticated.php

@@ -0,0 +1,32 @@
+<?php
+
+namespace App\Http\Middleware;
+
+use App\Providers\RouteServiceProvider;
+use Closure;
+use Illuminate\Http\Request;
+use Illuminate\Support\Facades\Auth;
+
+class RedirectIfAuthenticated
+{
+    /**
+     * Handle an incoming request.
+     *
+     * @param  \Illuminate\Http\Request  $request
+     * @param  \Closure(\Illuminate\Http\Request): (\Illuminate\Http\Response|\Illuminate\Http\RedirectResponse)  $next
+     * @param  string|null  ...$guards
+     * @return \Illuminate\Http\Response|\Illuminate\Http\RedirectResponse
+     */
+    public function handle(Request $request, Closure $next, ...$guards)
+    {
+        $guards = empty($guards) ? [null] : $guards;
+
+        foreach ($guards as $guard) {
+            if (Auth::guard($guard)->check()) {
+                return redirect(RouteServiceProvider::HOME);
+            }
+        }
+
+        return $next($request);
+    }
+}

+ 19 - 0
app/Http/Middleware/TrimStrings.php

@@ -0,0 +1,19 @@
+<?php
+
+namespace App\Http\Middleware;
+
+use Illuminate\Foundation\Http\Middleware\TrimStrings as Middleware;
+
+class TrimStrings extends Middleware
+{
+    /**
+     * The names of the attributes that should not be trimmed.
+     *
+     * @var array<int, string>
+     */
+    protected $except = [
+        'current_password',
+        'password',
+        'password_confirmation',
+    ];
+}

+ 20 - 0
app/Http/Middleware/TrustHosts.php

@@ -0,0 +1,20 @@
+<?php
+
+namespace App\Http\Middleware;
+
+use Illuminate\Http\Middleware\TrustHosts as Middleware;
+
+class TrustHosts extends Middleware
+{
+    /**
+     * Get the host patterns that should be trusted.
+     *
+     * @return array<int, string|null>
+     */
+    public function hosts()
+    {
+        return [
+            $this->allSubdomainsOfApplicationUrl(),
+        ];
+    }
+}

+ 28 - 0
app/Http/Middleware/TrustProxies.php

@@ -0,0 +1,28 @@
+<?php
+
+namespace App\Http\Middleware;
+
+use Illuminate\Http\Middleware\TrustProxies as Middleware;
+use Illuminate\Http\Request;
+
+class TrustProxies extends Middleware
+{
+    /**
+     * The trusted proxies for this application.
+     *
+     * @var array<int, string>|string|null
+     */
+    protected $proxies;
+
+    /**
+     * The headers that should be used to detect proxies.
+     *
+     * @var int
+     */
+    protected $headers =
+        Request::HEADER_X_FORWARDED_FOR |
+        Request::HEADER_X_FORWARDED_HOST |
+        Request::HEADER_X_FORWARDED_PORT |
+        Request::HEADER_X_FORWARDED_PROTO |
+        Request::HEADER_X_FORWARDED_AWS_ELB;
+}

+ 17 - 0
app/Http/Middleware/VerifyCsrfToken.php

@@ -0,0 +1,17 @@
+<?php
+
+namespace App\Http\Middleware;
+
+use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as Middleware;
+
+class VerifyCsrfToken extends Middleware
+{
+    /**
+     * The URIs that should be excluded from CSRF verification.
+     *
+     * @var array<int, string>
+     */
+    protected $except = [
+        //
+    ];
+}

+ 41 - 0
app/Libs/AliOSS.php

@@ -0,0 +1,41 @@
+<?php
+/**
+ * Created by PhpStorm.
+ * User: tandunzhao
+ * Date: 2018/1/19
+ * Time: 下午12:58
+ */
+
+namespace App\Libs;
+
+use Illuminate\Support\Facades\Log;
+use OSS\Core\OssException;
+use OSS\OssClient;
+
+class AliOSS
+{
+
+    public static function uploadImg($ossPath, $filePath)
+    {
+        $ossImgBackData = self::ossObject()->uploadFile(env('OSS_BUCKET', 'zhuishuyun'), $ossPath, $filePath);
+        return $ossImgBackData['oss-request-url'];
+    }
+
+
+    /**
+     * OSS文件操作
+     */
+    public static function ossObject()
+    {
+        $accessKeyId     = env('OSS_ACCESS_ID');
+        $accessKeySecret = env('OSS_ACCESS_KEY');
+        $endpoint        = env('OSS_END_POINT');
+        try {
+            $ossClient = new OssClient($accessKeyId, $accessKeySecret, $endpoint);
+        } catch (OssException $e) {
+            Log::error($e->getMessage() . "      " . date("y-m-d H:i:s" . "\n"));
+            return null;
+        }
+        return $ossClient;
+    }
+}

+ 86 - 0
app/Libs/AliSMS.php

@@ -0,0 +1,86 @@
+<?php
+
+namespace App\Libs;
+
+use Exception;
+use AlibabaCloud\SDK\Dysmsapi\V20170525\Dysmsapi;
+use Darabonba\OpenApi\Models\Config;
+use AlibabaCloud\SDK\Dysmsapi\V20170525\Models\SendSmsRequest;
+use AlibabaCloud\Tea\Utils\Utils\RuntimeOptions;
+use AlibabaCloud\SDK\Dysmsapi\V20170525\Models\QuerySmsTemplateListRequest;
+use AlibabaCloud\SDK\Dysmsapi\V20170525\Models\SendSmsResponse;
+use AlibabaCloud\SDK\Dysmsapi\V20170525\Models\QuerySmsTemplateListResponse;
+
+
+class AliSMS
+{
+
+    /**
+     * 使用AK&SK初始化账号Client
+     *
+     * @return Dysmsapi Client
+     */
+    public static function createClient(): Dysmsapi
+    {
+        $config = new Config([
+            // 必填,您的 AccessKey ID
+            "accessKeyId"     => env('SMS_AccessKeyId'),
+            // 必填,您的 AccessKey Secret
+            "accessKeySecret" => env('SMS_AccessKeySecret')
+        ]);
+
+        // Endpoint 请参考 https://api.aliyun.com/product/Dysmsapi
+        $config->endpoint = "dysmsapi.aliyuncs.com";
+        return new Dysmsapi($config);
+    }
+
+    /**
+     * 发送短信
+     * https://next.api.aliyun.com/api/Dysmsapi/2017-05-25/SendSms
+     *
+     * @param $phone
+     * @param $templateCode
+     * @param $param
+     * @param $sign
+     * @return SendSmsResponse|void
+     */
+    public static function sendSms($phone, $templateCode, $param, $sign)
+    {
+        $client = self::createClient();
+
+        // 组装请求参数
+        $sendSmsRequest                = new SendSmsRequest([]);
+        $sendSmsRequest->phoneNumbers  = $phone;
+        $sendSmsRequest->templateCode  = $templateCode;
+        $sendSmsRequest->templateParam = json_encode($param, JSON_UNESCAPED_UNICODE);
+        $sendSmsRequest->signName      = $sign;
+
+        $runtime = new RuntimeOptions([]);
+
+        try {
+            // 复制代码运行请自行打印 API 的返回值
+            return $client->sendSmsWithOptions($sendSmsRequest, $runtime);
+        } catch (Exception $error) {
+            dLog('exception')->info('sendSms', [$error->getMessage(), $error->getCode()]);
+        }
+    }
+
+    /**
+     * 查询短信模板
+     * https://next.api.aliyun.com/api/Dysmsapi/2017-05-25/QuerySmsTemplateList
+     *
+     * @return QuerySmsTemplateListResponse|void
+     */
+    public static function querySmsTemplateList()
+    {
+        $client                      = self::createClient();
+        $querySmsTemplateListRequest = new QuerySmsTemplateListRequest([]);
+        $runtime                     = new RuntimeOptions([]);
+        try {
+            // 复制代码运行请自行打印 API 的返回值
+            return $client->querySmsTemplateListWithOptions($querySmsTemplateListRequest, $runtime);
+        } catch (Exception $error) {
+            dLog('exception')->info('querySmsTemplateList', [$error->getMessage(), $error->getCode()]);
+        }
+    }
+}

+ 185 - 0
app/Libs/ApiResponse.php

@@ -0,0 +1,185 @@
+<?php
+
+
+namespace App\Libs;
+
+use Symfony\Component\HttpFoundation\Response as FoundationResponse;
+use Response;
+
+trait ApiResponse
+{
+    /**
+     * @var int
+     */
+    protected $statusCode = FoundationResponse::HTTP_OK;
+
+    /**
+     * @return mixed
+     */
+    public function getStatusCode()
+    {
+        return $this->statusCode;
+    }
+
+    /**
+     * @param $statusCode
+     * @return $this
+     */
+    public function setStatusCode($statusCode, $httpCode = null)
+    {
+        $httpCode         = $httpCode ?? $statusCode;
+        $this->statusCode = $statusCode;
+        return $this;
+    }
+
+    /**
+     * @param       $data
+     * @param array $header
+     * @return mixed
+     */
+    public function respond($data, $header = [])
+    {
+        return Response::json($data, $this->getStatusCode(), $header, JSON_UNESCAPED_UNICODE);
+    }
+
+    /**
+     * @param       $status
+     * @param array $data
+     * @param null  $code
+     * @return mixed
+     */
+    public function status($status, $data, $code = null)
+    {
+        if ($code) {
+            $this->setStatusCode($code);
+        }
+        $res = [
+            'msg'  => $status,
+            'code' => 0,
+            'data' => $data
+        ];
+
+        return $this->respond($res);
+    }
+
+    /**
+     * @param        $message
+     * @param int    $code
+     * @param string $status
+     * @return mixed
+     */
+    /*
+     * 格式
+     * data:
+     *  code:422
+     *  message:xxx
+     *  status:'error'
+     */
+    public function failed($message, $code = FoundationResponse::HTTP_BAD_REQUEST, $status = 'error')
+    {
+
+        return $this->setStatusCode($code)->message($message, $status);
+    }
+
+    /**
+     * @param        $message
+     * @param string $status
+     * @return mixed
+     */
+    public function message($message, $status = 'success')
+    {
+
+        return $this->status($status, [
+            'message' => $message
+        ]);
+    }
+
+    /**
+     * @param string $message
+     * @return mixed
+     */
+    public function internalError($message = 'Internal Error!')
+    {
+
+        return $this->failed($message, FoundationResponse::HTTP_INTERNAL_SERVER_ERROR);
+    }
+
+    /**
+     * @param string $message
+     * @return mixed
+     */
+    public function created($message = 'created')
+    {
+        return $this->setStatusCode(FoundationResponse::HTTP_CREATED)
+            ->message($message);
+
+    }
+
+    /**
+     * @param $data
+     * @param $callFunc
+     * @return mixed
+     */
+    public function success($data, $callFunc = [])
+    {
+        if ($callFunc) {
+            return $this->status('', call_user_func($callFunc, $data));
+        }
+
+        return $this->status('', $data);
+    }
+
+    /**
+     * @param $data
+     * @param $callFunc
+     * @return mixed
+     */
+    public function paginate($data, $callFunc = [])
+    {
+        $result = [
+            'meta' => getMeta($data),
+            'list' => $data->items()
+        ];
+
+        if ($callFunc) {
+            $result['list'] = call_user_func($callFunc, $data->items());
+        }
+
+        return $this->status('', $result);
+    }
+
+    /**
+     * @param $errorData
+     * @param $data
+     * @return mixed
+     */
+    public function error($errorData, $data = '')
+    {
+        // 分解错误码、错误信息
+        $arr  = explode(':', (string)$errorData);
+        $code = (int)$arr[0];
+        $msg  = (string)$arr[1];
+
+        $res = [
+            'msg'  => $msg,
+            'code' => $code,
+            'data' => $data
+        ];
+
+        return $this->respond($res);
+    }
+
+    public function appResponse($res)
+    {
+        return $this->respond($res);
+    }
+
+    /**
+     * @param string $message
+     * @return mixed
+     */
+    public function notFond($message = 'Not Fond!')
+    {
+        return $this->failed($message, Foundationresponse::HTTP_NOT_FOUND);
+    }
+}

+ 60 - 0
app/Libs/BatchUpdateTrait.php

@@ -0,0 +1,60 @@
+<?php
+
+namespace App\Libs;
+
+use Illuminate\Support\Facades\DB;
+
+trait BatchUpdateTrait
+{
+    /**
+     * @param string $table
+     * @param array  $list_data
+     * @param string  $index
+     * @param int    $chunk_size
+     *
+     * @return int
+     */
+    public function batchUpdateDb(string $table, array $list_data, string $index = 'id', int $chunk_size = 500): int
+    {
+        if (count($list_data) < 1 || $chunk_size < 1) {
+            return 0;
+        }
+
+        $chunk_list = array_chunk($list_data, $chunk_size);
+        $count = 0;
+        foreach ($chunk_list as $list_item) {
+            $first_row = current($list_item);
+            $update_col = array_keys($first_row);
+            // 默认以id为条件更新,如果没有ID则以第一个字段为条件
+            $reference_col = isset($first_row[$index]) ? $index : current($update_col);
+            unset($update_col[0]);
+            // 拼接sql语句
+            $update_sql = 'UPDATE ' . $table . ' SET ';
+            $sets = [];
+            $bindings = [];
+            foreach ($update_col as $u_col) {
+                $set_sql = '`' . $u_col . '` = CASE ';
+                foreach ($list_item as $item) {
+                    $set_sql .= 'WHEN `' . $reference_col . '` = ? THEN ';
+                    $bindings[] = $item[$reference_col];
+                    if ($item[$u_col] instanceof \Illuminate\Database\Query\Expression) {
+                        $set_sql .= $item[$u_col]->getValue() . ' ';
+                    } else {
+                        $set_sql .= '? ';
+                        $bindings[] = $item[$u_col];
+                    }
+                }
+                $set_sql .= 'ELSE `' . $u_col . '` END ';
+                $sets[] = $set_sql;
+            }
+            $update_sql .= implode(', ', $sets);
+            $where_in = collect($list_item)->pluck($reference_col)->values()->all();
+            $bindings = array_merge($bindings, $where_in);
+            $where_in = rtrim(str_repeat('?,', count($where_in)), ',');
+            $update_sql = rtrim($update_sql, ', ') . ' WHERE `' . $reference_col . '` IN (' . $where_in . ')';
+            //
+            $count += DB::update($update_sql, $bindings);
+        }
+        return $count;
+    }
+}

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 1707 - 0
app/Libs/Helpers.php


+ 195 - 0
app/Libs/OSS.php

@@ -0,0 +1,195 @@
+<?php
+
+namespace App\Libs;
+
+use DateTime;
+use Exception;
+use JohnLui\AliyunOSS;
+
+class OSS
+{
+
+    /* 城市名称:
+     *
+     *  经典网络下可选:杭州、上海、青岛、北京、张家口、深圳、香港、硅谷、弗吉尼亚、新加坡、悉尼、日本、法兰克福、迪拜
+     *  VPC 网络下可选:杭州、上海、青岛、北京、张家口、深圳、硅谷、弗吉尼亚、新加坡、悉尼、日本、法兰克福、迪拜
+     */
+    private $city = '杭州';
+
+    // 经典网络 or VPC
+    private $networkType = '经典网络';
+
+    private $AccessKeyId     = 'LTAI975hEK1kFkQb';
+    private $AccessKeySecret = 'hdnZFm8roqdCaZNovc4Ygbt4G7dBqt';
+
+
+    private $ossClient;
+
+    /**
+     * 私有初始化 API,非 API,不用关注
+     *
+     * @param boolean 是否使用内网
+     */
+    public function __construct($isInternal = false)
+    {
+        if ($this->networkType == 'VPC' && !$isInternal) {
+            throw new Exception("VPC 网络下不提供外网上传、下载等功能");
+        }
+        $this->ossClient = AliyunOSS::boot(
+            $this->city,
+            $this->networkType,
+            $isInternal,
+            $this->AccessKeyId,
+            $this->AccessKeySecret
+        );
+    }
+
+
+    /**
+     * 使用外网上传文件
+     *
+     * @param string bucket名称
+     * @param string 上传之后的 OSS object 名称
+     * @param string 上传文件路径
+     * @return boolean 上传是否成功
+     */
+    public static function publicUpload($bucketName, $ossKey, $filePath, $options = [])
+    {
+        $oss = new OSS();
+        $oss->ossClient->setBucket($bucketName);
+        return $oss->ossClient->uploadFile($ossKey, $filePath, $options);
+    }
+
+    /**
+     * 使用阿里云内网上传文件
+     *
+     * @param string bucket名称
+     * @param string 上传之后的 OSS object 名称
+     * @param string 上传文件路径
+     * @return boolean 上传是否成功
+     */
+    public static function privateUpload($bucketName, $ossKey, $filePath, $options = [])
+    {
+        $oss = new OSS(true);
+        $oss->ossClient->setBucket($bucketName);
+        return $oss->ossClient->uploadFile($ossKey, $filePath, $options);
+    }
+
+
+    /**
+     * 使用外网直接上传变量内容
+     *
+     * @param string bucket名称
+     * @param string 上传之后的 OSS object 名称
+     * @param string 上传的变量
+     * @return boolean 上传是否成功
+     */
+    public static function publicUploadContent($bucketName, $ossKey, $content, $options = [])
+    {
+        $oss = new OSS();
+        $oss->ossClient->setBucket($bucketName);
+        return $oss->ossClient->uploadContent($ossKey, $content, $options);
+    }
+
+    /**
+     * 使用阿里云内网直接上传变量内容
+     *
+     * @param string bucket名称
+     * @param string 上传之后的 OSS object 名称
+     * @param string 上传的变量
+     * @return boolean 上传是否成功
+     */
+    public static function privateUploadContent($bucketName, $ossKey, $content, $options = [])
+    {
+        $oss = new OSS(true);
+        $oss->ossClient->setBucket($bucketName);
+        return $oss->ossClient->uploadContent($ossKey, $content, $options);
+    }
+
+
+    /**
+     * 使用外网删除文件
+     *
+     * @param string bucket名称
+     * @param string 目标 OSS object 名称
+     * @return boolean 删除是否成功
+     */
+    public static function publicDeleteObject($bucketName, $ossKey)
+    {
+        $oss = new OSS();
+        $oss->ossClient->setBucket($bucketName);
+        return $oss->ossClient->deleteObject($bucketName, $ossKey);
+    }
+
+    /**
+     * 使用阿里云内网删除文件
+     *
+     * @param string bucket名称
+     * @param string 目标 OSS object 名称
+     * @return boolean 删除是否成功
+     */
+    public static function privateDeleteObject($bucketName, $ossKey)
+    {
+        $oss = new OSS(true);
+        $oss->ossClient->setBucket($bucketName);
+        return $oss->ossClient->deleteObject($bucketName, $ossKey);
+    }
+
+
+    /**
+     * -------------------------------------------------
+     *
+     *
+     *  下面不再分公网内网出 API,也不注释了,大家自行体会吧。。。
+     *
+     *
+     * -------------------------------------------------
+     */
+
+    public function copyObject($sourceBuckt, $sourceKey, $destBucket, $destKey)
+    {
+        $oss = new OSS();
+        return $oss->ossClient->copyObject($sourceBuckt, $sourceKey, $destBucket, $destKey);
+    }
+
+    public function moveObject($sourceBuckt, $sourceKey, $destBucket, $destKey)
+    {
+        $oss = new OSS();
+        return $oss->ossClient->moveObject($sourceBuckt, $sourceKey, $destBucket, $destKey);
+    }
+
+    // 获取公开文件的 URL
+    public static function getPublicObjectURL($bucketName, $ossKey)
+    {
+        $oss = new OSS();
+        $oss->ossClient->setBucket($bucketName);
+        return $oss->ossClient->getPublicUrl($ossKey);
+    }
+
+    // 获取私有文件的URL,并设定过期时间,如 \DateTime('+1 day')
+    public static function getPrivateObjectURLWithExpireTime($bucketName, $ossKey, DateTime $expire_time)
+    {
+        $oss = new OSS();
+        $oss->ossClient->setBucket($bucketName);
+        return $oss->ossClient->getUrl($ossKey, $expire_time);
+    }
+
+    public static function createBucket($bucketName)
+    {
+        $oss = new OSS();
+        return $oss->ossClient->createBucket($bucketName);
+    }
+
+    public static function getAllObjectKey($bucketName)
+    {
+        $oss = new OSS();
+        return $oss->ossClient->getAllObjectKey($bucketName);
+    }
+
+    public static function getObjectMeta($bucketName, $ossKey)
+    {
+        $oss = new OSS();
+        return $oss->ossClient->getObjectMeta($bucketName, $ossKey);
+    }
+
+}

+ 183 - 0
app/Libs/Pays/AliPaySdk/aop/AlipayConfig.php

@@ -0,0 +1,183 @@
+
+<?php
+class AlipayConfig {
+    /**
+     * 网关地址
+     * 线上:https://openapi.alipay.com/gateway.do 
+     * 沙箱:https://openapi.alipaydev.com/gateway.do
+     */
+    private $serverUrl;
+
+    /**
+     * 开放平台上创建的应用的ID
+     */
+    private $appId;
+
+    /**
+     * 报文格式,推荐:json
+     */
+    private $format = "json";
+
+    /**
+     * 字符串编码,推荐:utf-8
+     */
+    private $charset = "utf-8";
+
+    /**
+     * 签名算法类型,推荐:RSA2
+     */
+    private $signType = "RSA2";
+
+    /**
+     * 商户私钥
+     */
+    private $privateKey;
+
+    /**
+     * 支付宝公钥字符串(公钥模式下设置,证书模式下无需设置)
+     */
+    private $alipayPublicKey;
+
+    /**
+     * 商户应用公钥证书路径(证书模式下设置,公钥模式下无需设置)
+     */
+    private $appCertPath;
+
+    /**
+     * 支付宝公钥证书路径(证书模式下设置,公钥模式下无需设置)
+     */
+    private $alipayPublicCertPath;
+
+    /**
+     * 支付宝根证书路径(证书模式下设置,公钥模式下无需设置)
+     */
+    private $rootCertPath;
+
+    /**
+     * 指定商户公钥应用证书内容字符串,该字段与appCertPath只需指定一个,优先以该字段的值为准(证书模式下设置,公钥模式下无需设置)
+     */
+    private $appCertContent;
+
+    /**
+     * 指定支付宝公钥证书内容字符串,该字段与alipayPublicCertPath只需指定一个,优先以该字段的值为准(证书模式下设置,公钥模式下无需设置)
+     */
+    private $alipayPublicCertContent;
+
+    /**
+     * 指定根证书内容字符串,该字段与rootCertPath只需指定一个,优先以该字段的值为准(证书模式下设置,公钥模式下无需设置)
+     */
+    private $rootCertContent;
+
+    /**
+     * 敏感信息对称加密算法类型,推荐:AES
+     */
+    private $encryptType = "AES";
+
+    /**
+     * 敏感信息对称加密算法密钥
+     */
+    private $encryptKey;
+
+
+    public function getServerUrl() {
+        return $this->serverUrl;
+    }
+
+    public function setServerUrl($serverUrl) {
+        $this->serverUrl = $serverUrl;
+    }
+    public function getAppId(){
+        return $this->appId;
+    }
+    public function setAppId($appId){
+        $this->appId = $appId;
+    }
+    public function getFormat(){
+        return $this->format;
+    }
+    public function setFormat($format){
+        $this->format = $format;
+    }
+    public function getCharset() {
+        return $this->charset;
+    }
+
+    public function setCharset($charset) {
+        $this->charset = $charset;
+    }
+
+    public function getSignType() {
+        return $this->signType;
+    }
+
+    public function setSignType($signType) {
+        $this->signType = $signType;
+    }
+    public function getEncryptKey() {
+        return $this->encryptKey;
+    }
+
+    public function setEncryptKey($encryptKey) {
+       $this->encryptKey = $encryptKey;
+    }
+    public function getEncryptType() {
+        return $this->encryptType;
+    }
+    public function setEncryptType($encryptType) {
+        $this->encryptType = $encryptType;
+    }
+    public function getPrivateKey() {
+        return $this->privateKey;
+    }
+
+    public function setPrivateKey($privateKey) {
+        $this->privateKey = $privateKey;
+    }
+    public function getAlipayPublicKey() {
+        return $this->alipayPublicKey;
+    }
+    public function setAlipayPublicKey($alipayPublicKey) {
+        $this->alipayPublicKey = $alipayPublicKey;
+    }
+    public function getAppCertPath() {
+        return $this->appCertPath;
+    }
+
+    public function setAppCertPath($appCertPath) {
+        $this->appCertPath = $appCertPath;
+    }
+
+    public function getAlipayPublicCertPath() {
+        return $this->alipayPublicCertPath;
+    }
+    public function setAlipayPublicCertPath($alipayPublicCertPath) {
+        $this->alipayPublicCertPath = $alipayPublicCertPath;
+    }
+
+    public function getRootCertPath() {
+        return $this->rootCertPath;
+    }
+    public function setRootCertPath($rootCertPath) {
+        $this->rootCertPath = $rootCertPath;
+    }
+    public function getAppCertContent() {
+        return $this->appCertContent;
+    }
+    public function setAppCertContent($appCertContent) {
+        $this->appCertContent = $appCertContent;
+    }
+    public function getAlipayPublicCertContent() {
+        return $this->alipayPublicCertContent;
+    }
+    public function setAlipayPublicCertContent($alipayPublicCertContent) {
+        $this->alipayPublicCertContent = $alipayPublicCertContent;
+    }
+    public function getRootCertContent() {
+        return $this->rootCertContent;
+    }
+
+    public function setRootCertContent($rootCertContent) {
+        $this->rootCertContent = $rootCertContent;
+    }
+ 
+}

+ 188 - 0
app/Libs/Pays/AliPaySdk/aop/AlipayMobilePublicMultiMediaClient.php

@@ -0,0 +1,188 @@
+<?php
+
+/**
+ * 多媒体文件客户端
+ * @author yikai.hu
+ * @version $Id: AlipayMobilePublicMultiMediaClient.php, v 0.1 Aug 15, 2014 10:19:01 AM yikai.hu Exp $
+ */
+
+include("AlipayMobilePublicMultiMediaExecute.php");
+
+class AlipayMobilePublicMultiMediaClient
+{
+    private $DEFAULT_CHARSET = 'UTF-8';
+    private $METHOD_POST = "POST";
+    private $METHOD_GET = "GET";
+    private $SIGN = 'sign'; //get name
+
+    private $timeout = 10;// 超时时间
+    private $serverUrl;
+    private $appId;
+    private $privateKey;
+    private $prodCode;
+    private $format = 'json'; //todo
+    private $sign_type = 'RSA'; //todo
+
+    private $charset;
+    private $apiVersion = "1.0";
+    private $apiMethodName = "alipay.mobile.public.multimedia.download";
+    private $media_id = "L21pZnMvVDFQV3hYWGJKWFhYYUNucHJYP3Q9YW13ZiZ4c2lnPTU0MzRhYjg1ZTZjNWJmZTMxZGJiNjIzNDdjMzFkNzkw575";
+    //此处写死的,实际开发中,请传入
+
+    private $connectTimeout = 3000;
+    private $readTimeout = 15000;
+
+    function __construct($serverUrl = '', $appId = '', $partner_private_key = '', $format = '', $charset = 'GBK')
+    {
+        $this->serverUrl = $serverUrl;
+        $this->appId = $appId;
+        $this->privateKey = $partner_private_key;
+        $this->format = $format;
+        $this->charset = $charset;
+    }
+
+    /**
+     * getContents 获取网址内容
+     * @param $request
+     * @return text | bin
+     */
+    public function getContents()
+    {
+        $datas = array(
+            "app_id" => $this->appId,
+            "method" => $this->METHOD_POST,
+            "sign_type" => $this->sign_type,
+            "version" => $this->apiVersion,
+            "timestamp" => date('Y-m-d H:i:s'),//yyyy-MM-dd HH:mm:ss
+            "biz_content" => '{"mediaId":"' . $this->media_id . '"}',
+            "charset" => $this->charset
+        );
+
+        //要提交的数据
+        $data_sign = $this->buildGetUrl($datas);
+
+        $post_data = $data_sign;
+        //初始化 curl
+        $ch = curl_init();
+        //设置目标服务器
+        curl_setopt($ch, CURLOPT_URL, $this->serverUrl);
+        curl_setopt($ch, CURLOPT_HEADER, TRUE);
+        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
+        //超时时间
+        curl_setopt($ch, CURLOPT_TIMEOUT, $this->timeout);
+
+        if ($this->METHOD_POST == 'POST') {
+            // post数据
+            curl_setopt($ch, CURLOPT_POST, 1);
+            // post的变量
+            curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
+        }
+
+
+        $output = curl_exec($ch);
+        $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
+        curl_close($ch);
+
+        echo $output;
+
+        $datas = explode("\r\n\r\n", $output, 2);
+        $header = $datas[0];
+
+        if ($httpCode == '200') {
+            $body = $datas[1];
+        } else {
+            $body = '';
+
+        }
+
+        return $this->execute($header, $body, $httpCode);
+    }
+
+    /**
+     *
+     * @param $request
+     * @return text | bin
+     */
+    public function execute($header = '', $body = '', $httpCode = '')
+    {
+        $exe = new AlipayMobilePublicMultiMediaExecute($header, $body, $httpCode);
+        return $exe;
+    }
+
+    public function buildGetUrl($query = array())
+    {
+        if (!is_array($query)) {
+            //exit;
+        }
+        //排序参数,
+        $data = $this->buildQuery($query);
+
+        // 私钥密码
+        $passphrase = '';
+        $key_width = 64;
+
+        //私钥
+        $privateKey = $this->privateKey;
+        $p_key = array();
+        //如果私钥是 1行
+        if (!stripos($privateKey, "\n")) {
+            $i = 0;
+            while ($key_str = substr($privateKey, $i * $key_width, $key_width)) {
+                $p_key[] = $key_str;
+                $i++;
+            }
+        } else {
+            //echo '一行?';
+        }
+        $privateKey = "-----BEGIN RSA PRIVATE KEY-----\n" . implode("\n", $p_key);
+        $privateKey = $privateKey . "\n-----END RSA PRIVATE KEY-----";
+
+        //私钥
+        $private_id = openssl_pkey_get_private($privateKey, $passphrase);
+
+        // 签名
+        $signature = '';
+
+        if ("RSA2" == $this->sign_type) {
+
+            openssl_sign($data, $signature, $private_id, OPENSSL_ALGO_SHA256);
+        } else {
+
+            openssl_sign($data, $signature, $private_id, OPENSSL_ALGO_SHA1);
+        }
+
+        openssl_free_key($private_id);
+
+        //加密后的内容通常含有特殊字符,需要编码转换下
+        $signature = base64_encode($signature);
+
+        $signature = urlencode($signature);
+
+        //$signature = 'XjUN6YM1Mc9HXebKMv7GTLy7gmyhktyOgKk2/Jf+cz4DtP6udkzTdpkjW2j/Z4ZSD7xD6CNYI1Spz4yS93HPT0a5X9LgFWYY8SaADqe+ArXg+FBSiTwUz49SE//Xd9+LEiIRsSFkbpkuiGoO6mqJmB7vXjlD5lx6qCM3nb41wb8=';
+
+        $out = $data . '&' . $this->SIGN . '=' . $signature;
+
+        return $out;
+    }
+
+    /*
+     * 查询参数排序 a-z
+     * */
+    public function buildQuery($query)
+    {
+        if (!$query) {
+            return null;
+        }
+        //将要 参数 排序
+        ksort($query);
+
+        //重新组装参数
+        $params = array();
+        foreach ($query as $key => $value) {
+            $params[] = $key . '=' . $value;
+        }
+        $data = implode('&', $params);
+        return $data;
+    }
+
+}

+ 115 - 0
app/Libs/Pays/AliPaySdk/aop/AlipayMobilePublicMultiMediaExecute.php

@@ -0,0 +1,115 @@
+<?php
+
+/**
+ * 多媒体文件客户端
+ * @author yuanwai.wang
+ * @version $Id: AlipayMobilePublicMultiMediaExecute.php, v 0.1 Aug 15, 2014 10:19:01 AM yuanwai.wang Exp $
+ */
+
+//namespace alipay\api ;
+
+
+class AlipayMobilePublicMultiMediaExecute
+{
+
+    private $code = 200;
+    private $msg = '';
+    private $body = '';
+    private $params = '';
+
+    private $fileSuffix = array(
+        "image/jpeg" => 'jpg', //+
+        "text/plain" => 'text'
+    );
+
+    /*
+     * @$header : 头部
+     * */
+    function __construct($header, $body, $httpCode)
+    {
+        $this->code = $httpCode;
+        $this->msg = '';
+        $this->params = $header;
+        $this->body = $body;
+    }
+
+    /**
+     *
+     * @return text | bin
+     */
+    public function getCode()
+    {
+        return $this->code;
+    }
+
+    /**
+     *
+     * @return text | bin
+     */
+    public function getMsg()
+    {
+        return $this->msg;
+    }
+
+    /**
+     *
+     * @return text | bin
+     */
+    public function getType()
+    {
+        $subject = $this->params;
+        $pattern = '/Content\-Type:([^;]+)/';
+        preg_match($pattern, $subject, $matches);
+        if ($matches) {
+            $type = $matches[1];
+        } else {
+            $type = 'application/download';
+        }
+
+        return str_replace(' ', '', $type);
+    }
+
+    /**
+     *
+     * @return text | bin
+     */
+    public function getContentLength()
+    {
+        $subject = $this->params;
+        $pattern = '/Content-Length:\s*([^\n]+)/';
+        preg_match($pattern, $subject, $matches);
+        return (int)(isset($matches[1]) ? $matches[1] : '');
+    }
+
+
+    public function getFileSuffix($fileType)
+    {
+        $type = isset($this->fileSuffix[$fileType]) ? $this->fileSuffix[$fileType] : 'text/plain';
+        if (!$type) {
+            $type = 'json';
+        }
+        return $type;
+    }
+
+
+    /**
+     *
+     * @return text | bin
+     */
+    public function getBody()
+    {
+        //header('Content-type: image/jpeg');
+        return $this->body;
+    }
+
+    /**
+     * 获取参数
+     * @return text | bin
+     */
+    public function getParams()
+    {
+        return $this->params;
+    }
+
+
+}

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 1303 - 0
app/Libs/Pays/AliPaySdk/aop/AopCertClient.php


+ 527 - 0
app/Libs/Pays/AliPaySdk/aop/AopCertification.php

@@ -0,0 +1,527 @@
+<?php
+
+/**
+ * 验证支付宝公钥证书是否可信
+ * @param $alipayCert 支付宝公钥证书
+ * @param $rootCert 支付宝根证书
+ */
+function isTrusted($alipayCert, $rootCert)
+{
+    $alipayCerts = readPemCertChain($alipayCert);
+    $rootCerts = readPemCertChain($rootCert);
+    if (verifyCertChain($alipayCerts, $rootCerts)) {
+        return verifySignature($alipayCert, $rootCert);
+    } else {
+        return false;
+    }
+
+}
+
+function verifySignature($alipayCert, $rootCert)
+{
+    $alipayCertArray = explode("-----END CERTIFICATE-----", $alipayCert);
+    $rootCertArray = explode("-----END CERTIFICATE-----", $rootCert);
+    $length = count($rootCertArray) - 1;
+    $checkSign = isCertSigner($alipayCertArray[0] . "-----END CERTIFICATE-----", $alipayCertArray[1] . "-----END CERTIFICATE-----");
+    if (!$checkSign) {
+        $checkSign = isCertSigner($alipayCertArray[1] . "-----END CERTIFICATE-----", $alipayCertArray[0] . "-----END CERTIFICATE-----");
+        if ($checkSign) {
+            $issuer = openssl_x509_parse($alipayCertArray[0] . "-----END CERTIFICATE-----")['issuer'];
+            for ($i = 0; $i < $length; $i++) {
+                $subject = openssl_x509_parse($rootCertArray[$i] . "-----END CERTIFICATE-----")['subject'];
+                if ($issuer == $subject) {
+                    isCertSigner($alipayCertArray[0] . "-----END CERTIFICATE-----", $rootCertArray[$i] . $rootCertArray);
+                    return $checkSign;
+                }
+            }
+        } else {
+            return $checkSign;
+        }
+    } else {
+        $issuer = openssl_x509_parse($alipayCertArray[1] . "-----END CERTIFICATE-----")['issuer'];
+        for ($i = 0; $i < $length; $i++) {
+            $subject = openssl_x509_parse($rootCertArray[$i] . "-----END CERTIFICATE-----")['subject'];
+            if ($issuer == $subject) {
+                $checkSign = isCertSigner($alipayCertArray[1] . "-----END CERTIFICATE-----", $rootCertArray[$i] . "-----END CERTIFICATE-----");
+                return $checkSign;
+            }
+        }
+        return $checkSign;
+    }
+}
+
+function readPemCertChain($cert)
+{
+    $array = explode("-----END CERTIFICATE-----", $cert);
+    $certs[] = null;
+    for ($i = 0; $i < count($array) - 1; $i++) {
+        $certs[$i] = openssl_x509_parse($array[$i] . "-----END CERTIFICATE-----");
+    }
+    return $certs;
+}
+
+function verifyCert($prev, $rootCerts)
+{
+    $nowTime = time();
+    if ($nowTime < $prev['validFrom_time_t']) {
+        echo "证书未激活";
+        return false;
+    }
+    if ($nowTime > $prev['validTo_time_t']) {
+        echo "证书已经过期";
+        return false;
+    }
+    $subjectMap = null;
+    for ($i = 0; $i < count($rootCerts); $i++) {
+        $subjectDN = array2string($rootCerts[$i]['subject']);
+        $subjectMap[$subjectDN] = $rootCerts[$i];
+    }
+    $issuerDN = array2string(($prev['issuer']));
+    if (!array_key_exists($issuerDN, $subjectMap)) {
+        echo "证书链验证失败";
+        return false;
+    }
+    return true;
+}
+
+/**
+ * 验证证书链是否是信任证书库中证书签发的
+ * @param $alipayCerts 目标验证证书列表
+ * @param $rootCerts 可信根证书列表
+ */
+function verifyCertChain($alipayCerts, $rootCerts)
+{
+    $sorted = sortByDn($alipayCerts);
+    if (!$sorted) {
+        echo "证书链验证失败:不是完整的证书链";
+        return false;
+    }
+    //先验证第一个证书是不是信任库中证书签发的
+    $prev = $alipayCerts[0];
+    $firstOK = verifyCert($prev, $rootCerts);
+    $length = count($alipayCerts);
+    if (!$firstOK || $length == 1) {
+        return $firstOK;
+    }
+
+    $nowTime = time();
+    //验证证书链
+    for ($i = 1; $i < $length; $i++) {
+        $cert = $alipayCerts[$i];
+        if ($nowTime < $cert['validFrom_time_t']) {
+            echo "证书未激活";
+            return false;
+        }
+        if ($nowTime > $cert['validTo_time_t']) {
+            echo "证书已经过期";
+            return false;
+        }
+    }
+    return true;
+}
+
+/**
+ * 将证书链按照完整的签发顺序进行排序,排序后证书链为:[issuerA, subjectA]-[issuerA, subjectB]-[issuerB, subjectC]-[issuerC, subjectD]...
+ * @param $certs 证书链
+ */
+function sortByDn(&$certs)
+{
+    //是否包含自签名证书
+    $hasSelfSignedCert = false;
+    $subjectMap = null;
+    $issuerMap = null;
+    for ($i = 0; $i < count($certs); $i++) {
+        if (isSelfSigned($certs[$i])) {
+            if ($hasSelfSignedCert) {
+                return false;
+            }
+            $hasSelfSignedCert = true;
+        }
+        $subjectDN = array2string($certs[$i]['subject']);
+        $issuerDN = array2string(($certs[$i]['issuer']));
+        $subjectMap[$subjectDN] = $certs[$i];
+        $issuerMap[$issuerDN] = $certs[$i];
+    }
+    $certChain = null;
+    addressingUp($subjectMap, $certChain, $certs[0]);
+    addressingDown($issuerMap, $certChain, $certs[0]);
+
+    //说明证书链不完整
+    if (count($certs) != count($certChain)) {
+        return false;
+    }
+    //将证书链复制到原先的数据
+    for ($i = 0; $i < count($certs); $i++) {
+        $certs[$i] = $certChain[count($certs) - $i - 1];
+    }
+    return true;
+}
+
+/**
+ * 验证证书是否是自签发的
+ * @param $cert 目标证书
+ */
+function isSelfSigned($cert)
+{
+    $subjectDN = array2string($cert['subject']);
+    $issuerDN = array2string($cert['issuer']);
+    return ($subjectDN == $issuerDN);
+}
+
+
+function array2string($array)
+{
+    $string = [];
+    if ($array && is_array($array)) {
+        foreach ($array as $key => $value) {
+            $string[] = $key . '=' . $value;
+        }
+    }
+    return implode(',', $string);
+}
+
+/**
+ * 向上构造证书链
+ * @param $subjectMap 主题和证书的映射
+ * @param $certChain 证书链
+ * @param $current 当前需要插入证书链的证书,include
+ */
+function addressingUp($subjectMap, &$certChain, $current)
+{
+    $certChain[] = $current;
+    if (isSelfSigned($current)) {
+        return;
+    }
+    $issuerDN = array2string($current['issuer']);
+
+    if (!array_key_exists($issuerDN, $subjectMap)) {
+        return;
+    }
+    addressingUp($subjectMap, $certChain, $subjectMap[$issuerDN]);
+}
+
+/**
+ * 向下构造证书链
+ * @param $issuerMap 签发者和证书的映射
+ * @param $certChain 证书链
+ * @param $current 当前需要插入证书链的证书,exclude
+ */
+function addressingDown($issuerMap, &$certChain, $current)
+{
+    $subjectDN = array2string($current['subject']);
+    if (!array_key_exists($subjectDN, $issuerMap)) {
+        return $certChain;
+    }
+    $certChain[] = $issuerMap[$subjectDN];
+    addressingDown($issuerMap, $certChain, $issuerMap[$subjectDN]);
+}
+
+
+/**
+ * Extract signature from der encoded cert.
+ * Expects x509 der encoded certificate consisting of a section container
+ * containing 2 sections and a bitstream.  The bitstream contains the
+ * original encrypted signature, encrypted by the public key of the issuing
+ * signer.
+ * @param string $der
+ * @return string on success
+ * @return bool false on failures
+ */
+function extractSignature($der = false)
+{
+    if (strlen($der) < 5) {
+        return false;
+    }
+    // skip container sequence
+    $der = substr($der, 4);
+    // now burn through two sequences and the return the final bitstream
+    while (strlen($der) > 1) {
+        $class = ord($der[0]);
+        $classHex = dechex($class);
+        switch ($class) {
+            // BITSTREAM
+            case 0x03:
+                $len = ord($der[1]);
+                $bytes = 0;
+                if ($len & 0x80) {
+                    $bytes = $len & 0x0f;
+                    $len = 0;
+                    for ($i = 0; $i < $bytes; $i++) {
+                        $len = ($len << 8) | ord($der[$i + 2]);
+                    }
+                }
+                return substr($der, 3 + $bytes, $len);
+                break;
+            // SEQUENCE
+            case 0x30:
+                $len = ord($der[1]);
+                $bytes = 0;
+                if ($len & 0x80) {
+                    $bytes = $len & 0x0f;
+                    $len = 0;
+                    for ($i = 0; $i < $bytes; $i++) {
+                        $len = ($len << 8) | ord($der[$i + 2]);
+                    }
+                }
+                $contents = substr($der, 2 + $bytes, $len);
+                $der = substr($der, 2 + $bytes + $len);
+                break;
+            default:
+                return false;
+                break;
+        }
+    }
+    return false;
+}
+
+/**
+ * Get signature algorithm oid from der encoded signature data.
+ * Expects decrypted signature data from a certificate in der format.
+ * This ASN1 data should contain the following structure:
+ * SEQUENCE
+ *    SEQUENCE
+ *       OID    (signature algorithm)
+ *       NULL
+ * OCTET STRING (signature hash)
+ * @return bool false on failures
+ * @return string oid
+ */
+function getSignatureAlgorithmOid($der = null)
+{
+    // Validate this is the der we need...
+    if (!is_string($der) or strlen($der) < 5) {
+        return false;
+    }
+    $bit_seq1 = 0;
+    $bit_seq2 = 2;
+    $bit_oid = 4;
+    if (ord($der[$bit_seq1]) !== 0x30) {
+        die('Invalid DER passed to getSignatureAlgorithmOid()');
+    }
+    if (ord($der[$bit_seq2]) !== 0x30) {
+        die('Invalid DER passed to getSignatureAlgorithmOid()');
+    }
+    if (ord($der[$bit_oid]) !== 0x06) {
+        die('Invalid DER passed to getSignatureAlgorithmOid');
+    }
+    // strip out what we don't need and get the oid
+    $der = substr($der, $bit_oid);
+    // Get the oid
+    $len = ord($der[1]);
+    $bytes = 0;
+    if ($len & 0x80) {
+        $bytes = $len & 0x0f;
+        $len = 0;
+        for ($i = 0; $i < $bytes; $i++) {
+            $len = ($len << 8) | ord($der[$i + 2]);
+        }
+    }
+    $oid_data = substr($der, 2 + $bytes, $len);
+    // Unpack the OID
+    $oid = floor(ord($oid_data[0]) / 40);
+    $oid .= '.' . ord($oid_data[0]) % 40;
+    $value = 0;
+    $i = 1;
+    while ($i < strlen($oid_data)) {
+        $value = $value << 7;
+        $value = $value | (ord($oid_data[$i]) & 0x7f);
+        if (!(ord($oid_data[$i]) & 0x80)) {
+            $oid .= '.' . $value;
+            $value = 0;
+        }
+        $i++;
+    }
+    return $oid;
+}
+
+/**
+ * Get signature hash from der encoded signature data.
+ * Expects decrypted signature data from a certificate in der format.
+ * This ASN1 data should contain the following structure:
+ * SEQUENCE
+ *    SEQUENCE
+ *       OID    (signature algorithm)
+ *       NULL
+ * OCTET STRING (signature hash)
+ * @return bool false on failures
+ * @return string hash
+ */
+function getSignatureHash($der = null)
+{
+    // Validate this is the der we need...
+    if (!is_string($der) or strlen($der) < 5) {
+        return false;
+    }
+    if (ord($der[0]) !== 0x30) {
+        die('Invalid DER passed to getSignatureHash()');
+    }
+    // strip out the container sequence
+    $der = substr($der, 2);
+    if (ord($der[0]) !== 0x30) {
+        die('Invalid DER passed to getSignatureHash()');
+    }
+    // Get the length of the first sequence so we can strip it out.
+    $len = ord($der[1]);
+    $bytes = 0;
+    if ($len & 0x80) {
+        $bytes = $len & 0x0f;
+        $len = 0;
+        for ($i = 0; $i < $bytes; $i++) {
+            $len = ($len << 8) | ord($der[$i + 2]);
+        }
+    }
+    $der = substr($der, 2 + $bytes + $len);
+    // Now we should have an octet string
+    if (ord($der[0]) !== 0x04) {
+        die('Invalid DER passed to getSignatureHash()');
+    }
+    $len = ord($der[1]);
+    $bytes = 0;
+    if ($len & 0x80) {
+        $bytes = $len & 0x0f;
+        $len = 0;
+        for ($i = 0; $i < $bytes; $i++) {
+            $len = ($len << 8) | ord($der[$i + 2]);
+        }
+    }
+    return bin2hex(substr($der, 2 + $bytes, $len));
+}
+
+/**
+ * Determine if one cert was used to sign another
+ * Note that more than one CA cert can give a positive result, some certs
+ * re-issue signing certs after having only changed the expiration dates.
+ * @param string $cert - PEM encoded cert
+ * @param string $caCert - PEM encoded cert that possibly signed $cert
+ * @return bool
+ */
+function isCertSigner($certPem = null, $caCertPem = null)
+{
+    if (!function_exists('openssl_pkey_get_public')) {
+        die('Need the openssl_pkey_get_public() function.');
+    }
+    if (!function_exists('openssl_public_decrypt')) {
+        die('Need the openssl_public_decrypt() function.');
+    }
+    if (!function_exists('hash')) {
+        die('Need the php hash() function.');
+    }
+    if (empty($certPem) or empty($caCertPem)) {
+        return false;
+    }
+    // Convert the cert to der for feeding to extractSignature.
+    $certDer = pemToDer($certPem);
+    if (!is_string($certDer)) {
+        die('invalid certPem');
+    }
+    // Grab the encrypted signature from the der encoded cert.
+    $encryptedSig = extractSignature($certDer);
+    if (!is_string($encryptedSig)) {
+        die('Failed to extract encrypted signature from certPem.');
+    }
+    // Extract the public key from the ca cert, which is what has
+    // been used to encrypt the signature in the cert.
+    $pubKey = openssl_pkey_get_public($caCertPem);
+    if ($pubKey === false) {
+        die('Failed to extract the public key from the ca cert.');
+    }
+    // Attempt to decrypt the encrypted signature using the CA's public
+    // key, returning the decrypted signature in $decryptedSig.  If
+    // it can't be decrypted, this ca was not used to sign it for sure...
+    $rc = openssl_public_decrypt($encryptedSig, $decryptedSig, $pubKey);
+    if ($rc === false) {
+        return false;
+    }
+    // We now have the decrypted signature, which is der encoded
+    // asn1 data containing the signature algorithm and signature hash.
+    // Now we need what was originally hashed by the issuer, which is
+    // the original DER encoded certificate without the issuer and
+    // signature information.
+    $origCert = stripSignerAsn($certDer);
+    if ($origCert === false) {
+        die('Failed to extract unsigned cert.');
+    }
+    // Get the oid of the signature hash algorithm, which is required
+    // to generate our own hash of the original cert.  This hash is
+    // what will be compared to the issuers hash.
+    $oid = getSignatureAlgorithmOid($decryptedSig);
+    if ($oid === false) {
+        die('Failed to determine the signature algorithm.');
+    }
+    switch ($oid) {
+        case '1.2.840.113549.2.2':
+            $algo = 'md2';
+            break;
+        case '1.2.840.113549.2.4':
+            $algo = 'md4';
+            break;
+        case '1.2.840.113549.2.5':
+            $algo = 'md5';
+            break;
+        case '1.3.14.3.2.18':
+            $algo = 'sha';
+            break;
+        case '1.3.14.3.2.26':
+            $algo = 'sha1';
+            break;
+        case '2.16.840.1.101.3.4.2.1':
+            $algo = 'sha256';
+            break;
+        case '2.16.840.1.101.3.4.2.2':
+            $algo = 'sha384';
+            break;
+        case '2.16.840.1.101.3.4.2.3':
+            $algo = 'sha512';
+            break;
+        default:
+            die('Unknown signature hash algorithm oid: ' . $oid);
+            break;
+    }
+    // Get the issuer generated hash from the decrypted signature.
+    $decryptedHash = getSignatureHash($decryptedSig);
+    // Ok, hash the original unsigned cert with the same algorithm
+    // and if it matches $decryptedHash we have a winner.
+    $certHash = hash($algo, $origCert);
+    return ($decryptedHash === $certHash);
+}
+
+/**
+ * Convert pem encoded certificate to DER encoding
+ * @return string $derEncoded on success
+ * @return bool false on failures
+ */
+function pemToDer($pem = null)
+{
+    if (!is_string($pem)) {
+        return false;
+    }
+    $cert_split = preg_split('/(-----((BEGIN)|(END)) CERTIFICATE-----)/', $pem);
+    if (!isset($cert_split[1])) {
+        return false;
+    }
+    return base64_decode($cert_split[1]);
+}
+
+/**
+ * Obtain der cert with issuer and signature sections stripped.
+ * @param string $der - der encoded certificate
+ * @return string $der on success
+ * @return bool false on failures.
+ */
+function stripSignerAsn($der = null)
+{
+    if (!is_string($der) or strlen($der) < 8) {
+        return false;
+    }
+    $bit = 4;
+    $len = ord($der[($bit + 1)]);
+    $bytes = 0;
+    if ($len & 0x80) {
+        $bytes = $len & 0x0f;
+        $len = 0;
+        for ($i = 0; $i < $bytes; $i++) {
+            $len = ($len << 8) | ord($der[$bit + $i + 2]);
+        }
+    }
+    return substr($der, 4, $len + 4);
+}

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 1334 - 0
app/Libs/Pays/AliPaySdk/aop/AopClient.php


+ 78 - 0
app/Libs/Pays/AliPaySdk/aop/AopEncrypt.php

@@ -0,0 +1,78 @@
+<?php
+/**
+ *   加密工具类
+ *
+ * User: jiehua
+ * Date: 16/3/30
+ * Time: 下午3:25
+ */
+
+
+/**
+ * 加密方法
+ * @param string $str
+ * @return string
+ */
+function encrypt_new($str, $screct_key)
+{
+    //AES, 128 模式加密数据 CBC
+    $screct_key = base64_decode($screct_key);
+    $str = trim($str);
+    $str = addPKCS7Padding($str);
+
+    //设置全0的IV
+
+    $iv = str_repeat("\0", 16);
+    $encrypt_str = openssl_encrypt($str, 'aes-128-cbc', $screct_key, OPENSSL_NO_PADDING, $iv);
+    return base64_encode($encrypt_str);
+}
+
+/**
+ * 解密方法
+ * @param string $str
+ * @return string
+ */
+function decrypt_new($str, $screct_key)
+{
+    //AES, 128 模式加密数据 CBC
+    $str = base64_decode($str);
+    $screct_key = base64_decode($screct_key);
+
+    //设置全0的IV
+    $iv = str_repeat("\0", 16);
+    $decrypt_str = openssl_decrypt($str, 'aes-128-cbc', $screct_key, OPENSSL_NO_PADDING, $iv);
+    $decrypt_str = stripPKSC7Padding($decrypt_str);
+    return $decrypt_str;
+}
+
+/**
+ * 填充算法
+ * @param string $source
+ * @return string
+ */
+function addPKCS7Padding($source)
+{
+    $source = trim($source);
+    $block = 16;
+
+    $pad = $block - (strlen($source) % $block);
+    if ($pad <= $block) {
+        $char = chr($pad);
+        $source .= str_repeat($char, $pad);
+    }
+    return $source;
+}
+
+/**
+ * 移去填充算法
+ * @param string $source
+ * @return string
+ */
+function stripPKSC7Padding($source)
+{
+    $char = substr($source, -1);
+    $num = ord($char);
+    if ($num == 62) return $source;
+    $source = substr($source, 0, -$num);
+    return $source;
+}

+ 18 - 0
app/Libs/Pays/AliPaySdk/aop/EncryptParseItem.php

@@ -0,0 +1,18 @@
+<?php
+/**
+ *  TODO 补充说明
+ *
+ * User: jiehua
+ * Date: 16/3/30
+ * Time: 下午8:55
+ */
+
+class EncryptParseItem
+{
+    public $startIndex;
+
+    public $endIndex;
+
+    public $encryptContent;
+
+} 

+ 16 - 0
app/Libs/Pays/AliPaySdk/aop/EncryptResponseData.php

@@ -0,0 +1,16 @@
+<?php
+/**
+ *  TODO 补充说明
+ *
+ * User: jiehua
+ * Date: 16/3/30
+ * Time: 下午8:51
+ */
+
+class EncryptResponseData
+{
+    public $realContent;
+
+    public $returnContent;
+
+} 

+ 77 - 0
app/Libs/Pays/AliPaySdk/aop/NewAopEncrypt.php

@@ -0,0 +1,77 @@
+<?php
+/**
+ *   加密工具类
+ *
+ * User: jiehua
+ * Date: 16/3/30
+ * Time: 下午3:25
+ */
+
+/**
+ * 加密方法
+ * @param string $str
+ * @return string
+ */
+function encrypt($str, $screct_key)
+{
+    //AES, 128 模式加密数据 CBC
+    $screct_key = base64_decode($screct_key);
+    $str = trim($str);
+    $str = addPKCS7Padding($str);
+
+    //设置全0的IV
+
+    $iv = str_repeat("\0", 16);
+    $encrypt_str = openssl_encrypt($str, 'aes-128-cbc', $screct_key, OPENSSL_NO_PADDING, $iv);
+    return base64_encode($encrypt_str);
+}
+
+/**
+ * 解密方法
+ * @param string $str
+ * @return string
+ */
+function decrypt($str, $screct_key)
+{
+    //AES, 128 模式加密数据 CBC
+    $str = base64_decode($str);
+    $screct_key = base64_decode($screct_key);
+
+    //设置全0的IV
+    $iv = str_repeat("\0", 16);
+    $decrypt_str = openssl_decrypt($str, 'aes-128-cbc', $screct_key, OPENSSL_NO_PADDING, $iv);
+    $decrypt_str = stripPKSC7Padding($decrypt_str);
+    return $decrypt_str;
+}
+
+/**
+ * 填充算法
+ * @param string $source
+ * @return string
+ */
+function addPKCS7Padding($source)
+{
+    $source = trim($source);
+    $block = 16;
+
+    $pad = $block - (strlen($source) % $block);
+    if ($pad <= $block) {
+        $char = chr($pad);
+        $source .= str_repeat($char, $pad);
+    }
+    return $source;
+}
+
+/**
+ * 移去填充算法
+ * @param string $source
+ * @return string
+ */
+function stripPKSC7Padding($source)
+{
+    $char = substr($source, -1);
+    $num = ord($char);
+    if ($num == 62) return $source;
+    $source = substr($source, 0, -$num);
+    return $source;
+}

+ 15 - 0
app/Libs/Pays/AliPaySdk/aop/SignData.php

@@ -0,0 +1,15 @@
+<?php
+/**
+ * Created by PhpStorm.
+ * User: jiehua
+ * Date: 15/5/2
+ * Time: 下午6:21
+ */
+
+class SignData
+{
+    public $signSourceData = null;
+
+    public $sign = null;
+
+} 

+ 118 - 0
app/Libs/Pays/AliPaySdk/aop/request/AftAifinFireeyeOcrImageQueryRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: aft.aifin.fireeye.ocr.image.query request
+ *
+ * @author auto create
+ * @since 1.0, 2023-04-03 04:21:58
+ */
+class AftAifinFireeyeOcrImageQueryRequest
+{
+	/** 
+	 * OCR火眼识别
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "aft.aifin.fireeye.ocr.image.query";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 103 - 0
app/Libs/Pays/AliPaySdk/aop/request/AftAifinNewtestQueryRequest.php

@@ -0,0 +1,103 @@
+<?php
+/**
+ * ALIPAY API: aft.aifin.newtest.query request
+ *
+ * @author auto create
+ * @since 1.0, 2019-02-18 13:15:00
+ */
+class AftAifinNewtestQueryRequest
+{
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function getApiMethodName()
+	{
+		return "aft.aifin.newtest.query";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 118 - 0
app/Libs/Pays/AliPaySdk/aop/request/AftFinsecureRiskplusSecurityPolicyQueryRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: aft.finsecure.riskplus.security.policy.query request
+ *
+ * @author auto create
+ * @since 1.0, 2023-04-03 16:09:03
+ */
+class AftFinsecureRiskplusSecurityPolicyQueryRequest
+{
+	/** 
+	 * 策略咨询服务输出
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "aft.finsecure.riskplus.security.policy.query";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 118 - 0
app/Libs/Pays/AliPaySdk/aop/request/AliosOpenAutoInfoQueryRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alios.open.auto.info.query request
+ *
+ * @author auto create
+ * @since 1.0, 2023-04-03 06:16:49
+ */
+class AliosOpenAutoInfoQueryRequest
+{
+	/** 
+	 * 查询阿里车的车辆信息
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alios.open.auto.info.query";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 118 - 0
app/Libs/Pays/AliPaySdk/aop/request/AlipayAccountCashpoolAccountBindRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.account.cashpool.account.bind request
+ *
+ * @author auto create
+ * @since 1.0, 2020-07-06 11:20:40
+ */
+class AlipayAccountCashpoolAccountBindRequest
+{
+	/** 
+	 * 账户资金池绑定
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.account.cashpool.account.bind";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 118 - 0
app/Libs/Pays/AliPaySdk/aop/request/AlipayAccountCashpoolAllocateruleCreateRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.account.cashpool.allocaterule.create request
+ *
+ * @author auto create
+ * @since 1.0, 2023-04-03 02:50:31
+ */
+class AlipayAccountCashpoolAllocateruleCreateRequest
+{
+	/** 
+	 * 资金池调拨规则新增
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.account.cashpool.allocaterule.create";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 118 - 0
app/Libs/Pays/AliPaySdk/aop/request/AlipayAccountCashpoolAllocaterulePayRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.account.cashpool.allocaterule.pay request
+ *
+ * @author auto create
+ * @since 1.0, 2023-04-03 04:27:59
+ */
+class AlipayAccountCashpoolAllocaterulePayRequest
+{
+	/** 
+	 * 资金池调拨规则强制执行
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.account.cashpool.allocaterule.pay";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 118 - 0
app/Libs/Pays/AliPaySdk/aop/request/AlipayAccountCashpoolBasicQueryRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.account.cashpool.basic.query request
+ *
+ * @author auto create
+ * @since 1.0, 2023-04-03 02:43:55
+ */
+class AlipayAccountCashpoolBasicQueryRequest
+{
+	/** 
+	 * 查询资金池基本信息
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.account.cashpool.basic.query";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 118 - 0
app/Libs/Pays/AliPaySdk/aop/request/AlipayAccountCashpoolCreateRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.account.cashpool.create request
+ *
+ * @author auto create
+ * @since 1.0, 2023-04-03 02:23:57
+ */
+class AlipayAccountCashpoolCreateRequest
+{
+	/** 
+	 * 资金池创建
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.account.cashpool.create";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 118 - 0
app/Libs/Pays/AliPaySdk/aop/request/AlipayAccountCashpoolDeleteRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.account.cashpool.delete request
+ *
+ * @author auto create
+ * @since 1.0, 2023-04-03 06:55:39
+ */
+class AlipayAccountCashpoolDeleteRequest
+{
+	/** 
+	 * 资金池删除
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.account.cashpool.delete";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 118 - 0
app/Libs/Pays/AliPaySdk/aop/request/AlipayAccountCashpoolDetailQueryRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.account.cashpool.detail.query request
+ *
+ * @author auto create
+ * @since 1.0, 2023-04-03 15:07:21
+ */
+class AlipayAccountCashpoolDetailQueryRequest
+{
+	/** 
+	 * 资金池详情查询
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.account.cashpool.detail.query";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 118 - 0
app/Libs/Pays/AliPaySdk/aop/request/AlipayAccountCashpoolRuleModifyRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.account.cashpool.rule.modify request
+ *
+ * @author auto create
+ * @since 1.0, 2023-04-03 02:48:33
+ */
+class AlipayAccountCashpoolRuleModifyRequest
+{
+	/** 
+	 * 资金池规则修改
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.account.cashpool.rule.modify";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 118 - 0
app/Libs/Pays/AliPaySdk/aop/request/AlipayAccountCashpoolRulegroupCreateRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.account.cashpool.rulegroup.create request
+ *
+ * @author auto create
+ * @since 1.0, 2023-04-03 16:28:25
+ */
+class AlipayAccountCashpoolRulegroupCreateRequest
+{
+	/** 
+	 * 资金池规则组新增
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.account.cashpool.rulegroup.create";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 118 - 0
app/Libs/Pays/AliPaySdk/aop/request/AlipayAccountCashpoolRulegroupModifyRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.account.cashpool.rulegroup.modify request
+ *
+ * @author auto create
+ * @since 1.0, 2023-04-03 17:18:59
+ */
+class AlipayAccountCashpoolRulegroupModifyRequest
+{
+	/** 
+	 * 资金池规则组修改
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.account.cashpool.rulegroup.modify";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 118 - 0
app/Libs/Pays/AliPaySdk/aop/request/AlipayAccountCashpoolStatusModifyRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.account.cashpool.status.modify request
+ *
+ * @author auto create
+ * @since 1.0, 2023-04-03 11:03:10
+ */
+class AlipayAccountCashpoolStatusModifyRequest
+{
+	/** 
+	 * 资金池状态修改
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.account.cashpool.status.modify";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 118 - 0
app/Libs/Pays/AliPaySdk/aop/request/AlipayAccountClearingcenterPayoffModifyRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.account.clearingcenter.payoff.modify request
+ *
+ * @author auto create
+ * @since 1.0, 2023-04-03 05:29:37
+ */
+class AlipayAccountClearingcenterPayoffModifyRequest
+{
+	/** 
+	 * 修改待解付登记薄
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.account.clearingcenter.payoff.modify";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 118 - 0
app/Libs/Pays/AliPaySdk/aop/request/AlipayAccountClearingcenterPayoffQueryRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.account.clearingcenter.payoff.query request
+ *
+ * @author auto create
+ * @since 1.0, 2023-04-03 00:49:14
+ */
+class AlipayAccountClearingcenterPayoffQueryRequest
+{
+	/** 
+	 * 查询解付登记薄信息
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.account.clearingcenter.payoff.query";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 118 - 0
app/Libs/Pays/AliPaySdk/aop/request/AlipayAccountExrateAdviceAcceptRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.account.exrate.advice.accept request
+ *
+ * @author auto create
+ * @since 1.0, 2023-04-03 08:51:36
+ */
+class AlipayAccountExrateAdviceAcceptRequest
+{
+	/** 
+	 * 标准的兑换交易受理接口
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.account.exrate.advice.accept";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 118 - 0
app/Libs/Pays/AliPaySdk/aop/request/AlipayAccountExrateAllclientrateQueryRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.account.exrate.allclientrate.query request
+ *
+ * @author auto create
+ * @since 1.0, 2023-04-03 03:36:15
+ */
+class AlipayAccountExrateAllclientrateQueryRequest
+{
+	/** 
+	 * 查询客户的所有币种对最新有效汇率
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.account.exrate.allclientrate.query";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 118 - 0
app/Libs/Pays/AliPaySdk/aop/request/AlipayAccountExrateCollectcoreDataSendRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.account.exrate.collectcore.data.send request
+ *
+ * @author auto create
+ * @since 1.0, 2023-04-03 14:19:55
+ */
+class AlipayAccountExrateCollectcoreDataSendRequest
+{
+	/** 
+	 * 金融信息受理接口
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.account.exrate.collectcore.data.send";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 118 - 0
app/Libs/Pays/AliPaySdk/aop/request/AlipayAccountExrateConfigQueryRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.account.exrate.config.query request
+ *
+ * @author auto create
+ * @since 1.0, 2023-04-03 03:53:57
+ */
+class AlipayAccountExrateConfigQueryRequest
+{
+	/** 
+	 * 主站配置查询接口
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.account.exrate.config.query";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 118 - 0
app/Libs/Pays/AliPaySdk/aop/request/AlipayAccountExrateConfigSyncRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.account.exrate.config.sync request
+ *
+ * @author auto create
+ * @since 1.0, 2023-04-03 14:18:22
+ */
+class AlipayAccountExrateConfigSyncRequest
+{
+	/** 
+	 * 国际同步主站配置通用接口
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.account.exrate.config.sync";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 118 - 0
app/Libs/Pays/AliPaySdk/aop/request/AlipayAccountExratePricingNotifyRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.account.exrate.pricing.notify request
+ *
+ * @author auto create
+ * @since 1.0, 2023-04-03 10:28:50
+ */
+class AlipayAccountExratePricingNotifyRequest
+{
+	/** 
+	 * 源汇率受理通知接口
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.account.exrate.pricing.notify";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 118 - 0
app/Libs/Pays/AliPaySdk/aop/request/AlipayAccountExrateRateSyncRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.account.exrate.rate.sync request
+ *
+ * @author auto create
+ * @since 1.0, 2023-04-03 15:18:52
+ */
+class AlipayAccountExrateRateSyncRequest
+{
+	/** 
+	 * 汇率openapi通用操作接口
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.account.exrate.rate.sync";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 118 - 0
app/Libs/Pays/AliPaySdk/aop/request/AlipayAccountExrateRatequeryRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.account.exrate.ratequery request
+ *
+ * @author auto create
+ * @since 1.0, 2023-04-03 05:57:24
+ */
+class AlipayAccountExrateRatequeryRequest
+{
+	/** 
+	 * 对于部分签约境内当面付的商家,为了能够在境外进行推广,因此需要汇率进行币种之间的转换,本接口提供此业务场景下的汇率查询服务
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.account.exrate.ratequery";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 118 - 0
app/Libs/Pays/AliPaySdk/aop/request/AlipayAccountExrateSentimentDataSendRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.account.exrate.sentiment.data.send request
+ *
+ * @author auto create
+ * @since 1.0, 2023-04-03 06:56:06
+ */
+class AlipayAccountExrateSentimentDataSendRequest
+{
+	/** 
+	 * 国家制裁数据受理接口
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.account.exrate.sentiment.data.send";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 118 - 0
app/Libs/Pays/AliPaySdk/aop/request/AlipayAccountExrateSourcerateQueryRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.account.exrate.sourcerate.query request
+ *
+ * @author auto create
+ * @since 1.0, 2023-04-03 15:08:41
+ */
+class AlipayAccountExrateSourcerateQueryRequest
+{
+	/** 
+	 * 源汇率查询
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.account.exrate.sourcerate.query";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 118 - 0
app/Libs/Pays/AliPaySdk/aop/request/AlipayAccountExrateTraderequestCreateRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.account.exrate.traderequest.create request
+ *
+ * @author auto create
+ * @since 1.0, 2023-03-31 18:22:54
+ */
+class AlipayAccountExrateTraderequestCreateRequest
+{
+	/** 
+	 * 受理外汇交易请求
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.account.exrate.traderequest.create";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 118 - 0
app/Libs/Pays/AliPaySdk/aop/request/AlipayAccountFinriskCompanyVerifyCreateRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.account.finrisk.company.verify.create request
+ *
+ * @author auto create
+ * @since 1.0, 2023-04-03 15:22:56
+ */
+class AlipayAccountFinriskCompanyVerifyCreateRequest
+{
+	/** 
+	 * 商户验证受理接口
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.account.finrisk.company.verify.create";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 118 - 0
app/Libs/Pays/AliPaySdk/aop/request/AlipayAccountFinriskCompanyVerifyGetRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.account.finrisk.company.verify.get request
+ *
+ * @author auto create
+ * @since 1.0, 2023-03-31 18:13:48
+ */
+class AlipayAccountFinriskCompanyVerifyGetRequest
+{
+	/** 
+	 * 商户验真接口
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.account.finrisk.company.verify.get";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 118 - 0
app/Libs/Pays/AliPaySdk/aop/request/AlipayAccountFinriskGiriskrequestCreateRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.account.finrisk.giriskrequest.create request
+ *
+ * @author auto create
+ * @since 1.0, 2023-04-03 05:42:27
+ */
+class AlipayAccountFinriskGiriskrequestCreateRequest
+{
+	/** 
+	 * 全面风险评价与监控平台风险请求受理接口
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.account.finrisk.giriskrequest.create";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 118 - 0
app/Libs/Pays/AliPaySdk/aop/request/AlipayAccountFinriskInstriskmonitorKeywordsBatchqueryRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.account.finrisk.instriskmonitor.keywords.batchquery request
+ *
+ * @author auto create
+ * @since 1.0, 2023-04-03 11:08:54
+ */
+class AlipayAccountFinriskInstriskmonitorKeywordsBatchqueryRequest
+{
+	/** 
+	 * 查询关键词接口
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.account.finrisk.instriskmonitor.keywords.batchquery";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 118 - 0
app/Libs/Pays/AliPaySdk/aop/request/AlipayAccountFinriskMarkriskDatafactorQueryRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.account.finrisk.markrisk.datafactor.query request
+ *
+ * @author auto create
+ * @since 1.0, 2023-04-03 14:42:29
+ */
+class AlipayAccountFinriskMarkriskDatafactorQueryRequest
+{
+	/** 
+	 * 市场风险平台风险因子计算
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.account.finrisk.markrisk.datafactor.query";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 118 - 0
app/Libs/Pays/AliPaySdk/aop/request/AlipayAccountInstfundAccountSyncRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.account.instfund.account.sync request
+ *
+ * @author auto create
+ * @since 1.0, 2022-10-28 17:18:33
+ */
+class AlipayAccountInstfundAccountSyncRequest
+{
+	/** 
+	 * 机构资金管理账户同步
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.account.instfund.account.sync";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 118 - 0
app/Libs/Pays/AliPaySdk/aop/request/AlipayAccountInstfundWithdrawApplyRequest.php

@@ -0,0 +1,118 @@
+<?php
+/**
+ * ALIPAY API: alipay.account.instfund.withdraw.apply request
+ *
+ * @author auto create
+ * @since 1.0, 2023-04-03 07:54:13
+ */
+class AlipayAccountInstfundWithdrawApplyRequest
+{
+	/** 
+	 * 资金指令门面
+	 **/
+	private $bizContent;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBizContent($bizContent)
+	{
+		$this->bizContent = $bizContent;
+		$this->apiParas["biz_content"] = $bizContent;
+	}
+
+	public function getBizContent()
+	{
+		return $this->bizContent;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.account.instfund.withdraw.apply";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 171 - 0
app/Libs/Pays/AliPaySdk/aop/request/AlipayAcquireCancelRequest.php

@@ -0,0 +1,171 @@
+<?php
+/**
+ * ALIPAY API: alipay.acquire.cancel request
+ *
+ * @author auto create
+ * @since 1.0, 2019-03-08 15:29:11
+ */
+class AlipayAcquireCancelRequest
+{
+	/** 
+	 * 操作员ID。
+	 **/
+	private $operatorId;
+	
+	/** 
+	 * 操作员的类型:
+0:支付宝操作员
+1:商户的操作员
+如果传入其它值或者为空,则默认设置为1
+	 **/
+	private $operatorType;
+	
+	/** 
+	 * 支付宝合作商户网站唯一订单号。
+	 **/
+	private $outTradeNo;
+	
+	/** 
+	 * 该交易在支付宝系统中的交易流水号。
+最短16位,最长64位。
+如果同时传了out_trade_no和trade_no,则以trade_no为准。
+	 **/
+	private $tradeNo;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setOperatorId($operatorId)
+	{
+		$this->operatorId = $operatorId;
+		$this->apiParas["operator_id"] = $operatorId;
+	}
+
+	public function getOperatorId()
+	{
+		return $this->operatorId;
+	}
+
+	public function setOperatorType($operatorType)
+	{
+		$this->operatorType = $operatorType;
+		$this->apiParas["operator_type"] = $operatorType;
+	}
+
+	public function getOperatorType()
+	{
+		return $this->operatorType;
+	}
+
+	public function setOutTradeNo($outTradeNo)
+	{
+		$this->outTradeNo = $outTradeNo;
+		$this->apiParas["out_trade_no"] = $outTradeNo;
+	}
+
+	public function getOutTradeNo()
+	{
+		return $this->outTradeNo;
+	}
+
+	public function setTradeNo($tradeNo)
+	{
+		$this->tradeNo = $tradeNo;
+		$this->apiParas["trade_no"] = $tradeNo;
+	}
+
+	public function getTradeNo()
+	{
+		return $this->tradeNo;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.acquire.cancel";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 152 - 0
app/Libs/Pays/AliPaySdk/aop/request/AlipayAcquireCloseRequest.php

@@ -0,0 +1,152 @@
+<?php
+/**
+ * ALIPAY API: alipay.acquire.close request
+ *
+ * @author auto create
+ * @since 1.0, 2022-12-08 11:40:05
+ */
+class AlipayAcquireCloseRequest
+{
+	/** 
+	 * 卖家的操作员ID
+	 **/
+	private $operatorId;
+	
+	/** 
+	 * 支付宝合作商户网站唯一订单号
+	 **/
+	private $outTradeNo;
+	
+	/** 
+	 * 该交易在支付宝系统中的交易流水号。
+最短16位,最长64位。
+如果同时传了out_trade_no和trade_no,则以trade_no为准
+	 **/
+	private $tradeNo;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setOperatorId($operatorId)
+	{
+		$this->operatorId = $operatorId;
+		$this->apiParas["operator_id"] = $operatorId;
+	}
+
+	public function getOperatorId()
+	{
+		return $this->operatorId;
+	}
+
+	public function setOutTradeNo($outTradeNo)
+	{
+		$this->outTradeNo = $outTradeNo;
+		$this->apiParas["out_trade_no"] = $outTradeNo;
+	}
+
+	public function getOutTradeNo()
+	{
+		return $this->outTradeNo;
+	}
+
+	public function setTradeNo($tradeNo)
+	{
+		$this->tradeNo = $tradeNo;
+		$this->apiParas["trade_no"] = $tradeNo;
+	}
+
+	public function getTradeNo()
+	{
+		return $this->tradeNo;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.acquire.close";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 550 - 0
app/Libs/Pays/AliPaySdk/aop/request/AlipayAcquireCreateandpayRequest.php

@@ -0,0 +1,550 @@
+<?php
+/**
+ * ALIPAY API: alipay.acquire.createandpay request
+ *
+ * @author auto create
+ * @since 1.0, 2022-11-21 11:20:03
+ */
+class AlipayAcquireCreateandpayRequest
+{
+	/** 
+	 * 证书签名
+	 **/
+	private $alipayCaRequest;
+	
+	/** 
+	 * 对一笔交易的具体描述信息。如果是多种商品,请将商品描述字符串累加传给body。
+	 **/
+	private $body;
+	
+	/** 
+	 * 买家支付宝账号,可以为email或者手机号。
+	 **/
+	private $buyerEmail;
+	
+	/** 
+	 * 买家支付宝账号对应的支付宝唯一用户号。
+以2088开头的纯16位数字。
+	 **/
+	private $buyerId;
+	
+	/** 
+	 * 描述多渠道收单的渠道明细信息,json格式,具体请参见“4.5 渠道明细说明”。
+	 **/
+	private $channelParameters;
+	
+	/** 
+	 * 订单金额币种。
+目前只支持传入156(人民币)。
+如果为空,则默认设置为156。
+	 **/
+	private $currency;
+	
+	/** 
+	 * 动态ID。
+	 **/
+	private $dynamicId;
+	
+	/** 
+	 * 动态ID类型:
+&#1048698;
+soundwave:声波
+&#1048698;
+qrcode:二维码
+&#1048698;
+barcode:条码
+&#1048698;
+wave_code:声波,等同soundwave
+&#1048698;
+qr_code:二维码,等同qrcode
+&#1048698;
+bar_code:条码,等同barcode
+建议取值wave_code、qr_code、bar_code。
+	 **/
+	private $dynamicIdType;
+	
+	/** 
+	 * 用于商户的特定业务信息的传递,只有商户与支付宝约定了传递此参数且约定了参数含义,此参数才有效。
+比如可传递声波支付场景下的门店ID等信息,以json格式传输,具体请参见“4.7 业务扩展参数说明”。
+	 **/
+	private $extendParams;
+	
+	/** 
+	 * xml或json
+	 **/
+	private $formatType;
+	
+	/** 
+	 * 描述商品明细信息,json格式,具体请参见“4.3 商品明细说明”。
+	 **/
+	private $goodsDetail;
+	
+	/** 
+	 * 设置未付款交易的超时时间,一旦超时,该笔交易就会自动被关闭。
+取值范围:1m~15d。
+m-分钟,h-小时,d-天,1c-当天(无论交易何时创建,都在0点关闭)。
+该参数数值不接受小数点,如1.5h,可转换为90m。
+该功能需要联系支付宝配置关闭时间。
+	 **/
+	private $itBPay;
+	
+	/** 
+	 * 描述预付卡相关的明细信息,json格式,具体请参见“4.8 预付卡明细参数说明”。
+	 **/
+	private $mcardParameters;
+	
+	/** 
+	 * 卖家的操作员ID。
+	 **/
+	private $operatorId;
+	
+	/** 
+	 * 操作员的类型:
+&#1048698;
+0:支付宝操作员
+&#1048698;
+1:商户的操作员
+如果传入其它值或者为空,则默认设置为1。
+	 **/
+	private $operatorType;
+	
+	/** 
+	 * 支付宝合作商户网站唯一订单号。
+	 **/
+	private $outTradeNo;
+	
+	/** 
+	 * 订单中商品的单价。
+如果请求时传入本参数,则必须满足total_fee=price×quantity的条件。
+	 **/
+	private $price;
+	
+	/** 
+	 * 订单中商品的数量。
+如果请求时传入本参数,则必须满足total_fee=price×quantity的条件。
+	 **/
+	private $quantity;
+	
+	/** 
+	 * 业务关联ID集合,用于放置商户的订单号、支付流水号等信息,json格式,具体请参见“4.6 业务关联ID集合说明”。
+	 **/
+	private $refIds;
+	
+	/** 
+	 * 描述分账明细信息,json格式,具体请参见“4.4 分账明细说明”。
+	 **/
+	private $royaltyParameters;
+	
+	/** 
+	 * 卖家的分账类型,目前只支持传入ROYALTY(普通分账类型)。
+	 **/
+	private $royaltyType;
+	
+	/** 
+	 * 卖家支付宝账号,可以为email或者手机号。
+如果seller_id不为空,则以seller_id的值作为卖家账号,忽略本参数。
+	 **/
+	private $sellerEmail;
+	
+	/** 
+	 * 卖家支付宝账号对应的支付宝唯一用户号。
+以2088开头的纯16位数字。
+如果和seller_email同时为空,则本参数默认填充partner的值。
+	 **/
+	private $sellerId;
+	
+	/** 
+	 * 收银台页面上,商品展示的超链接。
+	 **/
+	private $showUrl;
+	
+	/** 
+	 * 商品的标题/交易标题/订单标题/订单关键字等。
+该参数最长为128个汉字。
+	 **/
+	private $subject;
+	
+	/** 
+	 * 该笔订单的资金总额,取值范围[0.01,100000000],精确到小数点后2位。
+	 **/
+	private $totalFee;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setAlipayCaRequest($alipayCaRequest)
+	{
+		$this->alipayCaRequest = $alipayCaRequest;
+		$this->apiParas["alipay_ca_request"] = $alipayCaRequest;
+	}
+
+	public function getAlipayCaRequest()
+	{
+		return $this->alipayCaRequest;
+	}
+
+	public function setBody($body)
+	{
+		$this->body = $body;
+		$this->apiParas["body"] = $body;
+	}
+
+	public function getBody()
+	{
+		return $this->body;
+	}
+
+	public function setBuyerEmail($buyerEmail)
+	{
+		$this->buyerEmail = $buyerEmail;
+		$this->apiParas["buyer_email"] = $buyerEmail;
+	}
+
+	public function getBuyerEmail()
+	{
+		return $this->buyerEmail;
+	}
+
+	public function setBuyerId($buyerId)
+	{
+		$this->buyerId = $buyerId;
+		$this->apiParas["buyer_id"] = $buyerId;
+	}
+
+	public function getBuyerId()
+	{
+		return $this->buyerId;
+	}
+
+	public function setChannelParameters($channelParameters)
+	{
+		$this->channelParameters = $channelParameters;
+		$this->apiParas["channel_parameters"] = $channelParameters;
+	}
+
+	public function getChannelParameters()
+	{
+		return $this->channelParameters;
+	}
+
+	public function setCurrency($currency)
+	{
+		$this->currency = $currency;
+		$this->apiParas["currency"] = $currency;
+	}
+
+	public function getCurrency()
+	{
+		return $this->currency;
+	}
+
+	public function setDynamicId($dynamicId)
+	{
+		$this->dynamicId = $dynamicId;
+		$this->apiParas["dynamic_id"] = $dynamicId;
+	}
+
+	public function getDynamicId()
+	{
+		return $this->dynamicId;
+	}
+
+	public function setDynamicIdType($dynamicIdType)
+	{
+		$this->dynamicIdType = $dynamicIdType;
+		$this->apiParas["dynamic_id_type"] = $dynamicIdType;
+	}
+
+	public function getDynamicIdType()
+	{
+		return $this->dynamicIdType;
+	}
+
+	public function setExtendParams($extendParams)
+	{
+		$this->extendParams = $extendParams;
+		$this->apiParas["extend_params"] = $extendParams;
+	}
+
+	public function getExtendParams()
+	{
+		return $this->extendParams;
+	}
+
+	public function setFormatType($formatType)
+	{
+		$this->formatType = $formatType;
+		$this->apiParas["format_type"] = $formatType;
+	}
+
+	public function getFormatType()
+	{
+		return $this->formatType;
+	}
+
+	public function setGoodsDetail($goodsDetail)
+	{
+		$this->goodsDetail = $goodsDetail;
+		$this->apiParas["goods_detail"] = $goodsDetail;
+	}
+
+	public function getGoodsDetail()
+	{
+		return $this->goodsDetail;
+	}
+
+	public function setItBPay($itBPay)
+	{
+		$this->itBPay = $itBPay;
+		$this->apiParas["it_b_pay"] = $itBPay;
+	}
+
+	public function getItBPay()
+	{
+		return $this->itBPay;
+	}
+
+	public function setMcardParameters($mcardParameters)
+	{
+		$this->mcardParameters = $mcardParameters;
+		$this->apiParas["mcard_parameters"] = $mcardParameters;
+	}
+
+	public function getMcardParameters()
+	{
+		return $this->mcardParameters;
+	}
+
+	public function setOperatorId($operatorId)
+	{
+		$this->operatorId = $operatorId;
+		$this->apiParas["operator_id"] = $operatorId;
+	}
+
+	public function getOperatorId()
+	{
+		return $this->operatorId;
+	}
+
+	public function setOperatorType($operatorType)
+	{
+		$this->operatorType = $operatorType;
+		$this->apiParas["operator_type"] = $operatorType;
+	}
+
+	public function getOperatorType()
+	{
+		return $this->operatorType;
+	}
+
+	public function setOutTradeNo($outTradeNo)
+	{
+		$this->outTradeNo = $outTradeNo;
+		$this->apiParas["out_trade_no"] = $outTradeNo;
+	}
+
+	public function getOutTradeNo()
+	{
+		return $this->outTradeNo;
+	}
+
+	public function setPrice($price)
+	{
+		$this->price = $price;
+		$this->apiParas["price"] = $price;
+	}
+
+	public function getPrice()
+	{
+		return $this->price;
+	}
+
+	public function setQuantity($quantity)
+	{
+		$this->quantity = $quantity;
+		$this->apiParas["quantity"] = $quantity;
+	}
+
+	public function getQuantity()
+	{
+		return $this->quantity;
+	}
+
+	public function setRefIds($refIds)
+	{
+		$this->refIds = $refIds;
+		$this->apiParas["ref_ids"] = $refIds;
+	}
+
+	public function getRefIds()
+	{
+		return $this->refIds;
+	}
+
+	public function setRoyaltyParameters($royaltyParameters)
+	{
+		$this->royaltyParameters = $royaltyParameters;
+		$this->apiParas["royalty_parameters"] = $royaltyParameters;
+	}
+
+	public function getRoyaltyParameters()
+	{
+		return $this->royaltyParameters;
+	}
+
+	public function setRoyaltyType($royaltyType)
+	{
+		$this->royaltyType = $royaltyType;
+		$this->apiParas["royalty_type"] = $royaltyType;
+	}
+
+	public function getRoyaltyType()
+	{
+		return $this->royaltyType;
+	}
+
+	public function setSellerEmail($sellerEmail)
+	{
+		$this->sellerEmail = $sellerEmail;
+		$this->apiParas["seller_email"] = $sellerEmail;
+	}
+
+	public function getSellerEmail()
+	{
+		return $this->sellerEmail;
+	}
+
+	public function setSellerId($sellerId)
+	{
+		$this->sellerId = $sellerId;
+		$this->apiParas["seller_id"] = $sellerId;
+	}
+
+	public function getSellerId()
+	{
+		return $this->sellerId;
+	}
+
+	public function setShowUrl($showUrl)
+	{
+		$this->showUrl = $showUrl;
+		$this->apiParas["show_url"] = $showUrl;
+	}
+
+	public function getShowUrl()
+	{
+		return $this->showUrl;
+	}
+
+	public function setSubject($subject)
+	{
+		$this->subject = $subject;
+		$this->apiParas["subject"] = $subject;
+	}
+
+	public function getSubject()
+	{
+		return $this->subject;
+	}
+
+	public function setTotalFee($totalFee)
+	{
+		$this->totalFee = $totalFee;
+		$this->apiParas["total_fee"] = $totalFee;
+	}
+
+	public function getTotalFee()
+	{
+		return $this->totalFee;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.acquire.createandpay";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 402 - 0
app/Libs/Pays/AliPaySdk/aop/request/AlipayAcquirePrecreateRequest.php

@@ -0,0 +1,402 @@
+<?php
+/**
+ * ALIPAY API: alipay.acquire.precreate request
+ *
+ * @author auto create
+ * @since 1.0, 2019-03-08 15:29:11
+ */
+class AlipayAcquirePrecreateRequest
+{
+	/** 
+	 * 对一笔交易的具体描述信息。如果是多种商品,请将商品描述字符串累加传给body
+	 **/
+	private $body;
+	
+	/** 
+	 * 描述多渠道收单的渠道明细信息,json格式
+	 **/
+	private $channelParameters;
+	
+	/** 
+	 * 订单金额币种。目前只支持传入156(人民币)。
+如果为空,则默认设置为156
+	 **/
+	private $currency;
+	
+	/** 
+	 * 公用业务扩展信息。用于商户的特定业务信息的传递,只有商户与支付宝约定了传递此参数且约定了参数含义,此参数才有效。
+比如可传递二维码支付场景下的门店ID等信息,以json格式传输。
+	 **/
+	private $extendParams;
+	
+	/** 
+	 * 描述商品明细信息,json格式。
+	 **/
+	private $goodsDetail;
+	
+	/** 
+	 * 订单支付超时时间。设置未付款交易的超时时间,一旦超时,该笔交易就会自动被关闭。
+取值范围:1m~15d。
+m-分钟,h-小时,d-天,1c-当天(无论交易何时创建,都在0点关闭)。
+该参数数值不接受小数点,如1.5h,可转换为90m。
+该功能需要联系支付宝配置关闭时间。
+	 **/
+	private $itBPay;
+	
+	/** 
+	 * 操作员的类型:
+0:支付宝操作员
+1:商户的操作员
+如果传入其它值或者为空,则默认设置为1
+	 **/
+	private $operatorCode;
+	
+	/** 
+	 * 卖家的操作员ID
+	 **/
+	private $operatorId;
+	
+	/** 
+	 * 支付宝合作商户网站唯一订单号
+	 **/
+	private $outTradeNo;
+	
+	/** 
+	 * 订单中商品的单价。
+如果请求时传入本参数,则必须满足total_fee=price×quantity的条件
+	 **/
+	private $price;
+	
+	/** 
+	 * 订单中商品的数量。
+如果请求时传入本参数,则必须满足total_fee=price×quantity的条件
+	 **/
+	private $quantity;
+	
+	/** 
+	 * 分账信息。
+描述分账明细信息,json格式
+	 **/
+	private $royaltyParameters;
+	
+	/** 
+	 * 分账类型。卖家的分账类型,目前只支持传入ROYALTY(普通分账类型)
+	 **/
+	private $royaltyType;
+	
+	/** 
+	 * 卖家支付宝账号,可以为email或者手机号。如果seller_id不为空,则以seller_id的值作为卖家账号,忽略本参数
+	 **/
+	private $sellerEmail;
+	
+	/** 
+	 * 卖家支付宝账号对应的支付宝唯一用户号,以2088开头的纯16位数字。如果和seller_email同时为空,则本参数默认填充partner的值
+	 **/
+	private $sellerId;
+	
+	/** 
+	 * 收银台页面上,商品展示的超链接
+	 **/
+	private $showUrl;
+	
+	/** 
+	 * 商品购买
+	 **/
+	private $subject;
+	
+	/** 
+	 * 订单金额。该笔订单的资金总额,取值范围[0.01,100000000],精确到小数点后2位。
+	 **/
+	private $totalFee;
+
+	private $apiParas = array();
+	private $terminalType;
+	private $terminalInfo;
+	private $prodCode;
+	private $apiVersion="1.0";
+	private $notifyUrl;
+	private $returnUrl;
+    private $needEncrypt=false;
+
+	
+	public function setBody($body)
+	{
+		$this->body = $body;
+		$this->apiParas["body"] = $body;
+	}
+
+	public function getBody()
+	{
+		return $this->body;
+	}
+
+	public function setChannelParameters($channelParameters)
+	{
+		$this->channelParameters = $channelParameters;
+		$this->apiParas["channel_parameters"] = $channelParameters;
+	}
+
+	public function getChannelParameters()
+	{
+		return $this->channelParameters;
+	}
+
+	public function setCurrency($currency)
+	{
+		$this->currency = $currency;
+		$this->apiParas["currency"] = $currency;
+	}
+
+	public function getCurrency()
+	{
+		return $this->currency;
+	}
+
+	public function setExtendParams($extendParams)
+	{
+		$this->extendParams = $extendParams;
+		$this->apiParas["extend_params"] = $extendParams;
+	}
+
+	public function getExtendParams()
+	{
+		return $this->extendParams;
+	}
+
+	public function setGoodsDetail($goodsDetail)
+	{
+		$this->goodsDetail = $goodsDetail;
+		$this->apiParas["goods_detail"] = $goodsDetail;
+	}
+
+	public function getGoodsDetail()
+	{
+		return $this->goodsDetail;
+	}
+
+	public function setItBPay($itBPay)
+	{
+		$this->itBPay = $itBPay;
+		$this->apiParas["it_b_pay"] = $itBPay;
+	}
+
+	public function getItBPay()
+	{
+		return $this->itBPay;
+	}
+
+	public function setOperatorCode($operatorCode)
+	{
+		$this->operatorCode = $operatorCode;
+		$this->apiParas["operator_code"] = $operatorCode;
+	}
+
+	public function getOperatorCode()
+	{
+		return $this->operatorCode;
+	}
+
+	public function setOperatorId($operatorId)
+	{
+		$this->operatorId = $operatorId;
+		$this->apiParas["operator_id"] = $operatorId;
+	}
+
+	public function getOperatorId()
+	{
+		return $this->operatorId;
+	}
+
+	public function setOutTradeNo($outTradeNo)
+	{
+		$this->outTradeNo = $outTradeNo;
+		$this->apiParas["out_trade_no"] = $outTradeNo;
+	}
+
+	public function getOutTradeNo()
+	{
+		return $this->outTradeNo;
+	}
+
+	public function setPrice($price)
+	{
+		$this->price = $price;
+		$this->apiParas["price"] = $price;
+	}
+
+	public function getPrice()
+	{
+		return $this->price;
+	}
+
+	public function setQuantity($quantity)
+	{
+		$this->quantity = $quantity;
+		$this->apiParas["quantity"] = $quantity;
+	}
+
+	public function getQuantity()
+	{
+		return $this->quantity;
+	}
+
+	public function setRoyaltyParameters($royaltyParameters)
+	{
+		$this->royaltyParameters = $royaltyParameters;
+		$this->apiParas["royalty_parameters"] = $royaltyParameters;
+	}
+
+	public function getRoyaltyParameters()
+	{
+		return $this->royaltyParameters;
+	}
+
+	public function setRoyaltyType($royaltyType)
+	{
+		$this->royaltyType = $royaltyType;
+		$this->apiParas["royalty_type"] = $royaltyType;
+	}
+
+	public function getRoyaltyType()
+	{
+		return $this->royaltyType;
+	}
+
+	public function setSellerEmail($sellerEmail)
+	{
+		$this->sellerEmail = $sellerEmail;
+		$this->apiParas["seller_email"] = $sellerEmail;
+	}
+
+	public function getSellerEmail()
+	{
+		return $this->sellerEmail;
+	}
+
+	public function setSellerId($sellerId)
+	{
+		$this->sellerId = $sellerId;
+		$this->apiParas["seller_id"] = $sellerId;
+	}
+
+	public function getSellerId()
+	{
+		return $this->sellerId;
+	}
+
+	public function setShowUrl($showUrl)
+	{
+		$this->showUrl = $showUrl;
+		$this->apiParas["show_url"] = $showUrl;
+	}
+
+	public function getShowUrl()
+	{
+		return $this->showUrl;
+	}
+
+	public function setSubject($subject)
+	{
+		$this->subject = $subject;
+		$this->apiParas["subject"] = $subject;
+	}
+
+	public function getSubject()
+	{
+		return $this->subject;
+	}
+
+	public function setTotalFee($totalFee)
+	{
+		$this->totalFee = $totalFee;
+		$this->apiParas["total_fee"] = $totalFee;
+	}
+
+	public function getTotalFee()
+	{
+		return $this->totalFee;
+	}
+
+	public function getApiMethodName()
+	{
+		return "alipay.acquire.precreate";
+	}
+
+	public function setNotifyUrl($notifyUrl)
+	{
+		$this->notifyUrl=$notifyUrl;
+	}
+
+	public function getNotifyUrl()
+	{
+		return $this->notifyUrl;
+	}
+
+	public function setReturnUrl($returnUrl)
+	{
+		$this->returnUrl=$returnUrl;
+	}
+
+	public function getReturnUrl()
+	{
+		return $this->returnUrl;
+	}
+
+	public function getApiParas()
+	{
+		return $this->apiParas;
+	}
+
+	public function getTerminalType()
+	{
+		return $this->terminalType;
+	}
+
+	public function setTerminalType($terminalType)
+	{
+		$this->terminalType = $terminalType;
+	}
+
+	public function getTerminalInfo()
+	{
+		return $this->terminalInfo;
+	}
+
+	public function setTerminalInfo($terminalInfo)
+	{
+		$this->terminalInfo = $terminalInfo;
+	}
+
+	public function getProdCode()
+	{
+		return $this->prodCode;
+	}
+
+	public function setProdCode($prodCode)
+	{
+		$this->prodCode = $prodCode;
+	}
+
+	public function setApiVersion($apiVersion)
+	{
+		$this->apiVersion=$apiVersion;
+	}
+
+	public function getApiVersion()
+	{
+		return $this->apiVersion;
+	}
+
+  public function setNeedEncrypt($needEncrypt)
+  {
+
+     $this->needEncrypt=$needEncrypt;
+
+  }
+
+  public function getNeedEncrypt()
+  {
+    return $this->needEncrypt;
+  }
+
+}

+ 0 - 0
app/Libs/Pays/AliPaySdk/aop/request/AlipayAcquireQueryRequest.php


Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio