feat: 添加附件(下载管理)回收站分页/恢复/删除接口

This commit is contained in:
2025-02-21 16:01:40 +08:00
parent c66d7a6761
commit 7402c0a57f
8 changed files with 150 additions and 40 deletions

View File

@@ -83,11 +83,12 @@ class Attachment
{
$post = request()->post([
'name',
'desc',
'category_id',
'sort',
'recommend',
'image',
'aplicable_to',
'applicable_to',
'support_platform',
'attach',
'seo_title',
@@ -96,7 +97,8 @@ class Attachment
]);
$data = array_merge($post, ['language_id' => request()->lang_id]);
$validate = new AttachmentValidate;
$validate = new AttachmentValidate;
$data['attach'] = json_decode($data['attach'], true);
if (!$validate->scene('create')->check($data)) {
return error($validate->getError());
}
@@ -116,11 +118,12 @@ class Attachment
$id = request()->param('id');
$put = request()->put([
'name',
'desc',
'category_id',
'sort',
'recommend',
'image',
'aplicable_to',
'applicable_to',
'support_platform',
'attach',
'seo_title',
@@ -128,7 +131,8 @@ class Attachment
'seo_desc'
]);
$validate = new AttachmentValidate;
$validate = new AttachmentValidate;
$put['attach'] = json_decode($put['attach'], true);
if (!$validate->scene('update')->check(array_merge($put, ['id' => $id]))) {
return error($validate->getError());
}