新增添加录制计划接口

This commit is contained in:
648540858
2024-11-20 18:37:39 +08:00
parent 8b88a5e034
commit 2dcbee74b0
6 changed files with 99 additions and 19 deletions

View File

@@ -17,7 +17,7 @@ public class ChannelProvider {
" stream_proxy_id,\n" +
" create_time,\n" +
" update_time,\n" +
" record_plan,\n" +
" record_plan_id,\n" +
" coalesce(gb_device_id, device_id) as gb_device_id,\n" +
" coalesce(gb_name, name) as gb_name,\n" +
" coalesce(gb_manufacturer, manufacturer) as gb_manufacturer,\n" +
@@ -198,8 +198,8 @@ public class ChannelProvider {
if (params.get("online") != null && !(Boolean)params.get("online")) {
sqlBuild.append(" AND coalesce(gb_status, status) = 'OFF'");
}
if (params.get("hasRecordPlan") != null && !(Boolean)params.get("hasRecordPlan")) {
sqlBuild.append(" AND record_plan == 0");
if (params.get("hasRecordPlan") != null && (Boolean)params.get("hasRecordPlan")) {
sqlBuild.append(" AND record_plan_id > 0");
}
if (params.get("channelType") != null) {

View File

@@ -1,9 +1,17 @@
package com.genersoft.iot.vmp.vmanager.recordPlan;
import com.genersoft.iot.vmp.conf.exception.ControllerException;
import com.genersoft.iot.vmp.conf.security.JwtUtils;
import com.genersoft.iot.vmp.service.bean.RecordPlan;
import com.genersoft.iot.vmp.vmanager.bean.ErrorCode;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@Tag(name = "录制计划")
@Slf4j
@@ -11,5 +19,20 @@ import org.springframework.web.bind.annotation.RestController;
@RequestMapping("/api/record/plan")
public class RecordPlanController {
@ResponseBody
@PostMapping("/add")
@Operation(summary = "添加录制计划", security = @SecurityRequirement(name = JwtUtils.HEADER))
@Parameter(name = "channelId", description = "通道ID", required = true)
@Parameter(name = "deviceDbId", description = "国标设备ID", required = true)
@Parameter(name = "planList", description = "录制计划, 为空则清空计划", required = false)
public void openRtpServer(@RequestParam(required = false) Integer channelId, @RequestParam(required = false) Integer deviceDbId, @RequestParam(required = false) List<RecordPlan> planList
) {
if (channelId == null && deviceDbId == null) {
throw new ControllerException(ErrorCode.ERROR100.getCode(), "通道ID和国标设备ID不可都为NULL");
}
}
}