Class AdminNewsController
java.lang.Object
springboot.bg.harisauto.news.controller.AdminNewsController
AdminNewsController.java - Handles admin interactions for News management.
- Author:
- Kristian Popov
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.web.servlet.ModelAndViewcreateNews(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.ModelAndViewdeleteNews(Long id, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes) org.springframework.web.servlet.ModelAndView
-
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)
-