-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: ✨ Inclusao da classe ApiResponse para retorno de respostas
Padronizacao das mensagens e status de erro e criacao do model ApiResponse
- Loading branch information
1 parent
c2b7af5
commit 9d66427
Showing
20 changed files
with
438 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
exports.ApiResponse = void 0; | ||
class ApiResponse { | ||
constructor(statusCode = 200, responseText = '', errorMessage = '') { | ||
this._statusCode = statusCode; | ||
this._responseText = responseText; | ||
this._errorMessage = errorMessage; | ||
} | ||
set statusCode(statusCode) { | ||
this._statusCode = statusCode; | ||
} | ||
set responseText(responseText) { | ||
this._responseText = responseText; | ||
} | ||
set errorMessage(errorMessage) { | ||
this._errorMessage = errorMessage; | ||
} | ||
get statusCode() { | ||
return this._statusCode; | ||
} | ||
get responseText() { | ||
return this._responseText; | ||
} | ||
get jsonResponse() { | ||
return { | ||
responseText: this._responseText, | ||
errorMessage: this._errorMessage, | ||
}; | ||
} | ||
} | ||
exports.ApiResponse = ApiResponse; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.