我知道这个问题已经被问过很多次了,但我真的很难找到正确的解决方案。通过看到这些问题,我尝试了很多东西,但似乎没有一个适合我的情况。这是我目前的实现:SpringBoot应用程序:@SpringBootApplication@EnableJpaRepositories(basePackages="com.timmi.springBoot.repositories")@EntityScan(basePackages="com.timmi.springBoot.entities")@EnableAutoConfiguration@ComponentScan(basePackages="com.timmi.springBoot.service")public class Application extends SpringBootServletInitializer { public static void main(String[] args) { SpringApplication.run(Application.class, args); } @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { // TODO Auto-generated method stub return super.configure(builder); }}休息控制器:@RestController@RequestMapping("/app")public class RestEndPoints { @Value("${default.course.name}") private String cName; @Value("${default.course.chapterCount}") private int chaptersCount; @Autowired private CourseConfiguration courseConfiguration; @Autowired private DashboardService dashboardService; @RequestMapping("/employees") public List<EmployeeInformation> getAllEmpl(){ return dashboardService.getAllEmployee(); }}仪表板服务接口:public interface DashboardService{ List<CompanyRevenue> getTodayRevenueDash(); List<ProductCategory> getBestCategory(); List<OrderRecieved> getAllOrderRecieved(); List<OrderCollectionStatus> getOrderCollection(); List<EmployeeInformation> getAllEmployee(); void addEmployee(EmployeeInformation employeeInformation); EmployeeInformation updateEmployee(EmployeeInformation employeeInformation); void deleteEmployee(EmployeeInformation employeeInformation);}
添加回答
举报
0/150
提交
取消