临时提交
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.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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user