feat(ckeditor5,board,ecommerce,page,core,admin_basic): 미참조 에디터 업로드 이미지 정리 신설 + 업로드 고아 동종 결함 7건 전수 해소
공개 (@Tuwasduliebst 제보) 대응. - ckeditor5: 미참조 이미지 정리 엔진 신설 — 참조 판정(hash + 파일명 2토큰, filter_reference_sources 훅으로 확장 콘텐츠 등록) + 정리 커맨드(기본 꺼짐 옵트인, 3중 게이트) + 업로드 관리 화면(권한 분리·참조 배지·개별/선택 삭제) + 기설치본 설정 백필 upgrade step - board: 임시 첨부 GC(상시) + 소프트삭제 첨부 영구 정리(옵트인) + 설정 UI, 저장 payload 누락(F4)·빈 temp 디렉토리 잔존(F5) 수정 - ecommerce: 임시 상품 이미지 GC + 카테고리 삭제 시 이미지 파일 미삭제(S4) 수정 - page: 임시 첨부 GC - 코어: 고아 첨부 정리 커맨드(옵트인, site_logo 보호) + 사이트 로고 교체 시 구 로고 재편입 차단(S6) + DB 백업 미구현 501 정직화(B3) + 플러그인 관리자 메뉴 설치·업데이트 자동 동기화(F1·F7) - 동반: 플러그인 설정 검증 오류 필드명 라벨화(F3), Toggle 노드 type 정정 수평 전개(marketing 1.0.2 bump·gdpr·ecommerce), ja 언어팩 4종, API 문서, hooks.md, 시나리오 매니페스트 8종, Playwright E2E 4종
This commit is contained in:
1 parent
1d895a6428
commit
cfc2caba1b
170 files changed
+11142
-209
No files matched your search
@@ -90,6 +90,14 @@ class CategoryImageRepository implements CategoryImageRepositoryInterface
|
||||
return $image?->delete() ?? false;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function deleteByCategoryId(int $categoryId): int
|
||||
{
|
||||
return $this->model->where('category_id', $categoryId)->delete();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
|
||||
+27
-17
@@ -13,7 +13,7 @@ interface CategoryImageRepositoryInterface
|
||||
/**
|
||||
* ID로 이미지 조회
|
||||
*
|
||||
* @param int $id 이미지 ID
|
||||
* @param int $id 이미지 ID
|
||||
* @return CategoryImage|null
|
||||
*/
|
||||
public function findById(int $id): ?CategoryImage;
|
||||
@@ -21,7 +21,7 @@ interface CategoryImageRepositoryInterface
|
||||
/**
|
||||
* 해시로 이미지 조회
|
||||
*
|
||||
* @param string $hash 이미지 해시
|
||||
* @param string $hash 이미지 해시
|
||||
* @return CategoryImage|null
|
||||
*/
|
||||
public function findByHash(string $hash): ?CategoryImage;
|
||||
@@ -29,8 +29,8 @@ interface CategoryImageRepositoryInterface
|
||||
/**
|
||||
* 카테고리의 모든 이미지 조회
|
||||
*
|
||||
* @param int $categoryId 카테고리 ID
|
||||
* @param string|null $collection 컬렉션 필터
|
||||
* @param int $categoryId 카테고리 ID
|
||||
* @param string|null $collection 컬렉션 필터
|
||||
* @return Collection
|
||||
*/
|
||||
public function getByCategoryId(int $categoryId, ?string $collection = null): Collection;
|
||||
@@ -38,8 +38,8 @@ interface CategoryImageRepositoryInterface
|
||||
/**
|
||||
* temp_key로 임시 이미지 조회
|
||||
*
|
||||
* @param string $tempKey 임시 키
|
||||
* @param string|null $collection 컬렉션 필터
|
||||
* @param string $tempKey 임시 키
|
||||
* @param string|null $collection 컬렉션 필터
|
||||
* @return Collection
|
||||
*/
|
||||
public function getByTempKey(string $tempKey, ?string $collection = null): Collection;
|
||||
@@ -47,7 +47,7 @@ interface CategoryImageRepositoryInterface
|
||||
/**
|
||||
* 카테고리 이미지 생성
|
||||
*
|
||||
* @param array $data 이미지 데이터
|
||||
* @param array $data 이미지 데이터
|
||||
* @return CategoryImage
|
||||
*/
|
||||
public function create(array $data): CategoryImage;
|
||||
@@ -55,8 +55,8 @@ interface CategoryImageRepositoryInterface
|
||||
/**
|
||||
* 이미지 수정
|
||||
*
|
||||
* @param int $id 이미지 ID
|
||||
* @param array $data 수정할 데이터
|
||||
* @param int $id 이미지 ID
|
||||
* @param array $data 수정할 데이터
|
||||
* @return CategoryImage
|
||||
*/
|
||||
public function update(int $id, array $data): CategoryImage;
|
||||
@@ -64,16 +64,26 @@ interface CategoryImageRepositoryInterface
|
||||
/**
|
||||
* 이미지 삭제
|
||||
*
|
||||
* @param int $id 이미지 ID
|
||||
* @param int $id 이미지 ID
|
||||
* @return bool
|
||||
*/
|
||||
public function delete(int $id): bool;
|
||||
|
||||
/**
|
||||
* 카테고리에 속한 이미지 행을 일괄 삭제
|
||||
*
|
||||
* 물리 파일 삭제는 호출한 Service 가 담당합니다 (행마다 disk 가 다를 수 있음).
|
||||
*
|
||||
* @param int $categoryId 카테고리 ID
|
||||
* @return int 삭제된 행 수
|
||||
*/
|
||||
public function deleteByCategoryId(int $categoryId): int;
|
||||
|
||||
/**
|
||||
* 임시 이미지를 카테고리에 연결
|
||||
*
|
||||
* @param string $tempKey 임시 키
|
||||
* @param int $categoryId 카테고리 ID
|
||||
* @param string $tempKey 임시 키
|
||||
* @param int $categoryId 카테고리 ID
|
||||
* @return int 연결된 이미지 수
|
||||
*/
|
||||
public function linkTempImages(string $tempKey, int $categoryId): int;
|
||||
@@ -81,8 +91,8 @@ interface CategoryImageRepositoryInterface
|
||||
/**
|
||||
* 카테고리의 최대 sort_order 조회
|
||||
*
|
||||
* @param int $categoryId 카테고리 ID
|
||||
* @param string $collection 컬렉션명
|
||||
* @param int $categoryId 카테고리 ID
|
||||
* @param string $collection 컬렉션명
|
||||
* @return int
|
||||
*/
|
||||
public function getMaxSortOrder(int $categoryId, string $collection): int;
|
||||
@@ -90,8 +100,8 @@ interface CategoryImageRepositoryInterface
|
||||
/**
|
||||
* temp_key의 최대 sort_order 조회
|
||||
*
|
||||
* @param string $tempKey 임시 키
|
||||
* @param string $collection 컬렉션명
|
||||
* @param string $tempKey 임시 키
|
||||
* @param string $collection 컬렉션명
|
||||
* @return int
|
||||
*/
|
||||
public function getMaxSortOrderByTempKey(string $tempKey, string $collection): int;
|
||||
@@ -99,7 +109,7 @@ interface CategoryImageRepositoryInterface
|
||||
/**
|
||||
* 순서 변경
|
||||
*
|
||||
* @param array<int, int> $orders 이미지 ID => sort_order 매핑
|
||||
* @param array<int, int> $orders 이미지 ID => sort_order 매핑
|
||||
* @return bool
|
||||
*/
|
||||
public function reorder(array $orders): bool;
|
||||
|
||||
+13
@@ -3,6 +3,7 @@
|
||||
namespace Modules\Sirsoft\Ecommerce\Repositories\Contracts;
|
||||
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Modules\Sirsoft\Ecommerce\Models\ProductImage;
|
||||
|
||||
/**
|
||||
@@ -69,6 +70,18 @@ interface ProductImageRepositoryInterface
|
||||
*/
|
||||
public function delete(int $id): bool;
|
||||
|
||||
/**
|
||||
* 상품에 연결되지 않은 채 방치된 임시 이미지를 오래된 순으로 조회
|
||||
*
|
||||
* 상품 등록 폼에서 업로드만 하고 저장 없이 이탈하면 `temp_key` 가 남은 채
|
||||
* `product_id` 가 비어 있는 행과 그 파일이 영구 잔존합니다. 그 회수 대상을 찾습니다.
|
||||
*
|
||||
* @param Carbon $threshold 기준 시각 (이 시각 이전 업로드가 대상)
|
||||
* @param int $limit 최대 조회 건수
|
||||
* @return Collection<int, ProductImage> 임시 이미지 목록 (created_at 오름차순)
|
||||
*/
|
||||
public function findStaleTempImages(Carbon $threshold, int $limit): Collection;
|
||||
|
||||
/**
|
||||
* 임시 이미지를 상품에 연결
|
||||
*
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
namespace Modules\Sirsoft\Ecommerce\Repositories;
|
||||
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Modules\Sirsoft\Ecommerce\Models\ProductImage;
|
||||
use Modules\Sirsoft\Ecommerce\Repositories\Contracts\ProductImageRepositoryInterface;
|
||||
|
||||
@@ -90,6 +91,21 @@ class ProductImageRepository implements ProductImageRepositoryInterface
|
||||
return $image?->forceDelete() ?? false;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function findStaleTempImages(Carbon $threshold, int $limit): Collection
|
||||
{
|
||||
return $this->model->newQuery()
|
||||
->whereNotNull('temp_key')
|
||||
->whereNull('product_id')
|
||||
->where('created_at', '<', $threshold)
|
||||
->orderBy('created_at')
|
||||
->orderBy('id')
|
||||
->limit($limit)
|
||||
->get(['id', 'temp_key', 'disk', 'path', 'created_at']);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user