| | |
| | | import io.swagger.v3.oas.annotations.responses.ApiResponses; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import jakarta.validation.Valid; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | this.sv = sv ; |
| | | } |
| | | |
| | | @Value("${video.types}") |
| | | private String[] types; |
| | | /** |
| | | * 客户端请求得到所有摄像机类型 |
| | | * @return 所有摄像机类型 |
| | |
| | | public BaseResponse<QueryResultVo<List<TypesVo>>> types() { |
| | | try { |
| | | List<TypesVo> list = new ArrayList<>() ; |
| | | if(types != null && types.length > 0){ |
| | | for (String type : types) { |
| | | if(CameraTypesConfig.types != null && CameraTypesConfig.types.size() > 0){ |
| | | for (String type : CameraTypesConfig.types) { |
| | | String[] typeGrp = type.split(","); |
| | | if(typeGrp.length == 2){ |
| | | TypesVo vo = new TypesVo() ; |
| | |
| | | schema = @Schema(implementation = VoCamera.class))} |
| | | ) |
| | | }) |
| | | @PostMapping(path = "some", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | @GetMapping(path = "some") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoCamera>>> some(@RequestBody CameraQo vo){ |
| | | public BaseResponse<QueryResultVo<List<VoCamera>>> some(CameraQo vo){ |
| | | try { |
| | | QueryResultVo<List<VoCamera>> res = this.sv.some(vo) ; |
| | | return BaseResponseUtils.buildSuccess(res); |
| | |
| | | schema = @Schema(implementation = ViCamera.class))} |
| | | ) |
| | | }) |
| | | @GetMapping(path = "one", consumes = MediaType.TEXT_PLAIN_VALUE) |
| | | @GetMapping(path = "one") |
| | | @SsoAop() |
| | | public BaseResponse<ViCamera> one(Long id){ |
| | | return BaseResponseUtils.buildSuccess(this.sv.selectById(id)); |
| | |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | ViCamera po = dto.toNewPo() ; |
| | | po.deleted = 0 ; |
| | | int count; |
| | | try { |
| | | count = this.sv.save(po); |
| | |
| | | schema = @Schema(implementation = Boolean.class))} |
| | | ) |
| | | }) |
| | | @GetMapping(path = "delete", consumes = MediaType.TEXT_PLAIN_VALUE) |
| | | @GetMapping(path = "delete") |
| | | @SsoAop() |
| | | public BaseResponse<Boolean> delete(Long id){ |
| | | if(id == null){ |