package com.example.controller; import com.example.common.PageResult; import com.example.common.Result; import com.example.entity.User; import com.example.service.DataExcelService; import com.example.service.DepartmentService; import com.example.service.UserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import java.util.HashMap; import java.util.Map; /** * @author kdq * @version 1.0.0 * @ClassName IndexController.java * @Description TODO * @createTime 2026年03月21日 10:43:00 */ @RestController @RequestMapping("/api/index") public class IndexController { @Autowired private UserService userService; @Autowired private DepartmentService departmentService; @Autowired private DataExcelService dataExcelService; @RequestMapping("/getCount") public Result getCount(){ int userSize = userService.list().size(); int deptSize = departmentService.list().size(); int dataSize = dataExcelService.list().size(); Map map = new HashMap<>(); map.put("userSize", userSize); map.put("deptSize", deptSize); map.put("dataSize", dataSize); return Result.success(map); } }