2026-06-30 24681c81c09022f584a57006f2534b5f74723414
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
package cn.iocoder.yudao.module.im.enums.friend;
 
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
 
import java.util.Arrays;
 
/**
 * IM 好友添加来源枚举
 * <p>
 * 由发起方调用 apply 接口时传入;同意后同步写入 im_friend.add_source(双向)
 *
 * @author 芋道源码
 */
@RequiredArgsConstructor
@Getter
public enum ImFriendAddSourceEnum implements ArrayValuable<Integer> {
 
    SEARCH(1, "搜索"), // FriendAddDialog 搜索流程
    GROUP(2, "群聊"), // 群成员主页 → UserInfo「加为好友」入口
    QR_CODE(3, "扫码"), // TODO @芋艿:后续实现扫码加好友
    CARD(4, "名片"); // TODO @芋艿:后续实现通过名片加好友,类似微信的「扫一扫 - 名片」功能,或者「通讯录 - 推荐好友」功能
 
    public static final Integer[] ARRAYS = Arrays.stream(values()).map(ImFriendAddSourceEnum::getSource).toArray(Integer[]::new);
 
    /**
     * 来源
     */
    private final Integer source;
    /**
     * 名字
     */
    private final String name;
 
    @Override
    public Integer[] array() {
        return ARRAYS;
    }
 
}