Json=>Class
直通车=o=o=o=o>
demo
1.json数据:
- demo
- 1.json数据:
- 2.使用
{
"code":"000000",
"message":"请求成功",
"data":{
"page":{
"total":4,
"size":6
},
"content":[
{
"id":50,
"type":"TRANSLATE",
"businessType":"中俄互译",
"businessTypeId":null,
"title":"我需要一个会俄语的翻译人员",
"content":"我需要一个会俄语的翻译人员",
"name":"律师3",
"area":"山东省",
"country":"俄罗斯",
"countryId":null,
"province":null,
"provinceId":null,
"urgentStatus":"NORMAL",
"createTime":"2021-01-05"
},
{
"id":49,
"type":"OTHER",
"businessType":"其他",
"businessTypeId":null,
"title":"需求科技企业技术人才",
"content":"需求科技企业技术人才",
"name":"律师3",
"area":"山东省",
"country":"中国",
"countryId":null,
"province":"北京市",
"provinceId":null,
"urgentStatus":"EMERGENCY",
"createTime":"2021-01-02"
},
{
"id":46,
"type":"LAW",
"businessType":"海商海事",
"businessTypeId":null,
"title":"青岛海事海商需求",
"content":"青岛海事海商需求22",
"name":"律师3",
"area":"山东省",
"country":"中国",
"countryId":null,
"province":"山东省",
"provinceId":null,
"urgentStatus":"NORMAL",
"createTime":"2020-12-30"
},
{
"id":23,
"type":"LAW",
"businessType":"合同事务",
"businessTypeId":null,
"title":"机动车肇事逃逸法律援助需求",
"content":"机动车肇事逃逸法律援助需求",
"name":"青栞",
"area":"山东省",
"country":"中国",
"countryId":null,
"province":null,
"provinceId":null,
"urgentStatus":"EMERGENCY",
"createTime":"2020-12-14"
}
],
"empty":false
}
}
2.使用
把上面的json
填入软件中,配置后点击Generate
即可生成类文件。 使用上述配置生成的类文件如下所示
// Generated by Xamasoft JSON Class Generator
// http://www.xamasoft.com/json-class-generator
using System;
using System.Collections.Generic;
using Newtonsoft.Json.Linq;
namespace ZYF
{
public class Page
{
///
/// Examples: 4
///
public int total;
///
/// Examples: 6
///
public int size;
}
public class Content
{
///
/// Examples: 50, 49, 46, 23
///
public int id;
///
/// Examples: "TRANSLATE", "OTHER", "LAW"
///
public string type;
///
/// Examples: "中俄互译", "其他", "海商海事", "合同事务"
///
public string businessType;
///
/// Examples: null
///
public object businessTypeId;
///
/// Examples: "我需要一个会俄语的翻译人员", "需求科技企业技术人才", "青岛海事海商需求", "机动车肇事逃逸法律援助需求"
///
public string title;
///
/// Examples: "我需要一个会俄语的翻译人员", "需求科技企业技术人才", "青岛海事海商需求22", "机动车肇事逃逸法律援助需求"
///
public string content;
///
/// Examples: "律师3", "青栞"
///
public string name;
///
/// Examples: "山东省"
///
public string area;
///
/// Examples: "俄罗斯", "中国"
///
public string country;
///
/// Examples: null
///
public object countryId;
///
/// Examples: null, "北京市", "山东省"
///
public string province;
///
/// Examples: null
///
public object provinceId;
///
/// Examples: "NORMAL", "EMERGENCY"
///
public string urgentStatus;
///
/// Examples: "2021-01-05", "2021-01-02", "2020-12-30", "2020-12-14"
///
public string createTime;
}
public class Data
{
///
/// Examples: {"total":4,"size":6}
///
public Page page;
///
/// Examples: [{"id":50,"type":"TRANSLATE","businessType":"中俄互译","businessTypeId":null,"title":"我需要一个会俄语的翻译人员","content":"我需要一个会俄语的翻译人员","name":"律师3","area":"山东省","country":"俄罗斯","countryId":null,"province":null,"provinceId":null,"urgentStatus":"NORMAL","createTime":"2021-01-05"},{"id":49,"type":"OTHER","businessType":"其他","businessTypeId":null,"title":"需求科技企业技术人才","content":"需求科技企业技术人才","name":"律师3","area":"山东省","country":"中国","countryId":null,"province":"北京市","provinceId":null,"urgentStatus":"EMERGENCY","createTime":"2021-01-02"},{"id":46,"type":"LAW","businessType":"海商海事","businessTypeId":null,"title":"青岛海事海商需求","content":"青岛海事海商需求22","name":"律师3","area":"山东省","country":"中国","countryId":null,"province":"山东省","provinceId":null,"urgentStatus":"NORMAL","createTime":"2020-12-30"},{"id":23,"type":"LAW","businessType":"合同事务","businessTypeId":null,"title":"机动车肇事逃逸法律援助需求","content":"机动车肇事逃逸法律援助需求","name":"青栞","area":"山东省","country":"中国","countryId":null,"province":null,"provinceId":null,"urgentStatus":"EMERGENCY","createTime":"2020-12-14"}]
///
public IList content;
///
/// Examples: false
///
public bool empty;
}
public class Result
{
///
/// Examples: "000000"
///
public string code;
///
/// Examples: "请求成功"
///
public string message;
///
/// Examples: {"page":{"total":4,"size":6},"content":[{"id":50,"type":"TRANSLATE","businessType":"中俄互译","businessTypeId":null,"title":"我需要一个会俄语的翻译人员","content":"我需要一个会俄语的翻译人员","name":"律师3","area":"山东省","country":"俄罗斯","countryId":null,"province":null,"provinceId":null,"urgentStatus":"NORMAL","createTime":"2021-01-05"},{"id":49,"type":"OTHER","businessType":"其他","businessTypeId":null,"title":"需求科技企业技术人才","content":"需求科技企业技术人才","name":"律师3","area":"山东省","country":"中国","countryId":null,"province":"北京市","provinceId":null,"urgentStatus":"EMERGENCY","createTime":"2021-01-02"},{"id":46,"type":"LAW","businessType":"海商海事","businessTypeId":null,"title":"青岛海事海商需求","content":"青岛海事海商需求22","name":"律师3","area":"山东省","country":"中国","countryId":null,"province":"山东省","provinceId":null,"urgentStatus":"NORMAL","createTime":"2020-12-30"},{"id":23,"type":"LAW","businessType":"合同事务","businessTypeId":null,"title":"机动车肇事逃逸法律援助需求","content":"机动车肇事逃逸法律援助需求","name":"青栞","area":"山东省","country":"中国","countryId":null,"province":null,"provinceId":null,"urgentStatus":"EMERGENCY","createTime":"2020-12-14"}],"empty":false}
///
public Data data;
}
}