halucinor / e-voting

0 stars 0 forks source link

Agenda Service and Controller κΈ°λŠ₯ κ΅¬ν˜„ - [merged] #17

Closed halucinor closed 1 year ago

halucinor commented 1 year ago

Merges feature/agendaService -> dev

@mentor/mentor_2023.01

πŸ“ Description

μ•ˆκ±΄ 생성, 쑰회 κΈ°λŠ₯ κ΅¬ν˜„

πŸ’» How To Test

### πŸ’½ Commits κ΅¬ν˜„ 사항 μš”μ•½ 1. Agenda repository, service, controller κ΅¬ν˜„ 2. κ΄€λ ¨ dto 및 user, vote entity κ΅¬ν˜„ ### πŸ–Ό κ²°κ³Ό ex) μ‹€ν–‰, ν…ŒμŠ€νŠΈ κ²°κ³Ό λ˜λŠ” 사진 첨뢀
halucinor commented 1 year ago

In GitLab by @Kai on Jan 10, 2023, 16:02

Commented on src/main/java/com/gabia/evoting/web/dto/AgendaResponseDto.java line 31

μ»¨λ²€μ…˜μ„ ν˜„μž¬ λ‹€μ‹œ μˆ˜μ •ν•˜κ³  μžˆλŠ”κ±΄κ°€μš”? snake_case ν˜•νƒœκ°€ μžˆλŠ”λ° 변경을 μ•ˆν•˜λŠ” μ΄μœ κ°€ ν˜Ήμ‹œ λ”°λ‘œ μžˆλŠ”μ§€ κΆκΈˆν•΄μ„œ λ¬Όμ–΄λ΄…λ‹ˆλ‹€.

halucinor commented 1 year ago

In GitLab by @Kai on Jan 10, 2023, 16:02

Commented on src/main/java/com/gabia/evoting/web/AgendaController.java line 64

PutMapping 을 μ‚¬μš©ν•˜κΈ°μ—λŠ” 쑰금 μ•„μ‰¬μ›Œ λ³΄μž…λ‹ˆλ‹€. λ‹€λ₯Έ HTTP Method κ°€ μžˆλŠ”μ§€ ν•œλ²ˆ μ°Ύμ•„λ³΄μ„Έμš”.

halucinor commented 1 year ago

In GitLab by @Kai on Jan 10, 2023, 16:02

Commented on src/main/java/com/gabia/evoting/web/AbstractController.java line 47

ν˜„μž¬ AbstractController λΌλŠ” 좔상 ν΄λž˜μŠ€λŠ” μ–΄λ–€ 역할을 ν•˜κΈ° μœ„ν•œ ν΄λž˜μŠ€μΈκ°€μš”?

그리고 getUser, isGuestUser λ©”μ„œλ“œλŠ” λ‚˜μ€‘μ— Controller μ—μ„œ μ‚¬μš©ν•˜κΈ° μœ„ν•΄ 미리 μ •μ˜ν•œ κ²ƒμΈκ°€μš”?

halucinor commented 1 year ago

pythonμ—μ„œ μ‚¬μš©ν•˜λ˜ μ»¨λ²€μ…˜μ΄ 손에 읡어 가끔 snake_case ν˜•νƒœκ°€ λ‚˜μ˜€λŠ” κ±° κ°™μŠ΅λ‹ˆλ‹€;; πŸ˜… μ»¨λ²€μ…˜μ€ 가독성을 μœ„ν•΄ camel case둜 λ³€κ²½ν•˜λ €κ³  ν•˜κ³  μžˆμŠ΅λ‹ˆλ‹€. μ°Ύμ•„μ£Όμ…”μ„œ κ°μ‚¬ν•©λ‹ˆλ‹€!

halucinor commented 1 year ago

In GitLab by @Charlie on Jan 10, 2023, 16:12

Commented on src/main/java/com/gabia/evoting/web/AgendaController.java line 47

HTTP Status Code λŠ” 무엇이 있고 각각은 무엇을 μ˜λ―Έν•˜λ‚˜μš”? μ„€κ³„ν•˜μ‹  각 API 응닡에 응닡 μ½”λ“œκ°€ μ ν•©ν•œμ§€λ₯Ό κ³ λ―Όν•΄λ³΄μ‹œλ©΄ 쒋을 것 κ°™λ„€μš”.

halucinor commented 1 year ago

put vs patch

