use of com.tvd12.ezydata.example.jpa.data.AuthorData in project ezyfox-examples by tvd12.
the class AuthorController method addAuthor.
@DoPost("/add")
public AuthorResponse addAuthor(@RequestBody AddAuthorRequest request) {
authorValidator.validate(request);
final AddAuthorData addAuthorData = requestToDataConverter.toData(request);
final AuthorData authorData = authorService.saveAuthor(addAuthorData);
return dataToResponseConverter.toResponse(authorData);
}
use of com.tvd12.ezydata.example.jpa.data.AuthorData in project ezyfox-examples by tvd12.
the class AuthorService method saveAuthor.
public AuthorData saveAuthor(AddAuthorData data) {
final Author entity = dataToEntityConverter.toEntity(data);
authorRepository.save(entity);
return entityToDataConverter.toData(entity);
}
Aggregations