fix(core,board,ecommerce): 조건부 검증 결함 패밀리 일괄 수정 및 실패 안내 노출
여러 화면에서 조건부(FormRequest) 검증이 우회되거나 과도하게 제한되던 결함을 한 계열로 묶어 수정한다. - 검증 규칙 확장 필터 이름 10개를 나머지 92개와 동일 규칙으로 통일 - 설명 길이를 바이트가 아닌 글자 수로 계산(한글 오검출 해소) - 비활성 언어팩 번역 보존한 채 수정 허용 - 알림 템플릿 제목 nullable 존중, 미지원 발송 수단 저장 차단 - 일정/실행 이력 목록 조회 검증 정합 - 게시판 첨부 미사용 시 빈 확장자 통과, new_display_hours/최소 길이 0 허용, 일괄 적용 override_values 범위 검증(SSoT) - 이커머스 클레임 사유 조회 검증, 용어 정정 - 원문 i18n 키 노출 다수 해소, 저장/삭제 실패 시 사유 화면 노출 - 아이콘 크기/다크모드 대비 회귀 수정 번들 확장(모듈3·플러그인6·템플릿2·언어팩5) 버전 new-bump 및 CHANGELOG 반영, ja 언어팩 동기.
This commit is contained in:
1 parent
c001b30a87
commit
7f8fb6870f
288 files changed
+5339
-1049
No files matched your search
@@ -5,13 +5,13 @@ namespace Modules\Sirsoft\Board\Http\Controllers\Admin;
|
||||
use App\Http\Controllers\Api\Base\AdminBaseController;
|
||||
use Illuminate\Database\Eloquent\ModelNotFoundException;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Modules\Sirsoft\Board\Http\Requests\BlindCommentRequest;
|
||||
use Modules\Sirsoft\Board\Http\Requests\RestoreCommentRequest;
|
||||
use Modules\Sirsoft\Board\Http\Requests\StoreCommentRequest;
|
||||
use Modules\Sirsoft\Board\Http\Requests\UpdateCommentRequest;
|
||||
use Modules\Sirsoft\Board\Http\Resources\CommentResource;
|
||||
use Modules\Sirsoft\Board\Models\Board;
|
||||
use Modules\Sirsoft\Board\Services\BoardService;
|
||||
use Modules\Sirsoft\Board\Services\CommentService;
|
||||
use Modules\Sirsoft\Board\Traits\ChecksBoardPermission;
|
||||
|
||||
@@ -28,9 +28,11 @@ class CommentController extends AdminBaseController
|
||||
* CommentController 생성자
|
||||
*
|
||||
* @param CommentService $commentService 댓글 서비스
|
||||
* @param BoardService $boardService 게시판 서비스
|
||||
*/
|
||||
public function __construct(
|
||||
private CommentService $commentService
|
||||
private CommentService $commentService,
|
||||
private BoardService $boardService
|
||||
) {
|
||||
parent::__construct();
|
||||
}
|
||||
@@ -51,7 +53,7 @@ class CommentController extends AdminBaseController
|
||||
|
||||
// 비회원 댓글은 admin.manage 권한 필요
|
||||
if ($commentUserId === null) {
|
||||
return $this->forbidden('sirsoft-board::messages.permissions.access_denied');
|
||||
return $this->forbidden('sirsoft-board::messages.permission.denied');
|
||||
}
|
||||
|
||||
// admin.write 권한이 있고 본인 댓글이면 수정/삭제 가능
|
||||
@@ -59,7 +61,7 @@ class CommentController extends AdminBaseController
|
||||
return null;
|
||||
}
|
||||
|
||||
return $this->forbidden('sirsoft-board::messages.permissions.access_denied');
|
||||
return $this->forbidden('sirsoft-board::messages.permission.denied');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -84,7 +86,11 @@ class CommentController extends AdminBaseController
|
||||
public function store(StoreCommentRequest $request, string $slug, int $postId): JsonResponse
|
||||
{
|
||||
try {
|
||||
$board = Board::where('slug', $slug)->firstOrFail();
|
||||
$board = $this->boardService->getBoardBySlug($slug, checkScope: false);
|
||||
|
||||
if (! $board) {
|
||||
return $this->notFound('sirsoft-board::messages.boards.not_found');
|
||||
}
|
||||
|
||||
if (! $board->use_comment) {
|
||||
return $this->error('sirsoft-board::messages.comments.comments_disabled', 403);
|
||||
@@ -129,7 +135,11 @@ class CommentController extends AdminBaseController
|
||||
return $response;
|
||||
}
|
||||
|
||||
$board = Board::where('slug', $slug)->firstOrFail();
|
||||
$board = $this->boardService->getBoardBySlug($slug, checkScope: false);
|
||||
|
||||
if (! $board) {
|
||||
return $this->notFound('sirsoft-board::messages.boards.not_found');
|
||||
}
|
||||
|
||||
if (! $board->use_comment) {
|
||||
return $this->error('sirsoft-board::messages.comments.comments_disabled', 403);
|
||||
@@ -168,7 +178,11 @@ class CommentController extends AdminBaseController
|
||||
return $response;
|
||||
}
|
||||
|
||||
$board = Board::where('slug', $slug)->firstOrFail();
|
||||
$board = $this->boardService->getBoardBySlug($slug, checkScope: false);
|
||||
|
||||
if (! $board) {
|
||||
return $this->notFound('sirsoft-board::messages.boards.not_found');
|
||||
}
|
||||
|
||||
if (! $board->use_comment) {
|
||||
return $this->error('sirsoft-board::messages.comments.comments_disabled', 403);
|
||||
@@ -196,7 +210,11 @@ class CommentController extends AdminBaseController
|
||||
public function blind(BlindCommentRequest $request, string $slug, int $postId, int $id): JsonResponse
|
||||
{
|
||||
try {
|
||||
$board = Board::where('slug', $slug)->firstOrFail();
|
||||
$board = $this->boardService->getBoardBySlug($slug, checkScope: false);
|
||||
|
||||
if (! $board) {
|
||||
return $this->notFound('sirsoft-board::messages.boards.not_found');
|
||||
}
|
||||
|
||||
if (! $board->use_comment) {
|
||||
return $this->error('sirsoft-board::messages.comments.comments_disabled', 403);
|
||||
@@ -221,22 +239,26 @@ class CommentController extends AdminBaseController
|
||||
/**
|
||||
* 블라인드된 댓글을 복원합니다.
|
||||
*
|
||||
* @param Request $request HTTP 요청 객체
|
||||
* @param RestoreCommentRequest $request 댓글 복원 요청
|
||||
* @param string $slug 게시판 slug
|
||||
* @param int $postId 게시글 ID
|
||||
* @param int $id 댓글 ID
|
||||
* @return JsonResponse 댓글 복원 결과 응답
|
||||
*/
|
||||
public function restore(Request $request, string $slug, int $postId, int $id): JsonResponse
|
||||
public function restore(RestoreCommentRequest $request, string $slug, int $postId, int $id): JsonResponse
|
||||
{
|
||||
try {
|
||||
$board = Board::where('slug', $slug)->firstOrFail();
|
||||
$board = $this->boardService->getBoardBySlug($slug, checkScope: false);
|
||||
|
||||
if (! $board) {
|
||||
return $this->notFound('sirsoft-board::messages.boards.not_found');
|
||||
}
|
||||
|
||||
if (! $board->use_comment) {
|
||||
return $this->error('sirsoft-board::messages.comments.comments_disabled', 403);
|
||||
}
|
||||
|
||||
$reason = $request->input('reason');
|
||||
$reason = $request->validated()['reason'] ?? null;
|
||||
$comment = $this->commentService->restoreComment($slug, $id, $reason);
|
||||
|
||||
return $this->successWithResource(
|
||||
|
||||
Reference in new issue
Block a user