Skip to content

Conversation

@junggyo1020
Copy link
Contributor

@junggyo1020 junggyo1020 commented Apr 14, 2025

โš™๏ธ ISSUE

๐Ÿ“„ Work Description

1. ์ด๋ฆ„ ์ถฉ๋Œ๋กœ ์ธํ•ด /api/v1/notification/createํ˜ธ์ถœ ์‹œ, messages์™€ notifications ํ…Œ์ด๋ธ”์— ๋ฐ˜์˜์ด ๋˜์ง€ ์•Š๋Š” ์˜ค๋ฅ˜๋ฅผ ๋ฐœ๊ฒฌํ–ˆ์Šต๋‹ˆ๋‹ค. ์ด๋ฅผ ํ•ด๊ฒฐํ•˜๊ธฐ ์œ„ํ•ด ํ•ด๋‹น ํ…Œ์ด๋ธ”๋ช…์„ ๊ฐ๊ฐ message, notification์œผ๋กœ ์ˆ˜์ •ํ–ˆ์Šต๋‹ˆ๋‹ค.โ€จโ€จ

1-1) /api/v1/notification/create ํ˜ธ์ถœ ์‹œ ์ถ”๊ฐ€๋˜๋Š” notification ํ…Œ์ด๋ธ” ๋‚ด์šฉ (์œ ํ˜• 2,3 ์œผ๋กœ ํ…Œ์ŠคํŠธ)
๏ฟผ
Pasted Graphic 1
โ€จ

1-2) /api/v1/notification/create ํ˜ธ์ถœ ์‹œ ์ถ”๊ฐ€๋˜๋Š” message ํ…Œ์ด๋ธ” ๋‚ด์šฉ (์œ ํ˜• 2,3 ์œผ๋กœ ํ…Œ์ŠคํŠธ)

  • ์‚ฌ์šฉ์ž์˜ ์ด๋ฆ„์ด ํ•ด๋‹น ํ‘ธ์‹œ์•Œ๋ฆผ ๋ฉ”์„ธ์ง€ > sub์— ์ •์ƒ์ ์œผ๋กœ ๋ฐ˜์˜๋จ์„ ํ™•์ธํ–ˆ์Šต๋‹ˆ๋‹ค.
Pasted Graphic 2

1-3) Postman์œผ๋กœ ์ •์ƒ์ ์œผ๋กœ ํ•ด๋‹น POST API๊ฐ€ ์‹คํ–‰๋จ์„ ํ™•์ธํ–ˆ์Šต๋‹ˆ๋‹ค.โ€จ
๏ฟผ
Pasted Graphic 3

2. ์ „์ฒด ๋Œ€์ƒ ํ‘ธ์‹œ์•Œ๋ฆผ ๋ฐœ์†ก ์‹œ, ์ •์ƒ์ ์œผ๋กœ ๋ฐœ์†ก๋œ ํ‘ธ์‹œ์•Œ๋ฆผ์˜ sent_status๊ฐ€ true๋กœ ๋ณ€๊ฒฝ๋˜๋„๋ก ์„ค์ •ํ•˜์˜€์Šต๋‹ˆ๋‹ค.

2-1) ๋ฐœ์†ก ์ „ ์ƒํƒœ (ID 1๊ณผ 2 ๋ชจ๋‘ sent_status๊ฐ€ false)

Pasted Graphic 4 ๏ฟผ

2-2) /api/v1/push-notifications/send-all ํ˜ธ์ถœํ•˜์—ฌ ์ „์ฒด ๋Œ€์ƒ ํ‘ธ์‹œ์•Œ๋ฆผ ๋ฐœ์†ก (๋กœ๊ทธ๋กœ 2๊ฐœ๊ฐ€ ์ „์†ก๋จ์„ ํ™•์ธ)
๏ฟผ
Pasted Graphic 5

2-3) ๋ฐœ์†ก ํ›„ ์ƒํƒœ (ID 1๊ณผ 2 ๋ชจ๋‘ sent_status๊ฐ€ true)
๏ฟผ
Pasted Graphic 6

2-4) ๋งŒ์•ฝ, sent_status๊ฐ€ ์ด๋ฏธ true๋ผ๋ฉด ์ค‘๋ณต์œผ๋กœ ๋ฐœ์†ก๋˜์ง€ ์•Š๋„๋ก ๋กœ์ง์„ ๊ตฌํ˜„ํ–ˆ์Šต๋‹ˆ๋‹ค. (DDL์—์„œ ์กฐํšŒ๋งŒ ํ•˜๊ณ  ํ‘ธ์‹œ์•Œ๋ฆผ์„ ๋ฐœ์†กํ•˜์ง€ ์•Š์Œ์„ ํ™•์ธ)โ€จ
๏ฟผ
Pasted Graphic 7

3. ๊ณตํ†ต์ ์œผ๋กœ User์˜ push_status๊ฐ€ ENABLED์ธ ์œ ์ €๋งŒ ํ‘ธ์‹œ์•Œ๋ฆผ๊ณต๊ณ ๊ฐ€ create๋˜๋„๋ก ๋กœ์ง์„ ์ถ”๊ฐ€ํ–ˆ์Šต๋‹ˆ๋‹ค.

๏ฟผ
Pasted Graphic 8

4. FCM ํ† ํฐ์˜ ๊ธธ์ด๊ฐ€ 0์ด๊ฑฐ๋‚˜, ๊ณต๋ฐฑ์ด๊ฑฐ๋‚˜, null ๊ฐ’์˜ ๊ฒฝ์šฐ create๊ฐ€ ๋˜์ง€ ์•Š๋„๋ก ์œ ํšจ์„ฑ ๊ฒ€์ฆ ๋กœ์ง์„ ์ถ”๊ฐ€ํ–ˆ์Šต๋‹ˆ๋‹ค.

