Showing
1 changed file
with
4 additions
and
0 deletions
@@ -10,6 +10,7 @@ import com.yoho.core.redis.cluster.annotation.Redis; | @@ -10,6 +10,7 @@ import com.yoho.core.redis.cluster.annotation.Redis; | ||
10 | import com.yoho.core.redis.cluster.operations.nosync.YHRedisTemplate; | 10 | import com.yoho.core.redis.cluster.operations.nosync.YHRedisTemplate; |
11 | import com.yoho.core.redis.cluster.operations.nosync.YHValueOperations; | 11 | import com.yoho.core.redis.cluster.operations.nosync.YHValueOperations; |
12 | import com.yoho.core.redis.cluster.operations.serializer.RedisKeyBuilder; | 12 | import com.yoho.core.redis.cluster.operations.serializer.RedisKeyBuilder; |
13 | +import com.yoho.error.exception.ServiceException; | ||
13 | import com.yoho.order.dal.CameraRecordMapper; | 14 | import com.yoho.order.dal.CameraRecordMapper; |
14 | import com.yoho.order.dal.QiniuLiveRecordMapper; | 15 | import com.yoho.order.dal.QiniuLiveRecordMapper; |
15 | import com.yoho.order.dal.UserCameraRecordMapper; | 16 | import com.yoho.order.dal.UserCameraRecordMapper; |
@@ -213,6 +214,9 @@ public class UfoLiveService { | @@ -213,6 +214,9 @@ public class UfoLiveService { | ||
213 | } | 214 | } |
214 | 215 | ||
215 | public Boolean saveInitCameraRecord(QNliveReq req) { | 216 | public Boolean saveInitCameraRecord(QNliveReq req) { |
217 | + if(req.getCameraCode()==null||req.getCameraCode()<=0){ | ||
218 | + throw new ServiceException(400,"错误:请选择摄像头"); | ||
219 | + } | ||
216 | Integer userId = new UserHelper().getUserId(); | 220 | Integer userId = new UserHelper().getUserId(); |
217 | yhValueOperations.set(getRedisKey(userId), String.valueOf(req.getCameraCode()), 12, TimeUnit.HOURS); | 221 | yhValueOperations.set(getRedisKey(userId), String.valueOf(req.getCameraCode()), 12, TimeUnit.HOURS); |
218 | 222 |
-
Please register or login to post a comment