Skip to content

Commit

Permalink
```优化MethodEntity序列化策略
Browse files Browse the repository at this point in the history
``
  • Loading branch information
“v_kkhuang” committed Jan 8, 2025
1 parent 9e600c3 commit bde8fd8
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package org.apache.linkis.storage.domain

import java.lang.reflect.Type

import com.google.gson.GsonBuilder
import com.google.gson.{GsonBuilder, ToNumberPolicy}

/**
* @param id
Expand Down Expand Up @@ -56,7 +56,10 @@ case class MethodEntity(

object MethodEntitySerializer {

val gson = new GsonBuilder().setDateFormat("yyyy-MM-dd'T'HH:mm:ssZ").create
val gson = new GsonBuilder()
.setDateFormat("yyyy-MM-dd'T'HH:mm:ssZ")
.setObjectToNumberStrategy(ToNumberPolicy.LAZILY_PARSED_NUMBER)
.create

/**
* Serialized to code as a MethodEntity object 序列化为code为MethodEntity对象
Expand Down

0 comments on commit bde8fd8

Please sign in to comment.