package com.pcloud.book.group.service;

import com.pcloud.book.group.dto.BookWxQrcodeDTO;
import com.pcloud.book.group.dto.SyncWeixinGroupIdDTO;
import com.pcloud.book.group.dto.UpdateQrDTO;
import com.pcloud.book.group.dto.WeixinQrcodeCountDTO;
import com.pcloud.book.group.dto.WeixinQrcodeDTO;
import com.pcloud.common.dto.ResponseDto;
import com.pcloud.common.exceptions.BizException;

import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.http.ResponseEntity;
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 java.util.List;
import java.util.Map;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/**
 * @author lily
 * @date 2019/4/19 15:57
 */
@FeignClient(value = "pcloud-service-book", qualifier = "weixinQrcodeServiceCloud", path = "book/v1.0/weixinQrcodeService")
@Api(description = "微信群二维码码接口")
public interface WeixinQrcodeService {

    @ApiOperation("定时任务")
    @GetMapping("tenQuartz")
    void tenQuartz() throws BizException;

    @ApiOperation("发起更新二维码请求")
    @GetMapping("setUpdateQrUrl")
    void setUpdateQrUrl() throws BizException;

    @ApiOperation("更新二维码地址")
    @GetMapping("updateQrUrl")
    void updateQrUrl(UpdateQrDTO updateQrDTO) throws BizException;

    @ApiOperation("针对出错的二维码发起更新二维码请求")
    @GetMapping("setUpdateQr4Error")
    void setUpdateQr4Error(List<Long> ids) throws BizException;

    @ApiOperation("同步微信群id")
    @PostMapping("syncWeixinGroupId")
    void syncWeixinGroupId(@RequestBody SyncWeixinGroupIdDTO syncWeixinGroupIdDTO);

    @ApiOperation("发送修改群名称请求")
    @PostMapping("sendChangeGroupNameRequest")
    void sendChangeGroupNameRequest(@RequestBody(required = false) List<Long> ids);

    @ApiOperation("发送同步微信id的请求")
    @PostMapping("sendSyncWeixinGroupIdRequest")
    void sendSyncWeixinGroupIdRequest(@RequestBody List<Long> ids);

    @ApiOperation("获取机器人二维码分配情况")
    @PostMapping("listWeixinQrcodeCountByRobot")
    ResponseEntity<ResponseDto<Map<Long, WeixinQrcodeCountDTO>>> listWeixinQrcodeCountByRobot(@RequestBody List<Long> robotIds);

    @ApiOperation("获取一个二维码")
    @GetMapping("getOneQrcode")
    ResponseEntity<ResponseDto<WeixinQrcodeDTO>> getOneQrcode();

    @ApiOperation("分页获取可用微信群")
    @GetMapping("listAvailableGroupByPage")
    ResponseEntity<ResponseDto<List<BookWxQrcodeDTO>>> listAvailableGroupByPage(@RequestParam("currentPage") Integer currentPage, @RequestParam("numPerPage") Integer numPerPage);

    @ApiOperation("分页获取人数超过10人的可用微信群")
    @GetMapping("listOver10AvailableGroupByPage")
    ResponseEntity<ResponseDto<List<BookWxQrcodeDTO>>> listOver10AvailableGroupByPage(@RequestParam("currentPage") Integer currentPage, @RequestParam("numPerPage") Integer numPerPage);

    @ApiOperation("所有群邀请新的机器人小号(有接收消息机器人存在好友关系)")
    @GetMapping("inviteNewRobot")
    void inviteNewRobot(@RequestParam("wxUserId") String wxUserId);



}
