1
0
mirror of https://github.com/FatttSnake/Pinnacle-OA.git synced 2026-04-05 23:11:24 +08:00

Added spring security

This commit is contained in:
2023-05-05 00:17:11 +08:00
parent c3bde66b33
commit e5317da56d
89 changed files with 1028 additions and 783 deletions

View File

@@ -1,18 +0,0 @@
package com.cfive.pinnacle.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 中间表-权限-页面元素 前端控制器
* </p>
*
* @author FatttSnake
* @since 2023-04-30
*/
@RestController
@RequestMapping("/powerElement")
public class PowerElementController {
}

View File

@@ -1,18 +0,0 @@
package com.cfive.pinnacle.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 中间表-权限-文件 前端控制器
* </p>
*
* @author FatttSnake
* @since 2023-04-30
*/
@RestController
@RequestMapping("/powerFile")
public class PowerFileController {
}

View File

@@ -1,18 +0,0 @@
package com.cfive.pinnacle.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 中间表-权限-菜单 前端控制器
* </p>
*
* @author FatttSnake
* @since 2023-04-30
*/
@RestController
@RequestMapping("/powerMenu")
public class PowerMenuController {
}

View File

@@ -1,18 +0,0 @@
package com.cfive.pinnacle.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 中间表-权限-功能 前端控制器
* </p>
*
* @author FatttSnake
* @since 2023-04-30
*/
@RestController
@RequestMapping("/powerOperation")
public class PowerOperationController {
}

View File

@@ -1,18 +0,0 @@
package com.cfive.pinnacle.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 中间表-权限-角色 前端控制器
* </p>
*
* @author FatttSnake
* @since 2023-04-30
*/
@RestController
@RequestMapping("/powerRole")
public class PowerRoleController {
}

View File

@@ -1,18 +0,0 @@
package com.cfive.pinnacle.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 权限类型 前端控制器
* </p>
*
* @author FatttSnake
* @since 2023-04-30
*/
@RestController
@RequestMapping("/powerType")
public class PowerTypeController {
}

View File

@@ -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);
}
}

View File

@@ -1,4 +1,4 @@
package com.cfive.pinnacle.controller;
package com.cfive.pinnacle.controller.permission;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

View File

@@ -1,4 +1,4 @@
package com.cfive.pinnacle.controller;
package com.cfive.pinnacle.controller.permission;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

View File

@@ -0,0 +1,31 @@
package com.cfive.pinnacle.controller.permission;
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.permission.ILoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
@RestController
@RequestMapping("/user")
public class LoginController {
private ILoginService loginService;
@Autowired
public void setLoginService(ILoginService loginService) {
this.loginService = loginService;
}
@PostMapping("/login")
public ResponseResult login(@RequestBody User user) {
HashMap<String, String> hashMap = loginService.login(user);
return ResponseResult.build(ResponseCode.LOGIN_SUCCESS, "success", hashMap);
}
}

View File

@@ -1,4 +1,4 @@
package com.cfive.pinnacle.controller;
package com.cfive.pinnacle.controller.permission;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

View File

@@ -1,4 +1,4 @@
package com.cfive.pinnacle.controller;
package com.cfive.pinnacle.controller.permission;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

View File

@@ -1,4 +1,4 @@
package com.cfive.pinnacle.controller;
package com.cfive.pinnacle.controller.permission;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

View File

@@ -1,4 +1,4 @@
package com.cfive.pinnacle.controller;
package com.cfive.pinnacle.controller.permission;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

View File

@@ -0,0 +1,37 @@
package com.cfive.pinnacle.controller.permission;
import com.cfive.pinnacle.entity.common.ResponseCode;
import com.cfive.pinnacle.entity.common.ResponseResult;
import com.cfive.pinnacle.entity.permission.*;
import com.cfive.pinnacle.service.permission.*;
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>
* 权限类型 前端控制器
* </p>
*
* @author FatttSnake
* @since 2023-04-30
*/
@RestController
@RequestMapping("/powerType")
public class PowerTypeController {
IPowerService powerTypeService;
@Autowired
public void setPowerTypeService(IPowerService powerTypeService) {
this.powerTypeService = powerTypeService;
}
@GetMapping
public ResponseResult getAllPowerType() {
List<Power> powerTypes = powerTypeService.list();
return ResponseResult.build(ResponseCode.DATABASE_SELECT_OK, "success", powerTypes);
}
}