package org.king.modules.ad.controller;

import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.king.common.api.vo.Result;
import org.king.modules.ad.entity.AdDeviceCount;
import org.king.modules.ad.entity.ChargeCount;
import org.king.modules.ad.service.IAdDeviceService;
import org.king.modules.ad.service.StaticalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("/staticalCount")
public class StaticalController {

    @Autowired
    private StaticalService staticalService;

    @GetMapping(value = "/getDeviceCount")
    public Result<?> getDeviceCount() {
        AdDeviceCount count =staticalService.getDeviceCount();
        return Result.ok(count);
    }

    @GetMapping(value = "/getChargeData")
    public Result<?> getChargeData() {
        List<ChargeCount> list =staticalService.getChargeData();
        return Result.ok(list);
    }
}
