class EcoNewsController {

    @ApiOperation(value = "Add new eco news.")
    @ApiResponses(value = {
            @ApiResponse(code = 201, message = HttpStatuses.CREATED,
                    response = AddEcoNewsDtoResponse.class),
            @ApiResponse(code = 303, message = HttpStatuses.SEE_OTHER),
            @ApiResponse(code = 403, message = HttpStatuses.FORBIDDEN),
    })
    @PostMapping(consumes = {MediaType.APPLICATION_JSON_UTF8_VALUE, MediaType.MULTIPART_FORM_DATA_VALUE})
    public ResponseEntity<AddEcoNewsDtoResponse> save(
            @ApiParam(value = "Add Eco News Request", required = true)
            @RequestPart @ValidEcoNewsDtoRequest AddEcoNewsDtoRequest addEcoNewsDtoRequest,
            @ApiParam(value = "Image of eco news")
            @ImageValidation
            @RequestPart(required = false) MultipartFile image,
            @ApiIgnore Principal principal) {
        return ResponseEntity.status(HttpStatus.CREATED).body(
                ecoNewsService.save(addEcoNewsDtoRequest, image, principal.getName()));
    }

}