package com.cyksj.service.user;

import com.baomidou.mybatisplus.extension.service.IService;
import com.cyksj.dto.UserSharedDto;
import com.cyksj.model.dto.AuthRedirect;
import com.cyksj.model.dto.GzhOAuth2UserInfo;
import com.cyksj.model.dto.UserWhoami;
import com.cyksj.model.entity.User;
import com.cyksj.model.entity.WxSyncLog;
import com.cyksj.model.request.LoginReq;
import com.cyksj.model.views.UserCertInfoView;
import com.cyksj.model.views.UserSyncInfoView;

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

/**
 * @author chan
 * @date 2021/10/10 下午3:27
 */
public interface UserService extends IService<User> {

	User saveAuth(GzhOAuth2UserInfo userinfo, AuthRedirect re, User.RegisterEnv registerEnv) throws Exception;

	UserWhoami whoami(long userId, Long popularizeGoodsId);

    User getSyncUser(String openId, String unionId, WxSyncLog wxSyncLog);

    /**
     * 发放添加固定客服渠道优惠券
     */
    void sendFixedCustomerCoupon(Long popularizeId, Long userId, String unionId);

	List<Long> getRelationUserIdList(Long userId, User selectUser);

	List<Long> getUserIdsByNickname(String nickname);

	/**
	 * 设置用户镜像店铺展示id
	 * @param userId
	 * @return
	 */
	String getUserMirrorShopId(Long userId);

	/**
	 * 根据showId 获取用户id
	 */
	Long getUserIdByShowId(String showId);

	/**
	 * 验证码登录
	 */
	User webLogin(LoginReq loginReq, HttpServletRequest request) throws Exception;

	String bindWxAccountRedirect(String code, String state) throws Exception;

	/**
	 * 领取礼品卡
	 */
	void receiveGiftCardByRc(Long userId, String code, Long relationId);

	UserSharedDto getUserShredDtoByDsCode(String dsCode);

	Long getSharedIdByUserId(Long userId);

	void bindUserDistributeShared(Long userId, String dsCode);

	/**
	 * 实物好友邀请分销
	 */
	void saveEpDistributeShared(Long userId, String dsCode);

	UserCertInfoView getCertOverView(long userId);

	UserSyncInfoView getUserSyncInfo(long userId);
}
