Class DiningProxyService

java.lang.Object
edu.ucsb.cs156.diningcachingproxy.services.DiningProxyService

@Service public class DiningProxyService extends Object
Shared cache-check/forward/store logic used by every proxy controller. A cache miss is forwarded upstream with whatever ucsb-api-key/ucsb-api-version headers the caller sent; only a successful (2xx) upstream response gets cached. This is a byte-for-byte mirror of what the upstream UCSB API would have returned — no dining-specific business logic (e.g. proj-dining's own empty-response-to-204 conversion) belongs here.
  • Constructor Details

    • DiningProxyService

      public DiningProxyService(CachedResponseRepository cachedResponseRepository, StatsService statsService, org.springframework.web.client.RestTemplate restTemplate, @Value("${app.upstream.host}") String upstreamHost)
  • Method Details

    • proxyGet

      public org.springframework.http.ResponseEntity<String> proxyGet(String requestPath, String apiKey, String apiVersion)