instruction
string
input
string
output
string
source_file
string
priority
int64
请完成以下Java代码
public String getType() { return type; } public void setType(String type) { this.type = type; } public String getUserId() { return userId; } public void setUserId(String userId) { this.userId = userId; } public String getGroupId() { return groupId; } public void setGroupId(S...
return operationType; } public void setOperationType(String operationType) { this.operationType = operationType; } public String getAssignerId() { return assignerId; } public void setAssignerId(String assignerId) { this.assignerId = assignerId; } public String getTenantId() { retur...
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\history\event\HistoricIdentityLinkLogEventEntity.java
1
请在Spring Boot框架中完成以下Java代码
public Result<Boolean> insert(@RequestBody User user) { // 参数验证 if (StringUtils.isEmpty(user.getName()) || StringUtils.isEmpty(user.getPassword())) { return ResultGenerator.genFailResult("缺少参数"); } return ResultGenerator.genSuccessResult(userDao.insertUser(user) > 0); } ...
user.setPassword(tempUser.getPassword()); return ResultGenerator.genSuccessResult(userDao.updUser(user) > 0); } // 删除一条记录 @RequestMapping(value = "/users/{id}", method = RequestMethod.DELETE) @ResponseBody public Result<Boolean> delete(@PathVariable("id") Integer id) { if (id == nul...
repos\spring-boot-projects-main\SpringBoot入门案例源码\spring-boot-RESTful-api\src\main\java\cn\lanqiao\springboot3\controller\ApiController.java
2
请完成以下Java代码
public List<String> getEmail() { if (email == null) { email = new ArrayList<String>(); } return this.email; } /** * Gets the value of the url property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore ...
* <pre> * getUrl().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link String } * * */ public List<String> getUrl() { if (url == null) { url = new ArrayList<String>(); } retu...
repos\metasfresh-new_dawn_uat\backend\vertical-healthcare_ch\forum_datenaustausch_ch.invoice_440_request\src\main\java-xjc\de\metas\vertical\healthcare_ch\forum_datenaustausch_ch\invoice_440\request\OnlineAddressType.java
1
请完成以下Java代码
public static JobDefinitionSuspensionStateConfiguration byJobDefinitionId(String jobDefinitionId, boolean includeJobs) { JobDefinitionSuspensionStateConfiguration configuration = new JobDefinitionSuspensionStateConfiguration(); configuration.by = JOB_HANDLER_CFG_JOB_DEFINITION_ID; configuration.jobDef...
} public static JobDefinitionSuspensionStateConfiguration ByProcessDefinitionKeyAndTenantId(String processDefinitionKey, String tenantId, boolean includeProcessInstances) { JobDefinitionSuspensionStateConfiguration configuration = byProcessDefinitionKey(processDefinitionKey, includeProcessInstances); ...
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\jobexecutor\TimerChangeJobDefinitionSuspensionStateJobHandler.java
1
请在Spring Boot框架中完成以下Java代码
public void run() { while (true) { String url = null; try { url = cacheService.takeQueueTask(); if (url != null) { FileAttribute fileAttribute = fileHandlerService.getFileAttribute(url, null); ...
} catch (Exception ex) { Thread.currentThread().interrupt(); logger.error("Failed to sleep after exception", ex); } logger.info("处理预览转换任务异常,url:{}", url, e); } } } public boolean isNeedCo...
repos\kkFileView-master\server\src\main\java\cn\keking\service\FileConvertQueueTask.java
2
请完成以下Java代码
public ColumnDefinitions getColumnDefinitions() { return delegate.getColumnDefinitions(); } @NonNull @Override public ExecutionInfo getExecutionInfo() { return delegate.getExecutionInfo(); } @Override public int remaining() { return delegate.remaining(); } ...
AsyncResultSet resultSet, List<Row> allRows, SettableFuture<List<Row>> resultFuture, Executor executor) { allRows.addAll(loadRows(resultSet)); if (resultSet.hasMorePages()) { ByteBuffer nextPagingState = r...
repos\thingsboard-master\common\dao-api\src\main\java\org\thingsboard\server\dao\nosql\TbResultSet.java
1
请完成以下Java代码
private byte[] loadArchiveData(@NonNull final I_AD_Archive archiveRecord) { byte[] data = archiveBL.getBinaryData(archiveRecord); if (data == null || data.length == 0) { logger.info("AD_Archive {} does not contain any data. Skip", archiveRecord); data = null; } return data; } @NonNull private Prin...
logger.debug("Found no AD_Printer_Matching record for AD_PrinterRouting_ID={}, AD_User_PrinterMatchingConfig_ID={} and hostKey={}; -> creating no PrintingSegment for routing", printerRouting, UserId.toRepoId(userToPrintId), hostKey); return null; } final I_AD_PrinterTray_Matching trayMatchingRecord = pri...
repos\metasfresh-new_dawn_uat\backend\de.metas.printing\de.metas.printing.base\src\main\java\de\metas\printing\printingdata\PrintingDataFactory.java
1
请完成以下Java代码
public class X_MD_Candidate_QtyDetails extends org.compiere.model.PO implements I_MD_Candidate_QtyDetails, org.compiere.model.I_Persistent { private static final long serialVersionUID = 1818023286L; /** Standard Constructor */ public X_MD_Candidate_QtyDetails (final Properties ctx, final int MD_Candidate_Qt...
@Override public int getMD_Candidate_QtyDetails_ID() { return get_ValueAsInt(COLUMNNAME_MD_Candidate_QtyDetails_ID); } @Override public void setQty (final BigDecimal Qty) { set_Value (COLUMNNAME_Qty, Qty); } @Override public BigDecimal getQty() { final BigDecimal bd = get_ValueAsBigDecimal(COLUMNNAM...
repos\metasfresh-new_dawn_uat\backend\de.metas.material\dispo-commons\src\main\java-gen\de\metas\material\dispo\model\X_MD_Candidate_QtyDetails.java
1
请完成以下Java代码
public static boolean isSameDayUsingInstant(Date date1, Date date2) { Instant instant1 = date1.toInstant() .truncatedTo(ChronoUnit.DAYS); Instant instant2 = date2.toInstant() .truncatedTo(ChronoUnit.DAYS); return instant1.equals(instant2); } public static boolean...
} public static boolean isSameDayUsingApacheCommons(Date date1, Date date2) { return DateUtils.isSameDay(date1, date2); } public static boolean isSameDayUsingJoda(Date date1, Date date2) { org.joda.time.LocalDate localDate1 = new org.joda.time.LocalDate(date1); org.joda.time.LocalD...
repos\tutorials-master\core-java-modules\core-java-date-operations-2\src\main\java\com\baeldung\date\comparison\DateComparisonUtils.java
1
请完成以下Java代码
public class ErrorEndEventActivityBehavior extends AbstractBpmnActivityBehavior { protected String errorCode; private ParameterValueProvider errorMessageExpression; public ErrorEndEventActivityBehavior(String errorCode, ParameterValueProvider errorMessage) { this.errorCode = errorCode; this.errorMessage...
public String getErrorCode() { return errorCode; } public void setErrorCode(String errorCode) { this.errorCode = errorCode; } public ParameterValueProvider getErrorMessageExpression() { return errorMessageExpression; } public void setErrorMessageExpression(ParameterValueProvider errorMessage) ...
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\bpmn\behavior\ErrorEndEventActivityBehavior.java
1
请在Spring Boot框架中完成以下Java代码
public Collection<String> getCaseDefinitionKeys() { return caseDefinitionKeys; } public boolean isExcludeSubtasks() { return excludeSubtasks; } public boolean isWithLocalizationFallback() { return withLocalizationFallback; } @Override public List<Task> list() { ...
public List<List<String>> getSafeCandidateGroups() { return safeCandidateGroups; } public void setSafeCandidateGroups(List<List<String>> safeCandidateGroups) { this.safeCandidateGroups = safeCandidateGroups; } public List<List<String>> getSafeInvolvedGroups() { return safeInvol...
repos\flowable-engine-main\modules\flowable-task-service\src\main\java\org\flowable\task\service\impl\TaskQueryImpl.java
2
请完成以下Java代码
public Optional<CurrencyCode> getStatementCurrencyCode() { return Optional.ofNullable(accountStatement2.getAcct().getCcy()) .map(CurrencyCode::ofThreeLetterCode); } @Override @NonNull public String getId() { return accountStatement2.getId(); } @Override @NonNull public ImmutableList<IStatementLineWr...
.stream() .filter(AccountStatement2Wrapper::isOPBDCashBalance) .findFirst(); } @NonNull private Optional<CashBalance3> findPRCDCashBalance() { return accountStatement2.getBal() .stream() .filter(AccountStatement2Wrapper::isPRCDCashBalance) .findFirst(); } private static boolean isPRCDCashB...
repos\metasfresh-new_dawn_uat\backend\de.metas.banking\de.metas.banking.camt53\src\main\java\de\metas\banking\camt53\wrapper\v02\AccountStatement2Wrapper.java
1
请完成以下Java代码
public class StudentMap { private List<StudentEntry> entries = new ArrayList<StudentEntry>(); @XmlElement(nillable = false, name = "entry") public List<StudentEntry> getEntries() { return entries; } @XmlType(name = "StudentEntry") public static class StudentEntry { private Inte...
} public Integer getId() { return id; } public void setStudent(Student student) { this.student = student; } public Student getStudent() { return student; } } }
repos\tutorials-master\apache-cxf-modules\cxf-introduction\src\main\java\com\baeldung\cxf\introduction\StudentMap.java
1
请完成以下Spring Boot application配置
server: port: 8888 spring: application: name: gateway-application cloud: # Spring Cloud Gateway 配置项,对应 GatewayProperties 类 gateway: # 路由配置项,对应 RouteDefinition 数组 routes: - id: yudaoyuanma # 路由的编号 uri: http://www.iocoder.cn # 路由到的目标地址 predicates: # 断言,作为路由的匹配条件...
8 # 过滤器顺序,默认为 -2147483648 最高优先级 fallback: mode: # fallback 模式,目前有三种:response、redirect、空 # 专属 response 模式 response-status: 429 # 响应状态码,默认为 429 response-body: 你被 block 了... # 响应内容,默认为空 content-type: application/json # 内容类型,默认为 application/json # 专属 redir...
repos\SpringBoot-Labs-master\labx-08-spring-cloud-gateway\labx-08-sc-gateway-demo07-sentinel\src\main\resources\application.yaml
2
请完成以下Java代码
public void setWeight (final @Nullable BigDecimal Weight) { set_Value (COLUMNNAME_Weight, Weight); } @Override public BigDecimal getWeight() { final BigDecimal bd = get_ValueAsBigDecimal(COLUMNNAME_Weight); return bd != null ? bd : BigDecimal.ZERO; } @Override public void setWeightUOM (final @Nullable ...
@Override public void setWidthInCm (final int WidthInCm) { set_Value (COLUMNNAME_WidthInCm, WidthInCm); } @Override public int getWidthInCm() { return get_ValueAsInt(COLUMNNAME_WidthInCm); } @Override public void setX12DE355 (final @Nullable java.lang.String X12DE355) { set_Value (COLUMNNAME_X12DE355...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_I_Product.java
1
请完成以下Java代码
public int getC_UOM_ID() { return invoiceLine.getC_UOM_ID(); } @Override public void setC_UOM_ID(final int uomId) { invoiceLine.setC_UOM_ID(uomId); } @Override public void setQty(@NonNull final BigDecimal qtyInHUsUOM) { invoiceLine.setQtyEntered(qtyInHUsUOM); final ProductId productId = ProductId.of...
} @Override public void setM_HU_PI_Item_Product_ID(final int huPiItemProductId) { invoiceLine.setM_HU_PI_Item_Product_ID(huPiItemProductId); } @Override public BigDecimal getQtyTU() { return invoiceLine.getQtyEnteredTU(); } @Override public void setQtyTU(final BigDecimal qtyPacks) { invoiceLine.setQ...
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\adempiere\gui\search\impl\InvoiceLineHUPackingAware.java
1
请在Spring Boot框架中完成以下Java代码
public DeveloperRestApiProperties getDevRestApi() { return developerRestApiProperties; } public int getPort() { return this.port; } public void setPort(int port) { this.port = port; } public boolean isSslRequireAuthentication() { return this.sslRequireAuthentication; } public void setSsl...
public EnableMemcachedServer.MemcachedProtocol getProtocol() { return this.protocol; } public void setProtocol(EnableMemcachedServer.MemcachedProtocol protocol) { this.protocol = protocol; } } public static class RedisServerProperties { public static final int DEFAULT_PORT = 6379; private int port...
repos\spring-boot-data-geode-main\spring-geode-project\spring-geode-autoconfigure\src\main\java\org\springframework\geode\boot\autoconfigure\configuration\support\ServiceProperties.java
2
请完成以下Java代码
private Hyperlink createHyperlinkIfURL(@Nullable final String str) { if (str == null || str.isEmpty()) { return null; } final String urlStr = str.trim(); if (urlStr.startsWith("http://") || urlStr.startsWith("https://")) { try { new URI(urlStr); final Hyperlink hyperlink = getWorkbook...
throw new AdempiereException("Failed exporting to " + file, ex); } } @Value private static final class CellStyleKey { public static CellStyleKey header(final int column) { final int displayType = -1; // N/A final boolean functionRow = false; return new CellStyleKey("header", column, displayType, fun...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\impexp\spreadsheet\excel\AbstractExcelExporter.java
1
请完成以下Java代码
public class C_Order_VoidWithRelatedDocsAndRecreate extends JavaProcess implements IProcessPrecondition { private final IDocumentBL documentBL = Services.get(IDocumentBL.class); private final VoidOrderAndRelatedDocsService orderVoidedHandlerRegistry = Adempiere.getBean(VoidOrderAndRelatedDocsService.class); @Pa...
orderVoidedHandlerRegistry.invokeHandlers(request); return MSG_OK; } private VoidOrderAndRelatedDocsRequest createRequest(final I_C_Order orderRecord) { final OrderId requestOrderId = OrderId.ofRepoId(orderRecord.getC_Order_ID()); final IPair<RecordsToHandleKey, List<ITableRecordReference>> // requestRec...
repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\order\voidorderandrelateddocs\process\C_Order_VoidWithRelatedDocsAndRecreate.java
1
请在Spring Boot框架中完成以下Java代码
public InsuranceContractQuantity quantity(BigDecimal quantity) { this.quantity = quantity; return this; } /** * Anzahl * @return quantity **/ @Schema(example = "3", description = "Anzahl") public BigDecimal getQuantity() { return quantity; } public void setQuantity(BigDecimal quantity...
} if (o == null || getClass() != o.getClass()) { return false; } InsuranceContractQuantity insuranceContractQuantity = (InsuranceContractQuantity) o; return Objects.equals(this.pcn, insuranceContractQuantity.pcn) && Objects.equals(this.quantity, insuranceContractQuantity.quantity) && ...
repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-externalsystems\alberta\alberta-article-api\src\main\java\io\swagger\client\model\InsuranceContractQuantity.java
2
请完成以下Java代码
public String toSqlWhereClause() {return toSqlWhereClause0(importTableName, true);} /** * @return `AND ...` where clause */ public String toSqlWhereClause(@Nullable final String importTableAlias) { return toSqlWhereClause0(importTableAlias, true); } private String toSqlWhereClause0(@Nullable final String i...
final String importKeyColumnNameFQ = importTableAliasWithDot + importKeyColumnName; whereClause.append(" AND ").append(DB.createT_Selection_SqlWhereClause(selectionId, importKeyColumnNameFQ)); } } whereClause.append(")"); return whereClause.toString(); } public IQueryFilter<Object> toQueryFilter(@Null...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\impexp\processing\ImportRecordsSelection.java
1
请完成以下Java代码
class WebServerStartStopLifecycle implements SmartLifecycle { private final WebServerManager weServerManager; private volatile boolean running; WebServerStartStopLifecycle(WebServerManager weServerManager) { this.weServerManager = weServerManager; } @Override public void start() { this.weServerManager.sta...
@Override public boolean isRunning() { return this.running; } @Override public int getPhase() { return WebServerApplicationContext.START_STOP_LIFECYCLE_PHASE; } @Override public boolean isPauseable() { return false; } }
repos\spring-boot-4.0.1\module\spring-boot-web-server\src\main\java\org\springframework\boot\web\server\reactive\context\WebServerStartStopLifecycle.java
1
请在Spring Boot框架中完成以下Java代码
public String updateInventory(@Validated @ModelAttribute(INVENTORY_ATTR) Inventory inventory, BindingResult bindingResult, RedirectAttributes redirectAttributes, SessionStatus sessionStatus) { if (!bindingResult.hasErrors()) { try { Inventory updatedInventory = inventory...
sessionStatus.setComplete(); return "redirect:success"; } @GetMapping(value = "/success") public String success() { return "success"; } @InitBinder void allowFields(WebDataBinder webDataBinder ) { webDataBinder.setAllowedFields("quantity"); } }
repos\Hibernate-SpringBoot-master\HibernateSpringBootHTTPLongConversationDetachedEntity\src\main\java\com\bookstore\controller\InventoryController.java
2
请在Spring Boot框架中完成以下Java代码
public class JobResource { // @Autowired private JobRepository jobRepository; @GET @Produces("application/json") @Path("/jobs") public List<Job> getAllJobs(){ return jobRepository.findAll(); } @GET @Produces("application/json") @Path("/jobs") public ResponseEnti...
.orElseThrow(()->new ResourceNotFoundException("Job not found::" + jobId)); job.setEmailId(jobDetails.getEmailId()); job.setLastName(jobDetails.getLastName()); job.setFirstName(jobDetails.getFirstName()); final Job updateJob = jobRepository.save(job); return ResponseEntity.ok(upd...
repos\Spring-Boot-Advanced-Projects-main\Springboot-Jersey-JPA\src\main\java\spring\database\controller\JobResource.java
2
请完成以下Java代码
private static DataSource buildDataSource() { // 创建 HikariConfig 配置类 HikariConfig hikariConfig = new HikariConfig(); hikariConfig.setDriverClassName("com.mysql.cj.jdbc.Driver"); hikariConfig.setJdbcUrl(DB_URL + "/" + DB_NAME); hikariConfig.setUsername(DB_USERNAME); hikari...
.build(); } /** * 创建 screw 的处理配置,一般可忽略 * 指定生成逻辑、当存在指定表、指定表前缀、指定表后缀时,将生成指定表,其余表不生成、并跳过忽略表配置 */ private static ProcessConfig buildProcessConfig() { return ProcessConfig.builder() .designatedTableName(Collections.<String>emptyList()) // 根据名称指定表生成 .design...
repos\SpringBoot-Labs-master\lab-70-db-doc\lab-70-db-doc-screw-01\src\main\java\ScrewMain.java
1
请完成以下Java代码
public boolean containsKey(Object key) { for (Resolver scriptResolver : scriptResolvers) { if (scriptResolver.containsKey(key)) { return true; } } return defaultBindings.containsKey(key); } public Object get(Object key) { for (Resolver scr...
public void putAll(Map<? extends String, ? extends Object> toMerge) { throw new UnsupportedOperationException(); } public Object remove(Object key) { if (UNSTORED_KEYS.contains(key)) { return null; } return defaultBindings.remove(key); } public void clear() ...
repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\scripting\ScriptBindings.java
1
请完成以下Java代码
public void createRequestsForQuarantineLines(final I_DD_Order ddOrder) { final List<DDOrderLineId> ddOrderLineToQuarantineIds = retrieveLineToQuarantineWarehouseIds(ddOrder); C_Request_CreateFromDDOrder_Async.createWorkpackage(ddOrderLineToQuarantineIds); } @DocValidate(timings = { ModelValidator.TIMING_AFTE...
} private List<DDOrderLineId> retrieveLineToQuarantineWarehouseIds(final I_DD_Order ddOrder) { return ddOrderService.retrieveLines(ddOrder) .stream() .filter(this::isQuarantineWarehouseLine) .map(line -> DDOrderLineId.ofRepoId(line.getDD_OrderLine_ID())) .collect(ImmutableList.toImmutableList()); ...
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\distribution\ddorder\interceptor\DD_Order.java
1
请完成以下Java代码
public void process() { assertNotProcessed(); if (checks.size() < weightChecksRequired) { throw new AdempiereException(MSG_LessChecksThanRequired); } updateToleranceExceededFlag(); if (isToleranceExceeded) { throw new AdempiereException(MSG_ToleranceExceeded); } this.isProcessed = true; } ...
targetWeight.subtract(toleranceQty), targetWeight.add(toleranceQty) ); updateToleranceExceededFlag(); } public void updateUOMFromHeaderToChecks() { assertNotProcessed(); for (final PPOrderWeightingRunCheck check : checks) { check.setUomId(targetWeight.getUomId()); } } private void assertNotP...
repos\metasfresh-new_dawn_uat\backend\de.metas.manufacturing\src\main\java\de\metas\manufacturing\order\weighting\run\PPOrderWeightingRun.java
1
请完成以下Java代码
public class Todo { private Long id; private String title; private LocalDate dueDate; public Todo() { } public Todo(Long id, String title, LocalDate dueDate) { this.id = id; this.title = title; this.dueDate = dueDate; } public Long getId() { return id;...
return title; } public void setTitle(String title) { this.title = title; } public LocalDate getDueDate() { return dueDate; } public void setDueDate(LocalDate dueDate) { this.dueDate = dueDate; } }
repos\tutorials-master\spring-boot-modules\spring-boot-swagger-keycloak\src\main\java\com\baeldung\swaggerkeycloak\Todo.java
1
请完成以下Java代码
protected void removeIdentityLinkType(CommandContext commandContext, String processInstanceId, String identityType) { ExecutionEntity processInstanceEntity = getProcessInstanceEntity(commandContext, processInstanceId); // this will remove ALL identity links with the given identity type (for users AND g...
*/ protected void createIdentityLinkType(CommandContext commandContext, String processInstanceId, String userId, String groupId, String identityType) { // if both user and group ids are null, don't create an identity link if (userId == null && groupId == null) { return; } ...
repos\flowable-engine-main\modules\flowable-engine\src\main\java\org\flowable\engine\impl\cmd\AbstractProcessInstanceIdentityLinkCmd.java
1
请完成以下Java代码
private final IAttributeStorage getAttributeStorage(final IHUContext huContext, final I_M_HU hu) { final IAttributeStorageFactory attributeStorageFactory = huContext.getHUAttributeStorageFactory(); final IAttributeStorage attributeStorage = attributeStorageFactory.getAttributeStorage(hu); return attributeStorage...
* @return context document/lines (e.g. the receipt schedules) */ private List<TableRecordReference> getContextDocumentLines() { if (view == null) { return ImmutableList.of(); } return view.getReferencingDocumentPaths() .stream() .map(referencingDocumentPath -> documentCollections.getTableRecordR...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\handlingunits\process\WEBUIHUCreationWithSerialNumberService.java
1
请完成以下Java代码
private static @Nullable Throwable getRootCause(final Throwable throwable) { final List<Throwable> list = getThrowableList(throwable); return list.isEmpty() ? null : list.get(list.size() - 1); } private static List<Throwable> getThrowableList(Throwable throwable) { final List<Throwable> list = new ArrayList<>(...
public void setExecutionExceptionMessageHeaderName(String executionExceptionMessageHeaderName) { this.executionExceptionMessageHeaderName = executionExceptionMessageHeaderName; } public String getRootCauseExceptionTypeHeaderName() { return rootCauseExceptionTypeHeaderName; } public void setRootCauseExce...
repos\spring-cloud-gateway-main\spring-cloud-gateway-server-webflux\src\main\java\org\springframework\cloud\gateway\filter\factory\FallbackHeadersGatewayFilterFactory.java
1
请完成以下Java代码
public void setM_ProductDownload_ID (int M_ProductDownload_ID) { if (M_ProductDownload_ID < 1) set_Value (COLUMNNAME_M_ProductDownload_ID, null); else set_Value (COLUMNNAME_M_ProductDownload_ID, Integer.valueOf(M_ProductDownload_ID)); } /** Get Product Download. @return Product downloads */ public...
return (String)get_Value(COLUMNNAME_Remote_Host); } /** Set Serial No. @param SerNo Product Serial Number */ public void setSerNo (String SerNo) { set_ValueNoCheck (COLUMNNAME_SerNo, SerNo); } /** Get Serial No. @return Product Serial Number */ public String getSerNo () { return (String)ge...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_A_Asset_Delivery.java
1
请完成以下Java代码
public static Integer findMajorityElementUsingHashMap(int[] nums) { Map<Integer, Integer> frequencyMap = new HashMap<>(); for (int num : nums) { frequencyMap.put(num, frequencyMap.getOrDefault(num, 0) + 1); } int majorityThreshold = nums.length / 2; for (Map.Entry<I...
if (num == candidate) { count++; } } return count > majorityThreshold ? candidate : null; } public static void main(String[] args) { int[] nums = { 2, 3, 2, 4, 2, 5, 2 }; Integer majorityElement = findMajorityElementUsingMooreVoting(nums); i...
repos\tutorials-master\core-java-modules\core-java-arrays-operations-advanced-2\src\main\java\com\baeldung\majorityelement\FindMajorityElement.java
1
请完成以下Java代码
public class TypeInfoStructure { public static class Fleet { private List<Vehicle> vehicles; public List<Vehicle> getVehicles() { return vehicles; } public void setVehicles(List<Vehicle> vehicles) { this.vehicles = vehicles; } } public stati...
public Car() { } public Car(String make, String model, int seatingCapacity, double topSpeed) { super(make, model); this.seatingCapacity = seatingCapacity; this.topSpeed = topSpeed; } public int getSeatingCapacity() { return seatingCapacit...
repos\tutorials-master\jackson-modules\jackson-core\src\main\java\com\baeldung\jackson\inheritance\TypeInfoStructure.java
1
请在Spring Boot框架中完成以下Java代码
public R<TopMenu> detail(TopMenu topMenu) { TopMenu detail = topMenuService.getOne(Condition.getQueryWrapper(topMenu)); return R.data(detail); } /** * 分页 顶部菜单表 */ @GetMapping("/list") @ApiOperationSupport(order = 2) @Operation(summary = "分页", description = "传入topMenu") public R<IPage<TopMenu>> list(TopMe...
@ApiOperationSupport(order = 6) @Operation(summary = "新增或修改", description = "传入topMenu") public R submit(@Valid @RequestBody TopMenu topMenu) { return R.status(topMenuService.saveOrUpdate(topMenu)); } /** * 删除 顶部菜单表 */ @PostMapping("/remove") @ApiOperationSupport(order = 7) @Operation(summary = "逻辑删除", d...
repos\SpringBlade-master\blade-service\blade-system\src\main\java\org\springblade\system\controller\TopMenuController.java
2
请完成以下Java代码
public T get(String id) { return cache.get(id); } @Override public void add(String id, T obj) { cache.put(id, obj); } @Override public void remove(String id) { cache.remove(id); } @Override public boolean contains(String id) { return cache.containsK...
@Override public void clear() { cache.clear(); } @Override public Collection<T> getAll() { return cache.values(); } @Override public int size() { return cache.size(); } }
repos\flowable-engine-main\modules\flowable-engine-common\src\main\java\org\flowable\common\engine\impl\persistence\deploy\DefaultDeploymentCache.java
1
请在Spring Boot框架中完成以下Java代码
public class Customer { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Customer customer = (Customer) o; return age == customer.age && name.equals(customer.name); } ...
public Long getId() { return id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public int getAge() { return age; } public void setAge(int age) { this.age = age; } }
repos\tutorials-master\persistence-modules\spring-data-jpa-repo\src\main\java\com\baeldung\flush\Customer.java
2
请完成以下Java代码
public void setName (final java.lang.String Name) { set_Value (COLUMNNAME_Name, Name); } @Override public java.lang.String getName() { return get_ValueAsString(COLUMNNAME_Name); } @Override public void setProcessed (final boolean Processed) { set_Value (COLUMNNAME_Processed, Processed); } @Override...
public void setTermDurationUnit (final java.lang.String TermDurationUnit) { set_Value (COLUMNNAME_TermDurationUnit, TermDurationUnit); } @Override public java.lang.String getTermDurationUnit() { return get_ValueAsString(COLUMNNAME_TermDurationUnit); } @Override public void setTermOfNotice (final int Term...
repos\metasfresh-new_dawn_uat\backend\de.metas.contracts\src\main\java-gen\de\metas\contracts\model\X_C_Flatrate_Transition.java
1
请完成以下Java代码
public Map<String, Class> getReferencedEntitiesIdAndClass() { Map<String, Class> referenceIdAndClass = new HashMap<>(); if (processDefinitionId != null) { referenceIdAndClass.put(processDefinitionId, ProcessDefinitionEntity.class); } if (processInstanceId != null) { referenceIdAndClass.put(...
} @Override public boolean hasAttachment() { return attachmentExists; } @Override public boolean hasComment() { return commentExists; } public void escalation(String escalationCode, Map<String, Object> variables) { ensureTaskActive(); ActivityExecution activityExecution = getExecution(); ...
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\persistence\entity\TaskEntity.java
1
请完成以下Java代码
public String filterType() { return "pre"; } @Override public int filterOrder() { return 0; } /** * Filter requests on endpoints that are not in the list of authorized microservices endpoints. */ @Override public boolean shouldFilter() { String requestUri ...
// Go over the authorized endpoints to control that the request URI matches it for (String endpoint : authorizedEndpoints) { // We do a substring to remove the "**/" at the end of the route URL String gatewayEndpoint = serviceUrl.substring(0, serviceUrl.length() - 3) + endpoi...
repos\tutorials-master\jhipster-modules\jhipster-uaa\gateway\src\main\java\com\baeldung\jhipster\gateway\gateway\accesscontrol\AccessControlFilter.java
1
请完成以下Java代码
private static class SingleSharedSequence implements POJONextIdSupplier { // NOTE: because in some tests we are using hardcoded IDs which are like ~50000, we decided to start the IDs sequence from 100k. private static final int DEFAULT_FirstId = 100000; private int nextId = DEFAULT_FirstId; @Override public...
private final HashMap<String, AtomicInteger> nextIds = new HashMap<>(); @Override public int nextId(@NonNull final String tableName) { final String tableNameNorm = tableName.trim().toLowerCase(); return nextIds.computeIfAbsent(tableNameNorm, k -> new AtomicInteger(firstId)) .getAndIncrement(); } ...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\wrapper\POJONextIdSuppliers.java
1
请完成以下Java代码
default V getOrFetchFromDB(K key, Supplier<V> dbCall, boolean cacheNullValue, boolean putToCache) { if (putToCache) { return getAndPutInTransaction(key, dbCall, cacheNullValue); } else { TbCacheValueWrapper<V> cacheValueWrapper = get(key); if (cacheValueWrapper != nul...
cacheTransaction.commit(); return dbValue; } else { cacheTransaction.rollback(); return null; } } catch (Throwable e) { cacheTransaction.rollback(); throw e; } } default <R> R getOrFetchFromDB(K key,...
repos\thingsboard-master\common\cache\src\main\java\org\thingsboard\server\cache\TbTransactionalCache.java
1
请在Spring Boot框架中完成以下Java代码
public class TrxItemProcessorExecutorService implements ITrxItemProcessorExecutorService { @Override public ITrxItemProcessorContext createProcessorContext(final Properties ctx, final ITrx trx) { final IParams params = null; return createProcessorContext(ctx, trx, params); } @Override public ITrxItemProcesso...
@Override public <IT, RT> ITrxItemProcessorExecutor<IT, RT> createExecutor(final ITrxItemProcessorContext processorCtx, final ITrxItemProcessor<IT, RT> processor) { final ITrxItemExecutorBuilder<IT, RT> builder = createExecutor(); return builder .setContext(processorCtx) .setProcessor(processor) .buil...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\trx\processor\api\impl\TrxItemProcessorExecutorService.java
2
请在Spring Boot框架中完成以下Java代码
public ModelAndView index(HttpServletRequest request) { ModelAndView mv = new ModelAndView(); String token = (String) request.getSession().getAttribute(Consts.SESSION_KEY); mv.setViewName("index"); mv.addObject("token", token); return mv; } /** * 跳转到 登录页 * ...
if (ObjectUtil.isNotNull(redirect) && ObjectUtil.equal(true, redirect)) { mv.addObject("message", "请先登录!"); } mv.setViewName("login"); return mv; } @GetMapping("/doLogin") public String doLogin(HttpSession session) { session.setAttribute(Consts.SESSION_KEY, IdUti...
repos\spring-boot-demo-master\demo-session\src\main\java\com\xkcoding\session\controller\PageController.java
2
请完成以下Java代码
public String getProcessInstanceId() { return processInstanceId; } public String getProcessDefinitionId() { return processDefinitionId; } public String getProcessDefinitionKey() { return processDefinitionKey; } public String getDeploymentId() { return deploymentId; } public JobState ...
return state; } public String[] getTenantIds() { return tenantIds; } public String getHostname() { return hostname; } // setter ////////////////////////////////// protected void setState(JobState state) { this.state = state; } }
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\HistoricJobLogQueryImpl.java
1
请完成以下Java代码
byte[] getPayload() { return this.payload; } @Override public String toString() { return new String(this.payload); } void write(OutputStream outputStream) throws IOException { outputStream.write(0x80 | this.type.code); if (this.payload.length < 126) { outputStream.write(this.payload.length & 0x7F); ...
*/ BINARY(0x02), /** * Close frame. */ CLOSE(0x08), /** * Ping frame. */ PING(0x09), /** * Pong frame. */ PONG(0x0A); private final int code; Type(int code) { this.code = code; } static Type forCode(int code) { for (Type type : values()) { if (type.code == code) {...
repos\spring-boot-4.0.1\module\spring-boot-devtools\src\main\java\org\springframework\boot\devtools\livereload\Frame.java
1
请完成以下Java代码
public java.lang.String getPrintServiceTray() { return (java.lang.String)get_Value(COLUMNNAME_PrintServiceTray); } @Override public void setStatus_Print_Job_Instructions (boolean Status_Print_Job_Instructions) { set_ValueNoCheck (COLUMNNAME_Status_Print_Job_Instructions, Boolean.valueOf(Status_Print_Job_Inst...
} @Override public int getUpdatedby_Print_Job_Instructions() { return get_ValueAsInt(COLUMNNAME_Updatedby_Print_Job_Instructions); } @Override public void setUpdated_Print_Job_Instructions (java.sql.Timestamp Updated_Print_Job_Instructions) { set_ValueNoCheck (COLUMNNAME_Updated_Print_Job_Instructions, Up...
repos\metasfresh-new_dawn_uat\backend\de.metas.printing\de.metas.printing.base\src\main\java-gen\de\metas\printing\model\X_C_Printing_Queue_PrintInfo_v.java
1
请完成以下Java代码
public CarBuilder color(String color) { this.color = color; return this; } public CarBuilder automatic(boolean automatic) { this.automatic = automatic; return this; } public CarBuilder numDoors(int numDoors) { this.numDoors = ...
public CarBuilder features(String features) { this.features = features; return this; } public Car build() { return new Car(this); } } @Override public String toString() { return "Car [make=" + make + ", model=" + model + ", year=" + year ...
repos\tutorials-master\core-java-modules\core-java-lang-oop-methods-2\src\main\java\com\baeldung\methods\Car.java
1
请完成以下Java代码
public void pointcut() { } @Around("pointcut()") public Object retry(ProceedingJoinPoint joinPoint) throws Exception { // 获取注解 Retryable retryable = AnnotationUtils.findAnnotation(getSpecificmethod(joinPoint), Retryable.class); // 声明Callable Callable<Object> task = () -> get...
throw new RuntimeException("执行任务异常"); } } private Method getSpecificmethod(ProceedingJoinPoint pjp) { MethodSignature methodSignature = (MethodSignature) pjp.getSignature(); Method method = methodSignature.getMethod(); // The method may be on an interface, but we need attributes...
repos\spring-boot-student-master\spring-boot-student-guava-retrying\src\main\java\com\xiaolyuh\aspect\RetryAspect.java
1
请完成以下Java代码
public void setValueColumnName(String valueTableName, String valueColumnName, int valueDisplayType) { this.valueTableName = valueTableName; this.valueColumnName = valueColumnName; this.valueDisplayType = valueDisplayType; } public void addElement(TableColumnPathElement e) { elements.add(e); } @Override ...
} @Override public String getKeyColumnName() { return keyColumnName; } @Override public int getRecordId() { return recordId; } @Override public String toString() { return "TableColumnPath [valueTableName=" + valueTableName + ", valueColumnName=" + valueColumnName + ", keyTableName=" + keyTableName +...
repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\adempiere\model\TableColumnPath.java
1
请完成以下Java代码
public Cookie get(String name) { return cookieMap.get(name); } @Override public boolean containsAll(Collection<?> collection) { for(Object o : collection) { if (!contains(o)) { return false; } } return true; } @Override pu...
Iterator<Map.Entry<String, Cookie>> it = cookieMap.entrySet().iterator(); while(it.hasNext()) { Map.Entry<String, Cookie> e = it.next(); if (!collection.contains(e.getKey()) && !collection.contains(e.getValue())) { it.remove(); result = true; }...
repos\tutorials-master\jhipster-modules\jhipster-uaa\gateway\src\main\java\com\baeldung\jhipster\gateway\security\oauth2\CookieCollection.java
1
请完成以下Java代码
public String toString() { return toSqlString(); } public String toSqlString() { String sqlBuilt = this._sqlBuilt; if (sqlBuilt == null) { final String joinTableNameOrAliasIncludingDot = joinTableNameOrAlias != null ? joinTableNameOrAlias + "." : ""; final Evaluatee2 evalCtx = Evaluatees.ofSingleton(...
} public String toSqlStringWrappedInBracketsIfNeeded() { final String sql = toSqlString(); if (sql.contains(" ") && !sql.startsWith("(")) { return "(" + sql + ")"; } else { return sql; } } }
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\column\ColumnSql.java
1
请完成以下Java代码
public class CamundaBpmRunCorsProperty { public static final String PREFIX = CamundaBpmRunProperties.PREFIX + ".cors"; public static final String DEFAULT_ORIGINS = "*"; public static final String DEFAULT_HTTP_METHODS = "GET,POST,HEAD,OPTIONS,PUT,DELETE"; // Duplicate the default values of the following CorsFi...
public void setAllowCredentials(boolean allowCredentials) { this.allowCredentials = allowCredentials; } public String getAllowedHeaders() { return allowedHeaders; } public void setAllowedHeaders(String allowedHeaders) { this.allowedHeaders = allowedHeaders; } public String getExposedHeaders()...
repos\camunda-bpm-platform-master\distro\run\core\src\main\java\org\camunda\bpm\run\property\CamundaBpmRunCorsProperty.java
1
请完成以下Java代码
protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token) throws AuthenticationException { UsernamePasswordToken usernamePasswordToken = (UsernamePasswordToken) token; String username = usernamePasswordToken.getUsername(); if (StringUtils.isEmpty(username)) { throw new AccountException("...
if (userByName.getSalt() != null) { info.setCredentialsSalt(ByteSource.Util.bytes(userByName.getSalt())); } return info; } public static void main(String[] args) { String hashAlgorithmName = "MD5"; String credentials = "123456"; Object salt = "wxKYXuTPST5SG0jMQzVPsg=="; int hashIterations = 100; Sim...
repos\spring-boot-quick-master\quick-spring-shiro\src\main\java\com\shiro\shiro\realm\MyShiroRealm.java
1
请完成以下Java代码
public class Result<T> { private int code; private String message; private T data; public Result setCode(ResultCode resultCode) { this.code = resultCode.code(); return this; } public int getCode() { return code; } public String getMessage() { return mes...
this.message = message; return this; } public T getData() { return data; } public Result setData(T data) { this.data = data; return this; } @Override public String toString() { return JSON.toJSONString(this); } }
repos\spring-boot-api-project-seed-master\src\main\java\com\company\project\core\Result.java
1
请完成以下Java代码
public void setC_ConversionType_Default_ID (int C_ConversionType_Default_ID) { if (C_ConversionType_Default_ID < 1) set_ValueNoCheck (COLUMNNAME_C_ConversionType_Default_ID, null); else set_ValueNoCheck (COLUMNNAME_C_ConversionType_Default_ID, Integer.valueOf(C_ConversionType_Default_ID)); } /** Get Kur...
if (C_ConversionType_ID < 1) set_ValueNoCheck (COLUMNNAME_C_ConversionType_ID, null); else set_ValueNoCheck (COLUMNNAME_C_ConversionType_ID, Integer.valueOf(C_ConversionType_ID)); } /** Get Kursart. @return Kursart */ @Override public int getC_ConversionType_ID () { Integer ii = (Integer)get_Val...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_ConversionType_Default.java
1
请在Spring Boot框架中完成以下Java代码
public List<Employee> getAllEmployees() { return employeeList; } public Employee getEmployee(int id) { for (Employee emp : employeeList) { if (emp.getId() == id) { return emp; } } throw new EmployeeNotFound(); } public void update...
} public void deleteEmployee(int id) { for (Employee emp : employeeList) { if (emp.getId() == id) { employeeList.remove(emp); return; } } throw new EmployeeNotFound(); } public void addEmployee(Employee employee) { for...
repos\tutorials-master\spring-web-modules\spring-jersey\src\main\java\com\baeldung\server\repository\EmployeeRepositoryImpl.java
2
请完成以下Java代码
public void setA_Period_7 (BigDecimal A_Period_7) { set_Value (COLUMNNAME_A_Period_7, A_Period_7); } /** Get A_Period_7. @return A_Period_7 */ public BigDecimal getA_Period_7 () { BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_A_Period_7); if (bd == null) return Env.ZERO; return bd; } /** Se...
} /** Get A_Period_9. @return A_Period_9 */ public BigDecimal getA_Period_9 () { BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_A_Period_9); if (bd == null) return Env.ZERO; return bd; } /** Set Description. @param Description Optional short description of the record */ public void setD...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_A_Asset_Spread.java
1
请完成以下Java代码
public <CollectedType, ParentModelType> IQueryBuilder<CollectedType> andCollect(final ModelColumn<ParentModelType, CollectedType> column) { return andCollect(column.getColumnName(), column.getColumnModelType()); } @Override public <CollectedBaseType, CollectedType extends CollectedBaseType, ParentModelType> IQue...
@Override public IQueryBuilder<T> setJoinAnd() { filters.setJoinAnd(); return this; } @Override public <TargetModelType> QueryAggregateBuilder<T, TargetModelType> aggregateOnColumn(final ModelColumn<T, TargetModelType> column) { return aggregateOnColumn(column.getColumnName(), column.getColumnModelType());...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\dao\impl\QueryBuilder.java
1
请在Spring Boot框架中完成以下Java代码
public ResponseEntity<List<Employee>> getEmployeeByNameAndBeginContactNumber(@PathVariable final String name, @MatrixVariable final String beginContactNumber) { final List<Employee> employeesList = new ArrayList<>(); for (final Map.Entry<Long, Employee> employeeEntry : employeeMap.entrySet()) { ...
public ResponseEntity<Map<String, String>> getEmployeeData(@MatrixVariable final Map<String, String> matrixVars) { return new ResponseEntity<>(matrixVars, HttpStatus.OK); } @RequestMapping(value = "employeeArea/{workingArea}", method = RequestMethod.GET) @ResponseBody public ResponseEntity<List...
repos\tutorials-master\spring-web-modules\spring-mvc-java-2\src\main\java\com\baeldung\matrix\controller\EmployeeController.java
2
请完成以下Java代码
private GridController createGridController(GridTab tab, int width, int height) { final GridController gc = new GridController(); gc.initGrid(tab, true, // onlyMultiRow windowNo, null, // APanel null); // GridWindow if (width > 0 && height > 0) { gc.setPreferredSize(new Dimension(width, heig...
for (VTable t : m_mapVTables.values()) { t.autoSize(true); } } /** Map AD_Tab_ID -> VTable */ private Map<Integer, VTable> m_mapVTables = new HashMap<>(); @Override public void dispose() { if (frame != null) { frame.dispose(); } frame = null; } }
repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\adempiere\form\swing\OrderOverview.java
1
请完成以下Java代码
public @Nullable ClassLoaderFile getFile(@Nullable String name) { return this.filesByName.get(name); } /** * Returns a set of all file entries across all source directories for efficient * iteration. * @return a set of all file entries * @since 4.0.0 */ public Set<Entry<String, ClassLoaderFile>> getFile...
protected final @Nullable ClassLoaderFile get(String name) { return this.files.get(name); } /** * Return the name of the source directory. * @return the name of the source directory */ public String getName() { return this.name; } /** * Return all {@link ClassLoaderFile ClassLoaderFiles} i...
repos\spring-boot-4.0.1\module\spring-boot-devtools\src\main\java\org\springframework\boot\devtools\restart\classloader\ClassLoaderFiles.java
1
请完成以下Java代码
public String getId() { return this.id; } @Override public int getFieldSize() { // TODO return 0; } @Override public String getFieldNameAt(int index) { // TODO return null; }
@Override public Class<?> getFieldTypeAt(int index) { // TODO return null; } @Override public Class<?> getFieldParameterTypeAt(int index) { // TODO return null; } @Override public StructureInstance createInstance() { return new FieldBaseStructureInst...
repos\flowable-engine-main\modules\flowable-engine\src\main\java\org\flowable\engine\impl\bpmn\data\ClassStructureDefinition.java
1
请完成以下Java代码
public class ArrayStack { // 数组 private int elementCount; // 栈中元素个数 private String[] items; //栈的大小 private int size; // 初始化数组,申请一个大小为n的数组空间 public ArrayStack(int size) { this.items = new String[size]; this.size = size; this.elementCount = 0; } // 入栈操作 ...
++elementCount; return true; } // 出栈操作 public String pop() { // 栈为空,则直接返回null if (elementCount == 0) { return null; } // 返回下标为count-1的数组元素,并且栈中元素个数count减一 String tmp = items[elementCount - 1]; --elementCount; return tmp; } }
repos\spring-boot-student-master\spring-boot-student-concurrent\src\main\java\com\xiaolyuh\ArrayStack.java
1
请完成以下Java代码
public class FactAcctBL implements IFactAcctBL { private final IFactAcctDAO factAcctDAO = Services.get(IFactAcctDAO.class); private final IAccountDAO accountDAO = Services.get(IAccountDAO.class); @Override public Account getAccount(@NonNull final I_Fact_Acct factAcct) { final AccountDimension accountDimension =...
final CurrencyId acctCurrencyId = Services.get(IAcctSchemaBL.class).getAcctCurrencyId(acctSchemaId); final BigDecimal acctBalanceBD = factLines.stream() .map(factLine -> factLine.getAmtAcctDr().subtract(factLine.getAmtAcctCr())) .reduce(BigDecimal::add) .orElse(BigDecimal.ZERO); return Optional.of(Mon...
repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\org\adempiere\acct\api\impl\FactAcctBL.java
1
请在Spring Boot框架中完成以下Java代码
class LoginRedirectSecurityConfig { private static final String LOGIN_USER = "/loginUser"; @Bean public InMemoryUserDetailsManager userDetailsService() { UserDetails user = User.withUsername("user") .password(encoder().encode("user")) .roles("USER") .build(); ...
httpSecurityFormLoginConfigurer.loginPage(LOGIN_USER) .loginProcessingUrl("/user_login") .failureUrl("/loginUser?error=loginError") .defaultSuccessUrl("/userMainPage").permitAll()) .logout(httpSecurityLogoutConfigurer -> ...
repos\tutorials-master\spring-security-modules\spring-security-web-boot-2\src\main\java\com\baeldung\loginredirect\LoginRedirectSecurityConfig.java
2
请完成以下Java代码
public void setC_Flatrate_Transition(final de.metas.contracts.model.I_C_Flatrate_Transition C_Flatrate_Transition) { set_ValueFromPO(COLUMNNAME_C_Flatrate_Transition_ID, de.metas.contracts.model.I_C_Flatrate_Transition.class, C_Flatrate_Transition); } @Override public void setC_Flatrate_Transition_ID (final int ...
else set_Value (COLUMNNAME_M_Product_ID, M_Product_ID); } @Override public int getM_Product_ID() { return get_ValueAsInt(COLUMNNAME_M_Product_ID); } @Override public void setQtyPerDelivery (final BigDecimal QtyPerDelivery) { set_Value (COLUMNNAME_QtyPerDelivery, QtyPerDelivery); } @Override publi...
repos\metasfresh-new_dawn_uat\backend\de.metas.contracts\src\main\java-gen\de\metas\contracts\model\X_C_Flatrate_Matching.java
1
请完成以下Java代码
public class GetExecutionVariableInstanceCmd implements Command<VariableInstance>, Serializable { private static final long serialVersionUID = 1L; protected String executionId; protected String variableName; protected boolean isLocal; public GetExecutionVariableInstanceCmd(String executionId, Stri...
if (variableEntity != null) { variableEntity.getValue(); } return variableEntity; } protected VariableInstance getVariable(ExecutionEntity execution, CommandContext commandContext) { VariableInstance variableEntity = null; if (isLocal) { variableEntity =...
repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\cmd\GetExecutionVariableInstanceCmd.java
1
请完成以下Java代码
public boolean addTU(final I_M_HU tuHU) { if (!isMatchTU(tuHU)) { return false; } if (!luItemStorage.requestNewHU()) { return false; } huTrxBL.setParentHU(huContext, luItem, tuHU); return true; } /** * @return {@code true} if the given {@code tuHU} fits to this instance's wrapped item. *...
{ final int tuPIId = Services.get(IHandlingUnitsBL.class).getPIVersion(tuHU).getM_HU_PI_ID(); if (tuPIId != requiredTU_HU_PI_ID) { return false; } } // // Check if TU's BPartner is accepted if (requiredBPartnerId != null) { final BPartnerId tuBPartnerId = BPartnerId.ofRepoIdOrNull(tuHU.get...
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\allocation\impl\LULoaderItemInstance.java
1
请在Spring Boot框架中完成以下Java代码
public int updateShowStatus(List<Long> ids, Integer showStatus) { PmsProductCategory productCategory = new PmsProductCategory(); productCategory.setShowStatus(showStatus); PmsProductCategoryExample example = new PmsProductCategoryExample(); example.createCriteria().andIdIn(ids); ...
*/ private void setCategoryLevel(PmsProductCategory productCategory) { //没有父分类时为一级分类 if (productCategory.getParentId() == 0) { productCategory.setLevel(0); } else { //有父分类时选择根据父分类level设置 PmsProductCategory parentCategory = productCategoryMapper.selectByPri...
repos\mall-master\mall-admin\src\main\java\com\macro\mall\service\impl\PmsProductCategoryServiceImpl.java
2
请完成以下Java代码
private void processRows(Statement statement, AsyncResultSet resultSet, List<Row> allRows, SettableFuture<List<Row>> resultFuture, Executor executor) { allRows.addAll(loadRows(resultSet)); ...
public void onFailure(Throwable t) { resultFuture.setException(t); } }, executor != null ? executor : MoreExecutors.directExecutor() ); } else { resultFuture.set(allRows); } } List<Row> loadRows(Asyn...
repos\thingsboard-master\common\dao-api\src\main\java\org\thingsboard\server\dao\nosql\TbResultSet.java
1
请完成以下Java代码
public Builder issuedAt(Instant issuedAt) { this.claim(JwtClaimNames.IAT, issuedAt); return this; } /** * Use this issuer in the resulting {@link Jwt} * @param issuer The issuer to use * @return the {@link Builder} for further configurations */ public Builder issuer(String issuer) { this.cla...
return this; } /** * Build the {@link Jwt} * @return The constructed {@link Jwt} */ public Jwt build() { Instant iat = toInstant(this.claims.get(JwtClaimNames.IAT)); Instant exp = toInstant(this.claims.get(JwtClaimNames.EXP)); return new Jwt(this.tokenValue, iat, exp, this.headers, this.claims)...
repos\spring-security-main\oauth2\oauth2-jose\src\main\java\org\springframework\security\oauth2\jwt\Jwt.java
1
请在Spring Boot框架中完成以下Java代码
public String getSpecialConditions() { return specialConditions; } /** * Sets the value of the specialConditions property. * * @param value * allowed object is * {@link String } * */ public void setSpecialConditions(String value) { this.speci...
return this.kanbanID; } /** * The classification of the product/service in free-text form.Gets the value of the classification property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned li...
repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-edi\src\main\java-xjc_ecosio_remadv\at\erpel\schemas\_1p0\documents\AdditionalLineItemInformationType.java
2
请在Spring Boot框架中完成以下Java代码
public List<ResourceExportData> exportResources(WidgetTypeDetails widgetTypeDetails, SecurityUser user) throws ThingsboardException { return exportResources(() -> imageService.getUsedImages(widgetTypeDetails), () -> resourceService.getUsedResources(user.getTenantId(), widgetTypeDetails), user); } @Over...
} private TbResourceInfo importResource(ResourceExportData resourceData, SecurityUser user) throws ThingsboardException { TbResource resource = resourceService.toResource(user.getTenantId(), resourceData); if (resource.getData() != null) { accessControlService.checkPermission(user, Reso...
repos\thingsboard-master\application\src\main\java\org\thingsboard\server\service\resource\DefaultTbResourceService.java
2
请完成以下Java代码
public List<SequenceFlow> getIncomingFlows() { return incomingFlows; } public void setIncomingFlows(List<SequenceFlow> incomingFlows) { this.incomingFlows = incomingFlows; } public List<SequenceFlow> getOutgoingFlows() { return outgoingFlows; } public void setOutgoingF...
setNotExclusive(otherNode.isNotExclusive()); setAsynchronousLeave(otherNode.isAsynchronousLeave()); setAsynchronousLeaveNotExclusive(otherNode.isAsynchronousLeaveNotExclusive()); if (otherNode.getIncomingFlows() != null) { setIncomingFlows(otherNode.getIncomingFlows() ...
repos\flowable-engine-main\modules\flowable-bpmn-model\src\main\java\org\flowable\bpmn\model\FlowNode.java
1
请完成以下Java代码
public void setEmail(final String username) { email = username; } public int getAge() { return age; } public void setAge(final int age) { this.age = age; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prim...
if (obj == null) return false; if (getClass() != obj.getClass()) return false; final User user = (User) obj; return email.equals(user.email); } @Override public String toString() { final StringBuilder builder = new StringBuilder(); builder.app...
repos\tutorials-master\spring-web-modules\spring-rest-query-language\src\main\java\com\baeldung\persistence\model\User.java
1
请在Spring Boot框架中完成以下Java代码
public Object lIndex(String key, long index) { return redisTemplate.opsForList().index(key, index); } @Override public Long lPush(String key, Object value) { return redisTemplate.opsForList().rightPush(key, value); } @Override public Long lPush(String key, Object value, long ti...
public Long lPushAll(String key, Object... values) { return redisTemplate.opsForList().rightPushAll(key, values); } @Override public Long lPushAll(String key, Long time, Object... values) { Long count = redisTemplate.opsForList().rightPushAll(key, values); expire(key, time); ...
repos\mall-master\mall-common\src\main\java\com\macro\mall\common\service\impl\RedisServiceImpl.java
2
请在Spring Boot框架中完成以下Java代码
NettyDriverMongoClientSettingsBuilderCustomizer nettyDriverCustomizer( ObjectProvider<MongoClientSettings> settings) { return new NettyDriverMongoClientSettingsBuilderCustomizer(settings); } } /** * {@link MongoClientSettingsBuilderCustomizer} to apply Mongo client settings. */ static final class Nett...
@Override public void destroy() { EventLoopGroup eventLoopGroup = this.eventLoopGroup; if (eventLoopGroup != null) { eventLoopGroup.shutdownGracefully().awaitUninterruptibly(); this.eventLoopGroup = null; } } private boolean isCustomTransportConfiguration(@Nullable MongoClientSettings settings) ...
repos\spring-boot-4.0.1\module\spring-boot-mongodb\src\main\java\org\springframework\boot\mongodb\autoconfigure\MongoReactiveAutoConfiguration.java
2
请完成以下Java代码
public class ExecutorRouteFailover extends ExecutorRouter { @Override public ReturnT<String> route(TriggerParam triggerParam, List<String> addressList) { StringBuffer beatResultSB = new StringBuffer(); for (String address : addressList) { // beat ReturnT<String> beatRes...
.append("<br>code:").append(beatResult.getCode()) .append("<br>msg:").append(beatResult.getMsg()); // beat success if (beatResult.getCode() == ReturnT.SUCCESS_CODE) { beatResult.setMsg(beatResultSB.toString()); beatResult.setContent(address);...
repos\JeecgBoot-main\jeecg-boot\jeecg-server-cloud\jeecg-visual\jeecg-cloud-xxljob\src\main\java\com\xxl\job\admin\core\route\strategy\ExecutorRouteFailover.java
1
请完成以下Java代码
public RegisteredClient getRegisteredClient() { return get(RegisteredClient.class); } /** * Returns the {@link OAuth2AuthorizationRequest authorization request}. * @return the {@link OAuth2AuthorizationRequest} */ @Nullable public OAuth2AuthorizationRequest getAuthorizationRequest() { return get(OAuth2Au...
/** * Sets the {@link OAuth2AuthorizationRequest authorization request}. * @param authorizationRequest the {@link OAuth2AuthorizationRequest} * @return the {@link Builder} for further configuration */ public Builder authorizationRequest(OAuth2AuthorizationRequest authorizationRequest) { return put(OAut...
repos\spring-security-main\oauth2\oauth2-authorization-server\src\main\java\org\springframework\security\oauth2\server\authorization\authentication\OAuth2AuthorizationCodeRequestAuthenticationContext.java
1
请完成以下Java代码
public void setSequence (BigDecimal Sequence) { set_Value (COLUMNNAME_Sequence, Sequence); } /** Get Sequence. @return Sequence */ public BigDecimal getSequence () { BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_Sequence); if (bd == null) return Env.ZERO; return bd; } /** Set Web Menu. @p...
{ if (U_WebMenu_ID < 1) set_ValueNoCheck (COLUMNNAME_U_WebMenu_ID, null); else set_ValueNoCheck (COLUMNNAME_U_WebMenu_ID, Integer.valueOf(U_WebMenu_ID)); } /** Get Web Menu. @return Web Menu */ public int getU_WebMenu_ID () { Integer ii = (Integer)get_Value(COLUMNNAME_U_WebMenu_ID); if (ii == ...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_U_WebMenu.java
1
请完成以下Java代码
public Result beforeHU(final IMutable<I_M_HU> hu) { return defaultResult; } @Override public Result afterHU(final I_M_HU hu) { return defaultResult; } @Override public Result beforeHUItem(final IMutable<I_M_HU_Item> item) { return defaultResult; } @Override public Result afterHUItem(final I_M_HU_It...
{ return defaultResult; } @Override public Result beforeHUItemStorage(final IMutable<IHUItemStorage> itemStorage) { return defaultResult; } @Override public Result afterHUItemStorage(final IHUItemStorage itemStorage) { return defaultResult; } }
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\NullHUIteratorListener.java
1
请完成以下Java代码
protected void handle(final HttpServletRequest request, final HttpServletResponse response, final Authentication authentication) throws IOException { final String targetUrl = determineTargetUrl(authentication); if (response.isCommitted()) { logger.debug("Response has already been committed....
} /** * Removes temporary authentication-related data which may have been stored in the session * during the authentication process. */ protected final void clearAuthenticationAttributes(final HttpServletRequest request) { final HttpSession session = request.getSession(false); i...
repos\tutorials-master\spring-security-modules\spring-security-web-mvc-custom\src\main\java\com\baeldung\security\MySimpleUrlAuthenticationSuccessHandler.java
1
请在Spring Boot框架中完成以下Java代码
public class Book { @Id @GeneratedValue private Long id; private String name; public Book() { super(); } public Book(Long id, String name) { super(); this.id = id; this.name = name; }
public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } }
repos\tutorials-master\persistence-modules\spring-boot-persistence\src\main\java\com\baeldung\springboothibernate\application\models\Book.java
2
请完成以下Java代码
public POSPayment changingStatusFromRemote(@NonNull final POSPaymentProcessResponse response) { paymentMethod.assertCard(); // NOTE: when changing status from remote we cannot validate if the status transition is OK // we have to accept what we have on remote. return toBuilder() .paymentProcessingStatus(...
public POSPayment withCashTenderedAmount(@NonNull final BigDecimal cashTenderedAmountBD) { paymentMethod.assertCash(); Check.assume(cashTenderedAmountBD.signum() > 0, "Cash Tendered Amount must be positive"); final Money cashTenderedAmountNew = Money.of(cashTenderedAmountBD, this.cashTenderedAmount.getCurrencyI...
repos\metasfresh-new_dawn_uat\backend\de.metas.pos.base\src\main\java\de\metas\pos\POSPayment.java
1
请完成以下Java代码
protected final IHandlingUnitsDAO getHandlingUnitsDAO() { return handlingUnitsDAO; } @Override public void updateHUTrxAttribute(@NonNull final MutableHUTransactionAttribute huTrxAttribute, @NonNull final IAttributeValue fromAttributeValue) { assertNotDisposed(); // // Set M_HU final I_M_HU hu = getM_HU...
public final UOMType getQtyUOMTypeOrNull() { final I_M_HU hu = getM_HU(); final IHUStorageDAO huStorageDAO = getHUStorageDAO(); return huStorageDAO.getC_UOMTypeOrNull(hu); } @Override public final BigDecimal getStorageQtyOrZERO() { final IHUStorageFactory huStorageFactory = getAttributeStorageFactory().ge...
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\attribute\storage\impl\AbstractHUAttributeStorage.java
1
请在Spring Boot框架中完成以下Java代码
public String getTenantIdLikeIgnoreCase() { return tenantIdLikeIgnoreCase; } public void setTenantIdLikeIgnoreCase(String tenantIdLikeIgnoreCase) { this.tenantIdLikeIgnoreCase = tenantIdLikeIgnoreCase; } public Boolean getWithoutTenantId() { return withoutTenantId; } p...
return parentScopeId; } public void setParentScopeId(String parentScopeId) { this.parentScopeId = parentScopeId; } public Set<String> getCallbackIds() { return callbackIds; } public void setCallbackIds(Set<String> callbackIds) { this.callbackIds = callbackIds; } }
repos\flowable-engine-main\modules\flowable-rest\src\main\java\org\flowable\rest\service\api\history\HistoricProcessInstanceQueryRequest.java
2
请完成以下Java代码
public class Post { private int userId; private String title; private String body; public Post() { } public Post(int userId, String title, String body) { this.userId = userId; this.title = title; this.body = body; } public int getUserId() { return user...
public void setUserId(int userId) { this.userId = userId; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getBody() { return body; } public void setBody(String body) { this.b...
repos\tutorials-master\apache-libraries-2\src\main\java\com\baeldung\apache\camel\postrequest\Post.java
1
请完成以下Java代码
public void invalidateDocument() { invalidateDocument = true; } public void invalidateAllIncludedDocuments(@NonNull final String includedTableName) { getIncludedDocument(includedTableName).invalidateAll(); } public void addIncludedDocument(@NonNull final String includedTableName, final int includedRecordId)...
public Collection<IncludedDocumentToInvalidate> getIncludedDocuments() { return includedDocumentsByTableName.values(); } DocumentToInvalidate combine(@NonNull final DocumentToInvalidate other) { Check.assumeEquals(this.recordRef, other.recordRef, "recordRef"); this.invalidateDocument = this.invalidateDocumen...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\window\invalidation\DocumentToInvalidate.java
1
请完成以下Java代码
private UOMConversionsMap retrieveProductConversions(@NonNull final ProductId productId) { final UomId productStockingUomId = Services.get(IProductBL.class).getStockUOMId(productId); final ImmutableList<UOMConversionRate> rates = Services.get(IQueryBL.class) .createQueryBuilderOutOfTrx(I_C_UOM_Conversion.clas...
@NonNull private static UOMConversionsMap buildUOMConversionsMap( @NonNull final ProductId productId, @NonNull final UomId productStockingUomId, @NonNull final ImmutableList<UOMConversionRate> rates) { return UOMConversionsMap.builder() .productId(productId) .hasRatesForNonStockingUOMs(!rates.isEmp...
repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\uom\impl\UOMConversionDAO.java
1
请在Spring Boot框架中完成以下Java代码
public ResponseEntity<?> saveUserProfile(UserPrincipal userPrincipal, UserProfile userProfileForm){ Optional<User> userDto = userRepository.findById(userPrincipal.getId()); User user = userDto.orElse(null); if(user !=null && user.getPhone().equals(userProfileForm.getPhone()) && userRepository.e...
} } public Boolean saveCity(UserPrincipal userPrincipal, String city){ Optional<User> userDto = userRepository.findById(userPrincipal.getId()); User user = userDto.orElse(null); if(user!= null) { user.setCity(city); userRepository.save(user); return t...
repos\SpringBoot-Projects-FullStack-master\Part-9.SpringBoot-React-Projects\Project-2.SpringBoot-React-ShoppingMall\fullstack\backend\src\main\java\com\urunov\service\UserService.java
2
请完成以下Java代码
public Shengmu getShengmu() { return shengmu; } /** * 获取韵母 * @return */ public Yunmu getYunmu() { return yunmu; } /** * 获取声调 * @return */ public int getTone() { return tone; } /** * 获取带音调的拼音 * @return */ ...
public String getHeadString() { return head.toString(); } /** * 获取输入法头 * @return */ public Head getHead() { return head; } /** * 获取首字母 * @return */ public char getFirstChar() { return firstChar; } }
repos\springboot-demo-master\hanlp\src\main\java\demo\hankcs\hanlp\dictionary\py\Pinyin.java
1
请在Spring Boot框架中完成以下Java代码
WebClientCustomizer webClientHttpConnectorCustomizer(ClientHttpConnector clientHttpConnector) { return (builder) -> builder.clientConnector(clientHttpConnector); } @Bean @ConditionalOnMissingBean(WebClientSsl.class) @ConditionalOnBean(SslBundles.class) AutoConfiguredWebClientSsl webClientSsl(ResourceLoader reso...
@Configuration(proxyBeanMethods = false) @ConditionalOnBean(CodecCustomizer.class) protected static class WebClientCodecsConfiguration { @Bean @ConditionalOnMissingBean @Order(0) WebClientCodecCustomizer exchangeStrategiesCustomizer(ObjectProvider<CodecCustomizer> codecCustomizers) { return new WebClientC...
repos\spring-boot-4.0.1\module\spring-boot-webclient\src\main\java\org\springframework\boot\webclient\autoconfigure\WebClientAutoConfiguration.java
2
请完成以下Java代码
public List<I_C_ReferenceNo_Type_Table> retrieveTableAssignments(I_C_ReferenceNo_Type type) { throw new UnsupportedOperationException(); } @Override public List<I_C_ReferenceNo_Doc> retrieveAllDocAssignments(Properties ctx, int referenceNoTypeId, int tableId, int recordId, String trxName) { throw new Unsuppor...
} @Override protected List<I_C_ReferenceNo_Doc> retrieveRefNoDocByRefNoAndTableName(final I_C_ReferenceNo referenceNo, final String tableName) { return lookupMap.getRecords(I_C_ReferenceNo_Doc.class, new IPOJOFilter<I_C_ReferenceNo_Doc>() { @Override public boolean accept(I_C_ReferenceNo_Doc pojo) { ...
repos\metasfresh-new_dawn_uat\backend\de.metas.document.refid\src\main\java\de\metas\document\refid\api\impl\PlainReferenceNoDAO.java
1
请在Spring Boot框架中完成以下Java代码
public class WikiDocumentsController { private final WikiDocumentsServiceImpl wikiDocumentsService; private final ChatClient chatClient; private final QuestionAnswerAdvisor questionAnswerAdvisor; public WikiDocumentsController(WikiDocumentsServiceImpl wikiDocumentsService, ...
} @GetMapping public List<WikiDocument> get(@RequestParam("searchText") String searchText) { return wikiDocumentsService.findSimilarDocuments(searchText); } @GetMapping("/search") public String getWikiAnswer(@RequestParam("question") String question) { return chatClient.prompt() ...
repos\tutorials-master\spring-ai-modules\spring-ai-3\src\main\java\com\baeldung\springai\rag\mongodb\controller\WikiDocumentsController.java
2
请完成以下Java代码
public String getTenantId() { return tenantId; } public void setTenantId(String tenantId) { this.tenantId = tenantId; } public int getSuspensionState() { return suspensionState; } public void setSuspensionState(int suspensionState) { this.suspensionState = suspensionState; }
public Integer getInstances() { return instances; } public void setInstances(Integer instances) { this.instances = instances; } public Integer getIncidents() { return incidents; } public void setIncidents(Integer incidents) { this.incidents = incidents; } }
repos\camunda-bpm-platform-master\webapps\assembly\src\main\java\org\camunda\bpm\cockpit\impl\plugin\base\dto\ProcessDefinitionStatisticsDto.java
1
请在Spring Boot框架中完成以下Java代码
protected Integer getDurableClientTimeout() { return this.durableClientTimeout != null ? this.durableClientTimeout : DEFAULT_DURABLE_CLIENT_TIMEOUT; } protected Boolean getKeepAlive() { return this.keepAlive != null ? this.keepAlive : DEFAULT_KEEP_ALIVE; } protected Boolean getReadyForEvents() {...
clientCacheFactoryBean.setDurableClientId(durableClientId); clientCacheFactoryBean.setDurableClientTimeout(getDurableClientTimeout()); clientCacheFactoryBean.setKeepAlive(getKeepAlive()); clientCacheFactoryBean.setReadyForEvents(getReadyForEvents()); }); } @Bean PeerCacheConfigurer peerCacheDurableClient...
repos\spring-boot-data-geode-main\spring-geode-project\spring-geode\src\main\java\org\springframework\geode\config\annotation\DurableClientConfiguration.java
2
请在Spring Boot框架中完成以下Java代码
public SecurityFilterChain authorizationServerSecurityFilterChain(HttpSecurity http) throws Exception { // @formatter:off http .oauth2AuthorizationServer(Customizer.withDefaults()) .authorizeHttpRequests((authorize) -> authorize.anyRequest().authenticated() ); // @formatter:on return http.build(); ...
jwtProcessor.setJWSKeySelector(jwsKeySelector); // Override the default Nimbus claims set verifier as NimbusJwtDecoder handles it // instead jwtProcessor.setJWTClaimsSetVerifier((claims, context) -> { }); return new NimbusJwtDecoder(jwtProcessor); } @Bean RegisterMissingBeanPostProcessor registerMissingBe...
repos\spring-security-main\config\src\main\java\org\springframework\security\config\annotation\web\configuration\OAuth2AuthorizationServerConfiguration.java
2
请在Spring Boot框架中完成以下Java代码
public class MultiSourceExAop implements Ordered { private Logger log = LoggerFactory.getLogger(this.getClass()); @Pointcut(value = "@annotation(com.xncoding.pos.common.annotion.DataSource)") private void cut() { } @Around("cut()") public Object around(ProceedingJoinPoint point) throws Throw...
log.debug("设置数据源为:dataSourceCore"); } try { return point.proceed(); } finally { log.debug("清空数据源信息!"); DataSourceContextHolder.clearDataSourceType(); } } /** * aop的顺序要早于spring的事务 */ @Override public int getOrder() { ...
repos\SpringBootBucket-master\springboot-multisource\src\main\java\com\xncoding\pos\common\aop\MultiSourceExAop.java
2