feat: [mock-migration] Phase J-4 게시판 관리 API 수정
- BoardController: show 메서드 ID 기반 조회로 변경
- BoardStoreRequest: extra_settings.target/target_id/target_name 검증 추가
- BoardUpdateRequest: extra_settings.target/target_id/target_name 검증 추가
- routes/api.php: 게시판 상세 라우트 {code} → {id} 변경
테넌트 게시판 정책:
- 테넌트는 자신의 게시판만 CRUD 가능
- 시스템 게시판은 mng에서만 관리
- board_code는 시스템/테넌트 간 중복 허용
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -15,13 +15,17 @@ public function authorize(): bool
|
||||
public function rules(): array
|
||||
{
|
||||
$boardId = $this->route('id');
|
||||
$tenantId = auth()->user()?->current_tenant_id;
|
||||
|
||||
return [
|
||||
'board_code' => [
|
||||
'sometimes',
|
||||
'string',
|
||||
'max:50',
|
||||
Rule::unique('boards', 'board_code')->ignore($boardId),
|
||||
// 테넌트 게시판 내에서만 중복 체크 (시스템 게시판과는 중복 허용)
|
||||
Rule::unique('boards', 'board_code')
|
||||
->ignore($boardId)
|
||||
->where('tenant_id', $tenantId),
|
||||
],
|
||||
'board_type' => 'nullable|string|max:50',
|
||||
'name' => 'sometimes|string|max:100',
|
||||
@@ -31,6 +35,9 @@ public function rules(): array
|
||||
'max_file_count' => 'sometimes|integer|min:0|max:20',
|
||||
'max_file_size' => 'sometimes|integer|min:0|max:102400',
|
||||
'extra_settings' => 'nullable|array',
|
||||
'extra_settings.target' => 'nullable|string|in:all,department',
|
||||
'extra_settings.target_id' => 'nullable|integer',
|
||||
'extra_settings.target_name' => 'nullable|string|max:100',
|
||||
'extra_settings.permissions' => 'nullable|array',
|
||||
'extra_settings.permissions.read' => 'nullable|array',
|
||||
'extra_settings.permissions.write' => 'nullable|array',
|
||||
|
||||
Reference in New Issue
Block a user