package com.yiqi.crm.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.yiqi.crm.domain.CrmWeChatSetting;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;

import java.io.File;
import java.io.IOException;

/**
 * @author xiaohei
 * @date 2023/7/18
 */
public interface CrmWechatSettingService extends IService<CrmWeChatSetting> {
    /**
     * 获取回复信息
     * @param requestBody 微信发送过来的信息
     * @param encType
     * @param timestamp
     * @param nonce
     * @param msgSignature
     * @return
     */
    String getOutMsg(String requestBody,String signature, String encType, String timestamp, String nonce, String msgSignature);

    /**
     * 上传图片到微信素材平台
     *
     * @param file
     * @param type
     * @return mediaId
     */
    public String uploadMaterial(MultipartFile file,  String type) throws IOException;

    /**
     * 接口直接 上传图片到微信素材平台
     *
     * @param url
     * @return mediaId
     */
    public String uploadPicToMaterial(String url) throws Exception;

    /**
     * 接口直接 上传图片到微信素材平台
     *
     * @param mediaId
     * @return
     */
    public Boolean deleteMaterial(String mediaId) throws Exception;
}
