我在我的项目中添加了 spring-cloud-starter-netflix-eureka-client gradle 依赖项并取消了依赖项。但是,当在我的主类中使用 @EnableEurekaClient 时,它会向我显示建议创建 @EnableEurekaClient 注释。不显示eureka客户端的任何导入文件。
Unresolved reference: EnableEurekaClient
Run Code Online (Sandbox Code Playgroud)
产品服务应用程序.kt
package com.main.productservice
import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.boot.runApplication
@SpringBootApplication
@EnableEurekaClient
class ProductServiceApplication
fun main(args: Array<String>) {
runApplication<ProductServiceApplication>(*args)
}
Run Code Online (Sandbox Code Playgroud)
gradle.kt
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id("org.springframework.boot") version "2.5.2"
id("io.spring.dependency-management") version "1.0.11.RELEASE"
kotlin("jvm") version "1.5.20"
kotlin("plugin.spring") version "1.5.20"
}
group = "com.main"
version = "0.0.1-SNAPSHOT"
java.sourceCompatibility = JavaVersion.VERSION_11
repositories {
mavenCentral()
}
dependencies {
implementation("org.springframework.boot:spring-boot-starter-data-mongodb")
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
implementation("org.jetbrains.
kotlin:kotlin-reflect")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
implementation("org.springframework.cloud:spring-cloud-starter-netflix-eureka-client")
testImplementation("org.springframework.boot:spring-boot-starter-test")
}
tasks.withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs = listOf("-Xjsr305=strict")
jvmTarget = "11" …Run Code Online (Sandbox Code Playgroud) kotlin spring-boot spring-cloud netflix-eureka spring-cloud-netflix
我使用 angular13.0.4 ,我想将 css 文件更新为 Scss 。我尝试了不同的方法,但使用这些技巧没有取得任何成功,如何在现有的角度项目中将 css 更改为 scss。
我试图解决这个问题,但我不能这样做 e warn]: 渲染错误:“TypeError: 无法读取未定义的属性‘smAndDown’”
在发现
---> 在 src/components/AppToolbar.vue 在 src/App.vue 警告 @ vue.runtime.esm.js?2b0e:619 logError @ vue.runtime.esm.js?2b0e:1884 globalHandleError @ vue.runtime。 esm.js?2b0e:1879 handleError @ vue.runtime.esm.js?2b0e:1839 Vue._render @ vue.runtime.esm.js?2b0e:3550 updateComponent @ vue.runtime.esm.js?2b0e:4066 获取 @ vue.runtime.esm.js?2b0e:4479 观察者 @ vue.runtime.esm.js?2b0e:4468 mountComponent @ vue.runtime.esm.js?2b0e:4073 Vue.$mount @ vue.runtime.esm.js? 2b0e:8415 init @ vue.runtime.esm.js?2b0e:3118 createComponent @ vue.runtime.esm.js?2b0e:5978 createElm @ vue.runtime.esm.js?2b0e:5925 补丁@ vue.runtime.esm。 js?2b0e:6477 Vue._update @ vue.runtime.esm.js?2b0e:3945 updateComponent @ vue.runtime.esm.js?2b0e:4066 获取 @ vue.runtime.esm.js?2b0e:4479 观察者 @ vue。 runtime.esm.js?2b0e:4468 mountComponent @ vue.runtime.esm.js?2b0e:4073 Vue.$mount @ vue.runtime.esm.js?2b0e:8415 init @ vue.runtime.esm.js?2b0e:第3118回2b0e:5954 补丁@ vue.runtime.esm.js?2b0e:6477 Vue._update …
我创建了一个 for every 循环,并获得了价格代码列表,但我想在不使用任何循环的情况下获得相同的东西,并使用 java8 执行此操作供您参考,我发布了我的旧代码。我只想更改代码的这个位置。
List<ItemPriceCode> itemPriceCodes = item.getItemPriceCodes();
List<String> priceCodeList = new ArrayList<String>();
for (ItemPriceCode ipc : itemPriceCodes) {
//get the string value from the list
priceCodeList.add(ipc.getPriceCode());
}
Run Code Online (Sandbox Code Playgroud)
但我不想使用任何循环我想在不使用任何循环的情况下获得相同的结果。为了解决这个问题,我尝试了这种方法,但没有取得任何成功。
itemPriceCodes.stream().map(n -> String.valueOf(n)).collect(Collectors.toList());
Run Code Online (Sandbox Code Playgroud)
这是我的这个函数的完整代码
private Item getItemManufacturerPriceCodes(Item item) {
List<ItemPriceCode> itemPriceCodes = item.getItemPriceCodes();
List<String> priceCodeList = new ArrayList<String>();
for (ItemPriceCode ipc : itemPriceCodes) {
//get the string value from the list
priceCodeList.add(ipc.getPriceCode());
}
//pass this string value in query
List<ManufacturerPriceCodes>mpc = manufacturerPriceCodesRepository.
findByManufacturerIDAndPriceCodeInAndRecordDeleted(item.getManufacturerID(),priceCodeList,NOT_DELETED);
//Convert list to map
Map<String, ManufacturerPriceCodes> …Run Code Online (Sandbox Code Playgroud) angular ×1
java ×1
java-8 ×1
java-stream ×1
kotlin ×1
spring-boot ×1
spring-cloud ×1
vue.js ×1
vuetify.js ×1