Skip to content
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

[게시글 생성/조회/수정/삭제] 지노 미션 제출합니다. #45

Merged
merged 18 commits into from
Jul 16, 2019

Conversation

hyunssooo
Copy link

오프라인 리뷰 감사합니다 :)

Copy link

@woowahan-pjs woowahan-pjs left a comment

Choose a reason for hiding this comment

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

간단한 생각거리를 남겼으니 코드에 반영해 주셔도 좋습니다.
다음 리뷰 요청 때는 Merge 하도록 하겠습니다.

private ArticleRepository articleRepository;

@Autowired

Choose a reason for hiding this comment

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

단일 생성자인 경우, @Autowired가 없어도 됩니다.

If a class only declares a single constructor to begin with, it will always be used, even if not annotated.

Suggested change
@Autowired

}

@PutMapping("/articles/{articleId}")
public String update(@PathVariable String articleId, Article newArticle) {

Choose a reason for hiding this comment

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

ModelAndView를 사용한다면 RedirectView도 사용해 보는 것은 어떨까요?

webTestClient.post().uri("/articles")
.body(BodyInserters.fromFormData("title", "title")
.with("coverUrl", "coverUrl").with("contents", "contents"))
.exchange();

Choose a reason for hiding this comment

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

중복 제거!

.body(BodyInserters.fromFormData("title", "title")
.with("coverUrl", "coverUrl").with("contents", "contents"))
.exchange()
.expectHeader().valueMatches("Location","http://localhost:[0-9]+/")

Choose a reason for hiding this comment

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

헤더의 Location에 대해 조금 더 명확히 검증하면 어떨까요?

}

