puzhibing
2026-02-04 85bafa86f44fbe6646019fd8ecbab79f552ccd0a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package com.xiaopeng.maintenance.controller;
 
import com.xiaopeng.common.core.domain.R;
import com.xiaopeng.maintenance.dto.IndexDataQuery;
import com.xiaopeng.maintenance.service.IndexDataService;
import com.xiaopeng.maintenance.vo.IndexDataVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
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;
 
    @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));
    }
}