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

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
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.gs.IVRContent;
import com.tofly.xrtygis.custom.entity.gs.IVRReturn;
import com.tofly.xrtygis.custom.service.call.IVRService;
import com.tofly.xrtygis.entity.Gdreturn;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
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;

import java.util.List;
import java.util.Map;

/**
 * 语音播报获取信息数据
 * @author FlashWJL
 * @date 2021/7/13 19:35
 */
@RestController
@AllArgsConstructor
@RequestMapping("/ivr")
@Api(tags = "热线--语音播报")
public class IVRController {

    private final IVRService ivrService ;


    @ApiOperation(value = "根据用户编号查询用户欠费状态（欠费、水量）")
    @GetMapping("/getArrearageState")
    @ApiImplicitParam(name = "yhbh", value = "用户编号", required = true, dataType = "String")
    public IVRReturn getArrearageState(String yhbh) {
        if (StringUtil.isEmpty(yhbh)){
            throw new ToflyDeniedException("请传入用户编号");
        }
        return ivrService.getArrearageState(yhbh);
    }

//    @ApiOperation(value = "根据用户电话号码查询用户停水信息")
//    @GetMapping("/getStopWaterInfo")
//    @ApiImplicitParam(name = "mobile", value = "用户电话号码", required = true, dataType = "String")
//    public String getStopWaterInfo(String mobile) {
//        if (StringUtil.isEmpty(mobile)){
//            throw new ToflyDeniedException("请传入用户电话号码");
//        }
//        return ivrService.getStopWaterInfo(mobile);
//    }

    /**
     * 跟上面的查询停水信息有所区别
     * 这里的停水信息不再是根据用户电话查询停水短信了
     * 而是采用应急记录中的停水信息播报语音
     * @return
     */
    @ApiOperation(value = "查询停水信息")
    @GetMapping("/getStopWaterInfo")
    public IVRReturn getStopWaterInfoTwo() {
        return ivrService.getStopWaterInfoTwo();
    }

}
