Class ForumViewController

java.lang.Object
com.bytedesk.forum.controller.ForumViewController

@Controller @RequestMapping("/forum") public class ForumViewController extends Object
  • Field Details

    • showDemo

      @Value("${bytedesk.custom.show-demo:true}") private Boolean showDemo
    • customEnabled

      @Value("${bytedesk.custom.enabled:false}") private Boolean customEnabled
    • customName

      @Value("${bytedesk.custom.name:\u5fae\u8bed}") private String customName
    • customDescription

      @Value("${bytedesk.custom.description:\u91cd\u590d\u5de5\u4f5c\u81ea\u52a8\u5316}") private String customDescription
    • postService

      @Autowired private PostService postService
    • categoryRepository

      @Autowired private CategoryRepository categoryRepository
    • forumUserService

      @Autowired private ForumUserService forumUserService
  • Constructor Details

    • ForumViewController

      public ForumViewController()
  • Method Details

    • addAttributes

      @ModelAttribute public void addAttributes(@AuthenticationPrincipal org.springframework.security.core.userdetails.UserDetails userDetails, org.springframework.ui.Model model)
    • index

      @GetMapping({"","/"}) public String index(org.springframework.ui.Model model)
    • category

      @GetMapping("/category/{categoryId}") public String category(@PathVariable Long categoryId, org.springframework.ui.Model model, @PageableDefault(size=10,sort="createdAt",direction=DESC) org.springframework.data.domain.Pageable pageable)
    • post

      @GetMapping("/posts/{postId}") public String post(@PathVariable Long postId, org.springframework.ui.Model model, @PageableDefault(size=20,sort="createdAt",direction=ASC) org.springframework.data.domain.Pageable pageable)
    • createPost

      @GetMapping("/posts/create") public String createPost(@RequestParam(required=false) Long categoryId, org.springframework.ui.Model model)
    • editPost

      @GetMapping("/posts/{postId}/edit") public String editPost(@PathVariable Long postId, org.springframework.ui.Model model)
    • search

      @GetMapping("/search") public String search(@RequestParam String keyword, org.springframework.ui.Model model, @PageableDefault(size=10,sort="createdAt",direction=DESC) org.springframework.data.domain.Pageable pageable)
    • userPosts

      @GetMapping("/user/posts") public String userPosts(@AuthenticationPrincipal org.springframework.security.core.userdetails.UserDetails userDetails, org.springframework.ui.Model model, @PageableDefault(size=10,sort="createdAt",direction=DESC) org.springframework.data.domain.Pageable pageable)
    • userComments

      @GetMapping("/user/comments") public String userComments(@AuthenticationPrincipal org.springframework.security.core.userdetails.UserDetails userDetails, org.springframework.ui.Model model, @PageableDefault(size=20,sort="createdAt",direction=DESC) org.springframework.data.domain.Pageable pageable)
    • userProfile

      @GetMapping("/user/profile") public String userProfile(@AuthenticationPrincipal org.springframework.security.core.userdetails.UserDetails userDetails, org.springframework.ui.Model model)
    • userSettings

      @GetMapping("/user/settings") public String userSettings(@AuthenticationPrincipal org.springframework.security.core.userdetails.UserDetails userDetails, org.springframework.ui.Model model)
    • userLikes

      @GetMapping("/user/likes") public String userLikes(@AuthenticationPrincipal org.springframework.security.core.userdetails.UserDetails userDetails, org.springframework.ui.Model model, @PageableDefault(size=20,sort="createdAt",direction=DESC) org.springframework.data.domain.Pageable pageable)