/*
 * Author: wangjian
 * 生成controller
 */
package com.tofly.callcenter.controller;

import com.tofly.callcenter.service.CalllosscountService;
import com.tofly.common.core.entity.ResultRespone;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 标识未接来电记录用作统计
 *
 * @author admin
 * @date Thu Sep 29 00:00:00 CST 2022
 */
@RestController
@AllArgsConstructor
@RequestMapping("/calllosscount")
@Api(tags = "标识未接来电记录用作统计接口")
public class CalllosscountController {

    private final CalllosscountService calllosscountService;

    @GetMapping("/count")
    @ApiOperation("未接来电统计")
    public ResultRespone calllosscount(String empcode) {
        return ResultRespone.success(calllosscountService.calllosscount(empcode));
    }

    @PutMapping("/updateFlag")
    @ApiOperation("将未接电话标未已读")
    public ResultRespone updateFlag(String empcode) {
        return ResultRespone.success(calllosscountService.updateFlag(empcode));
    }


    /**
     * 分页查询
     * @param page 分页对象
     * @param calllosscount 标识未接来电记录用作统计
     * @return
     *//*
    @GetMapping("/page" )
    @ApiOperation(value = "分页查询")
    public ResultRespone getCalllosscountPage(Page page, @ModelAttribute Calllosscount calllosscount) {
      return ResultRespone.success(calllosscountService.page(page, Wrappers.query(calllosscount)));
    }


    *//**
     * 通过id查询标识未接来电记录用作统计
     * @param tel id
     * @return ResultRespone
     *//*
    @GetMapping("/{tel}" )
    @ApiOperation(value = "通过ID查询")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "tel", value = "ID", required = true, dataType = "String")
    })
    public ResultRespone getById(@PathVariable("tel" ) String tel) {
      return ResultRespone.success(calllosscountService.getById(tel));
    }

    *//**
     * 新增标识未接来电记录用作统计
     * @param calllosscount 标识未接来电记录用作统计
     * @return ResultRespone
     *//*
    @ToFlyAppLog(title="新增标识未接来电记录用作统计" )
    @ApiOperation(value = "新增标识未接来电记录用作统计")
    @PostMapping
    public ResultRespone save(@RequestBody Calllosscount calllosscount) {
      return ResultRespone.success(calllosscountService.save(calllosscount));
    }

    *//**
     * 修改标识未接来电记录用作统计
     * @param calllosscount 标识未接来电记录用作统计
     * @return ResultRespone
     *//*
    @ToFlyAppLog(title="修改标识未接来电记录用作统计" )
    @ApiOperation(value = "修改标识未接来电记录用作统计")
    @PutMapping
    public ResultRespone updateById(@RequestBody Calllosscount calllosscount) {
      return ResultRespone.success(calllosscountService.updateById(calllosscount));
    }

    *//**
     * 通过id删除标识未接来电记录用作统计
     * @param tel id
     * @return ResultRespone
     *//*
    @ToFlyAppLog(title="通过id删除标识未接来电记录用作统计" )
    @ApiOperation(value = "通过ID删除标识未接来电记录用作统计")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "tel", value = "ID", required = true, dataType = "String")
    })
    @DeleteMapping("/{tel}" )
    public ResultRespone removeById(@PathVariable String tel) {
      return ResultRespone.success(calllosscountService.removeById(tel));
    }

    *//**
     * 通过id批量删除标识未接来电记录用作统计
     * @param ids id
     * @return ResultRespone
     *//*
    @ToFlyAppLog(title="通过id批量删除标识未接来电记录用作统计" )
    @ApiOperation(value = "通过ID批量删除标识未接来电记录用作统计")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "ids", value = "批量删除，多个id以逗号隔开", required = true, dataType = "String")
    })
    @DeleteMapping("/deleteByIds" )
    public ResultRespone removeByIds(String ids) {
        return ResultRespone.success(calllosscountService.removeByIds(Arrays.asList(ids.split(","))));
    }*/
}
