forked from kuaifan/dootask
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of ssh://git.gezi.vip:6006/gx/dootask
# Conflicts: # public/css/app.css # public/js/app.js # public/js/build/208.js # public/js/build/389.js # public/js/build/406.js # public/js/build/406.js.LICENSE.txt # public/js/build/423.js # public/js/build/459.js # public/js/build/459.js.LICENSE.txt # public/js/build/688.js # public/js/build/688.js.LICENSE.txt # public/js/build/726.js # public/js/build/755.js # public/js/build/93.js # public/js/build/954.js
- Loading branch information
Showing
7,013 changed files
with
2,558,474 additions
and
75 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?php | ||
|
||
namespace App\Tasks; | ||
|
||
use App\Exceptions\ApiException; | ||
use App\Models\File; | ||
use App\Models\Tmp; | ||
use App\Models\User; | ||
use App\Models\WebSocketTmpMsg; | ||
use Carbon\Carbon; | ||
use Log; | ||
use Throwable; | ||
|
||
/** | ||
* 删除过期临时数据任务 | ||
* Class DeleteTmpTask | ||
* @package App\Tasks | ||
*/ | ||
class BatchRemoveFileTask extends AbstractTask | ||
{ | ||
protected array $_ids = []; | ||
|
||
protected int $_userid; | ||
|
||
public function __construct(array $ids, $userid) | ||
{ | ||
$this->_ids = $ids; | ||
$this->_userid = $userid; | ||
} | ||
|
||
public function start() | ||
{ | ||
foreach ($this->_ids as $id) { | ||
Log::info("---------- $id ----------"); | ||
Log::info("尝试删除Id为[$id]的文件"); | ||
$file = File::find($id); | ||
if (empty($file)) { | ||
Log::warning("Id为[$id]的文件不存在或已被删除"); | ||
continue; | ||
} | ||
Log::info("获取到文件名为[" . $file->name . "],类型为[" . ( $file->type ?: $file->ext ) . "]"); | ||
$permission = $file->getPermission($this->_userid); | ||
if ($permission < 1000) { | ||
Log::warning("文件[$id][" . $file->name . "]仅限所有者或创建者操作"); | ||
continue; | ||
} | ||
try { | ||
$file->deleteFile(); | ||
Log::info("删除Id为[$id]的文件成功"); | ||
} catch (Throwable $throwable) { | ||
Log::error("删除Id为[$id]的文件失败,原因是:" . $throwable->getMessage()); | ||
} | ||
} | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
database/migrations/2022_02_16_145641_web_socket_dialog_users_add_top.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
class WebSocketDialogUsersAddTop extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
Schema::table('web_socket_dialog_users', function (Blueprint $table) { | ||
if (!Schema::hasColumn('web_socket_dialog_users', 'top')) { | ||
$table->tinyInteger('top')->nullable()->default(0)->after('userid')->comment('是否置顶:0否,1是'); | ||
} | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
Schema::table('web_socket_dialog_users', function (Blueprint $table) { | ||
$table->dropColumn("top"); | ||
}); | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
database/migrations/2022_02_18_095253_web_socket_dialog_users_add_top_at.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
class WebSocketDialogUsersAddTopAt extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
Schema::table('web_socket_dialog_users', function (Blueprint $table) { | ||
if (!Schema::hasColumn('web_socket_dialog_users', 'top_at')) { | ||
$table->timestamp('top_at')->nullable()->after('top')->comment('置顶时间'); | ||
} | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
Schema::table('web_socket_dialog_users', function (Blueprint $table) { | ||
$table->dropColumn("top_at"); | ||
}); | ||
} | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.