package com.example.demo.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.example.demo.common.APIResponse;
import com.example.demo.entity.Environment;
import com.example.demo.repository.EnvironmentRepo;
import com.example.demo.service.EnvironmentService;

@Service
public class EnvironmentServiceImpl implements EnvironmentService {

	@Autowired
	private EnvironmentRepo repo;

	@Override
	public APIResponse getallEnvironmet() {
		APIResponse api = new APIResponse();
		List<Environment> environment = repo.orderByName();
		api.setData(environment);
		return api;

	}

}
