package com.example.demo.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.example.demo.entity.ConfTimeZone;
import com.example.demo.repository.ConfTimeZoneRepo;

@CrossOrigin
@RestController
@RequestMapping("api/timezones")
public class TimeZoneController {
	
	@Autowired
	private ConfTimeZoneRepo confTimeZoneRepo;

	@GetMapping("list")
	public List<ConfTimeZone> getAllTimeZones() {
		return confTimeZoneRepo.orderByName();
	}


}
