package com.movie.api.controller;

import com.movie.api.model.entity.Query;
import com.movie.api.service.QueryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class queryController {
    @Autowired
    private QueryService queryService;
    @PostMapping("/api/query")
        public void query(@RequestBody Query query){

        System.out.println("--query--"+query);
        queryService.save(query);
    }
}
