PostRepositoryImpl

 avatar
unknown
java
2 years ago
810 B
3
Indexable
package pl.dmury.cv.repository;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.web.client.RestTemplate;
import pl.dmury.cv.model.blog.Post;
import pl.dmury.cv.model.blog.PostJson;

import java.util.List;

@Repository
public class PostRepositoryImpl implements PostRepository {

    private final RestTemplate restTemplate;

    @Autowired
    public PostRepositoryImpl(RestTemplate restTemplate) {
        this.restTemplate = restTemplate;
    }

    @Override
    public List<Post> findAll() {
        PostJson post = restTemplate.getForObject(
                "https://demo.ghost.io/ghost/api/content/posts/?key=22444f78447824223cefc48062", PostJson.class);
        return null;
    }
}
Editor is loading...