package com.cool.store.service;

import com.cool.store.dto.wx.MiniAppUrlLinkReqDTO;
import com.cool.store.dto.wx.MiniProgramFreeLoginDTO;
import com.cool.store.dto.wx.MiniProgramLoginDTO;
import com.cool.store.request.MobileUpdateRequest;
import com.cool.store.vo.PartnerUserInfoVO;

/**
 * @author zhangchenbiao
 * @FileName: WechatMiniAppService
 * @Description:
 * @date 2023-05-29 14:28
 */
public interface WechatMiniAppService {

    PartnerUserInfoVO miniProgramLogin(MiniProgramLoginDTO param);

    PartnerUserInfoVO getUserInfoByJsCode(String jsCode);

    Boolean cancellation(String openId);

    String getUserPhoneNumber(String mobileCode);

    String updateUserPhoneNumber(MobileUpdateRequest request, PartnerUserInfoVO userInfoVO);

    PartnerUserInfoVO getUserInfo(String mobile, String openId);

    String getMiniAppUrl();

    String getMiniAppUrlLink(MiniAppUrlLinkReqDTO miniAppUrlLinkReqDTO);

    /**
     * 通过手机号获取短期token
     * @param param 小程序免登DTO
     * @return Token
     */
    String getShortTermTokenByMobile(MiniProgramFreeLoginDTO param);

    /**
     * 通过短期token获取用户信息
     * @param token 短期token
     * @return 用户信息VO
     */
    PartnerUserInfoVO getUserInfoByShortTermToken(String token);
}
