package com.sonymusic.dx.dxadvsearchservice.controllers;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.sonymusic.dx.dxadvsearchservice.dto.LanguageDTO;
import com.sonymusic.dx.dxadvsearchservice.service.LanguageService;

@RestController
@RequestMapping("/language")
public class LanguageController {

    @Autowired
    LanguageService languageService;

    @GetMapping("/all")
    private List<LanguageDTO> getListOfLabel(@RequestParam(required = false) String name) {
        return languageService.getListOfLanguages(name);

    }
}
