Skip to content

Commit

Permalink
#18 fix compile warning
Browse files Browse the repository at this point in the history
[INFO] Compiling 23 Scala sources to /Users/jcai/workspace/oss/scala-wechaty/wechaty-puppet/target/classes ...
[WARNING] /Users/jcai/workspace/oss/scala-wechaty/wechaty-puppet/src/main/scala/wechaty/puppet/ResourceBox.scala:9: imported `Puppet' is permanently hidden by definition of trait Puppet in package puppet
  • Loading branch information
jcai committed Jun 15, 2020
1 parent 8f5fd23 commit ae5e515
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import java.util.Base64

import javax.activation.MimeType
import org.apache.commons.io.IOUtils
import wechaty.puppet.schemas.Puppet
import wechaty.puppet.schemas.Puppet.objectMapper

/**
* wrap stream,support file stream and url stream
Expand All @@ -24,7 +24,7 @@ object ResourceBox {
new Base64ResourceBox(base64)
}
def fromJson(json: String): ResourceBox={
val root = Puppet.objectMapper.readTree(json)
val root = objectMapper.readTree(json)
val boxTypeInt = root.get("boxType").asInt()
val boxType = ResourceBoxType.apply(boxTypeInt)
boxType match{
Expand Down Expand Up @@ -66,7 +66,7 @@ object ResourceBox {
}

override def toJson(): String = {
val objectNode = Puppet.objectMapper.createObjectNode
val objectNode = objectMapper.createObjectNode
objectNode.put("name",url.substring(url.lastIndexOf("/")+1))
objectNode.put("boxType",ResourceBoxType.Url.id)
objectNode.put("remoteUrl",url)
Expand All @@ -83,7 +83,7 @@ object ResourceBox {
override def toBase64: String = base64

override def toJson(): String = {
val objectNode = Puppet.objectMapper.createObjectNode
val objectNode = objectMapper.createObjectNode
objectNode.put("boxType",ResourceBoxType.Url.id)
objectNode.put("base64",base64)
objectNode.toString
Expand Down

0 comments on commit ae5e515

Please sign in to comment.