liu
2026-09-30 91491239c5d4611b5b1404a7abeb2bb23d0edad5
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
package cn.iocoder.yudao.module.wxcp.enums.activity;
 
import cn.hutool.core.util.ArrayUtil;
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
import lombok.AllArgsConstructor;
import lombok.Getter;
 
import java.util.Arrays;
 
/**
 * 企业微信活动推送范围枚举
 *
 * @author 超级管理员
 */
@Getter
@AllArgsConstructor
public enum WxCpPushScopeEnum implements ArrayValuable<Integer> {
 
    ALL(0, "全员"),
    PARTY(1, "指定部门"),
    USER(2, "指定成员"),
    ;
 
    public static final Integer[] ARRAYS = Arrays.stream(values())
            .map(WxCpPushScopeEnum::getScope).toArray(Integer[]::new);
 
    /**
     * 范围值
     */
    private final Integer scope;
    /**
     * 范围名
     */
    private final String name;
 
    @Override
    public Integer[] array() {
        return ARRAYS;
    }
 
    public static WxCpPushScopeEnum valueOf(Integer scope) {
        return ArrayUtil.firstMatch(o -> o.getScope().equals(scope), values());
    }
 
}