mirror of
https://github.com/FatttSnake/Pinnacle-OA.git
synced 2026-04-05 06:51:23 +08:00
Added spring security
This commit is contained in:
@@ -1,8 +1,16 @@
|
||||
package com.cfive.pinnacle.controller;
|
||||
|
||||
import com.cfive.pinnacle.entity.User;
|
||||
import com.cfive.pinnacle.entity.common.ResponseCode;
|
||||
import com.cfive.pinnacle.entity.common.ResponseResult;
|
||||
import com.cfive.pinnacle.service.IUserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户 前端控制器
|
||||
@@ -14,5 +22,16 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
@RestController
|
||||
@RequestMapping("/user")
|
||||
public class UserController {
|
||||
private IUserService userService;
|
||||
|
||||
@Autowired
|
||||
public void setUserService(IUserService userService) {
|
||||
this.userService = userService;
|
||||
}
|
||||
|
||||
@GetMapping
|
||||
public ResponseResult getAllUser() {
|
||||
List<User> users = userService.list();
|
||||
return ResponseResult.build(ResponseCode.DATABASE_SELECT_OK, "success", users);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user