package com.tofly.xrtygis.controller.callCenter;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tofly.common.core.entity.ResultRespone;
import com.tofly.xrtygis.entity.callCenter.CallSearch;
import com.tofly.xrtygis.entity.callCenter.PltCalllist1000;
import com.tofly.xrtygis.entity.callCenter.ServiceList1000;
import com.tofly.xrtygis.service.callCenter.service.PltCalllist1000Service;
import com.tofly.xrtygis.service.callCenter.service.ServiceList1000Service;
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.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 转接记录表1、保存呼入的转接全过程2、保存呼出的转接全过程3、预拨号数据不记录
 *
 * @author wangjieliu
 * @date Thu Jun 17 00:00:00 CST 2021
 */
@RestController
@AllArgsConstructor
@RequestMapping("/pltservice")
@Api(tags = "转接记录接口")
public class ServiceList1000Controller {

    private final ServiceList1000Service serviceList1000Service;

    /**
     * 分页查询
     *
     * @param page   分页对象
     * @param search 转接记录表1、保存呼入的转接全过程2、保存呼出的转接全过程3、预拨号数据不记录
     * @return
     */
    @GetMapping("/record")
    @ApiOperation(value = "转接记录")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "transferNo", value = "转接外线号码", dataType = "String"),
            @ApiImplicitParam(name = "startTime", value = "开始日期", dataType = "Date"),
            @ApiImplicitParam(name = "endTime", value = "结束日期", dataType = "Date"),
            @ApiImplicitParam(name = "telephone", value = "客户电话（查看某客户的通话记录）", dataType = "String")
    })
    public ResultRespone getPltCalllist(Page page, CallSearch search) {
        IPage<ServiceList1000> iPage = serviceList1000Service.getServicelist(page, search);
        return ResultRespone.success(iPage);
    }

}
