heheng
2025-06-25 076baf821f6ff0296826ecebac31b45ecce346a3
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
38
39
40
41
42
43
44
45
46
47
48
49
package com.gkhy.exam.admin.controller.web;
 
 
import com.gkhy.exam.common.api.CommonResult;
import com.gkhy.exam.system.service.ExStatisticService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
 
import java.util.Date;
 
/**
 * <p>
 * 统计前端控制器
 * </p>
 *
 * @author kzy
 * @since 2024-06-06 13:53:17
 */
@Api(tags = "统计记录前端控制器")
@RestController
@RequestMapping("/statistic")
public class ExStatisticController {
    @Autowired
    private ExStatisticService statisticService;
 
    @ApiOperation(value = "企业数据统计")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "pageNum", dataType = "int", required = false, value = "当前页,默认1"),
            @ApiImplicitParam(paramType = "query", name = "pageSize", dataType = "int", required = false, value = "每页数目,默认10"),
            @ApiImplicitParam(paramType = "query", name = "startTime", dataType = "string", required = false, value = "开始时间(格式:xxxx-xx-xx 00:00:00)"),
            @ApiImplicitParam(paramType = "query", name = "endTime", dataType = "string", required = false, value = "结束时间(格式:xxxx-xx-xx 00:00:00)"),
            @ApiImplicitParam(paramType = "query", name = "companyId", dataType = "long", required = false, value = "企业id"),
            @ApiImplicitParam(paramType = "query", name = "type", dataType = "int", required = true, value = "1线上教育  2线下教育,默认1")
    })
    @GetMapping("/companyStatistic")
    public CommonResult companyStatistic(@RequestParam(required = true,defaultValue = "1") Integer type, @RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date startTime, @RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")Date endTime, @RequestParam(required = false) Long companyId) {
        return CommonResult.success(statisticService.companyStatic(companyId, startTime, endTime,type));
    }
 
 
}