Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix compatibility issues in compatibility verification #1117

Merged
merged 1 commit into from
Mar 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import com.itangcent.idea.plugin.api.export.condition.ConditionOnSimple
import com.itangcent.idea.plugin.api.export.core.*
import com.itangcent.idea.plugin.api.export.spring.SpringRequestClassExporter
import com.itangcent.idea.plugin.condition.ConditionOnSetting
import org.apache.commons.lang.StringUtils.lowerCase

/**
* Support export apis from client that annotated with @FeignClient
Expand Down Expand Up @@ -104,7 +103,7 @@ open class FeignRequestClassExporter : SpringRequestClassExporter() {
val name = it.first
val value = it.second.trim()
if (name.equalIgnoreCase("content-type")) {
if (lowerCase(value).contains("application/json")) {
if (value.lowercase().contains("application/json")) {
methodExportContext.setExt("paramType", "body")
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ import com.intellij.util.io.createDirectories
import com.intellij.util.io.readText
import com.itangcent.intellij.context.ActionContext
import java.io.IOException
import java.nio.charset.StandardCharsets
import java.nio.file.Files
import java.nio.file.Path
import java.nio.file.Paths
import kotlin.io.path.readText
import kotlin.io.path.writeText

/**
Expand Down Expand Up @@ -67,7 +69,7 @@ class HttpClientFileSaver {
val file = scratchesPath.resolve(module).resolve(fileName).apply {
parent.createDirectories()
}
file.writeText(content(file.takeIf { Files.exists(it) }?.readText()))
file.writeText(content(file.takeIf { Files.exists(it) }?.readText(StandardCharsets.UTF_8)))

return (localFileSystem.refreshAndFindFileByPath(file.toString())
?: throw IOException("Unable to find file: $file"))
Expand Down
Loading