package com.xunwang.ucenter.service;

import com.xunwang.ucenter.entity.MpOpenidUid;
import com.baomidou.mybatisplus.extension.service.IService;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author Long
 * @since 2022-11-09
 */
public interface MiniProgramOpenidUidService extends IService<MpOpenidUid> {

    /**
     * 获取用户openid，unionid等
     * @param appid
     * @param secret
     * @param code
     * @param grant_type
     * @return
     */
    Map<String, String> getOpenId(HttpServletRequest request, String appid, String secret, String code, String grant_type) throws Exception;

    /**
     * 修改微信昵称
     * @param uid
     * @param alias
     */
    void editAlias(String uid, String alias, String avatar);

    /**
     * 获取手机号
     * @param uid
     * @param code
     * @return
     * @throws Exception
     */
    String getUserPhone(String uid, String code) throws Exception;
}
