package com.nisum.epe.demo.controller;

import com.nisum.epe.demo.repository.UsageRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UsageLimitController
{
    @Autowired
    private UsageRepository usageRepository;

    //get the usage limit for a specific user
    @GetMapping("/usage")
    public String getUsageDetailsForUser()
    {
        return "Remaining Usage Limit is : ".concat(usageRepository.getRemainingUsageLimit());
    }

}

