mirror of
https://github.com/FatttSnake/Pinnacle-OA.git
synced 2026-04-04 22:41:24 +08:00
40 lines
1.3 KiB
Java
40 lines
1.3 KiB
Java
package com.cfive.pinnacle.controller;
|
|
|
|
import com.cfive.pinnacle.entity.Department;
|
|
import com.cfive.pinnacle.entity.common.ResponseCode;
|
|
import com.cfive.pinnacle.entity.common.ResponseResult;
|
|
import com.cfive.pinnacle.service.IDepartmentService;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.web.bind.annotation.CrossOrigin;
|
|
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("/department")
|
|
@CrossOrigin
|
|
public class DepartmentController {
|
|
@Autowired
|
|
IDepartmentService departmentService;
|
|
|
|
//获取所有部门及其各部门所属成员
|
|
@GetMapping
|
|
public ResponseResult getDepartAndUser(){
|
|
List<Department> getDepartAndUser = departmentService.getDepartAndUser();
|
|
Integer code = getDepartAndUser != null ? ResponseCode.DATABASE_SELECT_OK : ResponseCode.DATABASE_SELECT_ERROR;
|
|
String msg = getDepartAndUser != null ? "" : "数据查询失败,请尝试!";
|
|
return ResponseResult.build(code, msg, getDepartAndUser);
|
|
}
|
|
|
|
}
|