package com.huiju.estateagents.service;

import cn.binarywang.wx.miniapp.api.WxMaService;
import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult;
import cn.binarywang.wx.miniapp.bean.WxMaPhoneNumberInfo;
import cn.binarywang.wx.miniapp.bean.WxMaUserInfo;
import com.alibaba.fastjson.JSONObject;
import com.huiju.estateagents.base.ResponseBean;
import com.huiju.estateagents.entity.TaMiniapp;
import com.huiju.estateagents.entity.TaMiniappQrcode;
import com.huiju.estateagents.entity.TaMiniappTemplate;
import com.huiju.estateagents.entity.TaPerson;
import me.chanjar.weixin.common.error.WxErrorException;

import java.time.LocalDateTime;
import java.util.List;

public interface IMiniAppService {
    WxMaJscode2SessionResult getSessionInfo(String code, String appid) throws WxErrorException;

    boolean checkUserInfo(String sessionKey, String rawData, String signature, String appid);

    WxMaUserInfo getUserInfo(String sessionKey, String encryptedData, String iv, String appid);

    WxMaPhoneNumberInfo getPhoneNoInfo(String sessionKey, String encryptedData, String iv, String appid);

    void sendNoticeMessage(TaPerson toUser, String link, String name, String phone, String content, LocalDateTime dt);

    void sendHelpMessage(TaPerson toUser, String link, String result, String activityName, LocalDateTime dt);

    void sendGroupMessage(TaPerson toUser, String link, String result, String activityName, LocalDateTime dt);

    void sendCheckMessage(TaPerson toUser, String link, String name, String result, String programName, String failReason, String remark, LocalDateTime dt, Boolean isSuccess);

    ResponseBean getQrCode(String paramsStr, String appid);

    String createQrCode(WxMaService service, String path) throws Exception;

    TaMiniappQrcode getQrCodeBySerialNo(Integer id);

    List<TaMiniapp> getAllAvaliableMiniapps();

    TaMiniappTemplate getTplByType(String type, String appid);

    List<TaMiniappTemplate> getTpls(String appid);

    ResponseBean getOrgQrCode(String paramsStr, Integer orgId);
}
