Git Product home page Git Product logo

Comments (2)

TommyLemon avatar TommyLemon commented on April 28, 2024

已经实现了,你的方式错了
User.id 和 Moment.praiseUserIdList 的关系是 id 在 praiseUserIdList 里面:

"id{}": praiseUserIdList 

因为 praiseUserIdList 的值是不确定的,可以通过 引用赋值 来从 Moment 中取:

"id{}@": "Moment/praiseUserIdList" // 按你上面的写法,[]里面都没有Moment,所以找不到

最终就是:

{
    "Moment": {},
    "[]": {
        "User": {
            "id{}@": "Moment/praiseUserIdList"
        }
    }
}

返回:

{
    "Moment": {
        "id": 12,
        "userId": 70793,
        "date": "2017-02-08 16:06:11.0",
        "content": "1111534034",
        "praiseUserIdList": [
            70793,
            38710
        ],
        "pictureList": [
            "http://static.oschina.net/uploads/img/201604/22172508_eGDi.jpg",
            "http://static.oschina.net/uploads/img/201604/22172507_rrZ5.jpg"
        ]
    },
    "[]": [
        {
            "User": {
                "id": 38710,
                "sex": 0,
                "name": "TommyLemon",
                "tag": "Android&Java",
                "head": "http://static.oschina.net/uploads/user/1218/2437072_100.jpg?t=1461076033000",
                "contactIdList": [
                    82003,
                    82005
                ],
                "pictureList": [
                    "http://static.oschina.net/uploads/user/1218/2437072_100.jpg?t=1461076033000",
                    "http://common.cnblogs.com/images/icon_weibo_24.png"
                ],
                "date": "2017-02-01 19:21:50.0"
            }
        },
        {
            "User": {
                "id": 70793,
                "sex": 0,
                "name": "Strong",
                "tag": "djdj",
                "head": "http://static.oschina.net/uploads/user/585/1170143_50.jpg?t=1390226446000",
                "contactIdList": [
                    38710,
                    82002
                ],
                "pictureList": [
                    "http://static.oschina.net/uploads/img/201604/22172508_eGDi.jpg",
                    "http://static.oschina.net/uploads/img/201604/22172507_rrZ5.jpg",
                    "https://camo.githubusercontent.com/788c0a7e11a",
                    "https://camo.githubusercontent.com/f513f67"
                ],
                "date": "2017-02-01 19:21:50.0"
            }
        }
    ],
    "code": 200,
    "msg": "success"
}

可以在 APIJSONAuto自动化接口管理工具 上测试:
http://apijson.org/

from apijson.

Jeffsyl01 avatar Jeffsyl01 commented on April 28, 2024

十分感谢

from apijson.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.