审查视图

src/main/java/com/tianbo/warehouse/controller/MainController.java 671 字节
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
package com.tianbo.warehouse.controller;

import com.tianbo.warehouse.model.USERS;
import com.tianbo.warehouse.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class MainController {

    @Autowired
    UserService userService;

    @GetMapping("/error")
18 19
    public String  error(){
            return "error";
20 21 22 23 24 25 26 27
    }

    @GetMapping("/main")
    public List<USERS> me(){
        List<USERS> usersList =userService.selectAllUser();
        return usersList;
    }
}