欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

传智健康项目讲义第十章 五

程序员文章站 2022-03-03 18:42:49
...

2.3 后台代码 
2.3.1 Controller 
ReportController中提供getBusinessReportData方法

@Reference
private ReportService reportService;
/**
* 获取运营统计数据
* @return
*/
@RequestMapping("/getBusinessReportData")
public Result getBusinessReportData(){
try {
Map<String, Object> result = reportService.getBusinessReport();
return new
Result(true,MessageConstant.GET_BUSINESS_REPORT_SUCCESS,result);
} catch (Exception e) {
e.printStackTrace();
return new Result(true,MessageConstant.GET_BUSINESS_REPORT_FAIL);
}
}

2.3.2 服务接口 
health_interface工程中创建ReportService服务接口并声明getBusinessReport方法

package com.itheima.service;
import java.util.Map;
public interface ReportService {
/**
* 获得运营统计数据
* Map数据格式:
* todayNewMember ‐> number
* totalMember ‐> number
* thisWeekNewMember ‐> number
* thisMonthNewMember ‐> number
* todayOrderNumber ‐> number
* todayVisitsNumber ‐> number
* thisWeekOrderNumber ‐> number
* thisWeekVisitsNumber ‐> number
* thisMonthOrderNumber ‐> number
* thisMonthVisitsNumber ‐> number
* hotSetmeals ‐> List<Setmeal>
*/
public Map<String,Object> getBusinessReport() throws Exception;
}

 

相关标签: 技术文章