package com.ruoyi.web.controller.system;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.system.domain.FsChannelRecord;
import com.ruoyi.system.domain.FsChannelRecordVo;
import com.ruoyi.web.controller.manager.FsChannelRecordManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * packageName com.ruoyi.web.controller.system
 *
 * @author wangxy
 * @version JDK 8
 * @className TotalCallsController
 * @date 2024/4/8
 * @description 呼叫总数
 */
@Controller
@RequestMapping("/totalCalls")
public class TotalCallsController extends BaseController {


    @Autowired
    private FsChannelRecordManager recordManager;

    private String prefix = "system/calls";

    @GetMapping()
    public String totalCalls()
    {
        return prefix + "/calls";
    }

    /**
     * 查询呼出列表
     */
    @PostMapping("/list")
    @ResponseBody
    public TableDataInfo list(FsChannelRecord record)
    {
        startPage();
        List<FsChannelRecordVo> list = recordManager.selectTotalCallsList(record);
        return getDataTable(list);
    }
}