4-1) name = โ€œ์นด์นด์˜ค์„œ๋ฒ„QA๊ณ„์ •โ€ ์˜ token๊ฐ’์ด ๋นˆ๊ฐ’์ด๋ฏ€๋กœ create๊ฐ€ ๋˜์ง€ ์•Š๊ณ , name = โ€œํ‘ธ์‹œ์•Œ๋ฆผQAโ€ ๋งŒ create ๋จ์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋‹ค.
๏ฟผ
Pasted Graphic 9

Pasted Graphic 10 Pasted Graphic 11

๏ฟผ

5. ์†Œ์…œ๋กœ๊ทธ์ธ ์‹œ, ํด๋ผ์ด์–ธํŠธ ์ธก์—์„œ fcmToken์„ RequestBody๋กœ ์ „๋‹ฌํ•˜๋„๋ก ํ•˜๊ณ , ํ•ด๋‹น fcmToken์„ ์•Œ๋ฆผ์„œ๋ฒ„์˜ user > token๊ฐ’์œผ๋กœ ์—…๋ฐ์ดํŠธ ํ•˜๋„๋ก ๋กœ์ง์„ ์ถ”๊ฐ€ํ–ˆ์Šต๋‹ˆ๋‹ค!

๏ฟผ
Pasted Graphic 13

Server response

๐Ÿ’ฌ To Reviewers

  • ํ˜„์žฌ ์œ ํšจํ•œ fcmํ† ํฐ์„ ๊ฐ€์ง€๊ณ  ์žˆ๋Š” ์œ ์ €์—๊ฒŒ๋งŒ ์ „์†ก์ด ๋˜๋Š” ๋กœ์ง์ด๊ธฐ ๋–„๋ฌธ์—, ๋‹ค์ค‘ ์œ ์ €์— ๋Œ€ํ•œ ํ‘ธ์‹œ์•Œ๋ฆผ ํ…Œ์ŠคํŠธ๋Š” ์ง„ํ–‰ํ•˜์ง€ ๋ชปํ•œ ์ƒํƒœ์ž…๋‹ˆ๋‹ค.
  • ํ˜„์žฌ ์œ ํ˜• 1์— ๋Œ€ํ•œ ํ‘ธ์‹œ์•Œ๋ฆผ ๊ตฌํ˜„์€ ์ˆ˜์ •์ด ํ•„์š”ํ•œ ์ƒํƒœ์—ฌ์„œ ์œ ํ˜• 2, 3์˜ ํ‘ธ์‹œ์•Œ๋ฆผ ๊ณต๊ณ ์— ๋Œ€ํ•œ ๊ฒ€์ฆ์„ ์œ„์ฃผ๋กœ ์ง„ํ–‰ํ–ˆ์Šต๋‹ˆ๋‹ค.
  • ์ดํ›„ ๋™๊ธฐํ™” ๊ด€๋ จ ๋กœ์ง ๊ฒ€์ฆ, ์œ ํ˜• 1 ๋กœ์ง ๊ฒ€์ฆ์„ ์ˆœ์ฐจ์ ์œผ๋กœ ์ง„ํ–‰ํ•  ์˜ˆ์ •์ž…๋‹ˆ๋‹ค.

โœ… PR check list

  • Reviewers
  • Assignees
  • Labels

Copy link
Member

@JungYoonShin JungYoonShin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ˆ˜๊ณ ํ•˜์…จ์Šต๋‹ˆ๋‹ค!!!๐Ÿ€ ๊ตฌ๋‘๋กœ ์„ค๋ช… ๋“ค์–ด์„œ ํ”Œ๋กœ์šฐ๋Š” ์ดํ•ด๋˜์—ˆ์Šต๋‹ˆ๋‹ค!!

Comment on lines 36 to 38
.filter(user -> user.getToken() != null
&& user.getToken().value() != null
&& !user.getToken().value().trim().isEmpty())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์š”๊ฑฐ ์•„๋ž˜ ์ฝ”๋“œ์ฒ˜๋Ÿผ filter ๋‹ค์ค‘์œผ๋กœ ๋‹ฌ์•„์ค„ ์ˆ˜ ์žˆ๋‹ค๊ตฌ ํ•˜๋„ค์š”!!
์š”๋ ‡๊ฒŒ ์‚ฌ์šฉํ•˜๋ฉด ๊ฐ€๋…์„ฑ ์ข€ ๋” ์ข‹์•„์งˆ ์ˆ˜ ์žˆ์„ ๊ฒƒ ๊ฐ™์•„์š”~!

List<Student> filteredStream = students.stream()
   .filter(s -> s.getMarksAverage() > 50)
   .filter(s -> s.getMarks().size() > 3)
   .filter(not(s -> s.getProfile() == Student.Profile.PHYSICS))

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stream API์—์„œ ๋‹ค์ค‘ ํ•„ํ„ฐ๊ฐ€ ์ ์šฉ๋˜๋Š”์ง€ ์ฒ˜์Œ ์•Œ์•˜๋„ค์š”..! ์ข‹์€ ์˜๊ฒฌ ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค :)

@junggyo1020 junggyo1020 merged commit d46b5bd into develop Apr 15, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

๐Ÿถ์ •๊ต๐Ÿถ ๐Ÿ”จ fix ๋ฒ„๊ทธ, ์˜ค๋ฅ˜ ์ˆ˜์ • size/M

Projects

None yet

3 participants