liu
10 小时以前 5d34bdd3c426bb2ca5f6627424ae67984f745603
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
package cn.iocoder.yudao.module.wxcp.enums.notice;
 
import cn.hutool.core.util.ArrayUtil;
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
import lombok.AllArgsConstructor;
import lombok.Getter;
 
import java.util.Arrays;
 
/**
 * 企业微信通知模板类型
 */
@Getter
@AllArgsConstructor
public enum WxCpNoticeTypeEnum implements ArrayValuable<Integer> {
 
    TEXT(1, "纯文本通知"),
    CARD(2, "图文卡片(填报/链接)"),
    FILE(3, "文件通知"),
    NEWS(4, "图文消息"),
    ;
 
    public static final Integer[] ARRAYS = Arrays.stream(values())
            .map(WxCpNoticeTypeEnum::getType).toArray(Integer[]::new);
 
    private final Integer type;
    private final String name;
 
    @Override
    public Integer[] array() {
        return ARRAYS;
    }
 
    public static WxCpNoticeTypeEnum valueOf(Integer type) {
        return ArrayUtil.firstMatch(o -> o.getType().equals(type), values());
    }
 
}