临时提交
This commit is contained in:
@@ -18,7 +18,6 @@ import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -143,6 +142,10 @@ public class RedisRpcConfig implements MessageListener {
|
||||
}
|
||||
}else {
|
||||
if (method == null) {
|
||||
// 回复404结果
|
||||
RedisRpcResponse response = request.getResponse();
|
||||
response.setStatusCode(ErrorCode.ERROR404.getCode());
|
||||
sendResponse(response);
|
||||
return;
|
||||
}
|
||||
RedisRpcResponse response = (RedisRpcResponse)method.invoke(controller, request);
|
||||
@@ -150,8 +153,11 @@ public class RedisRpcConfig implements MessageListener {
|
||||
sendResponse(response);
|
||||
}
|
||||
}
|
||||
}catch (InvocationTargetException | IllegalAccessException e) {
|
||||
}catch (Exception e) {
|
||||
log.error("[redis-rpc ] 处理请求失败 ", e);
|
||||
RedisRpcResponse response = request.getResponse();
|
||||
response.setStatusCode(ErrorCode.ERROR100.getCode());
|
||||
sendResponse(response);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -189,13 +189,19 @@ public class RedisRpcStreamPushController extends RpcController {
|
||||
response.setBody("param error");
|
||||
return response;
|
||||
}
|
||||
streamPushPlayService.start(id, (code, msg, data) -> {
|
||||
if (code == ErrorCode.SUCCESS.getCode()) {
|
||||
response.setStatusCode(ErrorCode.SUCCESS.getCode());
|
||||
response.setBody(JSONObject.toJSONString(data));
|
||||
sendResponse(response);
|
||||
}
|
||||
}, null, null);
|
||||
try {
|
||||
streamPushPlayService.start(id, (code, msg, data) -> {
|
||||
if (code == ErrorCode.SUCCESS.getCode()) {
|
||||
response.setStatusCode(ErrorCode.SUCCESS.getCode());
|
||||
response.setBody(JSONObject.toJSONString(data));
|
||||
sendResponse(response);
|
||||
}
|
||||
}, null, null);
|
||||
}catch (IllegalArgumentException e) {
|
||||
response.setStatusCode(ErrorCode.ERROR100.getCode());
|
||||
response.setBody(e.getMessage());
|
||||
sendResponse(response);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -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.InviteErrorCode;
|
||||
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.service.IStreamPushPlayService;
|
||||
import com.genersoft.iot.vmp.streamPush.service.IStreamPushService;
|
||||
|
||||
Reference in New Issue
Block a user