JHipster에서 컨트롤러를 생성하길 원할 경우
- jhipster spring-controller <entity-name>
- Swagger : 개발환경에서 Administration > API 에서 등록된 컨트롤러를 확인할 수 있다.
- @Secured 어노테이션을 권한 옵션과 함께 클래스 또는 메소드에 붙임으로써 접근 제한을 할 수 있다.
JHipster에서 서비스를 생성하길 원할 경우
- JHipster spring-service <entity-name>
- JHipster는 entity 생성시 Service계층을 따로 생성하지 않는 이유는?
- 기본적인 CRUD를 제공하는데 목적이 있으므로 서비스 계층이 불필요하다고 생각.
- 서비스 계층이 여러 repository를 동시에 사용하므로, entity 생성기와 개념이 맞지 않다고 생각.
+ AOP(Proxy)를 위한 interface또한 service 계층에서 불필요하다 생각. - 컨트롤러 마찬가지로 @Secured어노테이션을 통한 보안 옵션 사용 가능.
참조 :
- https://www.jhipster.tech/creating-a-spring-controller/
- https://www.jhipster.tech/creating-a-spring-service
Creating a service
Creating a Spring service Introduction Note: this sub-generator is much simpler than the entity sub-generator that creates full CRUD entities This sub-generator generates a Spring Service bean, which is where your application’s business logic is supposed t
www.jhipster.tech
Creating a controller
Creating a Spring controller Introduction Note: this sub-generator is much simpler than the entity sub-generator that creates full CRUD entities This sub-generator generates a Spring MVC REST Controller. It is also able to create REST methods. In order to
www.jhipster.tech
'공식메뉴얼 > jhipster' 카테고리의 다른 글
JHipster를 통한 어플리케이션 개발 시 이용법(Using JHipster in development) (0) | 2020.05.09 |
---|---|
엔티티 만들기(Creating an entity) (0) | 2020.05.09 |
Command-line options (0) | 2020.05.09 |
어플리케이션 만들기 ( Creating an application) (0) | 2020.05.09 |
도커 이용법 (Docker and Docker Compose) (0) | 2020.05.09 |