|
@@ -76,21 +76,19 @@ public class RequestManager {
|
|
if (!applicationRepository.existsByAppId(appId)) return new HttpResult<>(201, "appId不存在", null);
|
|
if (!applicationRepository.existsByAppId(appId)) return new HttpResult<>(201, "appId不存在", null);
|
|
if (!userRepository.existsByAppIdAndUserId(appId, userId))
|
|
if (!userRepository.existsByAppIdAndUserId(appId, userId))
|
|
return new HttpResult<>(201, "当前用户不存在", null);
|
|
return new HttpResult<>(201, "当前用户不存在", null);
|
|
- switch (path) {
|
|
|
|
- case Group_create_v1:
|
|
|
|
- return (HttpResult<T>) this.groupCreate(data instanceof String ?
|
|
|
|
- GsonImplHelp.get().toObject((String) data, GroupCreateData.class)
|
|
|
|
- : (GroupCreateData) data, appId, userId);
|
|
|
|
- case MsgHistoryForCount:
|
|
|
|
- if(null == data) return new HttpResult<>(201, "参数为空", null);
|
|
|
|
- return (HttpResult<T>) this.getHistoryForCount(data instanceof String ?
|
|
|
|
|
|
+ return switch (path) {
|
|
|
|
+ case Group_create_v1 -> (HttpResult<T>) this.groupCreate(data instanceof String ?
|
|
|
|
+ GsonImplHelp.get().toObject((String) data, GroupCreateData.class)
|
|
|
|
+ : (GroupCreateData) data, appId, userId);
|
|
|
|
+ case MsgHistoryForCount -> {
|
|
|
|
+ if (null == data) yield new HttpResult<>(201, "参数为空", null);
|
|
|
|
+ yield (HttpResult<T>) this.getHistoryForCount(data instanceof String ?
|
|
GsonImplHelp.get().toObject((String) data, MsgHistoryForCountData.class)
|
|
GsonImplHelp.get().toObject((String) data, MsgHistoryForCountData.class)
|
|
: (MsgHistoryForCountData) data, appId, userId);
|
|
: (MsgHistoryForCountData) data, appId, userId);
|
|
- case ConversationList:
|
|
|
|
- return (HttpResult<T>) this.getConversation(appId, userId);
|
|
|
|
- default:
|
|
|
|
- return new HttpResult<>(201, "路径错误" + path, null);
|
|
|
|
- }
|
|
|
|
|
|
+ }
|
|
|
|
+ case ConversationList -> (HttpResult<T>) this.getConversation(appId, userId);
|
|
|
|
+ default -> new HttpResult<>(201, "路径错误" + path, null);
|
|
|
|
+ };
|
|
|
|
|
|
} else return new HttpResult<>(201, "参数错误", null);
|
|
} else return new HttpResult<>(201, "参数错误", null);
|
|
|
|
|