package com.xiaopeng.vehicleConvoy.controller;
|
|
import com.xiaopeng.common.core.domain.R;
|
import com.xiaopeng.vehicleConvoy.model.query.IndexDataQuery;
|
import com.xiaopeng.vehicleConvoy.model.vo.IndexDataVO;
|
import com.xiaopeng.vehicleConvoy.service.IndexDataService;
|
import com.xiaopeng.vehicleConvoy.task.VehicleDocumentExpiryTask;
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiOperation;
|
import lombok.extern.slf4j.Slf4j;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RestController;
|
|
import javax.annotation.Resource;
|
|
/**
|
* 首页 Controller
|
*
|
* @author mitao
|
*/
|
@Slf4j
|
@RestController
|
@Api(tags = "管理后台-首页")
|
public class IndexController {
|
|
@Resource
|
private IndexDataService indexDataService;
|
@Autowired
|
private VehicleDocumentExpiryTask vehicleDocumentExpiryTask;
|
|
@ApiOperation(value = "首页数据统计", tags = {"管理后台-首页"})
|
@PostMapping("/base/v1/indexData")
|
public R<IndexDataVO> indexData(@RequestBody(required = false) IndexDataQuery query) {
|
if (query == null) {
|
query = new IndexDataQuery();
|
}
|
return R.ok(indexDataService.getIndexData(query));
|
}
|
|
@ApiOperation(value = "车辆资质过期检查", tags = {"定时任务"})
|
@PostMapping("/base/v1/vehicle/execute")
|
public R<?> vehicleExecute() {
|
vehicleDocumentExpiryTask.checkAndStockExpiredVehicles();
|
return R.ok();
|
}
|
}
|