package com.liuyanzhao.forum.controller;
import com.liuyanzhao.forum.entity.Comment;
import com.liuyanzhao.forum.entity.Post;
import com.liuyanzhao.forum.entity.User;
import com.liuyanzhao.forum.repository.PostRepository;
import com.liuyanzhao.forum.service.CommentService;
import com.liuyanzhao.forum.service.PostService;
import com.liuyanzhao.forum.util.ConstraintViolationExceptionHandler;
import com.liuyanzhao.forum.vo.Response;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import javax.validation.ConstraintViolationExcep