diff --git a/README.md b/README.md index 910bdf6..d2bd3b9 100644 --- a/README.md +++ b/README.md @@ -323,6 +323,10 @@ We decided to use Kotlin to develop the Java Wechaty! - [Java Wechaty](https://github.com/wechaty/java-wechaty) - Java WeChaty Conversational AI Chatbot SDK for Wechat Individual Accounts (Java) - [Scala Wechaty](https://github.com/wechaty/scala-wechaty) - Scala WeChaty Conversational AI Chatbot SDK for WechatyIndividual Accounts (Scala) +## Stargazers over time + +[![Stargazers over time](https://starchart.cc/wechaty/java-wechaty.svg)](https://starchart.cc/wechaty/java-wechaty) + ## Badge [![Wechaty in Kotlin](https://img.shields.io/badge/Wechaty-Kotlin-orange)](https://github.com/wechaty/java-wechaty) diff --git a/pom.xml b/pom.xml index 59edf86..05f8401 100644 --- a/pom.xml +++ b/pom.xml @@ -180,6 +180,25 @@ + + org.codehaus.mojo + build-helper-maven-plugin + 3.0.0 + + + + generate-sources + + add-source + + + + src/main/kotlin + + + + + diff --git a/wechaty-puppet/src/main/kotlin/io/github/wechaty/filebox/FileBox.kt b/wechaty-puppet/src/main/kotlin/io/github/wechaty/filebox/FileBox.kt index 31f9857..904e8ef 100644 --- a/wechaty-puppet/src/main/kotlin/io/github/wechaty/filebox/FileBox.kt +++ b/wechaty-puppet/src/main/kotlin/io/github/wechaty/filebox/FileBox.kt @@ -138,13 +138,13 @@ class FileBox(options: FileBoxOptions) { } fun toJsonString(): String { - buffer = toByte(this) + buffer = getBufferByte(this) return JsonUtils.write(this) } - fun toByte(fileBox: FileBox): ByteArray? { + private fun getBufferByte(fileBox: FileBox): ByteArray? { when (fileBox.type()) { FileBoxType.File -> { @@ -153,11 +153,12 @@ class FileBox(options: FileBoxOptions) { return FileUtils.readFileToByteArray(file) } - FileBoxType.Url -> { return null; } - + FileBoxType.Base64 -> { + return null; + } else -> { TODO() }