package com.searene.controller

import com.searene.domain.Feedback
import com.searene.domain.Result
import com.searene.repository.FeedbackRepository
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.web.bind.annotation.PostMapping
import org.springframework.web.bind.annotation.RequestBody
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController

@RestController
@RequestMapping("/feedback")
class FeedbackController {

    @Autowired
    private lateinit var feedbackRepository: FeedbackRepository;

    @PostMapping("/post")
    fun postFeedback(@RequestBody feedback: Feedback): Result {
        feedbackRepository.save(feedback)
        return Result(true)
    }
}