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

import com.zanxiang.erp.security.annotation.PreAuthorize;
import com.zanxiang.game.data.serve.pojo.dto.PromotionDayDTO;
import com.zanxiang.game.data.serve.pojo.dto.PromotionDayTotalDTO;
import com.zanxiang.game.data.serve.pojo.dto.TencentPromotionDayDTO;
import com.zanxiang.game.data.serve.pojo.dto.TencentPromotionDayTotalDTO;
import com.zanxiang.game.data.serve.pojo.vo.PromotionDayTotalVO;
import com.zanxiang.game.data.serve.pojo.vo.PromotionDayVO;
import com.zanxiang.game.data.serve.pojo.vo.TencentPromotionDayTotalVO;
import com.zanxiang.game.data.serve.pojo.vo.TencentPromotionDayVO;
import com.zanxiang.game.data.serve.service.IAdsPromotionDayService;
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/7/27
 * @Description
 **/
@RestController
@RequestMapping("/promotionData")
@Slf4j
public class AdsPromotionDayController {

    @Autowired
    private IAdsPromotionDayService adsPromotionDayService;

//    @Log(title = "头条广告监控")
    @PreAuthorize(permissionKey = "promotionData:adsPromotionDay:day")
    @PostMapping("/day")
    public ResultVO<Page<PromotionDayVO>> getPromotionDayData(@RequestBody PromotionDayDTO dto) {
        return ResultVO.ok(adsPromotionDayService.getPromotionDayData(dto));
    }

    @PreAuthorize(permissionKey = "promotionData:adsPromotionDay:total")
    @PostMapping("/total")
    public ResultVO<PromotionDayTotalVO> getPromotionDayTotalData(@RequestBody PromotionDayTotalDTO dto) {
        return ResultVO.ok(adsPromotionDayService.getPromotionDayTotalData(dto));
    }

    @PreAuthorize(permissionKey = "promotionData:adsPromotionDay:dayList")
    @PostMapping("/day/list")
    public ResultVO<Page<PromotionDayVO>> getPromotionDayListData(@RequestBody PromotionDayDTO dto) {
        return ResultVO.ok(adsPromotionDayService.getPromotionDayListData(dto));
    }

    @PreAuthorize(permissionKey = "promotionData:adsPromotionDay:dayListTotal")
    @PostMapping("/day/listTotal")
    public ResultVO<PromotionDayTotalVO> getPromotionDayListTotalData(@RequestBody PromotionDayTotalDTO dto) {
        return ResultVO.ok(adsPromotionDayService.getPromotionDayTotalData(dto));
    }

    @PreAuthorize(permissionKey = "promotionData:adsAdGroupDay:day")
    @PostMapping("/tencent/day")
    public ResultVO<Page<TencentPromotionDayVO>> getTencentPromotionDayData(@RequestBody TencentPromotionDayDTO dto) {
        return ResultVO.ok(adsPromotionDayService.getTencentPromotionDayData(dto));
    }

    @PreAuthorize(permissionKey = "promotionData:adsAdGroupDay:total")
    @PostMapping("/tencent/total")
    public ResultVO<TencentPromotionDayTotalVO> getTencentPromotionDayTotalData(@RequestBody TencentPromotionDayTotalDTO dto) {
        return ResultVO.ok(adsPromotionDayService.getTencentPromotionDayTotalData(dto));
    }

    @PreAuthorize(permissionKey = "promotionData:adsAdGroupDay:dayList")
    @PostMapping("/tencent/day/list")
    public ResultVO<Page<TencentPromotionDayVO>> getTencentPromotionDayListData(@RequestBody TencentPromotionDayDTO dto) {
        return ResultVO.ok(adsPromotionDayService.getTencentPromotionDayListData(dto));
    }

    @PreAuthorize(permissionKey = "promotionData:adsAdGroupDay:dayListTotal")
    @PostMapping("/tencent/day/listTotal")
    public ResultVO<TencentPromotionDayTotalVO> getTencentPromotionDayListTotalData(@RequestBody TencentPromotionDayTotalDTO dto) {
        return ResultVO.ok(adsPromotionDayService.getTencentPromotionDayTotalData(dto));
    }

}
