Skip to content

[ FEATURE] 공지사항 작성 api #276

Description

@gary5876

📄 설명

공지사항을 생성할 수 있는 API를 구현합니다.

기능 요약:

SYSTEM_ADMIN 권한을 가진 사용자만 공지사항을 생성할 수 있습니다.
제목, 내용을 필수로 입력받고, 파일 첨부는 선택 사항입니다.
요청 형식: multipart/form-data
성공 시 201 Created 응답과 함께 Location 헤더를 반환합니다.

API 스펙:

항목 내용
Endpoint POST /api/notices
Content-Type multipart/form-data
권한 SYSTEM_ADMIN
Request Body title (필수), content (필수), files (선택)
Response 201 Created + NoticeResponseDto

✅ 작업할 내용

  • [] NoticeCreateRequestDto 생성 (title, content 필수 검증)
  • [] NoticeController에 createNotice 메서드 추가
  • [] NoticeService 인터페이스에 createNotice 메서드 정의
  • [] NoticeServiceImpl에 공지사항 생성 로직 구현
  • [] S3Service를 통한 파일 업로드 연동
  • [] @PreAuthorize로 SYSTEM_ADMIN 권한 검증
  • [] Swagger 문서 작성 (@operation, @ApiResponses)
  • [] 단위 테스트 작성

🙋🏻 참고 자료

  • Spring Security @PreAuthorize 어노테이션
  • multipart/form-data 요청 처리
  • 기존 NoticeController 목록/상세 조회 API 참고

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions