package com.liangjian.dataplatform.member.service;

import com.liangjian.dataplatform.member.entity.po.secondary.WeixinUserInfo;

import java.util.Optional;

/**
 * @Author: 黄子奇
 * @Date: 2019/11/14
 */
public interface IWeixinUserInfoService {
    int ADD_SUCCESS = 0;
    int HAS_EXIST = 1;
    int ADD_ERROR = 2;
    int NOT_USER_REGIS = 3;

    String WECHAT = "WECHAT";
    String APP = "APP";
    String WEB = "WEB";

    Optional<WeixinUserInfo> findByPhone(String phone);

    Optional<WeixinUserInfo> findByOpenid(String openid);

    int addWeixinUserInfo(WeixinUserInfo userInfo, String phone);

    boolean save(WeixinUserInfo userInfo);

    Optional<String> encodeJwt(WeixinUserInfo userInfo, String remark);

    String decodeStr(String str);
}
