-
Notifications
You must be signed in to change notification settings - Fork 297
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
π 1λ¨κ³ - λ κ±°μ μ½λ 리ν©ν°λ§ #669
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
μλ νμΈμ ν΄μλ π
μκ°μ μ² λ―Έμ μ 리뷰μ΄λ₯Ό 맑μ μ΅μ§μμ λλ€.
λ―Έμ μ μ§νν΄μ£Όμ ¨λ€μ! λͺκ°μ§ μ½λ©νΈ λ¨κ²¨λμμΌλ λ€μ λ¨κ³ μ§ννμλ©΄μ ν¨κ» νμΈλΆνλλ €μ :)
κΆκΈνκ±°λ κ³ λ―Όμ΄ λλ λΆλΆμ΄ μμΌμλ€λ©΄ μΈμ λ pr μ½λ©νΈ λλ dmμΌλ‘ μμ² λΆνλ립λλ€.
κ°μ¬ν©λλ€ πββοΈ
return id; | ||
public DeleteHistory delete() { | ||
this.deleted = true; | ||
return createDeleteHistory(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
λ€ μ λ delete μ²λ¦¬μ κ²°κ³Όλ‘ DeleteHistory
λ₯Ό λ°ννλκ² ν¬κ² μ΄μν΄λ³΄μ΄μ§λ μμμ.
λ©μλλΆλ¦¬κΉμ§λ κ³Όνμ§ μλλΌλ μκ°μ΄ λλ€μ π
import java.util.Collections; | ||
import java.util.List; | ||
|
||
public class Answers { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
μΌκΈ 컬λμ μ λ§λ€μ΄μ£Όμ ¨λ€μ π
|
||
public class Answers { | ||
|
||
private final List<Answer> answerList; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
보μ ν λ°μ΄ν°μ λν΄μ Listλ‘ μλ£νμ νννμ§ μμλ μ’μ κ² κ°μμ. κ΄λ¦¬νλ λμμ answers
μ΄κ³ , μ΄λ―Έ νμ
μμ μ΄λ€ μλ£νμΈμ§κ° ννμ΄ λμ΄μκΈ°λνꡬμ.
μλ£νμ΄ λ³κ²½λλ€λ©΄ λ³μλͺ λ κ°μ΄ λ°λμ΄μΌνλ€λ λ¨μ λ μκ² λ€μ π
if (!answers.areAllAnswersSameWriter(writer)) { | ||
throw new CannotDeleteException("λ€λ₯Έ μ¬λμ΄ μ΄ λ΅λ³μ΄ μμ΄ μμ ν μ μμ΅λλ€."); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
λ΅λ³ λ³ΈμΈμ μμ μ λν μμΈμ²λ¦¬λ Answer
λ΄λΆμμ μ²λ¦¬νμ¬μΌνμ§ μμκΉμ? :)
answer.setDeleted(true); | ||
deleteHistories.add(new DeleteHistory(ContentType.ANSWER, answer.getId(), answer.getWriter(), LocalDateTime.now())); | ||
} | ||
List<DeleteHistory> deleteHistories = question.delete(loginUser); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
κΉλνκ² μ μ²λ¦¬λμλ€μ π
μλ νμΈμ π€
1λ¨κ³ ꡬν μλ£νμ¬ PR λ립λλ€!
λ§μ§λ§ λ¨κ³κΉμ§ μ λΆνλ립λλ· πββοΈ
π 리ν©ν°λ§ λ΄μ©
QnaService
μ λΉμ¦λμ€ λ‘μ§μ λλ©μΈ λͺ¨λΈλ‘ μ΄λQnaService
μdeleteQuestion()
λ©μλκ° λ무 λ§μ λΉμ¦λμ€ λ‘μ§μ ν¬ν¨νκ³ μμ΄ μ΄λ₯Ό λλ©μΈ λͺ¨λΈλ‘ λΆλ¦¬νμμ΅λλ€.Question
,Answers
,Answer
,DeleteHistory
λλ©μΈ ν΄λμ€λ‘ κΈ°λ₯μ μ¬κ΅¬μ±νμμ΅λλ€.Question
μ΄ κ°μ§κ³ μλList<Answer>
λ₯Ό μΌκΈμ»¬λ μ μΈAnswers
λ‘ νλ² κ°μμ΅λλ€.π§ κ³ λ―Ό ν¬μΈνΈ
Question
κ³ΌAnswer
μdelete
λ©μλκ°DeleteHistory
κ°μ²΄λ₯Ό λ°ννλ κ²μ΄ μ΄μνλ€κ³ λκΌλλ°μγdelete
λ©μλμDeleteHistory
μμ±μ λ³λλ‘ μ²λ¦¬νλ©΄, μ¬μ©μκ°delete
λ©μλλ₯Ό νΈμΆν λDeleteHistory
μμ±μ λΉ λ¨λ¦΄ μ μλ€λ λ¬Έμ (?)μ μ΄ μμ κ² κ°μμ,DeleteHistory
μμ±μ΄ 보μ₯μ μν΄delete
λ©μλ μμ ꡬννκΈ΄ νμ΅λλ€..!