# WalkRoomRequestNotifyConfigTypeEnum.java

    package cloud.wconnect.frontoffice.cons.walkroomrequest;

    import lombok.AllArgsConstructor;
    import lombok.Getter;

    import java.util.Arrays;
    import java.util.Optional;

    /**
     * Walk Room Request通知配置类型枚举类
     *
     * @author lichen
     * @date 2024/11/14
     */
    @Getter
    @AllArgsConstructor
    public enum WalkRoomRequestNotifyConfigTypeEnum {

        /**
         * 发送方待审批通知
         */
        SENDER_WAIT_FOR_APPROVING(1, "walk-room-request.notify.subject.waiting-for-approval-of-sender"),
        /**
         * 接收方待审批通知
         */
        RECEIVER_WAIT_FOR_APPROVING(2, "walk-room-request.notify.subject.waiting-for-approval-of-receiver"),
        /**
         * 发送方保存（新增或修改）时通知接收方
         */
        SAVE(3, "walk-room-request.notify.subject.save");

        /**
         * 通知类型
         */
        private int type;

        /**
         * 默认通知主题的国际化code
         */
        private String defaultSubjectI18nCode;

        /**
         * 根据类型获取默认主题的国际化code
         *
         * @param type 类型
         * @return java.lang.String
         * @author lichen
         * @date 2024/11/13
         */
        public static String getDefaultSubjectI18nCode(int type){
            Optional<WalkRoomRequestNotifyConfigTypeEnum> optional = Arrays.stream(WalkRoomRequestNotifyConfigTypeEnum.values()).filter(item -> item.getType() == type).findFirst();
            return optional.isEmpty() ? "" : optional.get().getDefaultSubjectI18nCode();
        }

    }