You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
61 lines
2.3 KiB
61 lines
2.3 KiB
1 year ago
|
package com.zc.business.controller;
|
||
|
|
||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||
|
import com.zc.business.domain.DcTrafficMetricsData;
|
||
|
import com.zc.business.request.DcTrafficMetricsDataRequest;
|
||
|
import com.zc.business.service.DcTrafficStatisticsService;
|
||
|
import io.swagger.annotations.Api;
|
||
|
import io.swagger.annotations.ApiOperation;
|
||
|
import io.swagger.annotations.ApiParam;
|
||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||
|
import org.springframework.http.MediaType;
|
||
|
import org.springframework.web.bind.annotation.*;
|
||
|
|
||
|
import java.util.List;
|
||
|
|
||
|
/**
|
||
|
* 交通数据统计
|
||
|
*
|
||
|
* @author xiepufeng
|
||
|
*/
|
||
|
@Api(tags = "交通数据统计")
|
||
|
@RestController
|
||
|
@RequestMapping("/business/traffic-statistics")
|
||
|
public class DcTrafficStatisticsController {
|
||
|
|
||
|
@Autowired
|
||
|
private DcTrafficStatisticsService dcTrafficStatisticsService;
|
||
|
|
||
|
|
||
|
/**
|
||
|
* 获取当前交通特征指数
|
||
|
*
|
||
|
* @param request 请求参数,封装了获取交通指标所需的数据和条件
|
||
|
* @return 返回当前交通特征指数的数据结果,使用AjaxResult包装
|
||
|
*/
|
||
|
@ApiOperation("获取当前交通特征指数")
|
||
|
@GetMapping("/current/metrics")
|
||
|
public AjaxResult currentTrafficMetrics(DcTrafficMetricsDataRequest request){
|
||
|
// 调用服务层方法,获取当前交通指标数据
|
||
|
DcTrafficMetricsData dcTrafficMetricsData = dcTrafficStatisticsService.currentTrafficMetrics(request);
|
||
|
// 将获取到的交通指标数据封装为成功的结果并返回
|
||
|
return AjaxResult.success(dcTrafficMetricsData);
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* 获取历史交通特征指数
|
||
|
*
|
||
|
* @param request 请求参数,包含需要查询的历史交通特征指数的详细信息
|
||
|
* @return 返回一个AjaxResult对象,其中包含了查询结果的成功状态和历史交通特征指数数据列表
|
||
|
*/
|
||
|
@ApiOperation("获取历史交通特征指数")
|
||
|
@GetMapping("/history/metrics")
|
||
|
public AjaxResult historyTrafficMetrics(DcTrafficMetricsDataRequest request){
|
||
|
// 调用服务层方法,查询历史交通特征指数数据
|
||
|
List<DcTrafficMetricsData> dcTrafficMetricsDataList = dcTrafficStatisticsService.historyTrafficMetrics(request);
|
||
|
// 将查询结果封装成成功响应并返回
|
||
|
return AjaxResult.success(dcTrafficMetricsDataList);
|
||
|
}
|
||
|
|
||
|
}
|