From f957b2a7bdd3d427e42cc0dfd2fc9502d6c7f6de Mon Sep 17 00:00:00 2001 From: smg0725 Date: Sat, 1 Mar 2025 20:07:10 +0900 Subject: [PATCH 1/3] =?UTF-8?q?[CHORE]=20=EC=97=85=EB=8D=B0=EC=9D=B4?= =?UTF-8?q?=ED=8A=B8=20=EC=8B=9C=20=EC=9E=91=EC=84=B1=EC=9E=90=20=EC=9D=BC?= =?UTF-8?q?=EC=B9=98=20=EC=A1=B0=EA=B1=B4=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/tiki/server/note/entity/Note.java | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/main/java/com/tiki/server/note/entity/Note.java b/src/main/java/com/tiki/server/note/entity/Note.java index dc1760a1..7fb4f77f 100644 --- a/src/main/java/com/tiki/server/note/entity/Note.java +++ b/src/main/java/com/tiki/server/note/entity/Note.java @@ -84,7 +84,6 @@ public void updateValue( final boolean complete, final NoteType noteType ) { - checkAuthor(clientId); checkTeam(clientTeamId); this.title = title; this.contents = contents; @@ -98,12 +97,6 @@ public void deleteMemberDependency() { this.memberId = null; } - private void checkAuthor(final long clientId) { - if (this.memberId != clientId) { - throw new NoteException(UPDATE_ONLY_AUTHOR); - } - } - private void checkTeam(final long clientTeamId) { if (this.teamId != clientTeamId) { throw new NoteException(UPDATE_ONLY_BELONGING_TEAM); From d0ebae04e6570a1e5214fdcfdcf3b8bce883a302 Mon Sep 17 00:00:00 2001 From: smg0725 Date: Sat, 1 Mar 2025 21:03:28 +0900 Subject: [PATCH 2/3] =?UTF-8?q?[CHORE]=20=EC=93=B8=EB=AA=A8=EC=97=86?= =?UTF-8?q?=EB=8A=94=20import=EB=AC=B8=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/tiki/server/note/entity/Note.java | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/tiki/server/note/entity/Note.java b/src/main/java/com/tiki/server/note/entity/Note.java index 7fb4f77f..50b6dcc1 100644 --- a/src/main/java/com/tiki/server/note/entity/Note.java +++ b/src/main/java/com/tiki/server/note/entity/Note.java @@ -1,21 +1,24 @@ package com.tiki.server.note.entity; +import static com.tiki.server.note.message.ErrorCode.UPDATE_ONLY_BELONGING_TEAM; +import static jakarta.persistence.GenerationType.IDENTITY; +import static lombok.AccessLevel.PRIVATE; +import static lombok.AccessLevel.PROTECTED; + import com.tiki.server.common.entity.BaseTime; import com.tiki.server.note.exception.NoteException; -import jakarta.persistence.*; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.EnumType; +import jakarta.persistence.Enumerated; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import java.time.LocalDate; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; -import java.time.LocalDate; - -import static com.tiki.server.note.message.ErrorCode.UPDATE_ONLY_AUTHOR; -import static com.tiki.server.note.message.ErrorCode.UPDATE_ONLY_BELONGING_TEAM; -import static jakarta.persistence.GenerationType.IDENTITY; -import static lombok.AccessLevel.PRIVATE; -import static lombok.AccessLevel.PROTECTED; - @Entity @Getter @Builder From 60b5ae49dfff121da8b4e7689ef7e661d25df98f Mon Sep 17 00:00:00 2001 From: smg0725 Date: Sat, 1 Mar 2025 21:03:47 +0900 Subject: [PATCH 3/3] =?UTF-8?q?[CHORE]=20=EC=93=B8=EB=AA=A8=EC=97=86?= =?UTF-8?q?=EB=8A=94=20Exception=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/tiki/server/note/message/ErrorCode.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/com/tiki/server/note/message/ErrorCode.java b/src/main/java/com/tiki/server/note/message/ErrorCode.java index c5f9e49b..48afe5b7 100644 --- a/src/main/java/com/tiki/server/note/message/ErrorCode.java +++ b/src/main/java/com/tiki/server/note/message/ErrorCode.java @@ -14,7 +14,6 @@ public enum ErrorCode { /* 400 BAD REQUEST : 잘못된 요청 */ TITLE_IS_EMPTY(BAD_REQUEST, "제목은 필수 입력값 입니다."), TITLE_LENGTH_OVER(BAD_REQUEST, "제목은 100자를 넘길 수 없습니다."), - UPDATE_ONLY_AUTHOR(BAD_REQUEST, "수정은 작성자만 가능합니다."), UPDATE_ONLY_BELONGING_TEAM(BAD_REQUEST, "해당 팀에 소속된 파일이 아닙니다."), /* 404 NOT_FOUND : 자원을 찾을 수 없음 */