package com.nokia.hb.controller;

import com.nokia.common.R;
import com.nokia.hb.pojo.RetData;
import com.nokia.hb.pojo.dto.RenderTableDto;
import com.nokia.hb.service.PmService;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;
import javax.validation.Valid;

@Tag(name = "pm数据")
@RestController
public class PmController {
    private final PmService pmService;

    public PmController(PmService pmService) {
        this.pmService = pmService;
    }

    /**
     * 查询pm数据
     */
    @PostMapping("/api/renderTable")
    public R<RetData> renderTable(@Valid @RequestBody RenderTableDto dto, HttpSession session) {
        return pmService.renderTable(dto, session);
    }
}
