package com.xhkjedu.sapi.controller.region;

import com.xhkjedu.sapi.service.region.RAppAnalyzeService;
import com.xhkjedu.utils.N_Utils;
import com.xhkjedu.vo.ResultVo;
import com.xhkjedu.sapi.vo.region.RegionParam;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Map;

/**
 * @author ywx
 * @classname RAppAnalyzeController
 * @description 区域后台统计--应用统计
 * @date 2021/7/15 8:53
 **/
@RestController
@RequestMapping("/raanalyze")
public class RAppAnalyzeController {
    @Resource
    private RAppAnalyzeService rAppAnalyzeService;

    @PostMapping("/list_app")
    public ResultVo listApp(@RequestBody RegionParam param){
        Integer begintime = param.getBegintime();
        Integer endtime = param.getEndtime();
        Integer level = param.getLevel();
        N_Utils.validation(new Object[]{level,"学段",1,begintime,"开始时间",1,endtime,"结束时间",1});
        Map map = rAppAnalyzeService.listApp(level,begintime, endtime);
        return new ResultVo(0,"获取应用统计成功",map);
    }
}
