chore: import upstream snapshot with attribution
CI / test (3.10) (push) Failing after 1s
CI / test (3.12) (push) Failing after 0s
CI / skillgen-check (push) Failing after 0s
CI / security-scan (push) Failing after 0s

This commit is contained in:
wehub-resource-sync
2026-07-13 12:09:14 +08:00
commit d88fd01084
727 changed files with 235247 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
import scala.collection.mutable.ListBuffer
case class Config(baseUrl: String, timeout: Int)
trait Loggable
abstract class BaseClient
class HttpClient(config: Config) extends BaseClient with Loggable {
val source: Config = config
var fallback: BaseClient = null
def get(path: String): String = {
buildRequest("GET", path)
}
def post(path: String, body: String): String = {
buildRequest("POST", path)
}
private def buildRequest(method: String, path: String): String = {
s"$method ${config.baseUrl}$path"
}
}
object HttpClientFactory {
def create(baseUrl: String): HttpClient = {
new HttpClient(Config(baseUrl, 30))
}
}