根据设备编码(21位) 国标设备id(20位) 查询指定设备信息

This commit is contained in:
shikong 2023-09-07 16:58:20 +08:00
parent d4ae48d963
commit cd43cc9fa8
2 changed files with 18 additions and 4 deletions

View File

@ -18,9 +18,8 @@ import org.springdoc.core.annotations.ParameterObject;
import org.springdoc.core.models.GroupedOpenApi;
import org.springframework.context.annotation.Bean;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
@Slf4j
@Tag(name = "设备信息")
@RestController
@ -40,8 +39,23 @@ public class DeviceController {
return JsonResponse.success(PageWrapper.of(deviceService.getDevicesWithPage(dto.getPage(), dto.getSize())));
}
@Operation(summary = "添加设备")
@PostJson("/add")
public JsonResponse<Boolean> addDevice(@RequestBody AddDeviceDTO dto) {
return JsonResponse.success(deviceService.addDevice(DeviceDTOConvertor.INSTANCE.dto2dao(dto)));
}
@Operation(summary = "根据设备编码(21位) 查询指定设备信息")
@GetJson("/info/deviceCode")
public JsonResponse<WvpProxyDevice> infoByDeviceCode(@RequestParam String deviceCode) {
WvpProxyDevice wvpProxyDevice = deviceService.getDeviceByDeviceCode(deviceCode).orElse(null);
return JsonResponse.success(wvpProxyDevice);
}
@Operation(summary = "根据国标id(20位) 查询指定设备信息")
@GetJson("/info/gbDeviceId")
public JsonResponse<WvpProxyDevice> infoByGbDeviceId(@RequestParam String gbDeviceId) {
WvpProxyDevice wvpProxyDevice = deviceService.getDeviceByGbDeviceId(gbDeviceId).orElse(null);
return JsonResponse.success(wvpProxyDevice);
}
}

View File

@ -1,4 +1,4 @@
package cn.skcks.docking.gb28181.wvp.api;
package cn.skcks.docking.gb28181.wvp.api.video;
import cn.skcks.docking.gb28181.media.config.ZlmMediaConfig;
import cn.skcks.docking.gb28181.wvp.config.SwaggerConfig;