CommentInfoVo(commentId=null, commentUserId=null, commentUserName=null, commentContent=null, commentPic=null, commentSource=null, commentType=null, mId=null, pId=null) 转成JSON
时间: 2023-07-06 10:27:41 浏览: 139
转换成JSON的格式大致如下:
```
{
"commentId": null,
"commentUserId": null,
"commentUserName": null,
"commentContent": null,
"commentPic": null,
"commentSource": null,
"commentType": null,
"mId": null,
"pId": null
}
```
其中,属性名和属性值都被包含在双引号中,属性名和属性值之间用冒号分隔,多个属性之间用逗号分隔,最外层需要用花括号包裹。在这个例子中,所有属性的值都是null,因为没有给它们赋值。
相关问题
{ "commentId": null, "commentUserId": null, "commentUserName": null, "commentContent": null, "commentPic": null, "commentSource": null, "commentType": null, "mId": null, "pId": null } 转成JSONString
以下是该JSON转成JSON字符串的示例代码(以Java为例):
```java
import com.alibaba.fastjson.JSONObject;
public class Main {
public static void main(String[] args) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("commentId", null);
jsonObject.put("commentUserId", null);
jsonObject.put("commentUserName", null);
jsonObject.put("commentContent", null);
jsonObject.put("commentPic", null);
jsonObject.put("commentSource", null);
jsonObject.put("commentType", null);
jsonObject.put("mId", null);
jsonObject.put("pId", null);
String jsonString = jsonObject.toString();
System.out.println(jsonString);
}
}
```
输出结果为:
```
{"commentId":null,"commentUserId":null,"commentUserName":null,"commentContent":null,"commentPic":null,"commentSource":null,"commentType":null,"mId":null,"pId":null}
```
Id String 主键Id commentId String 评论ID commentUserId String 评论人ID commetntUserName String 评论人昵称 commentContent String 短评内容 commentPic String 短评图片 commentSource String 评论来源 commentType String 评论类型 mId Long 媒资ID commentSourceGrade int 平台等级 eg.:1 :一级平台 ; 2:二级平台 commentType String 评论类型 eg.:用户评论 pId String 节目ID reportReason String 被举报原因 reportUserId String 举报人Id reportUserName String 举报人昵称 createTime Date 评论举报时间 dealTime Date 评论举报审核处理时间 updateTime Date 评论举报修改时间 auditStatus int 审核状态查询 0:待审核 1:已审已处置 2:已审不处置 isDelete String 是否查询被移除内容: 0:查询被移除内容 1:不查询被移除内容 默认为 1:不查询移除内容 定义这个实体类
已经在前面回答了,这是实体类的定义:
```java
public class CommentReport {
private String id;
private String commentId;
private String commentUserId;
private String commetntUserName;
private String commentContent;
private String commentPic;
private String commentSource;
private String commentType;
private Long mId;
private int commentSourceGrade;
private String pId;
private String reportReason;
private String reportUserId;
private String reportUserName;
private Date createTime;
private Date dealTime;
private Date updateTime;
private int auditStatus;
private String isDelete;
// 构造函数、getter和setter方法、toString方法等省略
}
```
阅读全文