package com.tofly.xrtygis.custom.controller.callCenter;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tofly.common.core.entity.ResultRespone;
import com.tofly.common.core.util.StringUtil;
import com.tofly.common.oauth.exception.ToflyDeniedException;
import com.tofly.xrtygis.custom.entity.callCenter.FlowNum;
import com.tofly.xrtygis.custom.service.callCenter.RecordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import java.util.Map;

/**
 * @author FlashWJL
 * @date 2021/7/7 16:06
 */
@RestController
@AllArgsConstructor
@RequestMapping("/record")
@Api(tags = "获取接口")
public class RecordController {


    private final RecordService recordService;




    @GetMapping("/queryRecordNum")
    @ApiOperation("获取录音总数")
    public Map<String, Integer> queryRecordNum(String crew, String start, String end){
        return recordService.queryRecordNum(crew, start, end);
    }

    @GetMapping("/missedCalls")
    @ApiOperation("获取未接来电信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "emp",value = "员工",required = true,dataType = "string"),
            @ApiImplicitParam(name = "tel",value = "电话，可模糊",dataType = "string")
    })
    public ResultRespone missedCalls(Page page,String emp, String tel){
        return ResultRespone.success(recordService.missedCalls(page,emp, tel));
    }

}
