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

import com.zanxiang.erp.security.annotation.PreAuthorize;
import com.zanxiang.game.data.serve.pojo.dto.*;
import com.zanxiang.game.data.serve.pojo.vo.*;
import com.zanxiang.game.data.serve.service.IMediaDataService;
import com.zanxiang.game.data.serve.utils.Page;
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;

/**
 * @author tianhua
 * @time 2023/8/30
 * @Description 媒体相关数据的控制层
 **/
@RestController
@RequestMapping("/media")
@Slf4j
public class AdsMediaDataController {

    @Autowired
    private IMediaDataService iMediaDataService;

    @PreAuthorize(permissionKey = "media:pitcherGameMedia:day")
    @PostMapping("/pitcherGame/day")
    public ResultVO<Page<PitcherGameMediaDataDayVO>> getPitcherGameMediaDataDay(@RequestBody PitcherGameMediaDataDayDTO dto) {
        return ResultVO.ok(iMediaDataService.getPitcherGameMediaDataDay(dto));
    }

    @PreAuthorize(permissionKey = "media:pitcherGameMedia:dayTotal")
    @PostMapping("/pitcherGame/dayTotal")
    public ResultVO<PitcherGameMediaDataDayVO> getPitcherGameMediaDataDayTotal(@RequestBody PitcherGameMediaDataDayTotalDTO dto) {
        return ResultVO.ok(iMediaDataService.getPitcherGameMediaDataDayTotal(dto));
    }

    @PreAuthorize(permissionKey = "media:pitcherGameMedia:total")
    @PostMapping("/pitcherGame/total")
    public ResultVO<Page<PitcherGameMediaDataTotalVO>> getPitcherGameMediaDataTotal(@RequestBody PitcherGameMediaDataTotalDTO dto) {
        return ResultVO.ok(iMediaDataService.getPitcherGameMediaDataTotal(dto));
    }

    @PreAuthorize(permissionKey = "media:pitcherGameMedia:totalSum")
    @PostMapping("/pitcherGame/totalSum")
    public ResultVO<PitcherGameMediaDataTotalVO> getPitcherGameMediaDataTotalSum(@RequestBody PitcherGameMediaDataTotalSumDTO dto) {
        return ResultVO.ok(iMediaDataService.getPitcherGameMediaDataTotalSum(dto));
    }

    @PreAuthorize(permissionKey = "media:pitcherMedia:day")
    @PostMapping("/pitcher/day")
    public ResultVO<Page<PitcherMediaDataDayVO>> getPitcherMediaDataDay(@RequestBody PitcherMediaDataDayDTO dto) {
        return ResultVO.ok(iMediaDataService.getPitcherMediaDataDay(dto));
    }

    @PreAuthorize(permissionKey = "media:pitcherMedia:dayTotal")
    @PostMapping("/pitcher/dayTotal")
    public ResultVO<PitcherMediaDataDayVO> getPitcherMediaDataDayTotal(@RequestBody PitcherMediaDataDayTotalDTO dto) {
        return ResultVO.ok(iMediaDataService.getPitcherMediaDataDayTotal(dto));
    }

    @PreAuthorize(permissionKey = "media:pitcherMedia:total")
    @PostMapping("/pitcher/total")
    public ResultVO<Page<PitcherMediaDataTotalVO>> getPitcherMediaDataTotal(@RequestBody PitcherMediaDataTotalDTO dto) {
        return ResultVO.ok(iMediaDataService.getPitcherMediaDataTotal(dto));
    }

    @PreAuthorize(permissionKey = "media:pitcherMedia:totalSum")
    @PostMapping("/pitcher/totalSum")
    public ResultVO<PitcherMediaDataTotalVO> getPitcherMediaDataTotalSum(@RequestBody PitcherMediaDataTotalSumDTO dto) {
        return ResultVO.ok(iMediaDataService.getPitcherMediaDataTotalSum(dto));
    }

    @PreAuthorize(permissionKey = "media:gameMedia:day")
    @PostMapping("/game/day")
    public ResultVO<Page<GameMediaDataDayVO>> getGameMediaDataDay(@RequestBody GameMediaDataDayDTO dto) {
        return ResultVO.ok(iMediaDataService.getGameMediaDataDay(dto));
    }

    @PreAuthorize(permissionKey = "media:gameMedia:dayTotal")
    @PostMapping("/game/dayTotal")
    public ResultVO<GameMediaDataDayVO> getGameMediaDataDayTotal(@RequestBody GameMediaDataDayTotalDTO dto) {
        return ResultVO.ok(iMediaDataService.getGameMediaDataDayTotal(dto));
    }

    @PreAuthorize(permissionKey = "media:gameMedia:total")
    @PostMapping("/game/total")
    public ResultVO<Page<GameMediaDataTotalVO>> getGameMediaDataTotal(@RequestBody GameMediaDataTotalDTO dto) {
        return ResultVO.ok(iMediaDataService.getGameMediaDataTotal(dto));
    }

    @PreAuthorize(permissionKey = "media:gameMedia:totalSum")
    @PostMapping("/game/totalSum")
    public ResultVO<GameMediaDataTotalVO> getGameMediaDataTotalSum(@RequestBody GameMediaDataTotalSumDTO dto) {
        return ResultVO.ok(iMediaDataService.getGameMediaDataTotalSum(dto));
    }


}
