中文

Supports

Home/Sevices/Supports/

获取有权限的项目

此接口用于获取Access Token下有权限的项目列表。

请求头参数

需要放到http请求头(Headers)里的参数,通常为token。

 Header参数             类型             是否必填             示例             描述            
cookie             String             是             generator=eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiI0ODM5NzA5MTgxMjE0NzIwMDAiLCJzeXN0ZW1JZCI6MzMzMjE4NTQ1MTU4OTc5NTg0L             将access token写入到cookie中,用于网关校验。            

请求参数

无

示例代码

 请求方式 :POST

 请求地址 :https://api.njgn.com/api/new_project/select_all_project_by_user_new

public static String getAllProject(){    // 接口请求地址
    String url = "https://api.njgn.com/api/new_project/select_all_project_by_user_new";    // 获取的AccessToken组装成cookie
    String cookie = "generator=eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiI0ODM5NzA5MTgxMjE0NzIwMDAiLCJzeXN0ZW1JZCI6MzMzMjE4NTQ1MTU4OTc5NTg0LCJlbnYiOiJ0ZXN0IiwidHlwZSI6ImdlbmVyYXRpb24iLCJleHAiOjQ3NTEyMjc3MjQsInZlcnNpb24iOiIxLjAiLCJpYXQiOjE1OTU1NTQxMjR9.wTbTICUpp9siuILzSaUYWWoE9dn_Runpa1lURSk2WRY";    // 不需要请求参数
    Map < String, String > requestParam = new HashMap < > ();    // 请求头的参数
    Map < String, String > headerMap = new HashMap < > ();
    headerMap.put("cookie", cookie);    // 调用提供的HttpUtil库,result即为本次调用的结果
    String result = HttpUtil.post(url, requestParam, headerMap);    return result;
}

返回示例

{
    "result": [
        {
            "id": "524",
            "createTime": 1571814859366,
            "updateTime": 1597822906349,
            "name": "for_test",
            "longitude": "116.6096571147707",
            "latitude": "39.85846392246292",
            "comment": "",
            "country": "",
            "province": "北京市",
            "city": "北京市"
        }
    ],
    "op": true,
    "message": "OK"
}
参数名称             类型             描述            
op             boolean             标识调用是否成功            
message             String             调用失败时返回错误信息            
result.id             String             项目唯一id            
result.createTime             long             项目创建时间            
result.updateTime             long             项目更新时间            
result.name             String             项目的名称            
result.longitude             String             项目位置-经度            
result.latitude             String             项目位置-纬度            
result.comment             String             备注            
result.country             String             项目所在的国家            
result.province             String             项目所在的省份/直辖市            
result.city             String             项目所在的城市/区县            


logo

Reaching the Nature, Discovering the World
Reverence for heaven and earth, concern for people and safety
For that tranquil landscape
We are always on the road
Follow Us:
Follow Us
Preview

Address

China Jiangsu
9th Floor, Building 34, Shanggu Center, No. 2 Junlan Road, Gulou District, Nanjing
+86 25 84443850
Mon-Sun 8:00 am- 18:00 pm