package com.zanxiang.game.data.serve.controller;

import com.zanxiang.erp.security.annotation.PreAuthorize;
import com.zanxiang.game.data.serve.pojo.dto.OverallSummaryDTO;
import com.zanxiang.game.data.serve.pojo.vo.OverallSummaryVO;
import com.zanxiang.game.data.serve.service.IOverallSummaryService;
import com.zanxiang.module.util.pojo.ResultVO;
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.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @author tianhua
 * @time 2023/7/4
 * @Description 整体概况控制层接口
 **/
@RestController
@RequestMapping("/allSurvey")
@Slf4j
public class OverallSummaryController {

    @Autowired
    private IOverallSummaryService overallSummaryService;

    @PreAuthorize(permissionKey = "gameData:adsOverallSummary:totalData")
    @PostMapping("/totalData")
    public ResultVO<OverallSummaryVO> getOverallSummaryTotalData(@RequestBody OverallSummaryDTO dto) {
        return ResultVO.ok(overallSummaryService.getOverallSummaryTotalData(dto));
    }

    @PreAuthorize(permissionKey = "gameData:adsOverallSummary:lineData")
    @PostMapping("/lineData")
    public ResultVO<Map<String,List>> getOverallSummaryLineData(@RequestBody OverallSummaryDTO dto) {
        return ResultVO.ok(overallSummaryService.getOverallSummaryLineData(dto));
    }


}
