123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- <?php
- namespace app\api\controller;
- use app\common\controller\Api;
- use think\Db;
- use app\common\library\Uploadvideo;
- use app\utils\RedisKeyEnum;
- use app\utils\RedisUtil;
- class Demo extends Api
- {
-
-
-
-
-
- protected $noNeedLogin = ['*'];
-
- protected $noNeedRight = ['test2'];
-
- public function test()
- {
- $params = [
- 'video_file' => '/uploads/20241101/b472251c04af8842b14f6c15a57fca9b.mp4',
- 'title' => '测试',
- ];
- $full_filepath = config('upload.cdnurl').$params['video_file'];
- $uploadvideo = new Uploadvideo();
- $res = $uploadvideo->testUploadWebVideo($full_filepath,$params['title']);
- $params['vodid'] = $res;
- }
-
- public function test33()
- {
- $params = [
- 'video_file' => 'C:\Windows\Temp\php4F8B.tmp',
- 'title' => '测试'.rand(10,99),
- ];
- $full_filepath = $params['video_file'];
- $uploadvideo = new Uploadvideo();
- $res = $uploadvideo->testUploadLocalVideo($full_filepath,$params['title']);
- $params['vodid'] = $res;
- }
-
- public function test1()
- {
- RedisUtil::getInstance('test'.date('Y-m-d'))->incrby_expire(3,86400);
- }
-
- public function test2()
- {
- $data = [
- [
- 'id' => 1,
- 'answer' => 'A',
- ],
- [
- 'id' => 2,
- 'answer' => 'B',
- ],
- ];
- echo json_encode($data);
- }
-
- public function test3()
- {
- $this->success('返回成功', ['action' => 'test3']);
- }
- }
|