PatchMapping 으둜 λ³€κ²½ν•΄λ³΄κ² μŠ΅λ‹ˆλ‹€ :D

halucinor commented 1 year ago

AbstractControllerλŠ” μ»¨νŠΈλ‘€λŸ¬μ—μ„œ κ³΅ν†΅μ μœΌλ‘œ μ‚¬μš©ν•  κΈ°λŠ₯에 λŒ€ν•œ 좔상화와 κ΅¬ν˜„μ„ μœ„ν•œ ν΄λž˜μŠ€μž…λ‹ˆλ‹€.

인증 κΈ°λŠ₯을 κ΅¬ν˜„ν•˜λ©΄μ„œ κΈ°λŠ₯을 μΆ”κ°€ν•˜κ±°λ‚˜ μ œκ±°ν•  κ³„νšμž…λ‹ˆλ‹€.

halucinor commented 1 year ago

In GitLab by @Pablo on Jan 10, 2023, 16:30

Commented on src/main/java/com/gabia/evoting/service/AgendaService.java line 23

λ‹¨μˆœ μ‘°νšŒκ°€ λ°œμƒλ˜λŠ” μ„œλΉ„μŠ€ 둜직 같은데 @Transactional μ–΄λ…Έν…Œμ΄μ…˜μ„ ν™œμš©ν•˜μ‹  μ΄μœ κ°€ μžˆμ„κΉŒμš”?

halucinor commented 1 year ago

λ³΅λΆ™ν•˜λ‹€κ°€ @Transectional이 같이 듀어간것 κ°™μŠ΅λ‹ˆλ‹€...

halucinor commented 1 year ago

λ‹€μŒ μƒνƒœμ½”λ“œμ— λŒ€ν•œ λ¬Έμ„œλ₯Ό ν™•μΈν•˜μ—¬ μˆ˜μ •ν•˜κ² μŠ΅λ‹ˆλ‹€.

HTTP μƒνƒœ μ½”λ“œ

halucinor commented 1 year ago

changed this line in version 2 of the diff

halucinor commented 1 year ago

changed this line in version 2 of the diff

halucinor commented 1 year ago

changed this line in version 2 of the diff

halucinor commented 1 year ago

added 1 commit

Compare with previous version

halucinor commented 1 year ago

In GitLab by @Pablo on Jan 10, 2023, 16:48

Commented on src/main/java/com/gabia/evoting/service/AgendaService.java line 23

ν™•μΈν–ˆμŠ΅λ‹ˆλ‹€. :smiley:

halucinor commented 1 year ago

In GitLab by @Luke on Jan 10, 2023, 16:50

Commented on src/main/java/com/gabia/evoting/service/AgendaService.java line 36

λΉŒλ” νŒ¨ν„΄μ— λŒ€ν•΄μ„œ 찾아보면 쒋을듯 μ‹ΆμŠ΅λ‹ˆλ‹€ :)

halucinor commented 1 year ago

changed this line in version 3 of the diff

halucinor commented 1 year ago

added 1 commit

Compare with previous version

halucinor commented 1 year ago

builder νŒ¨ν„΄ μ μš©ν•΄μ„œ μ½”λ“œ μˆ˜μ •ν•΄λ΄€μŠ΅λ‹ˆλ‹€ :smile:

halucinor commented 1 year ago

In GitLab by @Charlie on Jan 10, 2023, 17:12

Commented on src/main/java/com/gabia/evoting/web/dto/AgendaResponseDto.java line 31

μ½”λ”© μ»¨λ²€μ…˜μ€ μ‹€μˆ˜κ°€ λ‚˜μ˜¬ 수 있고, μ—¬λŸ¬ μž‘μ—…μžκ°€ ν•¨κ»˜ κ°œλ°œν•œλ‹€λ©΄ μ»¨λ²€μ…˜μ€ λ”μš± μ§€μΌœμ§€κΈ° μ–΄λ €μšΈ 수 μžˆμŠ΅λ‹ˆλ‹€.

이런 문제λ₯Ό ν•΄κ²°ν•  수 μžˆλŠ” 방법이 무엇이 μžˆμ„μ§€ κ³ λ―Όν•΄λ³΄λŠ” 것도 쒋은 κ²½ν—˜μ΄ 될 것 κ°™λ„€μš”.

halucinor commented 1 year ago

In GitLab by @Charlie on Jan 10, 2023, 17:14

Commented on src/main/java/com/gabia/evoting/web/AgendaController.java line 64

