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

import com.zanxiang.erp.security.annotation.PreAuthorize;
import com.zanxiang.game.data.serve.pojo.dto.TencentCreativeDayDTO;
import com.zanxiang.game.data.serve.pojo.vo.TencentCreativeDayTotalVO;
import com.zanxiang.game.data.serve.pojo.vo.TencentCreativeDayVO;
import com.zanxiang.game.data.serve.service.IAdsCreativeDayService;
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("/creativeData")
@Slf4j
public class AdsCreativeDayController {


    @Autowired
    private IAdsCreativeDayService adsCreativeDayService;

    @PreAuthorize(permissionKey = "creativeData:adsCreativeDay:day")
    @PostMapping("/tencent/day")
    public ResultVO<Page<TencentCreativeDayVO>> getTencentCreativeDayData(@RequestBody TencentCreativeDayDTO dto) {
        return ResultVO.ok(adsCreativeDayService.getTencentCreativeDayData(dto));
    }

    @PreAuthorize(permissionKey = "creativeData:adsCreativeDay:total")
    @PostMapping("/tencent/total")
    public ResultVO<TencentCreativeDayTotalVO> getTencentCreativeTotalData(@RequestBody TencentCreativeDayDTO dto) {
        return ResultVO.ok(adsCreativeDayService.getTencentCreativeTotalData(dto));
    }


}
