多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
# 组件源码 /** * <b>方法描述:</b> 批量生成ID <br/> * <b>创建者:</b> admin <br/> * <b>创建时间:</b> 2020-07-09 14:51:08 <br/> * * @param i 入参|生成ID数量| {@link int} * @param id 出参|主键ID| {@link java.util.List} * @return 1 成功<br/> */ @Component(label = "批量生成ID", style = "处理型", type = "同步组件", comment = "批量生成ID", version = "1.0.0", deprecated = false, author = "admin", date = "2020-07-09 02:51:08") @InParams(param = { @Param(name = "i", comment = "生成ID数量", type = int.class) }) @OutParams(param = { @Param(name = "id", comment = "主键ID", type = java.util.List.class) }) @Returns(returns = { @Return(id = "1", desp = "成功") }) public static ResultBase A_generateIds(int i) { List<Long> idList = new ArrayList<>(); FgbpSnowflakeUtil snowflake = SnowflakeIdUtil.createSnowflake(1, 1); for (int j = 0; j < i; j++) { idList.add(snowflake.nextId()); } return ResultBase.newSuccessResult(idList); } 交易中组件使用方式: ![](https://img.kancloud.cn/ce/0b/ce0b51aec090faa177583e309aed66e8_950x750.jpg) ## 参数说明及示例 生成ID数量:需要批量生成的ID数量,示例: `4` 主键ID:主键ID,示例: `__INNER__["result"]` > 批量生成ID