mares-app-service
슬로그업 ddd 패턴의 application layer에서 사용되는 base class
Installation
npm install --save mares-app-service
Examples
const MaresAppService = { return UserAppService }
Action
Response Object
Application layer에서는 항상 {status, body}의 형태로 응답을 넘겨주게 됩니다. 이를 정규화 하기 위한 응답 함수입니다. 반드시 return 시에는 다음과 같이 send* 함수를 이용해야 합니다.
{ return UserAppService }
Response Array
응답해야할 데이터가 배열인 경우 사용 방법입니다.
{ const count = 1000 return UserAppService }
Response Error
응답해야할 데이터가 에러인 경우 사용 방법입니다.
async { try //await call catch e UserAppService }
Response no contents
{ const count = 1000 // 두개의 리턴값은 동일합니다. return UserAppService // return UserAppService.sendObject(204, {}) }