/agenda λΌλŠ” URL 은 μ ν•©ν•œκ°€μš”? collection κ³Ό resource 의 μ°¨μ΄λŠ” 무엇인지 μƒκ°ν•΄λ³΄μ„Έμš”.

halucinor commented 1 year ago

In GitLab by @Pablo on Jan 10, 2023, 17:20

Commented on src/main/java/com/gabia/evoting/web/AbstractController.java line 27

~QUESTION

successMessage λ©”μ„œλ“œλŠ” μ˜¬λ°”λ₯Έ 응닡 결과의 ꡬ쑰λ₯Ό ν†΅μΌν•˜κΈ° μœ„ν•΄ μž‘μ„±ν•˜μ‹  것 같은데,
그럼 Controllerμ—μ„œ failureMessage λ©”μ„œλ“œλŠ” μ–΄λ–»κ²Œ ν™œμš©ν•˜μ‹€ κ³„νšμΈκ°€μš”?

halucinor commented 1 year ago

failureMessage μ—λŠ” μ‹€νŒ¨ μ‚¬μœ μ— λŒ€ν•œ κ°„λ‹¨ν•œ description을 data에 λ„£μ–΄ return ν•˜λ €κ³  생각 쀑 μž…λ‹ˆλ‹€.

halucinor commented 1 year ago

In GitLab by @Pablo on Jan 11, 2023, 20:10

Commented on src/main/java/com/gabia/evoting/web/AbstractController.java line 27

~QUESTION

failureMessage μ—λŠ” μ‹€νŒ¨ μ‚¬μœ μ— λŒ€ν•œ κ°„λ‹¨ν•œ description을 data에 λ„£μ–΄ return ν•˜λ €κ³  생각 쀑 μž…λ‹ˆλ‹€.

ν˜„μž¬λ‘œμ„  μ‹€νŒ¨λΌλŠ” 뢀뢄이 μ˜¬λ°”λ₯Έ 성곡 μΌ€μ΄μŠ€μ˜ API 응닡이 μ•„λ‹Œ 경우 정도라고 μƒκ°ν•˜κ³  μ§ˆλ¬Έλ“œλ¦½λ‹ˆλ‹€.

μ–΄λ–€ 경우의 μ‹€νŒ¨λ₯Ό λ‚˜νƒ€λ‚΄κΈ° μœ„ν•¨μΈμ§€ 예λ₯Ό λ“€μ–΄ 말씀해주싀 수 μžˆμ„κΉŒμš”?
(Service λ‘œμ§μ—μ„œ μ˜λ„ν•œ μ‹€νŒ¨μΈμ§€, μ˜λ„ν•˜μ§€ μ•Šμ€ μ‹€νŒ¨μΈμ§€, ν˜Ήμ€ λ‘˜λ‹€ ν¬ν•¨ν•˜λŠ”μ§€)
또 κ·ΈλŸ¬ν•œ λ¬΄μ–Έκ°€μ˜ μ‹€νŒ¨κ°€ λ°œμƒν–ˆμ„ λ•Œ, Controllerμ—μ„œ μ½”λ“œλ‘œ μ–΄λ–»κ²Œ ν‘œν˜„ν•  μƒκ°μ΄μ‹ κ°€μš”?

λ˜ν•œ μ‹€νŒ¨λΌλŠ” κ²½μš°κ°€ μ˜ˆμ™Έκ°€ λ°œμƒλœ 경우라면,
μ˜ˆμ™Έ λ°œμƒν–ˆμ„ λ•Œ Controllerμ—μ„œ failureMessage λ©”μ„œλ“œλ₯Ό ν™œμš©ν•˜λŠ” 것 보닀
ν†΅μΌλœ API 응닡 ꡬ쑰λ₯Ό λ‚˜νƒ€λ‚Ό 수 μžˆλŠ” 더 쒋은 λ°©μ•ˆμ΄ μžˆμ„ 것 κ°™μŠ΅λ‹ˆλ‹€.

halucinor commented 1 year ago

collection은 μžμ›μ˜ 집합 그리고 resourceλŠ” ν•˜λ‚˜μ˜ μžμ›μ„ μ˜λ―Έν•©λ‹ˆλ‹€.

단일 agenda에 λŒ€ν•œ λ³€κ²½ URIλ₯Ό λ‹€μŒκ³Ό 같이 λ³€κ²½ν•˜κ² μŠ΅λ‹ˆλ‹€. PUT /agenda -> PATCH /agendas/{id}

