Merge branch 'dev/springBoot3'

This commit is contained in:
lin 2025-11-10 08:58:00 +08:00
commit 78a506f0b1
3 changed files with 21 additions and 10 deletions

View File

@ -18,7 +18,6 @@ import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
@ -143,6 +142,10 @@ public class RedisRpcConfig implements MessageListener {
} }
}else { }else {
if (method == null) { if (method == null) {
// 回复404结果
RedisRpcResponse response = request.getResponse();
response.setStatusCode(ErrorCode.ERROR404.getCode());
sendResponse(response);
return; return;
} }
RedisRpcResponse response = (RedisRpcResponse)method.invoke(controller, request); RedisRpcResponse response = (RedisRpcResponse)method.invoke(controller, request);
@ -150,8 +153,11 @@ public class RedisRpcConfig implements MessageListener {
sendResponse(response); sendResponse(response);
} }
} }
}catch (InvocationTargetException | IllegalAccessException e) { }catch (Exception e) {
log.error("[redis-rpc ] 处理请求失败 ", e); log.error("[redis-rpc ] 处理请求失败 ", e);
RedisRpcResponse response = request.getResponse();
response.setStatusCode(ErrorCode.ERROR100.getCode());
sendResponse(response);
} }
} }

View File

@ -189,13 +189,19 @@ public class RedisRpcStreamPushController extends RpcController {
response.setBody("param error"); response.setBody("param error");
return response; return response;
} }
streamPushPlayService.start(id, (code, msg, data) -> { try {
if (code == ErrorCode.SUCCESS.getCode()) { streamPushPlayService.start(id, (code, msg, data) -> {
response.setStatusCode(ErrorCode.SUCCESS.getCode()); if (code == ErrorCode.SUCCESS.getCode()) {
response.setBody(JSONObject.toJSONString(data)); response.setStatusCode(ErrorCode.SUCCESS.getCode());
sendResponse(response); response.setBody(JSONObject.toJSONString(data));
} sendResponse(response);
}, null, null); }
}, null, null);
}catch (IllegalArgumentException e) {
response.setStatusCode(ErrorCode.ERROR100.getCode());
response.setBody(e.getMessage());
sendResponse(response);
}
return null; return null;
} }

View File

@ -14,7 +14,6 @@ import com.genersoft.iot.vmp.service.bean.CloudRecordItem;
import com.genersoft.iot.vmp.service.bean.ErrorCallback; import com.genersoft.iot.vmp.service.bean.ErrorCallback;
import com.genersoft.iot.vmp.service.bean.InviteErrorCode; import com.genersoft.iot.vmp.service.bean.InviteErrorCode;
import com.genersoft.iot.vmp.storager.IRedisCatchStorage; import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
import com.genersoft.iot.vmp.streamProxy.service.IStreamProxyService;
import com.genersoft.iot.vmp.streamPush.bean.StreamPush; import com.genersoft.iot.vmp.streamPush.bean.StreamPush;
import com.genersoft.iot.vmp.streamPush.service.IStreamPushPlayService; import com.genersoft.iot.vmp.streamPush.service.IStreamPushPlayService;
import com.genersoft.iot.vmp.streamPush.service.IStreamPushService; import com.genersoft.iot.vmp.streamPush.service.IStreamPushService;