package com.fs.wxwork;

import com.fs.wxwork.dto.*;
import com.fs.wxwork.service.WxWorkService;
import com.fs.wxwork.service.WxWorkServiceImpl;

import java.util.Arrays;
import java.util.List;

public class test {
    static String uuid="80162fbb96fb3e24342c4ebed94c6c60";
    static String key="8958B14390478C4B3789D376A2078857";
    static String code="036599";

   static WxWorkServiceImpl wxWorkService = new WxWorkServiceImpl();
    public static void main(String[] args) {
        Vid2UserId();
    }

    //初始化
    static  void  init(){
        WxWorkResponseDTO<WxWorkInitRespDTO> init = wxWorkService.init(new WxWorkInitDTO());
        WxWorkInitRespDTO data = init.getData();
        System.out.println(data);
    }

    static  void  Vid2UserId(){
        WxWorkVid2UserIdDTO wxWorkVid2UserIdDTO = new WxWorkVid2UserIdDTO();
        wxWorkVid2UserIdDTO.setUser_id(Arrays.asList(7881300789018608L));
        wxWorkVid2UserIdDTO.setUuid(uuid);
        WxWorkResponseDTO<List<WxWorkVid2UserIdRespDTO>> WxWorkVid2UserIdRespDTO = wxWorkService.Vid2UserId(wxWorkVid2UserIdDTO);
        List<WxWorkVid2UserIdRespDTO> data = WxWorkVid2UserIdRespDTO.getData();

        System.out.println(data);
    }
    static  void  sendMsg(){
        WxWorkSendTextMsgDTO wxWorkSendTextMsgDTO = new WxWorkSendTextMsgDTO();
        wxWorkSendTextMsgDTO.setSend_userid(7881300789018608L);
        wxWorkSendTextMsgDTO.setUuid(uuid);
        wxWorkSendTextMsgDTO.setContent("你好啊");
        wxWorkSendTextMsgDTO.setIsRoom(false);
        WxWorkResponseDTO<WxWorkSendTextMsgRespDTO> wxWorkSendTextMsgRespDTOWxWorkResponseDTO = wxWorkService.SendTextMsg(wxWorkSendTextMsgDTO);
        WxWorkSendTextMsgRespDTO data = wxWorkSendTextMsgRespDTOWxWorkResponseDTO.getData();


        System.out.println(data);
    }
    static  void  externalContacts(){
        WxwGetExternalContactsDTO wxwGetExternalContactsDTO = new WxwGetExternalContactsDTO();
        wxwGetExternalContactsDTO.setUuid(uuid);
        wxwGetExternalContactsDTO.setLimit(100);
        wxwGetExternalContactsDTO.setStrSeq("0");
        WxWorkResponseDTO<List<WxwGetExternalContactRespDTO>> externalContacts = wxWorkService.getExternalContacts(wxwGetExternalContactsDTO);
        List<WxwGetExternalContactRespDTO> data = externalContacts.getData();

        System.out.println(data);
    }
    static  void  getRunClient(){
        WxWorkResponseDTO<WxwGetRunClientRespDTO> runClient = wxWorkService.getRunClient();
        WxwGetRunClientRespDTO data = runClient.getData();
        System.out.println(data);
    }
    static  void  getQrCode(){
        WxWorkGetQrCodeDTO wxWorkGetQrCodeDTO = new WxWorkGetQrCodeDTO();
        wxWorkGetQrCodeDTO.setUuid(uuid);
        WxWorkResponseDTO<WxWorkGetQrCodeRespDTO> qrCode = wxWorkService.getQrCode(wxWorkGetQrCodeDTO);
        WxWorkGetQrCodeRespDTO data = qrCode.getData();

        System.out.println(data);
    }
    static  void  CheckCode(){
        WxWorkCheckCodeDTO wxWorkCheckCodeDTO = new WxWorkCheckCodeDTO();
        wxWorkCheckCodeDTO.setUuid(uuid);
        wxWorkCheckCodeDTO.setCode(code);
        wxWorkCheckCodeDTO.setQrcodeKey(key);
        WxWorkResponseDTO wxWorkResponseDTO = wxWorkService.CheckCode(wxWorkCheckCodeDTO);


        System.out.println(wxWorkResponseDTO);
    }
    static void setCallbackUrl(){
        WxWorkSetCallbackUrlDTO wxWorkSetCallbackUrlDTO = new WxWorkSetCallbackUrlDTO();
        wxWorkSetCallbackUrlDTO.setUrl("http://z7wzsv.natappfree.cc/msg/callback");
        wxWorkSetCallbackUrlDTO.setUuid(uuid);
        WxWorkResponseDTO wxWorkResponseDTO = wxWorkService.SetCallbackUrl(wxWorkSetCallbackUrlDTO);
        System.out.println(wxWorkResponseDTO);
    }


    static void SecondaryValidation(){
        WxWorkGetQrCodeDTO wxWorkGetQrCodeDTO = new WxWorkGetQrCodeDTO();
        wxWorkGetQrCodeDTO.setUuid(uuid);
        wxWorkService.SecondaryValidation(wxWorkGetQrCodeDTO);
        System.out.println(wxWorkGetQrCodeDTO);
    }

    static void getExternalContacts(){
        WxwGetExternalContactsDTO wxwGetExternalContactsDTO = new WxwGetExternalContactsDTO();
        wxwGetExternalContactsDTO.setUuid(uuid);
        WxWorkResponseDTO<List<WxwGetExternalContactRespDTO>> externalContacts = wxWorkService.getExternalContacts(wxwGetExternalContactsDTO);
        System.out.println(externalContacts);
    }

}
