mobile CCTV,mobile surveillance,police body worn cameras

 forgetPW
 registerNow
search
12NextPage
backToList newPost
view: 1011|reply: 17
打印 prevThread nextThread

设备文件检索接口对接报错 登录接口可以调通 是我哪块配置有问题吗

[copyURL]

3

主题

12

帖子

33

积分

newBie

Rank: 1

积分
33
jumpTo
owner
poston 2022-9-5 09:53 | authorOnly 回帖奖励 |倒序浏览 |阅读模式

reply

使用道具 report

60

主题

1413

帖子

5805

积分

Moderator

Rank: 7Rank: 7Rank: 7

积分
5805
sofa
poston 2022-9-5 10:02 | authorOnly
请详细描述,给出具体的代码和问题。
reply agree Against

使用道具 report

3

主题

12

帖子

33

积分

newBie

Rank: 1

积分
33
bench
 Owner| poston 2022-9-5 10:36 | authorOnly
接口代码: @RequestMapping("/sendHttps")
    public void sendHttps() throws ParseException {
        Map<String,String> map=new HashMap<>();
        map.put("page","1");
        map.put("pageSize","10");
        Map<String,Object> map1=new HashMap<>();
        SimpleDateFormat  sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String str="2022-09-02 12:00:00";
        Date startTime=sdf.parse(str);
        Long beginTime=startTime.getTime();
        Long endTime=System.currentTimeMillis();
        map1.put("beginTime",beginTime);
        map1.put("endTime",endTime);
        map1.put("puID","UA_2644F61C");
        map.put("filter",map1.toString());
        doPost("https://localhost:9781/bvcsp/v1/pu/recordfile/filter/:UA_2644F61C",map,"utf8");

    }

    public String doPost(String url, Map<String, String> map, String charset) {
        HttpClient httpClient = null;
        HttpPost httpPost = null;
        String result = null;
        try {
            httpClient = new SSLClient();
            httpPost = new HttpPost(url);
            httpPost.setHeader("Content-Type","application/json");
            httpPost.setHeader("Authorization","Y3UrQ1VfYWRtaW4rYWRtaW4rMjYrMjc4NTExKzE2NjIzMzg2NTcrYnZodHRwY21kZjgwNzRmZGMzZTI4YzE4YQ");
            //设置参数
            List<NameValuePair> list = new ArrayList<NameValuePair>();
            Iterator iterator = map.entrySet().iterator();
            while (iterator.hasNext()) {
                Map.Entry<String, String> elem = (Map.Entry<String, String>) iterator.next();
                list.add(new BasicNameValuePair(elem.getKey(), elem.getValue()));
            }
            if (list.size() > 0) {
                UrlEncodedFormEntity entity = new UrlEncodedFormEntity(list, charset);
                httpPost.setEntity(entity);
            }
            HttpResponse response = httpClient.execute(httpPost);
            if (response != null) {
                HttpEntity resEntity = response.getEntity();
                if (resEntity != null) {
                    result = EntityUtils.toString(resEntity, charset);
                }
            }
        } catch (Exception ex) {
            ex.printStackTrace();
        }
        System.out.println(result);
        return result;
    }

报错信息: {"code":4,"msg":"invalid character 'i' in literal false (expecting 'a')"}
reply agree Against

使用道具 report

3

主题

12

帖子

33

积分

newBie

Rank: 1

积分
33
ground
 Owner| poston 2022-9-5 11:24 | authorOnly
besovideo post on2022-9-5 10:02
请详细描述,给出具体的代码和问题。

我用postman测试又报这个错误   {"code":10,"msg":"device offline"}  
reply agree Against

使用道具 report

10

主题

531

帖子

2431

积分

admin

Rank: 9Rank: 9Rank: 9

积分
2431
5#
poston 2022-9-5 11:56 | authorOnly
平台提供的http接口,但是前端目前还不支持接入。
reply agree Against

使用道具 report

1

主题

580

帖子

2001

积分

vipMem

Rank: 6Rank: 6

积分
2001
6#
poston 2022-9-5 12:10 | authorOnly
huayi post on2022-9-5 11:24
我用postman测试又报这个错误   {"code":10,"msg":"device offline"}

https://localhost:9781/bvcsp/v1/pu/recordfile/filter/:UA_2644F61C
改成:https://localhost:9781/bvcsp/v1/pu/recordfile/filter/UA_2644F61C 试试。
api路径中的:表示这里是路径参数,真实请求的路径中不要有,要是真实的参数。
reply agree Against

使用道具 report

3

主题

12

帖子

33

积分

newBie

Rank: 1

积分
33
7#
 Owner| poston 2022-9-5 14:02 | authorOnly
fanghj90 post on2022-9-5 12:10
https://localhost:9781/bvcsp/v1/pu/recordfile/filter/:UA_2644F61C
改成:https://localhost:9781/bv ...

我改成   https://localhost:9781/bvcsp/v1/pu/recordfile/filter/UA_2644F61C  还是不行 现在不是路径的问题 是我根本就访问不过去  我用postman测试 报{
    "code": 10,
    "msg": "device offline"
}

我看报错码  这是 Forbidden = 10;  // 拒绝请求,服务器繁忙  我重启电脑 也没用 但是我请求登录接口一直是ok的
reply agree Against

使用道具 report

1

主题

580

帖子

2001

积分

vipMem

Rank: 6Rank: 6

积分
2001
8#
poston 2022-9-5 16:10 | authorOnly
huayi post on2022-9-5 14:02
我改成   https://localhost:9781/bvcsp/v1/pu/recordfile/filter/UA_2644F61C  还是不行 现在不是路径的 ...

UA_2644F61C是否在线?
后台管理->历史记录->媒体数据  中检索这个设备文件试试
reply agree Against

使用道具 report

0

主题

54

帖子

226

积分

midMem

Rank: 3Rank: 3

积分
226
9#
poston 2022-9-5 16:16 | authorOnly
查询设备文件时,设备要在线
reply agree Against

使用道具 report

3

主题

12

帖子

33

积分

newBie

Rank: 1

积分
33
10#
 Owner| poston 2022-9-5 16:27 | authorOnly
dingjian post on2022-9-5 16:16
查询设备文件时,设备要在线

没用的  还是这个错

reply agree Against

使用道具 report

creditRule

QQ|wireless surveillance

GMT+8, 2024-5-3 04:05 , Processed in 0.173834 second(s), 20 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

QuickReply backToTop BackToList