liurunyu
2025-08-14 00cf6de9f5e3152b6afb73f276dd27dfaf3de439
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
package com.dy.pipIrrWechat.remote;
 
import com.dy.common.webUtil.BaseResponse;
import com.dy.common.webUtil.BaseResponseUtils;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
 
/**
 * 微信端远程视频接口
 * 提供微信小程序调用远程控制模块video接口
 * 
 * @author zuoxiao
 * @date 2025-01-21
 * @description 微信端远程视频功能控制器
 */
@Slf4j
@Tag(name = "微信远程视频", description = "微信端调用远程控制模块的video接口")
@RestController
@RequestMapping(path = "remote")
@RequiredArgsConstructor
public class RemoteCtrl {
 
    private final RemoteService remoteService;
 
    /**
     * 获取视频监控数据
     * 
     * @param pageCurr 当前页码
     * @param pageSize 每页大小
     * @return 视频监控数据
     */
    @Operation(summary = "获取视频监控数据", description = "微信端调用远程控制模块获取摄像机数据")
    @GetMapping(path = "video/some")
    public BaseResponse<Object> getVideoSome(
            @RequestParam(defaultValue = "1") Integer pageCurr,
            @RequestParam(required = false) Integer pageSize) {
        try {
            log.info("微信端请求视频监控数据: pageCurr={}, pageSize={}", pageCurr, pageSize);
            
            // 构建查询参数
            StringBuilder queryParams = new StringBuilder();
            queryParams.append("pageCurr=").append(pageCurr);
            if (pageSize != null) {
                queryParams.append("&pageSize=").append(pageSize);
            }
            
            // 调用远程服务
            BaseResponse<Object> result = remoteService.getVideoSome(queryParams.toString());
            
            log.info("视频监控数据查询结果: {}", result);
            return result;
            
        } catch (Exception e) {
            log.error("微信端视频监控数据查询异常", e);
            return BaseResponseUtils.buildException("视频监控数据查询失败: " + e.getMessage());
        }
    }