Commit e64dfc6f811f876f8d4c73bd8e024c7aa19a72a2

Authored by xp.Huang
2 parents 9452d2b0 dc284910

Merge branch 'cherry-pick-3e7d72ec' into 'master_dev'

perf:查询视频配置去掉是否客户与客户id限制

See merge request yunteng/thingskit!318
... ... @@ -138,8 +138,6 @@ public class TkVideoController extends BaseController {
138 138 }
139 139 String url =
140 140 videoService.getCameraPreviewURL(
141   - getCurrentUser().isTenantAdmin(),
142   - getCurrentUser().getCurrentUserId(),
143 141 getCurrentUser().getCurrentTenantId(),
144 142 entityId,
145 143 protocolType);
... ...
... ... @@ -97,9 +97,9 @@ public class TkVideoServiceImpl extends AbstractBaseService<TkVideoMapper, TkVid
97 97 }
98 98
99 99 @Override
100   - public String getCameraPreviewURL(boolean isTenantAdmin, String customerUserId, String tenantId, String entityId,
  100 + public String getCameraPreviewURL(String tenantId, String entityId,
101 101 ProtocolType protocolType) throws IOException {
102   - TkVideoDTO videoDTO = getVideoInfo(isTenantAdmin,customerUserId,tenantId,entityId);
  102 + TkVideoDTO videoDTO = getVideoInfo(tenantId,entityId);
103 103 TkVideoPlatformDTO videoPlatformDTO = videoDTO.getVideoPlatformDTO();
104 104 if(videoPlatformDTO.getType()==0){//如果为海康威视
105 105 return HikVisionArtemis(videoDTO,protocolType);
... ... @@ -112,7 +112,7 @@ public class TkVideoServiceImpl extends AbstractBaseService<TkVideoMapper, TkVid
112 112
113 113 @Override
114 114 public String controlli(boolean isTenantAdmin, String customerUserId, String tenantId, String entityId, int action, String command ) {
115   - TkVideoDTO videoDTO = getVideoInfo(isTenantAdmin,customerUserId,tenantId,entityId);
  115 + TkVideoDTO videoDTO = getVideoInfo(tenantId,entityId);
116 116
117 117 //组装请求参数
118 118 ObjectNode jsonBody = JacksonUtil.newObjectNode();
... ... @@ -180,13 +180,10 @@ public class TkVideoServiceImpl extends AbstractBaseService<TkVideoMapper, TkVid
180 180 videoDTO.getVideoPlatformDTO().getSsl(),protocolType,body,videoDTO.getSn());
181 181 }
182 182
183   - private TkVideoDTO getVideoInfo(boolean isTenantAdmin,String customerUserId, String tenantId, String entityId){
184   - if (isTenantAdmin) {
185   - customerUserId = null;
186   - }
  183 + private TkVideoDTO getVideoInfo(String tenantId, String entityId){
187 184 //通过流媒体方式获取视频流的列表
188 185 List<TkVideoDTO> videoDTOList = baseMapper.getVideoInfosByTenantIdOrAccessModeOrId(tenantId, entityId,
189   - FastIotConstants.MagicNumber.ONE, customerUserId);
  186 + FastIotConstants.MagicNumber.ONE);
190 187 if (videoDTOList.size() == 0) {
191 188 throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage());
192 189 }
... ...
... ... @@ -31,9 +31,8 @@ public interface TkVideoMapper extends BaseMapper<TkVideoEntity> {
31 31 * @param tenantId 租户ID
32 32 * @param id 视频ID
33 33 * @param accessMode 流获取方式
34   - * @param customerUserId 客户ID
35 34 * @return
36 35 */
37 36 List<TkVideoDTO> getVideoInfosByTenantIdOrAccessModeOrId(@Param("tenantId") String tenantId, @Param("id") String id,
38   - @Param("accessMode") Integer accessMode, @Param("customerUserId") String customerUserId);
  37 + @Param("accessMode") Integer accessMode);
39 38 }
... ...
... ... @@ -53,16 +53,12 @@ public interface TkVideoService extends BaseService<TkVideoEntity> {
53 53 /**
54 54 * 根据租户ID、客户ID、视频ID获取视屏流播放地址
55 55 *
56   - * @param isTenantAdmin 是否租户管理员
57   - * @param customerUserId 客户ID
58 56 * @param tenantId 租户ID
59 57 * @param entityId 视频ID
60 58 * @param protocolType 视频协议
61 59 * @return 视屏流播放地址
62 60 */
63 61 String getCameraPreviewURL(
64   - boolean isTenantAdmin,
65   - String customerUserId,
66 62 String tenantId,
67 63 String entityId,
68 64 ProtocolType protocolType) throws IOException;
... ...
... ... @@ -91,9 +91,6 @@
91 91 <if test="accessMode !=null">
92 92 AND base.access_mode = #{accessMode}
93 93 </if>
94   - <if test="customerUserId !=null and customerUserId !=''">
95   - AND base.creator = #{customerUserId}
96   - </if>
97 94 </where>
98 95 </select>
99 96 </mapper>
... ...