枚举类上层接口IntArrayValuable修改为通用ArrayValuable
| | |
| | | /iailab-module-ai/ |
| | | /*/*/target/ |
| | | /.idea/ |
| | | /derby.log |
| | |
| | | package com.iailab.framework.ip.core.enums; |
| | | |
| | | import com.iailab.framework.common.core.IntArrayValuable; |
| | | import com.iailab.framework.common.core.ArrayValuable; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Getter; |
| | | |
| | |
| | | */ |
| | | @AllArgsConstructor |
| | | @Getter |
| | | public enum AreaTypeEnum implements IntArrayValuable { |
| | | public enum AreaTypeEnum implements ArrayValuable { |
| | | |
| | | COUNTRY(1, "国家"), |
| | | PROVINCE(2, "省份"), |
| | |
| | | DISTRICT(4, "地区"), // 县、镇、区等 |
| | | ; |
| | | |
| | | public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(AreaTypeEnum::getType).toArray(); |
| | | public static final Integer[] ARRAYS = Arrays.stream(values()).map(AreaTypeEnum::getType).toArray(Integer[]::new); |
| | | |
| | | /** |
| | | * 类型 |
| | |
| | | private final String name; |
| | | |
| | | @Override |
| | | public int[] array() { |
| | | public Integer[] array() { |
| | | return ARRAYS; |
| | | } |
| | | } |
| | |
| | | package com.iailab.framework.common.enums; |
| | | |
| | | import cn.hutool.core.util.ObjUtil; |
| | | import com.iailab.framework.common.core.IntArrayValuable; |
| | | import com.iailab.framework.common.core.ArrayValuable; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Getter; |
| | | |
| | |
| | | */ |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum CommonStatusEnum implements IntArrayValuable { |
| | | public enum CommonStatusEnum implements ArrayValuable { |
| | | |
| | | ENABLE(0, "开启"), |
| | | DISABLE(1, "关闭"); |
| | | |
| | | public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(CommonStatusEnum::getStatus).toArray(); |
| | | public static final Integer[] ARRAYS = Arrays.stream(values()).map(CommonStatusEnum::getStatus).toArray(Integer[]::new); |
| | | |
| | | /** |
| | | * 状态值 |
| | |
| | | private final String name; |
| | | |
| | | @Override |
| | | public int[] array() { |
| | | public Integer[] array() { |
| | | return ARRAYS; |
| | | } |
| | | |
| | |
| | | package com.iailab.framework.common.enums; |
| | | |
| | | import cn.hutool.core.util.ArrayUtil; |
| | | import com.iailab.framework.common.core.IntArrayValuable; |
| | | import com.iailab.framework.common.core.ArrayValuable; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Getter; |
| | | |
| | |
| | | */ |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum DateIntervalEnum implements IntArrayValuable { |
| | | public enum DateIntervalEnum implements ArrayValuable { |
| | | |
| | | DAY(1, "天"), |
| | | WEEK(2, "周"), |
| | |
| | | YEAR(5, "年") |
| | | ; |
| | | |
| | | public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(DateIntervalEnum::getInterval).toArray(); |
| | | public static final Integer[] ARRAYS = Arrays.stream(values()).map(DateIntervalEnum::getInterval).toArray(Integer[]::new); |
| | | |
| | | /** |
| | | * 类型 |
| | |
| | | private final String name; |
| | | |
| | | @Override |
| | | public int[] array() { |
| | | public Integer[] array() { |
| | | return ARRAYS; |
| | | } |
| | | |
| | |
| | | package com.iailab.framework.common.enums; |
| | | |
| | | import com.iailab.framework.common.core.IntArrayValuable; |
| | | import com.iailab.framework.common.core.ArrayValuable; |
| | | import lombok.Getter; |
| | | import lombok.RequiredArgsConstructor; |
| | | |
| | |
| | | */ |
| | | @RequiredArgsConstructor |
| | | @Getter |
| | | public enum TerminalEnum implements IntArrayValuable { |
| | | public enum TerminalEnum implements ArrayValuable { |
| | | |
| | | UNKNOWN(0, "未知"), // 目的:在无法解析到 terminal 时,使用它 |
| | | WECHAT_MINI_PROGRAM(10, "微信小程序"), |
| | |
| | | APP(31, "手机 App"), |
| | | ; |
| | | |
| | | public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(TerminalEnum::getTerminal).toArray(); |
| | | public static final Integer[] ARRAYS = Arrays.stream(values()).map(TerminalEnum::getTerminal).toArray(Integer[]::new); |
| | | |
| | | /** |
| | | * 终端 |
| | |
| | | private final String name; |
| | | |
| | | @Override |
| | | public int[] array() { |
| | | public Integer[] array() { |
| | | return ARRAYS; |
| | | } |
| | | } |
| | |
| | | package com.iailab.framework.common.enums; |
| | | |
| | | import cn.hutool.core.util.ArrayUtil; |
| | | import com.iailab.framework.common.core.IntArrayValuable; |
| | | import com.iailab.framework.common.core.ArrayValuable; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Getter; |
| | | |
| | |
| | | */ |
| | | @AllArgsConstructor |
| | | @Getter |
| | | public enum UserTypeEnum implements IntArrayValuable { |
| | | public enum UserTypeEnum implements ArrayValuable { |
| | | |
| | | MEMBER(1, "会员"), // 面向 c 端,普通用户 |
| | | ADMIN(2, "管理员"); // 面向 b 端,管理后台 |
| | | |
| | | public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(UserTypeEnum::getValue).toArray(); |
| | | public static final Integer[] ARRAYS = Arrays.stream(values()).map(UserTypeEnum::getValue).toArray(Integer[]::new); |
| | | |
| | | /** |
| | | * 类型 |
| | |
| | | } |
| | | |
| | | @Override |
| | | public int[] array() { |
| | | public Integer[] array() { |
| | | return ARRAYS; |
| | | } |
| | | } |
| | |
| | | package com.iailab.framework.common.validation; |
| | | |
| | | import com.iailab.framework.common.core.IntArrayValuable; |
| | | import com.iailab.framework.common.core.ArrayValuable; |
| | | |
| | | import javax.validation.Constraint; |
| | | import javax.validation.Payload; |
| | |
| | | /** |
| | | * @return 实现 EnumValuable 接口的 |
| | | */ |
| | | Class<? extends IntArrayValuable> value(); |
| | | Class<? extends ArrayValuable> value(); |
| | | |
| | | String message() default "必须在指定范围 {value}"; |
| | | |
| | |
| | | package com.iailab.framework.common.validation; |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import com.iailab.framework.common.core.IntArrayValuable; |
| | | import com.iailab.framework.common.core.ArrayValuable; |
| | | |
| | | import javax.validation.ConstraintValidator; |
| | | import javax.validation.ConstraintValidatorContext; |
| | |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | public class InEnumCollectionValidator implements ConstraintValidator<InEnum, Collection<Integer>> { |
| | | |
| | | private List<Integer> values; |
| | | public class InEnumCollectionValidator implements ConstraintValidator<InEnum, Collection<?>> { |
| | | |
| | | private List<?> values; |
| | | |
| | | @Override |
| | | public void initialize(InEnum annotation) { |
| | | IntArrayValuable[] values = annotation.value().getEnumConstants(); |
| | | ArrayValuable<?>[] values = annotation.value().getEnumConstants(); |
| | | if (values.length == 0) { |
| | | this.values = Collections.emptyList(); |
| | | } else { |
| | | this.values = Arrays.stream(values[0].array()).boxed().collect(Collectors.toList()); |
| | | this.values = Arrays.asList(values[0].array()); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public boolean isValid(Collection<Integer> list, ConstraintValidatorContext context) { |
| | | public boolean isValid(Collection<?> list, ConstraintValidatorContext context) { |
| | | if (list == null) { |
| | | return true; |
| | | } |
| | | // 校验通过 |
| | | if (CollUtil.containsAll(values, list)) { |
| | | return true; |
| | | } |
| | | // 校验不通过,自定义提示语句(因为,注解上的 value 是枚举类,无法获得枚举类的实际值) |
| | | // 校验不通过,自定义提示语句 |
| | | context.disableDefaultConstraintViolation(); // 禁用默认的 message 的值 |
| | | context.buildConstraintViolationWithTemplate(context.getDefaultConstraintMessageTemplate() |
| | | .replaceAll("\\{value}", CollUtil.join(list, ","))).addConstraintViolation(); // 重新添加错误提示语句 |
| | |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | package com.iailab.framework.common.validation; |
| | | |
| | | import com.iailab.framework.common.core.IntArrayValuable; |
| | | import com.iailab.framework.common.core.ArrayValuable; |
| | | |
| | | import javax.validation.ConstraintValidator; |
| | | import javax.validation.ConstraintValidatorContext; |
| | | import java.util.Arrays; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | public class InEnumValidator implements ConstraintValidator<InEnum, Integer> { |
| | | public class InEnumValidator implements ConstraintValidator<InEnum, Object> { |
| | | |
| | | private List<Integer> values; |
| | | private List<?> values; |
| | | |
| | | @Override |
| | | public void initialize(InEnum annotation) { |
| | | IntArrayValuable[] values = annotation.value().getEnumConstants(); |
| | | ArrayValuable<?>[] values = annotation.value().getEnumConstants(); |
| | | if (values.length == 0) { |
| | | this.values = Collections.emptyList(); |
| | | } else { |
| | | this.values = Arrays.stream(values[0].array()).boxed().collect(Collectors.toList()); |
| | | this.values = Arrays.asList(values[0].array()); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public boolean isValid(Integer value, ConstraintValidatorContext context) { |
| | | public boolean isValid(Object value, ConstraintValidatorContext context) { |
| | | // 为空时,默认不校验,即认为通过 |
| | | if (value == null) { |
| | | return true; |
| | |
| | | if (values.contains(value)) { |
| | | return true; |
| | | } |
| | | // 校验不通过,自定义提示语句(因为,注解上的 value 是枚举类,无法获得枚举类的实际值) |
| | | // 校验不通过,自定义提示语句 |
| | | context.disableDefaultConstraintViolation(); // 禁用默认的 message 的值 |
| | | context.buildConstraintViolationWithTemplate(context.getDefaultConstraintMessageTemplate() |
| | | .replaceAll("\\{value}", values.toString())).addConstraintViolation(); // 重新添加错误提示语句 |
| | |
| | | |
| | | } |
| | | |
| | | |
对比新文件 |
| | |
| | | # Default ignored files |
| | | /shelf/ |
| | | /workspace.xml |
| | | # Editor-based HTTP Client requests |
| | | /httpRequests/ |
| | | # Datasource local storage ignored files |
| | | /dataSources/ |
| | | /dataSources.local.xml |
对比新文件 |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <project version="4"> |
| | | <component name="SonarLintProjectSettings"> |
| | | <option name="moduleMapping"> |
| | | <map> |
| | | <entry key="iailab-module-ai-biz" value="yudao-module-ai-biz" /> |
| | | <entry key="iailab-spring-boot-starter-ai" value="yudao-spring-boot-starter-ai" /> |
| | | </map> |
| | | </option> |
| | | </component> |
| | | </project> |
对比新文件 |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <project version="4"> |
| | | <component name="VcsDirectoryMappings"> |
| | | <mapping directory="$PROJECT_DIR$/.." vcs="Git" /> |
| | | </component> |
| | | </project> |
| | |
| | | package com.iailab.module.ai.api.chat; |
| | | |
| | | import com.iailab.framework.common.pojo.CommonResult; |
| | | import com.iailab.module.ai.enums.ApiConstants; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | |
| | | // ========== AI 模型模板 ========== |
| | | ErrorCode QUESTION_TEMPLATE_NOT_EXISTS = new ErrorCode(1_040_012_001, "大模型问题模板不存在"); |
| | | ErrorCode QUESTION_PARAM_SETTING_NOT_EXISTS = new ErrorCode(1_040_012_002, "大模型问题设置参数不存在"); |
| | | ErrorCode SCHEDULE_SUGGEST_NOT_EXISTS = new ErrorCode(1_040_012_003, "大模型调度建议不存在"); |
| | | |
| | | } |
| | |
| | | public PageResult<AiChatMessageDO> getChatMessagePage(AiChatMessagePageReqVO pageReqVO) { |
| | | return chatMessageMapper.selectPage(pageReqVO); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.iailab.module.bpm.enums.definition; |
| | | |
| | | import com.iailab.framework.common.core.IntArrayValuable; |
| | | import com.iailab.framework.common.core.ArrayValuable; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Getter; |
| | | |
| | |
| | | */ |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum BpmModelFormTypeEnum implements IntArrayValuable { |
| | | public enum BpmModelFormTypeEnum implements ArrayValuable { |
| | | |
| | | NORMAL(10, "流程表单"), // 对应 BpmFormDO |
| | | CUSTOM(20, "业务表单") // 业务自己定义的表单,自己进行数据的存储 |
| | | ; |
| | | |
| | | public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmModelFormTypeEnum::getType).toArray(); |
| | | public static final Integer[] ARRAYS = Arrays.stream(values()).map(BpmModelFormTypeEnum::getType).toArray(Integer[]::new); |
| | | |
| | | private final Integer type; |
| | | private final String name; |
| | | |
| | | @Override |
| | | public int[] array() { |
| | | public Integer[] array() { |
| | | return ARRAYS; |
| | | } |
| | | |
| | |
| | | package com.iailab.module.bpm.enums.definition; |
| | | |
| | | import com.iailab.framework.common.core.IntArrayValuable; |
| | | import com.iailab.framework.common.core.ArrayValuable; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Getter; |
| | | |
| | |
| | | */ |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum BpmModelTypeEnum implements IntArrayValuable { |
| | | public enum BpmModelTypeEnum implements ArrayValuable { |
| | | |
| | | BPMN(10, "BPMN 设计器"), // https://bpmn.io/toolkit/bpmn-js/ |
| | | SIMPLE(20, "SIMPLE 设计器"); // 参考钉钉、飞书工作流的设计器 |
| | | |
| | | public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmModelTypeEnum::getType).toArray(); |
| | | public static final Integer[] ARRAYS = Arrays.stream(values()).map(BpmModelTypeEnum::getType).toArray(Integer[]::new); |
| | | |
| | | private final Integer type; |
| | | private final String name; |
| | | |
| | | @Override |
| | | public int[] array() { |
| | | public Integer[] array() { |
| | | return ARRAYS; |
| | | } |
| | | |
| | |
| | | package com.iailab.module.bpm.enums.definition; |
| | | |
| | | import cn.hutool.core.util.ArrayUtil; |
| | | import com.iailab.framework.common.core.IntArrayValuable; |
| | | import com.iailab.framework.common.core.ArrayValuable; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Getter; |
| | | |
| | |
| | | */ |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum BpmSimpleModeConditionType implements IntArrayValuable { |
| | | public enum BpmSimpleModeConditionType implements ArrayValuable { |
| | | |
| | | EXPRESSION(1, "条件表达式"), |
| | | RULE(2, "条件规则"); |
| | | |
| | | public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmSimpleModeConditionType::getType).toArray(); |
| | | public static final Integer[] ARRAYS = Arrays.stream(values()).map(BpmSimpleModeConditionType::getType).toArray(Integer[]::new); |
| | | |
| | | private final Integer type; |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public int[] array() { |
| | | public Integer[] array() { |
| | | return ARRAYS; |
| | | } |
| | | } |
| | |
| | | package com.iailab.module.bpm.enums.definition; |
| | | |
| | | import cn.hutool.core.util.ArrayUtil; |
| | | import com.iailab.framework.common.core.IntArrayValuable; |
| | | import com.iailab.framework.common.core.ArrayValuable; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Getter; |
| | | |
| | |
| | | */ |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum BpmSimpleModelNodeType implements IntArrayValuable { |
| | | public enum BpmSimpleModelNodeType implements ArrayValuable { |
| | | |
| | | // 0 ~ 1 开始和结束 |
| | | START_NODE(0, "开始", "startEvent"), |
| | |
| | | INCLUSIVE_BRANCH_NODE(53, "包容分支", "inclusiveGateway"), |
| | | ; |
| | | |
| | | public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmSimpleModelNodeType::getType).toArray(); |
| | | public static final Integer[] ARRAYS = Arrays.stream(values()).map(BpmSimpleModelNodeType::getType).toArray(Integer[]::new); |
| | | |
| | | private final Integer type; |
| | | private final String name; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public int[] array() { |
| | | public Integer[] array() { |
| | | return ARRAYS; |
| | | } |
| | | |
| | |
| | | package com.iailab.module.bpm.enums.definition; |
| | | |
| | | import cn.hutool.core.util.ArrayUtil; |
| | | import com.iailab.framework.common.core.IntArrayValuable; |
| | | import com.iailab.framework.common.core.ArrayValuable; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Getter; |
| | | |
| | |
| | | */ |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum BpmUserTaskApproveMethodEnum implements IntArrayValuable { |
| | | public enum BpmUserTaskApproveMethodEnum implements ArrayValuable { |
| | | |
| | | RANDOM(1, "随机挑选一人审批", null), |
| | | RATIO(2, "多人会签(按通过比例)", "${ nrOfCompletedInstances/nrOfInstances >= %s}"), // 会签(按通过比例) |
| | |
| | | */ |
| | | private final String completionCondition; |
| | | |
| | | public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmUserTaskApproveMethodEnum::getMethod).toArray(); |
| | | public static final Integer[] ARRAYS = Arrays.stream(values()).map(BpmUserTaskApproveMethodEnum::getMethod).toArray(Integer[]::new); |
| | | |
| | | public static BpmUserTaskApproveMethodEnum valueOf(Integer method) { |
| | | return ArrayUtil.firstMatch(item -> item.getMethod().equals(method), values()); |
| | | } |
| | | |
| | | @Override |
| | | public int[] array() { |
| | | public Integer[] array() { |
| | | return ARRAYS; |
| | | } |
| | | } |
| | |
| | | package com.iailab.module.bpm.enums.definition; |
| | | |
| | | import com.iailab.framework.common.core.IntArrayValuable; |
| | | import com.iailab.framework.common.core.ArrayValuable; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Getter; |
| | | |
| | |
| | | */ |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum BpmUserTaskApproveTypeEnum implements IntArrayValuable { |
| | | public enum BpmUserTaskApproveTypeEnum implements ArrayValuable { |
| | | |
| | | USER(1), // 人工审批 |
| | | AUTO_APPROVE(2), // 自动通过 |
| | | AUTO_REJECT(3); // 自动拒绝 |
| | | |
| | | public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmUserTaskApproveTypeEnum::getType).toArray(); |
| | | public static final Integer[] ARRAYS = Arrays.stream(values()).map(BpmUserTaskApproveTypeEnum::getType).toArray(Integer[]::new); |
| | | |
| | | private final Integer type; |
| | | |
| | | @Override |
| | | public int[] array() { |
| | | public Integer[] array() { |
| | | return ARRAYS; |
| | | } |
| | | |
| | |
| | | package com.iailab.module.bpm.enums.definition; |
| | | |
| | | import com.iailab.framework.common.core.IntArrayValuable; |
| | | import com.iailab.framework.common.core.ArrayValuable; |
| | | import lombok.Getter; |
| | | import lombok.RequiredArgsConstructor; |
| | | |
| | |
| | | */ |
| | | @RequiredArgsConstructor |
| | | @Getter |
| | | public enum BpmUserTaskAssignEmptyHandlerTypeEnum implements IntArrayValuable { |
| | | public enum BpmUserTaskAssignEmptyHandlerTypeEnum implements ArrayValuable { |
| | | |
| | | APPROVE(1), // 自动通过 |
| | | REJECT(2), // 自动拒绝 |
| | |
| | | ASSIGN_ADMIN(4), // 转交给流程管理员 |
| | | ; |
| | | |
| | | public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmUserTaskAssignEmptyHandlerTypeEnum::getType).toArray(); |
| | | public static final Integer[] ARRAYS = Arrays.stream(values()).map(BpmUserTaskAssignEmptyHandlerTypeEnum::getType).toArray(Integer[]::new); |
| | | |
| | | private final Integer type; |
| | | |
| | | @Override |
| | | public int[] array() { |
| | | public Integer[] array() { |
| | | return ARRAYS; |
| | | } |
| | | |
| | |
| | | package com.iailab.module.bpm.enums.definition; |
| | | |
| | | import com.iailab.framework.common.core.IntArrayValuable; |
| | | import com.iailab.framework.common.core.ArrayValuable; |
| | | import lombok.Getter; |
| | | import lombok.RequiredArgsConstructor; |
| | | |
| | |
| | | */ |
| | | @RequiredArgsConstructor |
| | | @Getter |
| | | public enum BpmUserTaskAssignStartUserHandlerTypeEnum implements IntArrayValuable { |
| | | public enum BpmUserTaskAssignStartUserHandlerTypeEnum implements ArrayValuable { |
| | | |
| | | START_USER_AUDIT(1), // 由发起人对自己审批 |
| | | SKIP(2), // 自动跳过【参考飞书】:1)如果当前节点还有其他审批人,则交由其他审批人进行审批;2)如果当前节点没有其他审批人,则该节点自动通过 |
| | | TRANSFER_DEPT_LEADER(3); // 转交给部门负责人审批【参考飞书】:若部门负责人为空,则自动通过 |
| | | |
| | | public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmUserTaskAssignStartUserHandlerTypeEnum::getType).toArray(); |
| | | public static final Integer[] ARRAYS = Arrays.stream(values()).map(BpmUserTaskAssignStartUserHandlerTypeEnum::getType).toArray(Integer[]::new); |
| | | |
| | | private final Integer type; |
| | | |
| | | @Override |
| | | public int[] array() { |
| | | public Integer[] array() { |
| | | return ARRAYS; |
| | | } |
| | | |
| | |
| | | package com.iailab.module.bpm.enums.definition; |
| | | |
| | | import cn.hutool.core.util.ArrayUtil; |
| | | import com.iailab.framework.common.core.IntArrayValuable; |
| | | import com.iailab.framework.common.core.ArrayValuable; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Getter; |
| | | |
| | |
| | | */ |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum BpmUserTaskRejectHandlerType implements IntArrayValuable { |
| | | public enum BpmUserTaskRejectHandlerType implements ArrayValuable { |
| | | |
| | | FINISH_PROCESS_INSTANCE(1, "终止流程"), |
| | | RETURN_USER_TASK(2, "驳回到指定任务节点"); |
| | |
| | | private final Integer type; |
| | | private final String name; |
| | | |
| | | public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmUserTaskRejectHandlerType::getType).toArray(); |
| | | public static final Integer[] ARRAYS = Arrays.stream(values()).map(BpmUserTaskRejectHandlerType::getType).toArray(Integer[]::new); |
| | | |
| | | public static BpmUserTaskRejectHandlerType typeOf(Integer type) { |
| | | return ArrayUtil.firstMatch(item -> item.getType().equals(type), values()); |
| | | } |
| | | |
| | | @Override |
| | | public int[] array() { |
| | | public Integer[] array() { |
| | | return ARRAYS; |
| | | } |
| | | } |
| | |
| | | package com.iailab.module.bpm.enums.definition; |
| | | |
| | | import com.iailab.framework.common.core.IntArrayValuable; |
| | | import com.iailab.framework.common.core.ArrayValuable; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Getter; |
| | | |
| | |
| | | */ |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum BpmUserTaskTimeoutHandlerTypeEnum implements IntArrayValuable { |
| | | public enum BpmUserTaskTimeoutHandlerTypeEnum implements ArrayValuable { |
| | | |
| | | REMINDER(1,"自动提醒"), |
| | | APPROVE(2, "自动同意"), |
| | |
| | | private final Integer type; |
| | | private final String name; |
| | | |
| | | public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmUserTaskTimeoutHandlerTypeEnum::getType).toArray(); |
| | | public static final Integer[] ARRAYS = Arrays.stream(values()).map(BpmUserTaskTimeoutHandlerTypeEnum::getType).toArray(Integer[]::new); |
| | | |
| | | @Override |
| | | public int[] array() { |
| | | public Integer[] array() { |
| | | return ARRAYS; |
| | | } |
| | | |
| | |
| | | package com.iailab.module.bpm.enums.task; |
| | | |
| | | import com.iailab.framework.common.core.IntArrayValuable; |
| | | import com.iailab.framework.common.core.ArrayValuable; |
| | | import com.iailab.framework.common.util.object.ObjectUtils; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Getter; |
| | |
| | | */ |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum BpmProcessInstanceStatusEnum implements IntArrayValuable { |
| | | public enum BpmProcessInstanceStatusEnum implements ArrayValuable { |
| | | |
| | | NOT_START(-1, "未开始"), |
| | | RUNNING(1, "审批中"), |
| | |
| | | REJECT(3, "审批不通过"), |
| | | CANCEL(4, "已取消"); |
| | | |
| | | public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmProcessInstanceStatusEnum::getStatus).toArray(); |
| | | public static final Integer[] ARRAYS = Arrays.stream(values()).map(BpmProcessInstanceStatusEnum::getStatus).toArray(Integer[]::new); |
| | | |
| | | /** |
| | | * 状态 |
| | |
| | | private final String desc; |
| | | |
| | | @Override |
| | | public int[] array() { |
| | | public Integer[] array() { |
| | | return ARRAYS; |
| | | } |
| | | |
| | |
| | | package com.iailab.module.bpm.framework.flowable.core.enums; |
| | | |
| | | import cn.hutool.core.util.ArrayUtil; |
| | | import com.iailab.framework.common.core.IntArrayValuable; |
| | | import com.iailab.framework.common.core.ArrayValuable; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Getter; |
| | | |
| | |
| | | */ |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum BpmTaskCandidateStrategyEnum implements IntArrayValuable { |
| | | public enum BpmTaskCandidateStrategyEnum implements ArrayValuable { |
| | | |
| | | ROLE(10, "角色"), |
| | | DEPT_MEMBER(20, "部门的成员"), // 包括负责人 |
| | |
| | | ASSIGN_EMPTY(1, "审批人为空"), |
| | | ; |
| | | |
| | | public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmTaskCandidateStrategyEnum::getStrategy).toArray(); |
| | | public static final Integer[] ARRAYS = Arrays.stream(values()).map(BpmTaskCandidateStrategyEnum::getStrategy).toArray(Integer[]::new); |
| | | |
| | | /** |
| | | * 类型 |
| | |
| | | } |
| | | |
| | | @Override |
| | | public int[] array() { |
| | | public Integer[] array() { |
| | | return ARRAYS; |
| | | } |
| | | |
| | |
| | | package com.iailab.module.system.enums.permission; |
| | | |
| | | import com.iailab.framework.common.core.IntArrayValuable; |
| | | import com.iailab.framework.common.core.ArrayValuable; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Getter; |
| | | |
| | |
| | | */ |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum DataScopeEnum implements IntArrayValuable { |
| | | public enum DataScopeEnum implements ArrayValuable { |
| | | |
| | | ALL(1), // 全部数据权限 |
| | | |
| | |
| | | */ |
| | | private final Integer scope; |
| | | |
| | | public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(DataScopeEnum::getScope).toArray(); |
| | | public static final Integer[] ARRAYS = Arrays.stream(values()).map(DataScopeEnum::getScope).toArray(Integer[]::new); |
| | | |
| | | @Override |
| | | public int[] array() { |
| | | public Integer[] array() { |
| | | return ARRAYS; |
| | | } |
| | | |
| | |
| | | package com.iailab.module.system.enums.sms; |
| | | |
| | | import cn.hutool.core.util.ArrayUtil; |
| | | import com.iailab.framework.common.core.IntArrayValuable; |
| | | import com.iailab.framework.common.core.ArrayValuable; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Getter; |
| | | |
| | |
| | | */ |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum SmsSceneEnum implements IntArrayValuable { |
| | | public enum SmsSceneEnum implements ArrayValuable { |
| | | |
| | | MEMBER_LOGIN(1, "user-sms-login", "会员用户 - 手机号登陆"), |
| | | MEMBER_UPDATE_MOBILE(2, "user-update-mobile", "会员用户 - 修改手机"), |
| | |
| | | |
| | | ADMIN_MEMBER_LOGIN(21, "admin-sms-login", "后台用户 - 手机号登录"); |
| | | |
| | | public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(SmsSceneEnum::getScene).toArray(); |
| | | public static final Integer[] ARRAYS = Arrays.stream(values()).map(SmsSceneEnum::getScene).toArray(Integer[]::new); |
| | | |
| | | /** |
| | | * 验证场景的编号 |
| | |
| | | private final String description; |
| | | |
| | | @Override |
| | | public int[] array() { |
| | | public Integer[] array() { |
| | | return ARRAYS; |
| | | } |
| | | |
| | |
| | | package com.iailab.module.system.enums.social; |
| | | |
| | | import cn.hutool.core.util.ArrayUtil; |
| | | import com.iailab.framework.common.core.IntArrayValuable; |
| | | import com.iailab.framework.common.core.ArrayValuable; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Getter; |
| | | |
| | |
| | | */ |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum SocialTypeEnum implements IntArrayValuable { |
| | | public enum SocialTypeEnum implements ArrayValuable { |
| | | |
| | | /** |
| | | * Gitee |
| | |
| | | */ |
| | | WECHAT_MINI_APP(34, "WECHAT_MINI_APP"), |
| | | ; |
| | | |
| | | public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(SocialTypeEnum::getType).toArray(); |
| | | public static final Integer[] ARRAYS = Arrays.stream(values()).map(SocialTypeEnum::getType).toArray(Integer[]::new); |
| | | |
| | | /** |
| | | * 类型 |
| | |
| | | private final String source; |
| | | |
| | | @Override |
| | | public int[] array() { |
| | | public Integer[] array() { |
| | | return ARRAYS; |
| | | } |
| | | |
| | |
| | | <artifactId>iailab-common-monitor</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- <!– 三方云服务相关 –>--> |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>com.xingyuv</groupId>--> |
| | | <!-- <artifactId>spring-boot-starter-justauth</artifactId> <!– 社交登陆(例如说,个人微信、企业微信等等) –>--> |
| | | <!-- </dependency>--> |
| | | |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>com.aliyun</groupId>--> |
| | | <!-- <artifactId>aliyun-java-sdk-core</artifactId> <!– 短信(阿里云) –>--> |
| | | <!-- </dependency>--> |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>com.aliyun</groupId>--> |
| | | <!-- <artifactId>aliyun-java-sdk-dysmsapi</artifactId> <!– 短信(阿里云) –>--> |
| | | <!-- </dependency>--> |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>com.tencentcloudapi</groupId>--> |
| | | <!-- <artifactId>tencentcloud-sdk-java-sms</artifactId> <!– 短信(腾讯云) –>--> |
| | | <!-- </dependency>--> |
| | | |
| | | <dependency> |
| | | <groupId>com.xingyuv</groupId> |
| | | <artifactId>spring-boot-starter-captcha-plus</artifactId> <!-- 验证码,一般用于登录使用 --> |
| | |
| | | <!-- 设置构建的 jar 包名 --> |
| | | <finalName>${project.artifactId}</finalName> |
| | | <plugins> |
| | | <!-- <plugin>--> |
| | | <!-- <groupId>com.github.wvengen</groupId>--> |
| | | <!-- <artifactId>proguard-maven-plugin</artifactId>--> |
| | | <!-- <version>2.7.0</version>--> |
| | | <!-- <executions>--> |
| | | <!-- <!– 以下配置说明执行mvn的package命令时候,会执行proguard–>--> |
| | | <!-- <execution>--> |
| | | <!-- <phase>package</phase>--> |
| | | <!-- <goals>--> |
| | | <!-- <goal>proguard</goal>--> |
| | | <!-- </goals>--> |
| | | <!-- </execution>--> |
| | | <!-- </executions>--> |
| | | <!-- <configuration>--> |
| | | <!-- <!– 就是输入Jar的名称,我们要知道,代码混淆其实是将一个原始的jar,生成一个混淆后的jar,那么就会有输入输出。 –>--> |
| | | <!-- <injar>${project.build.finalName}.jar</injar>--> |
| | | <!-- <!– 输出jar名称,输入输出jar同名的时候就是覆盖,也是比较常用的配置。 –>--> |
| | | <!-- <outjar>${project.build.finalName}.jar</outjar>--> |
| | | <!-- <!– 是否混淆 默认是true –>--> |
| | | <!-- <obfuscate>true</obfuscate>--> |
| | | <!-- <putLibraryJarsInTempDir>true</putLibraryJarsInTempDir>--> |
| | | <!-- <!– 配置一个文件,通常叫做proguard.cfg,该文件主要是配置options选项,也就是说使用proguard.cfg那么options下的所有内容都可以移到proguard.cfg中 –>--> |
| | | <!-- <proguardInclude>${project.basedir}/proguard.cfg</proguardInclude>--> |
| | | <!-- <!– 额外的jar包,通常是项目编译所需要的jar –>--> |
| | | <!-- <libs>--> |
| | | <!-- <lib>${java.home}/lib/rt.jar</lib>--> |
| | | <!-- <lib>${java.home}/lib/jce.jar</lib>--> |
| | | <!-- <lib>${java.home}/lib/jsse.jar</lib>--> |
| | | <!-- </libs>--> |
| | | <!-- <!– 对输入jar进行过滤比如,如下配置就是对META-INFO文件不处理。 –>--> |
| | | <!-- <inLibsFilter>!META-INF/**,!META-INF/versions/9/**.class</inLibsFilter>--> |
| | | <!-- <!– 这是输出路径配置,但是要注意这个路径必须要包括injar标签填写的jar –>--> |
| | | <!-- <outputDirectory>${project.basedir}/target</outputDirectory>--> |
| | | <!-- <!–这里特别重要,此处主要是配置混淆的一些细节选项,比如哪些类不需要混淆,哪些需要混淆–>--> |
| | | <!-- <options>--> |
| | | <!-- <!– 可以在此处写option标签配置,不过我上面使用了proguardInclude,故而我更喜欢在proguard.cfg中配置 –>--> |
| | | <!-- </options>--> |
| | | <!-- </configuration>--> |
| | | <!-- </plugin>--> |
| | | <!-- 步骤1:在prepare-package阶段加密YAML文件 --> |
| | | <plugin> |
| | | <groupId>org.apache.maven.plugins</groupId> |
| | | <artifactId>maven-antrun-plugin</artifactId> |
| | | <version>3.0.0</version> |
| | | <executions> |
| | | <execution> |
| | | <id>encrypt-yaml-files</id> |
| | | <phase>prepare-package</phase> |
| | | <goals> |
| | | <goal>run</goal> |
| | | </goals> |
| | | <configuration> |
| | | <target> |
| | | <!-- 对target/classes下的所有YAML文件进行Base64编码(实际使用应替换为加密算法) --> |
| | | <echo message="Encrypting YAML files..." /> |
| | | <apply executable="base64" dest="${project.build.outputDirectory}" verbose="true"> |
| | | <fileset dir="${project.build.outputDirectory}" includes="**/*.yml, **/*.yaml"/> |
| | | <mapper type="glob" from="*" to="*" /> |
| | | <srcfile/> |
| | | </apply> |
| | | <!-- 实际项目中应使用Java/Groovy脚本实现加密 --> |
| | | </target> |
| | | </configuration> |
| | | </execution> |
| | | </executions> |
| | | </plugin> |
| | | <!-- 步骤2:使用ProGuard混淆代码 --> |
| | | <plugin> |
| | | <groupId>com.github.wvengen</groupId> |
| | | <artifactId>proguard-maven-plugin</artifactId> |
| | | <version>2.7.0</version> |
| | | <executions> |
| | | <!-- 以下配置说明执行mvn的package命令时候,会执行proguard--> |
| | | <execution> |
| | | <phase>package</phase> |
| | | <goals> |
| | | <goal>proguard</goal> |
| | | </goals> |
| | | </execution> |
| | | </executions> |
| | | <configuration> |
| | | <!-- 就是输入Jar的名称,我们要知道,代码混淆其实是将一个原始的jar,生成一个混淆后的jar,那么就会有输入输出。 --> |
| | | <injar>${project.build.finalName}.jar</injar> |
| | | <!-- 输出jar名称,输入输出jar同名的时候就是覆盖,也是比较常用的配置。 --> |
| | | <outjar>${project.build.finalName}.jar</outjar> |
| | | <!-- 是否混淆 默认是true --> |
| | | <obfuscate>true</obfuscate> |
| | | <putLibraryJarsInTempDir>true</putLibraryJarsInTempDir> |
| | | <!-- 配置一个文件,通常叫做proguard.cfg,该文件主要是配置options选项,也就是说使用proguard.cfg那么options下的所有内容都可以移到proguard.cfg中 --> |
| | | <proguardInclude>${project.basedir}/proguard.cfg</proguardInclude> |
| | | <!-- 额外的jar包,通常是项目编译所需要的jar --> |
| | | <libs> |
| | | <lib>${java.home}/lib/rt.jar</lib> |
| | | <lib>${java.home}/lib/jce.jar</lib> |
| | | <lib>${java.home}/lib/jsse.jar</lib> |
| | | </libs> |
| | | <!-- 对输入jar进行过滤比如,如下配置就是对META-INFO文件不处理。 --> |
| | | <inLibsFilter>!META-INF/**,!META-INF/versions/9/**.class</inLibsFilter> |
| | | <!-- 这是输出路径配置,但是要注意这个路径必须要包括injar标签填写的jar --> |
| | | <outputDirectory>${project.basedir}/target</outputDirectory> |
| | | <!--这里特别重要,此处主要是配置混淆的一些细节选项,比如哪些类不需要混淆,哪些需要混淆--> |
| | | <options> |
| | | <!-- 可以在此处写option标签配置,不过我上面使用了proguardInclude,故而我更喜欢在proguard.cfg中配置 --> |
| | | </options> |
| | | </configuration> |
| | | </plugin> |
| | | <!-- 打包 --> |
| | | <plugin> |
| | | <groupId>org.springframework.boot</groupId> |
| | |
| | | </execution> |
| | | </executions> |
| | | </plugin> |
| | | |
| | | <plugin> |
| | | <groupId>org.apache.maven.plugins</groupId> |
| | | <artifactId>maven-compiler-plugin</artifactId> |
| | | <configuration> |
| | | <source>${java.version}</source> |
| | | <target>${java.version}</target> |
| | | </configuration> |
| | | </plugin> |
| | | </plugins> |
| | | </build> |
| | | |
| | |
| | | @Operation(summary = "获取菜单精简信息列表", description = "只包含被开启的菜单,用于【角色分配菜单】功能的选项。" + |
| | | "在多租户的场景下,会只返回租户所在套餐有的菜单") |
| | | public CommonResult<List<MenuSimpleRespVO>> getSimpleMenuList() { |
| | | List<MenuDO> list = menuService.getMenuListByTenant( |
| | | new MenuListReqVO().setStatus(CommonStatusEnum.ENABLE.getStatus())); |
| | | List<MenuDO> list = menuService.getMenuListByTenant(new MenuListReqVO()); |
| | | list.sort(Comparator.comparing(MenuDO::getSort)); |
| | | return success(BeanUtils.toBean(list, MenuSimpleRespVO.class)); |
| | | } |