package com.yuchen.saas.torch.api.feign;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.yuchen.saas.torch.api.dto.PageMyVisitorReqDTO;
import com.yuchen.saas.torch.api.entity.TorchVisitorInfo;
import com.yuchen.saas.torch.api.dto.PageTorchVisitorReqDTO;
import com.yuchen.saas.torch.api.entity.TorchVisitorOrg;
import com.yuchen.saas.torch.api.vo.*;
import io.swagger.annotations.ApiOperation;
import org.nest.springwrap.core.launch.app.AppNameConstant;
import org.nest.springwrap.core.mp.support.Query;
import org.nest.springwrap.core.tool.api.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.util.List;

/**
 * @description: 火炬访客接口
 * @author mqs
 * @date 2023/6/12 19:53
 * @version 1.0
 */
@FeignClient(
        value = AppNameConstant.SAAS_TORCH,
        fallbackFactory = TorchVisitorFeignServiceFallback.class
)
public interface TorchVisitorFeignService {

    /**
     * @description: 访客预约 新增/修改
     * @author mqs
     * @date 2023/5/18 15:24
     * @version 1.0
     */
    @PostMapping("/torchVisitorInfo/saveOrUpdate")
    R saveOrUpdate(@RequestBody TorchVisitorInfoVO torchVisitorInfoVO);

    /**
     * @description: 详情
     * @author mqs
     * @date 2023/5/18 15:50
     * @version 1.0
     */
    @GetMapping("/torchVisitorInfo/detail")
    R detail(@RequestParam String id);

    /**
     * @description: 分页查询
     * @author mqs
     * @date 2023/5/18 15:50
     * @version 1.0
     */
    @PostMapping("/torchVisitorInfo/page")
    R<IPage<TorchVisitorInfo>> page(PageTorchVisitorReqDTO pageTorchVisitorReqDTO, Query query);

    /**
     * @description 今日预约统计
     * @author  mqs
     * @date    2023/6/14 15:19
     * @param		
     * @return  org.nest.springwrap.core.tool.api.R<com.yuchen.saas.torch.api.vo.TorchTodayVisitorCountVO>
     */
    @GetMapping("/torchVisitorInfo/toDayCountNum")
    R<TorchTodayVisitorCountVO> toDayCountNum();


    /**
     * @description 导出访客信息
     * @author  mqs
     * @date    2023/6/19 16:07
     * @param	reqDTO
     * @param	response
     * @return  void
     */
    @PostMapping("/torchVisitorInfo/exportVisitor")
    void exportVisitor(@Valid @RequestBody PageTorchVisitorReqDTO reqDTO,HttpServletResponse response);

    /**
     * @description 每月top10被访者
     * @author  mqs
     * @date    2023/6/19 16:11
     * @param	reqDTO
     * @return  org.nest.springwrap.core.tool.api.R<java.util.List<com.yuchen.saas.torch.api.vo.TorchInterTop>>
     */
    @PostMapping("/torchVisitorInfo/topInterByMonth")
    @ApiOperation(value = "每月top10被访者", notes = "(visitorTime传入'yyyy-MM'格式日期字符)")
    R<List<TorchInterTop>> topInterByMonth(PageTorchVisitorReqDTO reqDTO);


    /**
     * @description  每月接待访客人数统计
     * @author  mqs
     * @date    2023/6/19 16:12
     * @param	reqDTO
     * @return  org.nest.springwrap.core.tool.api.R<com.yuchen.saas.torch.api.vo.TorchCountMonthVO>
     */
    @PostMapping("/torchVisitorInfo/getMonthCount")
    @ApiOperation(value = "每月接待访客人数统计", notes = "(visitorTime传入'yyyy-MM'格式日期字符)")
    R<TorchCountMonthVO> getMonthCount(PageTorchVisitorReqDTO reqDTO);

