package com.energy.manage.service.controller.chartsdata;

import com.energy.manage.common.base.Page;
import com.energy.manage.common.reponse.ResultResp;
import com.energy.manage.service.config.annotations.UserLoginToken;
import com.energy.manage.service.controller.base.BaseServiceController;
import com.energy.manage.service.domain.dto.analysis.PlotlyDataItem;
import com.energy.manage.service.service.chartsdata.ChartsDataService;
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;

/**
 * @author chy
 * @date 2024/8/15 09:31
 * @desc
 */
@RestController
@RequestMapping("/createChartsData")
public class CreateChartsDataController extends BaseServiceController {

    @Autowired
    private ChartsDataService chartsDataService;

    @UserLoginToken
    @GetMapping("/getChartsData")
    public ResultResp<Page<PlotlyDataItem>> getChartsData(Integer pageNum) {
        return success(chartsDataService.queryChartsData(pageNum));

    }

    @UserLoginToken
    @GetMapping("/getCharstDataCount")
    public ResultResp getChartsDataCount() {
        return success(chartsDataService.getChartsDataCount());
    }
}
