Skip to content

Conversation

@MEOHIN
Copy link
Collaborator

@MEOHIN MEOHIN commented Sep 26, 2025

📢 기능 설명

개발 환경 초기 데이터(DevInitData)를 추가했습니다.

initData의 시나리오

개요

  • 프로필: dev에서만 동작(ApplicationRunner).
  • 멱등성: 존재 시 스킵(카운트/존재 체크).
  • 제외: 챗봇 이력 시드는 포함하지 않음.

시드 순서

  • Cocktail → User → Board(게시글/댓글/좋아요) → MyBar → Notification
Cocktail
  • 4종 생성(이미지: /img/cocktail/1~4.jpg)
    • 하이볼: LIGHT, LONG, WHISKY
    • 진토닉: WEAK, LONG, GIN
    • 올드패션드: STRONG, SHORT, WHISKY
    • 모히또: LIGHT, LONG, RUM
User
  • A: USER, ACTIVE
  • B: USER → 나중에 soft delete 처리(닉네임 “탈퇴한 사용자”, email/oauthId null, deletedAt 세팅)
  • C: USER, ACTIVE
Board
  • 카테고리: “자유” 생성(없으면)
  • 게시글:
    • Post A: 작성자 A, 이미지 /img/cocktail/1.jpg
    • Post B: 작성자 B, 이미지 /img/cocktail/2.jpg
  • 댓글(작성자 C): Post A에 1건, Post B에 1건
  • 좋아요:
    • A → Post B LIKE
    • B → Post A LIKE
    • C → Post A LIKE, Post B LIKE
    • 각 포스트 likeCount 반영(각 2)
  • B 사용자 soft delete 처리(게시글·좋아요·댓글 생성 후)
MyBar
  • A: 하이볼(keptAt=now-2d), 진토닉(keptAt=now-1d)
  • B: 올드패션드 keep 후 unkeep → DELETED
  • C: 진토닉(keptAt=now-3d), 올드패션드(keptAt=now-2d), 모히또(keptAt=now-1h)
  • 방식: MyBarService.keep/unkeep 사용(ABV 점수 로직 반영), 이후 keptAt 보정
Notification
  • 게시글 소유자에게 COMMENT/LIKE 알림 생성
    • A에게: Post A 기준 COMMENT 1개 + LIKE 2개
    • B에게: Post B 기준 COMMENT 1개 + LIKE 2개
  • 읽음여부 기본 false(목록에 노출)

연결된 issue

close #158



🩷 Approve 하기 전 확인해주세요!

  • SecurityConfig에 회원 탈퇴 엔드포인트 인증 규칙 추가
    • DELETE /me/account 엔드포인트에 인증된 사용자만 접근 가능하도록 권한 설정 (.authenticated())

✅ 체크리스트

  • PR 제목 규칙 잘 지켰는가?
  • 추가/수정사항을 설명하였는가?
  • 이슈넘버를 적었는가?
  • Approve 하기 전 확인 사항 체크했는가?

- `DevInitData`에 사용자, 게시판(게시글/댓글/좋아요), 알림, 마이바 데이터 초기화 로직 추가
- cocktailInt: 기본 칵테일 4종 데이터 생성
- userInit: 테스트 사용자(A, B, C) 생성
- boardInit: 게시글, 댓글, 좋아요 샘플 데이터 및 탈퇴한 사용자 B의 데이터 포함
- notificationInit: 사용자별 알림 샘플 데이터 생성
- myBarInit: 사용자의 칵테일 킵(Keep) 기록 샘플 데이터 생성
- 전체 초기화 메서드를 `ApplicationRunner`에 등록하여 애플리케이션 시작 시 데이터 자동 삽입
- `DELETE /me/account` 엔드포인트에 인증된 사용자만 접근 가능하도록 권한 설정 (`.authenticated()`)
@MEOHIN MEOHIN self-assigned this Sep 26, 2025
@MEOHIN MEOHIN added the chore 문서 작업 label Sep 26, 2025
@github-actions github-actions bot added the feat 새로운 기능 추가 label Sep 26, 2025
@MEOHIN MEOHIN merged commit 86a6c69 into dev Sep 26, 2025
1 check passed
@MEOHIN MEOHIN deleted the feat#158 branch September 26, 2025 06:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore 문서 작업 feat 새로운 기능 추가

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[chore] init data 추가

4 participants