halucinor commented 1 year ago

μ œκ°€ κ΅¬ν˜„ μ‹œ μƒκ°ν–ˆλ˜ μ‹€νŒ¨λŠ”

이 두가지λ₯Ό λͺ¨λ‘ ν¬ν•¨ν•˜κ³  μžˆμŠ΅λ‹ˆλ‹€. μ§€κΈˆ κ΅¬ν˜„λœ μƒνƒœλ‘œλŠ”, μ‹€νŒ¨μ— λŒ€ν•œ μ •μ˜κ°€ λͺ¨ν˜Έν•˜μ—¬ ν†΅μΌλœ ꡬ쑰둜 API 응닡을 ν•˜κΈ° νž˜λ“€κ±° κ°™μŠ΅λ‹ˆλ‹€. :disappointed:

HTTP μƒνƒœ μ½”λ“œλ₯Ό μ°Έκ³ ν•˜μ—¬ μ—¬λŸ¬ 상황에 λ”°λ₯Έ μ˜ˆμ™Έμ²˜λ¦¬ λ‘œμ§μ„ λ”°λ‘œ κ΅¬ν˜„ν•˜λŠ” λ°©ν–₯으둜 λ‹€μ‹œ κ΅¬ν˜„ν•΄λ³΄κ² μŠ΅λ‹ˆλ‹€.

μ°Έκ³  https://velog.io/@aidenshin/Spring-Boot-Exception-Controller

halucinor commented 1 year ago

resolved all threads

halucinor commented 1 year ago

changed this line in version 4 of the diff

halucinor commented 1 year ago

added 1 commit

Compare with previous version

halucinor commented 1 year ago

TODO

  1. http μƒνƒœ μ½”λ“œμ— λ”°λ₯Έ API 응닡 μ˜ˆμ™Έμ²˜λ¦¬ 둜직 κ΅¬ν˜„

dev 브랜치둜 머지 ν›„ λ‚˜λ¨Έμ§€ λ‚΄μš©μ— μ™„λ£Œλ˜μ§€ μ•Šμ€ 뢀뢄에 λŒ€ν•΄ λ‹€μ‹œ κ΅¬ν˜„ν•˜κ² μŠ΅λ‹ˆλ‹€ :smile:

halucinor commented 1 year ago

approved this merge request

halucinor commented 1 year ago

mentioned in commit 24f4e54e56c7660fc13f01ea3f79a825ef031d92

halucinor commented 1 year ago

In GitLab by @Pablo on Jan 12, 2023, 13:10

Commented on src/main/java/com/gabia/evoting/web/AbstractController.java line 27

HTTP μƒνƒœ μ½”λ“œλ₯Ό μ°Έκ³ ν•˜μ—¬ μ—¬λŸ¬ 상황에 λ”°λ₯Έ μ˜ˆμ™Έμ²˜λ¦¬ λ‘œμ§μ„ λ”°λ‘œ κ΅¬ν˜„ν•˜λŠ” λ°©ν–₯으둜 λ‹€μ‹œ κ΅¬ν˜„ν•΄λ³΄κ² μŠ΅λ‹ˆλ‹€.

~CHECK

  • Service λ‘œμ§μ—μ„œ μ˜λ„ν•œ μ‹€νŒ¨
  • μ‚¬μš©μžμ˜ 잘λͺ»λœ μš”μ²­μ— μ˜ν•œ μ‹€νŒ¨

μ‚¬μš©μžμ˜ 잘λͺ»λœ μš”μ²­μ— μ˜ν•œ μ‹€νŒ¨ λ˜ν•œ μ‹€νŒ¨ μΌ€μ΄μŠ€λ₯Ό μ–΄λ– ν•œ κ΄€μ μœΌλ‘œ λ³΄λŠ”μ§€μ— 따라 μ˜λ„ν•œ μ‹€νŒ¨λ‘œ κ°„μ£Όν•  수 μžˆμ„ 것 κ°™μŠ΅λ‹ˆλ‹€.

halucinor commented 1 year ago

In GitLab by @Pablo on Jan 12, 2023, 13:10

resolved all threads

halucinor commented 1 year ago

In GitLab by @Charlie on Jan 12, 2023, 13:23

Commented on src/main/java/com/gabia/evoting/web/AgendaController.java line 64

~CHECK