-
Notifications
You must be signed in to change notification settings - Fork 1
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
[FE/BE] 공통 규칙 #112
Comments
문제 발생
|
kkn1125
added a commit
that referenced
this issue
Aug 8, 2022
kkn1125
added a commit
that referenced
this issue
Aug 8, 2022
[BE][:wrench: FIX]: 코드 컨벤션 관련 수정 [#112 참조]
Merged
Closed
파일 삭제 내용 #97 참조 |
kkn1125
added a commit
that referenced
this issue
Aug 10, 2022
…epository, service, restController 코드 컨벤션 적용 #112 참조
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
FE/BE 코드 규칙 설정
공통 사항
FE 공통 규칙
프론트에 생성하는 객체는 데이터를 주고 받는 그릇으로 활용하기 위해 생성. 공통으로 사용하는 함수를 개발해야 api개발에 사용할 때 편의성을 증대 시킬 수 있다. 유지보수성을 높히기 위한 이유도 포함.
Model
IModel의 개념
interface Model을 의미한다.
interface로서 모든 클래스에 필요한 공통의 함수명과 인자, 반환 값을 지정한다.
PModel의 개념
extends 하여 사용하기 위한 클래스로 공통으로 타입에 관계없이 사용할 수 있도록 확장하여 활용하기 위한 목적으로 만들어졌다.
API
api는 아래 규칙을 따른다.
BE 공통 규칙
Entity 클래스
Repository
리파지토리 명칭은 ClassNameRepository로 한다.
config디렉토리 MongoAuditConfig에 지정해두었기 때문에 @repository는 달지 않는다.
ClassNameRepository : interface
ClassNameRepositoryCustom : interface - 커스터마이징 구현 함수 설정
ClassNameRepositoryCustomImpl : class - 커스터마이징 구현 함수 작성 (MongoTemplate를 생성자 주입으로 사용하는 것을 원칙으로 한다.)
기본적으로 단순한 findAll, findById, insert, deleteById는 ClassNameRepository에서 사용하고, 쿼리문이 필요한 함수만 커스터마이징하여 사용한다.
Service
함수 명칭은 ClassNameRepositoryCustomImpl, ClassNameService, ClassNameRestController 모두 동일하게 처리한다. 예를 들면 다음과 같다.
The text was updated successfully, but these errors were encountered: