package zy.cloud.wms.manager.controller;
|
|
import com.core.common.Cools;
|
import com.core.common.R;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.jdbc.core.JdbcTemplate;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RestController;
|
import zy.cloud.wms.common.web.BaseController;
|
|
import java.util.Optional;
|
|
/**
|
* Created by vincent on 2021/3/5
|
*/
|
@RestController
|
@RequestMapping("console")
|
public class ConsoleController extends BaseController {
|
|
@Autowired
|
private JdbcTemplate jdbcTemplate;
|
|
@RequestMapping(value = "/header/auth")
|
public R header() {
|
Integer usersQty = jdbcTemplate.queryForObject("select count(*) from sys_user", Integer.class);
|
Integer deptQty = jdbcTemplate.queryForObject("select count(*) from sys_dept", Integer.class);
|
|
return R.ok().add(Cools
|
.add("usersQty", Optional.ofNullable(usersQty).orElse(0)) // 用户数量
|
.add("deptQty", Optional.ofNullable(deptQty).orElse(0)) // 部门数量
|
);
|
}
|
|
}
|