refactor: 替换net.sf.json为fastJson

This commit is contained in:
禾几海
2020-08-15 14:59:45 +08:00
parent 47e5030f52
commit d46dada23a
6 changed files with 42 additions and 44 deletions

View File

@@ -1,8 +1,9 @@
package cn.celess.blog.entity;
import cn.celess.blog.enmu.ResponseEnum;
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.Data;
import net.sf.json.JSONObject;
import lombok.SneakyThrows;
import java.io.Serializable;
@@ -56,9 +57,9 @@ public class Response<T> implements Serializable {
return new Response(r.getCode(), r.getMsg(), result);
}
@SneakyThrows
@Override
public String toString() {
JSONObject jsonObject = JSONObject.fromObject(this);
return jsonObject.toString();
return new ObjectMapper().writeValueAsString(this);
}
}