class TipsAndTricksCommentController {

    @ApiOperation(value = "Add comment.")
    @ApiResponses(value = {
        @ApiResponse(code = 201, message = HttpStatuses.CREATED, response = AddTipsAndTricksCommentDtoResponse.class),
        @ApiResponse(code = 303, message = HttpStatuses.SEE_OTHER),
        @ApiResponse(code = 400, message = HttpStatuses.BAD_REQUEST),
        @ApiResponse(code = 401, message = HttpStatuses.UNAUTHORIZED),
    })
    @PostMapping("{tipsAndTricksId}")
    public ResponseEntity<AddTipsAndTricksCommentDtoResponse> save(@PathVariable Long tipsAndTricksId,
                                                                   @Valid @RequestBody
                                                                       AddTipsAndTricksCommentDtoRequest request,
                                                                   @ApiIgnore @AuthenticationPrincipal
                                                                       Principal principal) {
        User user = userService.findByEmail(principal.getName());

        return ResponseEntity
            .status(HttpStatus.CREATED)
            .body(tipsAndTricksCommentService.save(tipsAndTricksId, request, user));
    }

}