8 changed files with 189 additions and 1 deletions
			
			
		| @ -0,0 +1,39 @@ | |||||||
|  | package com.hnac.hzims.equipment.feign; | ||||||
|  | 
 | ||||||
|  | import com.hnac.hzims.EquipmentConstants; | ||||||
|  | import com.hnac.hzims.equipment.entity.EmVideoBandingEntity; | ||||||
|  | import org.springblade.core.tool.api.R; | ||||||
|  | import org.springframework.cloud.openfeign.FeignClient; | ||||||
|  | import org.springframework.web.bind.annotation.GetMapping; | ||||||
|  | import org.springframework.web.bind.annotation.RequestParam; | ||||||
|  | 
 | ||||||
|  | import java.util.List; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @Author: huangxing | ||||||
|  |  * @Date: 2024/04/19 17:00 | ||||||
|  |  */ | ||||||
|  | @FeignClient(value = EquipmentConstants.APP_NAME) | ||||||
|  | public interface IEmVideoClient { | ||||||
|  | 
 | ||||||
|  |     String API_PREFIX = "/feign/em/video"; | ||||||
|  |     String GET_EM_BANDING_VIDEOS = API_PREFIX + "/getEmBandingVideos"; | ||||||
|  |     String IS_BANDING_VIDEO_BY_EM_CODES = API_PREFIX + "/isBandingVideoByEmCode"; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 获取设备绑定视频列表 | ||||||
|  |      * @param emCodes 设备编号 | ||||||
|  |      * @return 视频列表 | ||||||
|  |      */ | ||||||
|  |     @GetMapping(GET_EM_BANDING_VIDEOS) | ||||||
|  |     R<List<EmVideoBandingEntity>> getEmBandingVideos(@RequestParam String emCodes); | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 验证设备编号是否绑定视频 | ||||||
|  |      * @param emCode 设备编号 | ||||||
|  |      * @return 是否绑定视频结果 | ||||||
|  |      */ | ||||||
|  |     @GetMapping(IS_BANDING_VIDEO_BY_EM_CODES) | ||||||
|  |     R isBandingVideoByEmCode(@RequestParam String emCode); | ||||||
|  | 
 | ||||||
|  | } | ||||||
| @ -0,0 +1,42 @@ | |||||||
|  | package com.hnac.hzims.equipment.feign; | ||||||
|  | 
 | ||||||
|  | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||||||
|  | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||||||
|  | import com.hnac.hzims.equipment.entity.EmVideoBandingEntity; | ||||||
|  | import com.hnac.hzims.equipment.service.IEmVideoBandingService; | ||||||
|  | import com.hnac.hzims.equipment.service.IEmVideoService; | ||||||
|  | import lombok.AllArgsConstructor; | ||||||
|  | import org.springblade.core.tool.api.R; | ||||||
|  | import org.springblade.core.tool.utils.CollectionUtil; | ||||||
|  | import org.springblade.core.tool.utils.Func; | ||||||
|  | import org.springframework.web.bind.annotation.GetMapping; | ||||||
|  | import org.springframework.web.bind.annotation.RequestParam; | ||||||
|  | import org.springframework.web.bind.annotation.RestController; | ||||||
|  | 
 | ||||||
|  | import java.util.Collection; | ||||||
|  | import java.util.List; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @Author: huangxing | ||||||
|  |  * @Date: 2024/04/24 11:21 | ||||||
|  |  */ | ||||||
|  | @RestController | ||||||
|  | @AllArgsConstructor | ||||||
|  | public class EmVideoClient implements IEmVideoClient{ | ||||||
|  | 
 | ||||||
|  |     private final IEmVideoBandingService emVideoBandingService; | ||||||
|  | 
 | ||||||
|  |     @Override | ||||||
|  |     @GetMapping(GET_EM_BANDING_VIDEOS) | ||||||
|  |     public R<List<EmVideoBandingEntity>> getEmBandingVideos(@RequestParam String emCodes) { | ||||||
|  |         LambdaQueryWrapper<EmVideoBandingEntity> wrapper = Wrappers.<EmVideoBandingEntity>lambdaQuery().in(EmVideoBandingEntity::getEmCode, Func.toLongList(",",emCodes)); | ||||||
|  |         return R.data(emVideoBandingService.list(wrapper)); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     @Override | ||||||
|  |     public R isBandingVideoByEmCode(String emCode) { | ||||||
|  |         LambdaQueryWrapper<EmVideoBandingEntity> wrapper = Wrappers.<EmVideoBandingEntity>lambdaQuery().eq(EmVideoBandingEntity::getEmCode, emCode); | ||||||
|  |         List<EmVideoBandingEntity> videoList = emVideoBandingService.list(wrapper); | ||||||
|  |         return R.status(CollectionUtil.isNotEmpty(videoList)); | ||||||
|  |     } | ||||||
|  | } | ||||||
					Loading…
					
					
				
		Reference in new issue