@Test
void delete_test() {

Choose a reason for hiding this comment

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

올바른 테스트 코드인가요?

Copy link

@woowahan-pjs woowahan-pjs left a comment

Choose a reason for hiding this comment

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

스프링의 세계에 온 것을 환영합니다. 👍
이만 Merge 하겠습니다.

@woowahan-pjs woowahan-pjs merged commit 72e0dc0 into woowacourse:hyunssooo Jul 16, 2019
hyunssooo pushed a commit to hyunssooo/jwp-blog that referenced this pull request Jul 20, 2019
phs1116 pushed a commit that referenced this pull request Jul 24, 2019
* feat: thymeleaf 추가, html 파일 templates 디렉토리로 이동

* feat: Test 주석추가

* feat: ArticleController 추가

* feat: Article 클래스 추가

* [DOCS] Add README.md

* [ADD] Add dependencies

* [ADD] Add properties

* [MOVE] Move views to templates directory

* [ADD] Add properties

* [FEATURE] Implement redirection to article writing page

* [FEATURE] Implement methods for read and create article

* [FEATURE] Implement methods for read article edit page

* [FEATURE] Implement methods for update article

* [FEATURE] implement methods for delete article

* feat: 게시글 수정, 삭제 기능 구현

* [FEATURE] Implement methods for read all articles

* [FEATURE] Apply template to article page

* refactor: 코드 리팩토링

* refactor: 함수명 수정

* refactor: Controller 메서드명 수정

* [REFACTOR] adjust put method to article edit page

- 메소드 타입에 따른 해당 메소드 뷰 적용

* [REFACTOR] replace response from rendering to redirection

* [ADD] Update css and html for bug fix

* [FEATURE] Apply delete specific article

* [REFACTOR] management role from Article to ArticleRepository

* [REFACTOR] update for redirection tests

* [REFACTOR] remove duplicated html

* [REMOVE] unnecessary class and test

* [FEATURE] Create and apply error pages

* [REFACTOR] Move and rename Main controller

* [REFACTOR] Modify controller name

* [REFACTOR] Modify new article id from 0 to 1

* [REFACTOR] Modify repository method name to remove correlation with db

* [REFACTOR] Modify int to AtomicInteger

* [REFACTOR] Apply code alignment

* [REFACTOR] Modify field dependency injection to constructor dependency injection

* [REFACTOR] Modify constructor

세터 제거 및 생성자 private으로 변경.

* refactor: 코드 리팩토링

* refactor: 매서드 위치 수정

* refactor: 리뷰 반영

* refactor: 리뷰 반영 : setter 메서드명 번경

* [REFACTOR] Remove of() static factory method

* [FIX] add id attribute

* [REFACTOR] Apply constant at auto-increment value

* refactor: 리뷰 반영, ArticleRepository.class update 메서드 삭제

* refactor: 리뷰 반영, ArticleRepository.class 수정에 따른 테스트 코드 삭제

* [REFACTOR] Apply code alignment

* refactor: 리뷰 반영, controller ModelAnvView 메서드 내부에서 수정

* refactor: 테스트 코드 수정

* [REFACTOR] Remove console logs

* [REFACTOR] Remove modifyArticle method

* [REFACTOR] Modify Setter name

* [REFACTOR] Modify save method

modify method가 필요없도록 수정

* [REFACTOR] Modify id from int to Long

* [FIX] Fix typing error

* [REFACTOR] Change update request

findArticle(id) 후 해당 Article을 수정하도록 변경

* refactor 피드백 반영

* refactor 피드백 반영

* [ADD] Add db for test

프로덕트 코드에 MySQL, 테스트 코드에 H2 적용

* [FEATURE] Apply JPA

Repository에 CrudRepository 상속받도록 적용.

* [ADD] Add dto for Article Domain Model

* [FEATURE] Implements create and read user

* [FEATURE] Implements login

* [FEATURE] Implement modify user

* [FEATURE] Implement delete user

* [FEATURE] Add logback dependency

* [FEATURE] Implement interceptor for session

* [FEATURE] Implement logout

* [FEATURE] Implement exception handler

* [FEATURE] Implement login dto and exception

* [FEATURE] Test Controller

* [REFACTOR] Move WebMvcConfig Class to config package

* [ADD] Add User Entity Tests

* [ADD] Add Article Service

* [REFACTOR] Remove unnecessary classes

* [REFACTOR] Remove unnecessary classes

* [ADD] Add static factory method at UserDto

* [ADD] Add tests for UserService

* [REFACTOR] remove duplicates

* [REFACTOR] remove unnecessary exceptions

* [ADD] Add error message for session interceptor

* Revert "[게시글 생성/조회/수정/삭제] 지노 미션 제출합니다. (#45)"

This reverts commit 72e0dc0.

* refactor

* refactor 피드백 반영

* refactor 피드백 반영
vsh123 pushed a commit to hyojaekim/jwp-blog that referenced this pull request Jul 30, 2019
* feat: thymeleaf 추가, html 파일 templates 디렉토리로 이동

* feat: Test 주석추가

* feat: ArticleController 추가

* feat: Article 클래스 추가

* feat: 게시글 수정, 삭제 기능 구현

* refactor: 코드 리팩토링

* refactor: 함수명 수정

* refactor: Controller 메서드명 수정

* refactor: 코드 리팩토링

* refactor: 매서드 위치 수정

* refactor: 리뷰 반영

* refactor: 리뷰 반영 : setter 메서드명 번경

* refactor: 리뷰 반영, ArticleRepository.class update 메서드 삭제

* refactor: 리뷰 반영, ArticleRepository.class 수정에 따른 테스트 코드 삭제

* refactor: 리뷰 반영, controller ModelAnvView 메서드 내부에서 수정

* refactor: 테스트 코드 수정

* refactor 피드백 반영

* refactor 피드백 반영
vsh123 pushed a commit to hyojaekim/jwp-blog that referenced this pull request Jul 30, 2019
* feat: thymeleaf 추가, html 파일 templates 디렉토리로 이동

* feat: Test 주석추가

* feat: ArticleController 추가

* feat: Article 클래스 추가

* [DOCS] Add README.md

* [ADD] Add dependencies

* [ADD] Add properties

* [MOVE] Move views to templates directory

* [ADD] Add properties

* [FEATURE] Implement redirection to article writing page

* [FEATURE] Implement methods for read and create article

* [FEATURE] Implement methods for read article edit page

* [FEATURE] Implement methods for update article

* [FEATURE] implement methods for delete article

* feat: 게시글 수정, 삭제 기능 구현

* [FEATURE] Implement methods for read all articles

* [FEATURE] Apply template to article page

* refactor: 코드 리팩토링

* refactor: 함수명 수정

* refactor: Controller 메서드명 수정

* [REFACTOR] adjust put method to article edit page

- 메소드 타입에 따른 해당 메소드 뷰 적용

* [REFACTOR] replace response from rendering to redirection

* [ADD] Update css and html for bug fix

* [FEATURE] Apply delete specific article

* [REFACTOR] management role from Article to ArticleRepository

* [REFACTOR] update for redirection tests

* [REFACTOR] remove duplicated html

* [REMOVE] unnecessary class and test

* [FEATURE] Create and apply error pages

* [REFACTOR] Move and rename Main controller

* [REFACTOR] Modify controller name

* [REFACTOR] Modify new article id from 0 to 1

* [REFACTOR] Modify repository method name to remove correlation with db

* [REFACTOR] Modify int to AtomicInteger

* [REFACTOR] Apply code alignment

* [REFACTOR] Modify field dependency injection to constructor dependency injection

* [REFACTOR] Modify constructor

세터 제거 및 생성자 private으로 변경.

* refactor: 코드 리팩토링

* refactor: 매서드 위치 수정

* refactor: 리뷰 반영

* refactor: 리뷰 반영 : setter 메서드명 번경

* [REFACTOR] Remove of() static factory method

* [FIX] add id attribute

* [REFACTOR] Apply constant at auto-increment value

* refactor: 리뷰 반영, ArticleRepository.class update 메서드 삭제

* refactor: 리뷰 반영, ArticleRepository.class 수정에 따른 테스트 코드 삭제

* [REFACTOR] Apply code alignment

* refactor: 리뷰 반영, controller ModelAnvView 메서드 내부에서 수정

* refactor: 테스트 코드 수정

* [REFACTOR] Remove console logs

* [REFACTOR] Remove modifyArticle method

* [REFACTOR] Modify Setter name

* [REFACTOR] Modify save method

modify method가 필요없도록 수정

* [REFACTOR] Modify id from int to Long

* [FIX] Fix typing error

* [REFACTOR] Change update request

findArticle(id) 후 해당 Article을 수정하도록 변경

* refactor 피드백 반영

* refactor 피드백 반영

* [ADD] Add db for test

프로덕트 코드에 MySQL, 테스트 코드에 H2 적용

* [FEATURE] Apply JPA

Repository에 CrudRepository 상속받도록 적용.

* [ADD] Add dto for Article Domain Model

* [FEATURE] Implements create and read user

* [FEATURE] Implements login

* [FEATURE] Implement modify user

* [FEATURE] Implement delete user

* [FEATURE] Add logback dependency

* [FEATURE] Implement interceptor for session

* [FEATURE] Implement logout

* [FEATURE] Implement exception handler

* [FEATURE] Implement login dto and exception

* [FEATURE] Test Controller

* [REFACTOR] Move WebMvcConfig Class to config package

* [ADD] Add User Entity Tests

* [ADD] Add Article Service

* [REFACTOR] Remove unnecessary classes

* [REFACTOR] Remove unnecessary classes

* [ADD] Add static factory method at UserDto

* [ADD] Add tests for UserService

* [REFACTOR] remove duplicates

* [REFACTOR] remove unnecessary exceptions

* [ADD] Add error message for session interceptor

* Revert "[게시글 생성/조회/수정/삭제] 지노 미션 제출합니다. (woowacourse#45)"

This reverts commit 72e0dc0.

* refactor

* refactor 피드백 반영

* refactor 피드백 반영
woowahanCU pushed a commit that referenced this pull request Aug 4, 2019
* revert: Project revert

* [게시글 생성/조회/수정/삭제] 지노 미션 제출합니다. (#45)

* feat: thymeleaf 추가, html 파일 templates 디렉토리로 이동

* feat: Test 주석추가

* feat: ArticleController 추가

* feat: Article 클래스 추가

* feat: 게시글 수정, 삭제 기능 구현

* refactor: 코드 리팩토링

* refactor: 함수명 수정

* refactor: Controller 메서드명 수정

* refactor: 코드 리팩토링

* refactor: 매서드 위치 수정

* refactor: 리뷰 반영

* refactor: 리뷰 반영 : setter 메서드명 번경

* refactor: 리뷰 반영, ArticleRepository.class update 메서드 삭제

* refactor: 리뷰 반영, ArticleRepository.class 수정에 따른 테스트 코드 삭제

* refactor: 리뷰 반영, controller ModelAnvView 메서드 내부에서 수정

* refactor: 테스트 코드 수정

* refactor 피드백 반영

* refactor 피드백 반영

* [게시판 회원 기능] 지노 미션 제출합니다. (#79)

* feat: thymeleaf 추가, html 파일 templates 디렉토리로 이동

* feat: Test 주석추가

* feat: ArticleController 추가

* feat: Article 클래스 추가

* [DOCS] Add README.md

* [ADD] Add dependencies

* [ADD] Add properties

* [MOVE] Move views to templates directory

* [ADD] Add properties

* [FEATURE] Implement redirection to article writing page

* [FEATURE] Implement methods for read and create article

* [FEATURE] Implement methods for read article edit page

* [FEATURE] Implement methods for update article

* [FEATURE] implement methods for delete article

* feat: 게시글 수정, 삭제 기능 구현

* [FEATURE] Implement methods for read all articles

* [FEATURE] Apply template to article page

* refactor: 코드 리팩토링

* refactor: 함수명 수정

* refactor: Controller 메서드명 수정

* [REFACTOR] adjust put method to article edit page

- 메소드 타입에 따른 해당 메소드 뷰 적용

* [REFACTOR] replace response from rendering to redirection

* [ADD] Update css and html for bug fix

* [FEATURE] Apply delete specific article

* [REFACTOR] management role from Article to ArticleRepository

* [REFACTOR] update for redirection tests

* [REFACTOR] remove duplicated html

* [REMOVE] unnecessary class and test

* [FEATURE] Create and apply error pages

* [REFACTOR] Move and rename Main controller

* [REFACTOR] Modify controller name

* [REFACTOR] Modify new article id from 0 to 1

* [REFACTOR] Modify repository method name to remove correlation with db

* [REFACTOR] Modify int to AtomicInteger

* [REFACTOR] Apply code alignment

* [REFACTOR] Modify field dependency injection to constructor dependency injection

* [REFACTOR] Modify constructor

세터 제거 및 생성자 private으로 변경.

* refactor: 코드 리팩토링

* refactor: 매서드 위치 수정

* refactor: 리뷰 반영

* refactor: 리뷰 반영 : setter 메서드명 번경

* [REFACTOR] Remove of() static factory method

* [FIX] add id attribute

* [REFACTOR] Apply constant at auto-increment value

* refactor: 리뷰 반영, ArticleRepository.class update 메서드 삭제

* refactor: 리뷰 반영, ArticleRepository.class 수정에 따른 테스트 코드 삭제

* [REFACTOR] Apply code alignment

* refactor: 리뷰 반영, controller ModelAnvView 메서드 내부에서 수정

* refactor: 테스트 코드 수정

* [REFACTOR] Remove console logs

* [REFACTOR] Remove modifyArticle method

* [REFACTOR] Modify Setter name

* [REFACTOR] Modify save method

modify method가 필요없도록 수정

* [REFACTOR] Modify id from int to Long

* [FIX] Fix typing error

* [REFACTOR] Change update request

findArticle(id) 후 해당 Article을 수정하도록 변경

* refactor 피드백 반영

* refactor 피드백 반영

* [ADD] Add db for test

프로덕트 코드에 MySQL, 테스트 코드에 H2 적용

* [FEATURE] Apply JPA

Repository에 CrudRepository 상속받도록 적용.

* [ADD] Add dto for Article Domain Model

* [FEATURE] Implements create and read user

* [FEATURE] Implements login

* [FEATURE] Implement modify user

* [FEATURE] Implement delete user

* [FEATURE] Add logback dependency

* [FEATURE] Implement interceptor for session

* [FEATURE] Implement logout

* [FEATURE] Implement exception handler

* [FEATURE] Implement login dto and exception

* [FEATURE] Test Controller

* [REFACTOR] Move WebMvcConfig Class to config package

* [ADD] Add User Entity Tests

* [ADD] Add Article Service

* [REFACTOR] Remove unnecessary classes

* [REFACTOR] Remove unnecessary classes

* [ADD] Add static factory method at UserDto

* [ADD] Add tests for UserService

* [REFACTOR] remove duplicates

* [REFACTOR] remove unnecessary exceptions

* [ADD] Add error message for session interceptor

* Revert "[게시글 생성/조회/수정/삭제] 지노 미션 제출합니다. (#45)"

This reverts commit 72e0dc0.

* refactor

* refactor 피드백 반영

* refactor 피드백 반영

* [add] comment 클래스

* refactor

* refactor

* refactor

* add articles user 관계 추가

* delete ArticleConverter 삭제

* add 작성자만 글 수정 삭제 기능 추가

* add comment 추가 삭제 수정 기능 추가

* refactor 주석 제거, 어노테이션 추가

* refactor 불 필요 코드 제거

* refactor NotExistUserIdException class 수정

* add NotExistCommentIdException class 수정

* fix 예외처리 클래스 수정

* refactor 접근제어자 변경

* add comment 작성자만 추가, 삭제, 수정 기능 추가

* add comment test 작성중..

* refactor

* refactor

* refactor 예외 누락된 부분 custom exception 적용

* refactor Transactional 공통된 부분 적용

* refactor redirect 리팩토링

* refactor Path 중복제거

* refactor

* refactor 불필요한 부분 제거

* refactor 댓글 생성 테스트 추가

* refactor

* refactor Service

* refactor 도메인 리팩토링

* refactor 변수명 rename

* refactor controller 리팩토링

* refactor 모든 테스트 추가
vsh123 pushed a commit to hyojaekim/jwp-blog that referenced this pull request Aug 6, 2019
* revert: Project revert

* [게시글 생성/조회/수정/삭제] 지노 미션 제출합니다. (woowacourse#45)

* feat: thymeleaf 추가, html 파일 templates 디렉토리로 이동

* feat: Test 주석추가

* feat: ArticleController 추가

* feat: Article 클래스 추가

* feat: 게시글 수정, 삭제 기능 구현

* refactor: 코드 리팩토링

* refactor: 함수명 수정

* refactor: Controller 메서드명 수정

* refactor: 코드 리팩토링

* refactor: 매서드 위치 수정

* refactor: 리뷰 반영

* refactor: 리뷰 반영 : setter 메서드명 번경

* refactor: 리뷰 반영, ArticleRepository.class update 메서드 삭제

* refactor: 리뷰 반영, ArticleRepository.class 수정에 따른 테스트 코드 삭제

* refactor: 리뷰 반영, controller ModelAnvView 메서드 내부에서 수정

* refactor: 테스트 코드 수정

* refactor 피드백 반영

* refactor 피드백 반영

* [게시판 회원 기능] 지노 미션 제출합니다. (woowacourse#79)

* feat: thymeleaf 추가, html 파일 templates 디렉토리로 이동

* feat: Test 주석추가

* feat: ArticleController 추가

* feat: Article 클래스 추가

* [DOCS] Add README.md

* [ADD] Add dependencies

* [ADD] Add properties

* [MOVE] Move views to templates directory

* [ADD] Add properties

* [FEATURE] Implement redirection to article writing page

* [FEATURE] Implement methods for read and create article

* [FEATURE] Implement methods for read article edit page

* [FEATURE] Implement methods for update article

* [FEATURE] implement methods for delete article

* feat: 게시글 수정, 삭제 기능 구현

* [FEATURE] Implement methods for read all articles

* [FEATURE] Apply template to article page

* refactor: 코드 리팩토링

* refactor: 함수명 수정

* refactor: Controller 메서드명 수정

* [REFACTOR] adjust put method to article edit page

- 메소드 타입에 따른 해당 메소드 뷰 적용

* [REFACTOR] replace response from rendering to redirection

* [ADD] Update css and html for bug fix

* [FEATURE] Apply delete specific article

* [REFACTOR] management role from Article to ArticleRepository

* [REFACTOR] update for redirection tests

* [REFACTOR] remove duplicated html

* [REMOVE] unnecessary class and test

* [FEATURE] Create and apply error pages

* [REFACTOR] Move and rename Main controller

* [REFACTOR] Modify controller name

* [REFACTOR] Modify new article id from 0 to 1

* [REFACTOR] Modify repository method name to remove correlation with db

* [REFACTOR] Modify int to AtomicInteger

* [REFACTOR] Apply code alignment

* [REFACTOR] Modify field dependency injection to constructor dependency injection

* [REFACTOR] Modify constructor

세터 제거 및 생성자 private으로 변경.

* refactor: 코드 리팩토링

* refactor: 매서드 위치 수정

* refactor: 리뷰 반영

* refactor: 리뷰 반영 : setter 메서드명 번경

* [REFACTOR] Remove of() static factory method

* [FIX] add id attribute

* [REFACTOR] Apply constant at auto-increment value

* refactor: 리뷰 반영, ArticleRepository.class update 메서드 삭제

* refactor: 리뷰 반영, ArticleRepository.class 수정에 따른 테스트 코드 삭제

* [REFACTOR] Apply code alignment

* refactor: 리뷰 반영, controller ModelAnvView 메서드 내부에서 수정

* refactor: 테스트 코드 수정

* [REFACTOR] Remove console logs

* [REFACTOR] Remove modifyArticle method

* [REFACTOR] Modify Setter name

* [REFACTOR] Modify save method

modify method가 필요없도록 수정

* [REFACTOR] Modify id from int to Long

* [FIX] Fix typing error

* [REFACTOR] Change update request

findArticle(id) 후 해당 Article을 수정하도록 변경

* refactor 피드백 반영

* refactor 피드백 반영

* [ADD] Add db for test

프로덕트 코드에 MySQL, 테스트 코드에 H2 적용

* [FEATURE] Apply JPA

Repository에 CrudRepository 상속받도록 적용.

* [ADD] Add dto for Article Domain Model

* [FEATURE] Implements create and read user

* [FEATURE] Implements login

* [FEATURE] Implement modify user

* [FEATURE] Implement delete user

* [FEATURE] Add logback dependency

* [FEATURE] Implement interceptor for session

* [FEATURE] Implement logout

* [FEATURE] Implement exception handler

* [FEATURE] Implement login dto and exception

* [FEATURE] Test Controller

* [REFACTOR] Move WebMvcConfig Class to config package

* [ADD] Add User Entity Tests

* [ADD] Add Article Service

* [REFACTOR] Remove unnecessary classes

* [REFACTOR] Remove unnecessary classes

* [ADD] Add static factory method at UserDto

* [ADD] Add tests for UserService

* [REFACTOR] remove duplicates

* [REFACTOR] remove unnecessary exceptions

* [ADD] Add error message for session interceptor

* Revert "[게시글 생성/조회/수정/삭제] 지노 미션 제출합니다. (woowacourse#45)"

This reverts commit 72e0dc0.

* refactor

* refactor 피드백 반영

* refactor 피드백 반영

* [add] comment 클래스

* refactor

* refactor

* refactor

* add articles user 관계 추가

* delete ArticleConverter 삭제

* add 작성자만 글 수정 삭제 기능 추가

* add comment 추가 삭제 수정 기능 추가

* refactor 주석 제거, 어노테이션 추가

* refactor 불 필요 코드 제거

* refactor NotExistUserIdException class 수정

* add NotExistCommentIdException class 수정

* fix 예외처리 클래스 수정

* refactor 접근제어자 변경

* add comment 작성자만 추가, 삭제, 수정 기능 추가

* add comment test 작성중..

* refactor

* refactor

* refactor 예외 누락된 부분 custom exception 적용

* refactor Transactional 공통된 부분 적용

* refactor redirect 리팩토링

* refactor Path 중복제거

* refactor

* refactor 불필요한 부분 제거

* refactor 댓글 생성 테스트 추가

* refactor

* refactor Service

* refactor 도메인 리팩토링

* refactor 변수명 rename

* refactor controller 리팩토링

* refactor 모든 테스트 추가
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants