UsersController.java 910 Bytes
package com.cnlive.shenhe.controller;

import com.cnlive.shenhe.serviceImpl.UsersServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @Auther: 周伟鹏
 * @Date: 2018/11/29 14:22
 * @Description:
 */
@Controller
@RequestMapping("/users")
public class UsersController {

    @Autowired
    UsersServiceImpl usersService;

    @GetMapping(value = "/{id}")
    @ResponseBody
    public Object getTest(@PathVariable Integer id){
        return  usersService.getAll(id);
    }

    @GetMapping(value = "/index")
    public String toTest(){
           return "/static/page/5.html";
    }
}