fluttercandies / JsonToDart

The tool to convert json to dart code, support Windows,Mac,Web.
MIT License
355 stars 42 forks source link

类重复生产 #3

Closed lzy2014love closed 4 years ago

lzy2014love commented 4 years ago
{
  "has_read_messages": [
    {
      "id": "543fb7abae523bbc80412b26",
      "type": "at",
      "has_read": false,
      "author": {
        "loginname": "alsotang",
        "avatar_url": "https://avatars.githubusercontent.com/u/1147375?v=2"
      },
      "topic": {
        "id": "542d6ecb9ecb3db94b2b3d0f",
        "title": "adfadfadfasdf",
        "last_reply_at": "2014-10-18T07:47:22.563Z"
      },
      "reply": {
        "id": "543fb7abae523bbc80412b24",
        "content": "[@alsotang](/user/alsotang) 哈哈",
        "ups": [],
        "create_at": "2014-10-16T12:18:51.566Z"
      }
    }
  ],
  "hasnot_read_messages": [
    {
      "id": "543fb7abae523bbc80412b26",
      "type": "at",
      "has_read": false,
      "author": {
        "loginname": "alsotang",
        "avatar_url": "https://avatars.githubusercontent.com/u/1147375?v=2"
      },
      "topic": {
        "id": "542d6ecb9ecb3db94b2b3d0f",
        "title": "adfadfadfasdf",
        "last_reply_at": "2014-10-18T07:47:22.563Z"
      },
      "reply": {
        "id": "543fb7abae523bbc80412b24",
        "content": "[@alsotang](/user/alsotang) 哈哈",
        "ups": [],
        "create_at": "2014-10-16T12:18:51.566Z"
      }
    }
  ]
}

这种json, topic, reply会重复生成

zmtzawqlp commented 4 years ago

靠代码无法知道你是不是同一类,所以没法判断。除非是一个数组对象。其他场景都没法进行判断,不能光凭名字或者参数就说明它是一个东西

zmtzawqlp commented 3 years ago

已支持