package com.lion.lionwebsite.Controller;

import com.lion.lionwebsite.Service.QueryService;
import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/query")
public class QueryController {

    QueryService queryService;

    public QueryController(QueryService queryService) {
        this.queryService = queryService;
    }

    @GetMapping("")
    public String query(String keyword, String prev, String next){
        return queryService.query(keyword, prev, next);
    }

    @GetMapping("/image")
    public void image(HttpServletResponse response, String path){
        queryService.image(response, path);
    }

}
