package com.realnet.OpenAi.Controller;

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.realnet.OpenAi.Services.UnsplashService;

@RestController
@RequestMapping("/api/photos")
public class PhotoSearchController {

	@Autowired
	private UnsplashService unsplashService;

	@GetMapping("/search")
	public List<String> searchPhotos(@RequestParam String keyword) {
		return unsplashService.getImageUrls(keyword);
	}
}