    /**
     * @description  年度访客统计
     * @author  mqs
     * @date    2023/6/19 16:12
     * @param	reqDTO
     * @return  org.nest.springwrap.core.tool.api.R<com.yuchen.saas.torch.api.vo.TorchCountYearVO>
     */
    @PostMapping("/torchVisitorInfo/getCountYear")
    @ApiOperation(value = "年度访客统计", notes = "(visitorTime传入'yyyy'格式日期字符)")
    R<TorchCountYearVO> getCountYear(@Valid @RequestBody PageTorchVisitorReqDTO reqDTO);

    /**
     * @description 我的预约
     * @author  mqs
     * @date    2023/6/19 20:09
     * @param	reqDTO
     * @return  org.nest.springwrap.core.tool.api.R<java.util.List<com.yuchen.saas.torch.api.vo.TorchVisitorInfoCrewVO>>
     */
    @PostMapping("/torchVisitorInfo/getMyVisitor")
    @ApiOperation(value = "我的预约", notes = "(我的预约)")
    R<List<TorchVisitorInfoCrewVO>> getCountYear(@Valid @RequestBody PageMyVisitorReqDTO reqDTO);

    /**
     * @description  扫码获取预约信息
     * @author  mqs
     * @date    2023/6/20 20:36
     * @param	qrCode
     * @return  org.nest.springwrap.core.tool.api.R<com.yuchen.saas.torch.api.vo.TorchVisitorInfoVO>
     */
    @GetMapping("/torchVisitorInfo/getVisitByQrCode")
    @ApiOperation(value = "扫码获取预约信息", notes = "(扫码获取预约信息)")
    R<TorchVisitorInfoVO> getVisitByQrCode(String qrCode);

    /**
     * @description  站内消息提醒，未读预约消息
     * @author  mqs
     * @date    2023/6/21 14:51
     * @param
     * @return  org.nest.springwrap.core.tool.api.R<com.yuchen.saas.torch.api.vo.TorchNoReadMsgVO>
     */
    @GetMapping("/torchVisitorInfo/selectNoReadList")
    @ApiOperation(value = "站内消息提醒，未读预约消息", notes = "(站内消息提醒，未读预约消息)")
    R<TorchNoReadMsgVO> selectNoReadList();

    /**
     * @description  根据ids修改阅读状态
     * @author  mqs
     * @date    2023/6/21 14:52
     * @param	ids
     * @return  org.nest.springwrap.core.tool.api.R
     */
    @PostMapping("/torchVisitorInfo/updateReadStateByIds")
    @ApiOperation(value = "根据ids修改阅读状态", notes = "(根据ids修改阅读状态)")
    R updateReadStateByIds(String ids);

    /**
     * @description 取消访客预约
     * @author  mqs
     * @date    2023/6/27 15:15
     * @param	id
     * @return  org.nest.springwrap.core.tool.api.R
     */
    @PostMapping("/torchVisitorInfo/cancelVisitorById")
    @ApiOperation(value = "取消访客预约", notes = "(取消访客预约)")
    R cancelVisitorById(String id);

    /**
     * @description  火炬访客组织信息 新增/修改
     * @author  mqs
     * @date    2023/6/28 14:56
     * @param	visitorOrg
     * @return  org.nest.springwrap.core.tool.api.R
     */
    @PostMapping("/torchVisitorOrg/saveOrUpdate")
    @ApiOperation(value = "火炬访客组织信息 新增/修改", notes = "(火炬访客组织信息 新增/修改)")
    R saveOrUpdate(@Valid @RequestBody TorchVisitorOrg visitorOrg);

    /**
     * @description  组织信息 详情
     * @author  mqs
     * @date    2023/6/28 15:11
     * @param
     * @return  org.nest.springwrap.core.tool.api.R
     */
    @GetMapping("/getDetail")
    @ApiOperation(value = "组织信息 详情", notes = "组织信息 详情")
    R getDetail();

}
