eight
2024-11-21 b8ed4828e4d798111d36fc58ebb718ebe62359b9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package cn.lihu.jh.module.system.api.social;
 
import cn.lihu.jh.framework.common.exception.ServiceException;
import cn.lihu.jh.module.system.api.social.dto.SocialUserBindReqDTO;
import cn.lihu.jh.module.system.api.social.dto.SocialUserRespDTO;
import cn.lihu.jh.module.system.api.social.dto.SocialUserUnbindReqDTO;
 
import javax.validation.Valid;
 
/**
 * 社交用户的 API 接口
 *
 * @author 芋道源码
 */
public interface SocialUserApi {
 
    /**
     * 绑定社交用户
     *
     * @param reqDTO 绑定信息
     * @return 社交用户 openid
     */
    String bindSocialUser(@Valid SocialUserBindReqDTO reqDTO);
 
    /**
     * 取消绑定社交用户
     *
     * @param reqDTO 解绑
     */
    void unbindSocialUser(@Valid SocialUserUnbindReqDTO reqDTO);
 
    /**
     * 获得社交用户,基于 userId
     *
     * @param userType   用户类型
     * @param userId     用户编号
     * @param socialType 社交平台的类型
     * @return 社交用户
     */
    SocialUserRespDTO getSocialUserByUserId(Integer userType, Long userId, Integer socialType);
 
    /**
     * 获得社交用户
     *
     * 在认证信息不正确的情况下,也会抛出 {@link ServiceException} 业务异常
     *
     * @param userType   用户类型
     * @param socialType 社交平台的类型
     * @param code       授权码
     * @param state      state
     * @return 社交用户
     */
    SocialUserRespDTO getSocialUserByCode(Integer userType, Integer socialType, String code, String state);
 
}