Class AdminNewsController

java.lang.Object
springboot.bg.harisauto.news.controller.AdminNewsController

@Controller @RequestMapping("/admin/news") public class AdminNewsController extends Object
AdminNewsController.java - Handles admin interactions for News management.
Author:
Kristian Popov
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.springframework.web.servlet.ModelAndView
    createNews(String title, String content, org.springframework.web.multipart.MultipartFile image, org.springframework.web.multipart.MultipartFile video, AuthenticationMetaData metaData, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes)
     
    org.springframework.web.servlet.ModelAndView
    deleteNews(Long id, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes)
     
    org.springframework.web.servlet.ModelAndView
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AdminNewsController

      public AdminNewsController()
  • Method Details

    • getNewsPage

      @GetMapping public org.springframework.web.servlet.ModelAndView getNewsPage()
    • createNews

      @PostMapping("/create") public org.springframework.web.servlet.ModelAndView createNews(@RequestParam("title") String title, @RequestParam("content") String content, @RequestParam(value="image",required=false) org.springframework.web.multipart.MultipartFile image, @RequestParam(value="video",required=false) org.springframework.web.multipart.MultipartFile video, @AuthenticationPrincipal AuthenticationMetaData metaData, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes)
    • deleteNews

      @PostMapping("/delete") public org.springframework.web.servlet.ModelAndView deleteNews(@RequestParam("id") Long id, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes)