1
0
mirror of https://github.com/FatttSnake/Pinnacle-OA.git synced 2026-04-04 22:41: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

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

View File

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

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

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

View File

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

View File

@@ -0,0 +1,18 @@
package com.cfive.pinnacle.controller.permission;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 操作日志 前端控制器
* </p>
*
* @author FatttSnake
* @since 2023-04-30
*/
@RestController
@RequestMapping("/operationLog")
public class OperationLogController {
}

View File

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

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