| | |
| | | package com.yeshi.fanli.service.inter.user;
|
| | |
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | | import javax.servlet.http.HttpSession;
|
| | |
|
| | | import com.yeshi.fanli.dto.user.wx.WXMPLoginData;
|
| | | import com.yeshi.fanli.dto.user.wx.WXMPLoginResult;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.user.LoginResult;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.exception.user.UserAccountException;
|
| | |
|
| | | /**
|
| | | * 登录服务
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | public interface UserAccountService {
|
| | | /**
|
| | | * 用户登录
|
| | | * |
| | | * @param session
|
| | | * @param code
|
| | | * @param phone
|
| | | * @param wxinstall
|
| | | * @param loginType
|
| | | * @return
|
| | | * @throws UserAccountException
|
| | | */
|
| | | public LoginResult login(HttpServletRequest request, AcceptData acceptData, Boolean first, String appId,
|
| | | String code, String phone, UserInfo tbUserInfo, boolean wxinstall, int loginType)
|
| | | throws UserAccountException;
|
| | |
|
| | | /**
|
| | | * 没有安装微信时候的登录
|
| | | * |
| | | * @param appId
|
| | | * @param code
|
| | | * @param phone
|
| | | * @param tbUserInfo
|
| | | * @param loginType
|
| | | * @return
|
| | | * @throws UserAccountException
|
| | | */
|
| | | public LoginResult loginNoInstallWX(AcceptData acceptData, String appId, String code, String phone,
|
| | | UserInfo tbUserInfo, int loginType) throws UserAccountException;
|
| | |
|
| | | /**
|
| | | * 打通微信账号与其他类型的一个账号
|
| | | * |
| | | * @param session
|
| | | * @throws UserAccountException
|
| | | */
|
| | | public void connectUsers(HttpSession session) throws UserAccountException;
|
| | |
|
| | | /**
|
| | | * 备份重要的用户信息
|
| | | * |
| | | * @param uid
|
| | | */
|
| | | public String backupUserImportantInfo(Long uid);
|
| | |
|
| | | /**
|
| | | * 打通两个账号,以主账号为主
|
| | | * |
| | | * @param mainUser
|
| | | * @param lessUser
|
| | | * @throws UserAccountException
|
| | | */
|
| | | public void connectUsers(UserInfo mainUser, UserInfo lessUser) throws UserAccountException;
|
| | |
|
| | | /**
|
| | | * 注册用户
|
| | | * |
| | | * @param userInfo
|
| | | */
|
| | | public void register(UserInfo userInfo) throws UserAccountException;
|
| | |
|
| | | /**
|
| | | * 根据系统与微信unionid获取用户信息
|
| | | * |
| | | * @param appId
|
| | | * @param unionId
|
| | | * @return
|
| | | */
|
| | | public UserInfo getUserInfoByWXUnionId(String appId, String unionId) throws UserAccountException;
|
| | |
|
| | | /**
|
| | | * 根据系统和淘宝的Openid寻找用户
|
| | | * |
| | | * @param appId
|
| | | * @param openId
|
| | | * @return
|
| | | */
|
| | | public UserInfo getUserInfoByTaoBaoOpenId(String appId, String openId) throws UserAccountException;
|
| | |
|
| | | /**
|
| | | * 根据系统和电话号码寻找用户
|
| | | * |
| | | * @param appId
|
| | | * @param phone
|
| | | * @return
|
| | | */
|
| | | public UserInfo getUserInfoByPhone(String appId, String phone) throws UserAccountException;
|
| | |
|
| | | public void addUser(UserInfo user);
|
| | |
|
| | | /**
|
| | | * 更改部分用户信息
|
| | | * |
| | | * @param user
|
| | | */
|
| | | public void updateUserSelective(UserInfo user);
|
| | |
|
| | | /**
|
| | | * 绑定电话号码
|
| | | * |
| | | * @param uid
|
| | | * @param phone
|
| | | * @throws UserAccountException
|
| | | */
|
| | | public void bindPhone(Long uid, String phone) throws UserAccountException;
|
| | |
|
| | | /**
|
| | | * 解绑电话
|
| | | * |
| | | * @param uid
|
| | | * @param phone
|
| | | * @throws UserAccountException
|
| | | */
|
| | | public void unBindPhone(Long uid, String phone) throws UserAccountException;
|
| | |
|
| | | /**
|
| | | * 绑定淘宝
|
| | | * |
| | | * @param uid
|
| | | * @param tbOpenId
|
| | | * @param tbNickName
|
| | | * @param tbPortrait
|
| | | * @throws UserAccountException
|
| | | */
|
| | | public void bindTaoBao(Long uid, String tbOpenId, String tbNickName, String tbPortrait) throws UserAccountException;
|
| | |
|
| | | /**
|
| | | * 解绑淘宝
|
| | | * |
| | | * @param uid
|
| | | * @throws UserAccountException
|
| | | */
|
| | | public void unBindTaoBao(Long uid) throws UserAccountException;
|
| | |
|
| | | /**
|
| | | * 更改微信绑定
|
| | | * |
| | | * @param uid
|
| | | * @param code
|
| | | */
|
| | | public void changeWXBind(AcceptData acceptData, Long uid, String code) throws UserAccountException;
|
| | |
|
| | | /**
|
| | | * 清理用户头像
|
| | | * |
| | | * @param uid
|
| | | */
|
| | | public void clearUserPortrait(Long uid);
|
| | |
|
| | | /**
|
| | | * 修复用户头像
|
| | | * |
| | | * @param uid
|
| | | */
|
| | | public String repairPortrait(Long uid);
|
| | |
|
| | | /**
|
| | | * 电话号码登录 1.5.3
|
| | | * |
| | | * @param request
|
| | | * @param first
|
| | | * @param appId
|
| | | * @param phone
|
| | | * @return
|
| | | * @throws UserAccountException
|
| | | */
|
| | | public UserInfo loginPhone(HttpServletRequest request, int loginType, String vcode, String phone, String appId)
|
| | | throws UserAccountException;
|
| | |
|
| | | /**
|
| | | * 微信登录 1.5.3
|
| | | * |
| | | * @param request
|
| | | * @param first
|
| | | * @param appId
|
| | | * @param code
|
| | | * @param loginType
|
| | | * @return
|
| | | * @throws UserAccountException
|
| | | */
|
| | | public UserInfo loginWinXin(HttpServletRequest request, AcceptData acceptData, int loginType, String code,
|
| | | String appId) throws UserAccountException;
|
| | |
|
| | | /**
|
| | | * 绑定电话号码 V1.5.3
|
| | | * |
| | | * @param uid
|
| | | * @param phone
|
| | | * @throws UserAccountException
|
| | | */
|
| | | public void bindPhoneNew(Long uid, String phone) throws UserAccountException;
|
| | |
|
| | | /**
|
| | | * 绑定微信 V1.5.3
|
| | | * |
| | | * @param uid
|
| | | * @param code
|
| | | * @throws UserAccountException
|
| | | */
|
| | | public void bindWeiXin(AcceptData acceptData, Long uid, String code) throws UserAccountException;
|
| | |
|
| | | /**
|
| | | * 账户封禁
|
| | | * |
| | | * @param uid
|
| | | * @param reason
|
| | | */
|
| | | public void forbiddenUser(Long uid, String reason);
|
| | |
|
| | | /**
|
| | | * 封禁用户所有信息:手机号、微信、淘宝、支付宝
|
| | | * |
| | | * @param uid
|
| | | * @param reason
|
| | | */
|
| | | public void forbiddenUserAll(Long uid, String reason);
|
| | |
|
| | | /**
|
| | | * 删除账户
|
| | | * |
| | | * @param uid
|
| | | * @param reason
|
| | | */
|
| | | public void DeleteUser(Long uid, String reason);
|
| | |
|
| | | /**
|
| | | * 长时间未登录账户删除
|
| | | * |
| | | * @param uid
|
| | | * @param reason
|
| | | */
|
| | | public void DeleteUserOutOfDate(Long uid, String reason);
|
| | |
|
| | | /**
|
| | | * 2.0.1 新登录方式 -微信
|
| | | * |
| | | * @param request
|
| | | * @param acceptData
|
| | | * @param loginType
|
| | | * @param wxCode
|
| | | * @param appId
|
| | | * @return
|
| | | * @throws UserAccountException
|
| | | */
|
| | | public UserInfo loginWeiXinNew(HttpServletRequest request, AcceptData acceptData, int loginType, String wxCode,
|
| | | String appId) throws UserAccountException;
|
| | |
|
| | | /**
|
| | | * 未注册之前绑定手机号
|
| | | * |
| | | * @param phone
|
| | | * @param key
|
| | | * @param appId
|
| | | * @param request
|
| | | * @return
|
| | | * @throws UserAccountException
|
| | | */
|
| | | public UserInfo bindPhoneToLogin(String phone, String key, String appId, HttpServletRequest request)
|
| | | throws UserAccountException;
|
| | |
|
| | | }
|
| | | package com.yeshi.fanli.service.inter.user; |
| | | |
| | | import com.yeshi.fanli.entity.SystemEnum; |
| | | import com.yeshi.fanli.entity.accept.AcceptData; |
| | | import com.yeshi.fanli.entity.bus.user.LoginResult; |
| | | import com.yeshi.fanli.entity.bus.user.UserInfo; |
| | | import com.yeshi.fanli.entity.system.BusinessSystem; |
| | | import com.yeshi.fanli.exception.user.UserAccountException; |
| | | import com.yeshi.fanli.vo.taobao.TaoBaoUser; |
| | | import com.yeshi.fanli.vo.user.QQUserInfoVO; |
| | | import org.yeshi.utils.entity.ProxyIP; |
| | | import org.yeshi.utils.entity.wx.WeiXinUser; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | /** |
| | | * 登录服务 |
| | | * |
| | | * @author Administrator |
| | | */ |
| | | public interface UserAccountService { |
| | | |
| | | |
| | | public String getMobile(String vcode, String phone, String aliAccessToken, SystemEnum system,int vcodeType) throws UserAccountException; |
| | | /** |
| | | * 用户登录 |
| | | * |
| | | * @param code |
| | | * @param phone |
| | | * @param wxinstall |
| | | * @param loginType |
| | | * @return |
| | | * @throws UserAccountException |
| | | */ |
| | | public LoginResult login(HttpServletRequest request, AcceptData acceptData, Boolean first, String appId, |
| | | String code, String phone, UserInfo tbUserInfo, boolean wxinstall, int loginType) |
| | | throws UserAccountException; |
| | | |
| | | /** |
| | | * 没有安装微信时候的登录 |
| | | * |
| | | * @param appId |
| | | * @param code |
| | | * @param phone |
| | | * @param tbUserInfo |
| | | * @param loginType |
| | | * @return |
| | | * @throws UserAccountException |
| | | */ |
| | | public LoginResult loginNoInstallWX(AcceptData acceptData, String appId, String code, String phone, |
| | | UserInfo tbUserInfo, int loginType) throws UserAccountException; |
| | | |
| | | |
| | | /** |
| | | * 注册用户 |
| | | * |
| | | * @param userInfo |
| | | */ |
| | | public void register(UserInfo userInfo) throws UserAccountException; |
| | | |
| | | |
| | | /** |
| | | * 根据系统与微信unionid获取用户信息 |
| | | * |
| | | * @param system |
| | | * @param unionId |
| | | * @return |
| | | * @throws UserAccountException |
| | | */ |
| | | public UserInfo getUserInfoByWXUnionId(SystemEnum system, String unionId) throws UserAccountException; |
| | | |
| | | /** |
| | | * 根据系统和淘宝的Openid寻找用户 |
| | | * |
| | | * @param system |
| | | * @param openId |
| | | * @return |
| | | * @throws UserAccountException |
| | | */ |
| | | public UserInfo getUserInfoByTaoBaoOpenId(SystemEnum system, String openId) throws UserAccountException; |
| | | |
| | | |
| | | /** |
| | | * 根据系统和电话号码寻找用户 |
| | | * |
| | | * @param system |
| | | * @param phone |
| | | * @return |
| | | * @throws UserAccountException |
| | | */ |
| | | public UserInfo getUserInfoByPhone(SystemEnum system, String phone) throws UserAccountException; |
| | | |
| | | public void addUser(UserInfo user); |
| | | |
| | | /** |
| | | * 更改部分用户信息 |
| | | * |
| | | * @param user |
| | | */ |
| | | public void updateUserSelective(UserInfo user); |
| | | |
| | | /** |
| | | * 绑定电话号码 |
| | | * |
| | | * @param uid |
| | | * @param phone |
| | | * @throws UserAccountException |
| | | */ |
| | | public void bindPhone(Long uid, String phone) throws UserAccountException; |
| | | |
| | | /** |
| | | * 解绑电话 |
| | | * |
| | | * @param uid |
| | | * @param phone |
| | | * @throws UserAccountException |
| | | */ |
| | | public void unBindPhone(Long uid, String phone) throws UserAccountException; |
| | | |
| | | /** |
| | | * 绑定淘宝 |
| | | * |
| | | * @param uid |
| | | * @param tbOpenId |
| | | * @param tbNickName |
| | | * @param tbPortrait |
| | | * @throws UserAccountException |
| | | */ |
| | | public void bindTaoBao(Long uid, String tbOpenId, String tbNickName, String tbPortrait) throws UserAccountException; |
| | | |
| | | /** |
| | | * 解绑淘宝 |
| | | * |
| | | * @param uid |
| | | * @throws UserAccountException |
| | | */ |
| | | public void unBindTaoBao(Long uid) throws UserAccountException; |
| | | |
| | | /** |
| | | * 更改微信绑定 |
| | | * |
| | | * @param uid |
| | | * @param code |
| | | */ |
| | | public void changeWXBind(AcceptData acceptData, Long uid, String code) throws UserAccountException; |
| | | |
| | | /** |
| | | * 清理用户头像 |
| | | * |
| | | * @param uid |
| | | */ |
| | | public void clearUserPortrait(Long uid); |
| | | |
| | | /** |
| | | * 修复用户头像 |
| | | * |
| | | * @param uid |
| | | */ |
| | | public String repairPortrait(Long uid); |
| | | |
| | | /** |
| | | * 电话号码登录 1.5.3 |
| | | * |
| | | * @param ipInfo |
| | | * @param loginType |
| | | * @param vcode |
| | | * @param phone |
| | | * @param businessSystem |
| | | * @return |
| | | * @throws UserAccountException |
| | | */ |
| | | @Deprecated |
| | | public UserInfo loginPhone(ProxyIP ipInfo, int loginType, String vcode, String phone, String aliAccessToken, BusinessSystem businessSystem) |
| | | throws UserAccountException; |
| | | |
| | | /** |
| | | * 淘宝登录 |
| | | * |
| | | * @param ipInfo |
| | | * @param taoBaoUser -淘宝信息 |
| | | * @param businessSystem |
| | | * @return |
| | | * @throws UserAccountException |
| | | */ |
| | | public UserInfo loginTB(ProxyIP ipInfo, TaoBaoUser taoBaoUser, BusinessSystem businessSystem) |
| | | throws UserAccountException; |
| | | |
| | | /** |
| | | * 微信登录 1.5.3 |
| | | * |
| | | * @param ipInfo |
| | | * @param loginType |
| | | * @param code |
| | | * @param businessSystem |
| | | * @return |
| | | * @throws UserAccountException |
| | | */ |
| | | @Deprecated |
| | | public UserInfo loginWeiXin(ProxyIP ipInfo, int loginType, String code, BusinessSystem businessSystem) throws UserAccountException; |
| | | |
| | | /** |
| | | * 绑定电话号码 V1.5.3 |
| | | * |
| | | * @param uid |
| | | * @param phone |
| | | * @throws UserAccountException |
| | | */ |
| | | public void bindPhoneNew(Long uid, String phone) throws UserAccountException; |
| | | |
| | | /** |
| | | * 绑定微信 V1.5.3 |
| | | * |
| | | * @param uid |
| | | * @param code |
| | | * @throws UserAccountException |
| | | */ |
| | | public void bindWeiXin(BusinessSystem system, Long uid, String code) throws UserAccountException; |
| | | |
| | | |
| | | /** |
| | | * 绑定微信 V1.5.3 |
| | | * |
| | | * @param uid |
| | | * @param wxUser |
| | | * @throws UserAccountException |
| | | */ |
| | | public void bindWeiXin(Long uid, WeiXinUser wxUser) throws UserAccountException; |
| | | |
| | | |
| | | /** |
| | | * 绑定QQ |
| | | * |
| | | * @param uid |
| | | * @param qqUser |
| | | * @throws UserAccountException |
| | | */ |
| | | public void bindQQ( Long uid, QQUserInfoVO qqUser) throws UserAccountException; |
| | | |
| | | |
| | | /** |
| | | * 账户封禁 |
| | | * |
| | | * @param uid |
| | | * @param reason |
| | | */ |
| | | public void forbiddenUser(Long uid, String reason); |
| | | |
| | | /** |
| | | * 封禁用户所有信息:手机号、微信、淘宝、支付宝 |
| | | * |
| | | * @param uid |
| | | * @param reason |
| | | */ |
| | | public void forbiddenUserAll(Long uid, String reason); |
| | | |
| | | |
| | | /** |
| | | * 注销账户 |
| | | * |
| | | * @param uid |
| | | */ |
| | | public void unRegisterUser(Long uid,String reason); |
| | | |
| | | /** |
| | | * 删除账户 |
| | | * |
| | | * @param uid |
| | | * @param reason |
| | | */ |
| | | public void DeleteUser(Long uid, String reason); |
| | | |
| | | /** |
| | | * 长时间未登录账户删除 |
| | | * |
| | | * @param uid |
| | | * @param reason |
| | | */ |
| | | public void DeleteUserOutOfDate(Long uid, String reason); |
| | | |
| | | /** |
| | | * 2.0.1 新登录方式 -微信 |
| | | * |
| | | * @param ipInfo |
| | | * @param acceptData |
| | | * @param loginType |
| | | * @param wxCode |
| | | * @param appId |
| | | * @return |
| | | * @throws UserAccountException |
| | | */ |
| | | public UserInfo loginWeiXinNew(ProxyIP ipInfo, int loginType, String wxCode, |
| | | BusinessSystem businessSystem) throws UserAccountException; |
| | | |
| | | |
| | | /** |
| | | * QQ登录 |
| | | * @param ipInfo |
| | | * @param loginType |
| | | * @param qqUserInfo |
| | | * @param businessSystem |
| | | * @return |
| | | * @throws UserAccountException |
| | | */ |
| | | public UserInfo loginQQ(ProxyIP ipInfo, int loginType, QQUserInfoVO qqUserInfo, |
| | | BusinessSystem businessSystem) throws UserAccountException; |
| | | |
| | | /** |
| | | * 未注册之前绑定手机号 |
| | | * |
| | | * @param ipinfo |
| | | * @param acceptData |
| | | * @param phone |
| | | * @param key |
| | | * @return |
| | | * @throws UserAccountException |
| | | */ |
| | | public UserInfo bindPhoneToLogin(ProxyIP ipinfo, AcceptData acceptData, String phone, String key) |
| | | throws UserAccountException; |
| | | |
| | | /** |
| | | * 手机登录需要绑定微信 |
| | | * |
| | | * @param ipinfo |
| | | * @param acceptData |
| | | * @param loginType |
| | | * @param vcode |
| | | * @param phone |
| | | * @param appId |
| | | * @return |
| | | * @throws UserAccountException |
| | | */ |
| | | public UserInfo loginPhoneNew(ProxyIP ipinfo, AcceptData acceptData, int loginType, String vcode, String phone, String appId) |
| | | throws UserAccountException; |
| | | |
| | | /** |
| | | * 绑定微信登录 + 手机号key |
| | | * |
| | | * @param ipInfo |
| | | * @param acceptData |
| | | * @param code |
| | | * @param appId |
| | | * @param key |
| | | * @return |
| | | * @throws UserAccountException |
| | | */ |
| | | public UserInfo bindWXToLogin(ProxyIP ipInfo, AcceptData acceptData, String code, String appId, |
| | | String key) throws UserAccountException; |
| | | |
| | | } |