aboutsummaryrefslogtreecommitdiff
path: root/juick-spring-www/src/main/java/com/juick/www/controllers/TagController.java
blob: 5c3b62870f3e64f627cdb3ef0341f5f33e86e6bc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package com.juick.www.controllers;

import com.juick.service.MessagesService;
import com.juick.service.TagService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.inject.Inject;

/**
 * Created by aalexeev on 11/21/16.
 */
@Controller
public class TagController {
    @Inject
    private TagService tagService;
    @Inject
    private MessagesService messagesService;


    @RequestMapping("/tag/{tagName}")
    public String showTags(
            @PathVariable String tagName,
            @RequestParam(required = false, defaultValue = "0") int before,
            Model model) {

        return "index";
    }

    @RequestMapping("/tag")
    public String redirectToMain() {
        return "redirect:/";
    }
}