11package top .ysqorz .forum .controller ;
22
3- import org .springframework .stereotype .Component ;
43import org .springframework .stereotype .Controller ;
54import org .springframework .validation .annotation .Validated ;
65import org .springframework .web .bind .annotation .*;
98import top .ysqorz .forum .common .StatusCode ;
109import top .ysqorz .forum .im .entity .MsgModel ;
1110import top .ysqorz .forum .im .entity .MsgType ;
12- import top .ysqorz .forum .im .handler .MsgCenter ;
11+ import top .ysqorz .forum .im .handler .MsgCenterImpl ;
1312import top .ysqorz .forum .service .IMService ;
14- import top .ysqorz .forum .shiro .ShiroUtils ;
1513import top .ysqorz .forum .utils .JsonUtils ;
1614
1715import javax .annotation .Resource ;
@@ -44,7 +42,7 @@ public StatusCode sendMsg(@NotBlank String msgJson, @NotBlank String channelId)
4442 if (MsgType .isFunctionalType (MsgType .valueOf (msg .getMsgType ()))) { // 如果非法type会抛出异常
4543 return StatusCode .NOT_SUPPORT_FUNC_TYPE ;
4644 }
47- MsgCenter . getInstance (). remoteDispatch ( msg , channelId , ShiroUtils . getToken () );
45+ imService . handleMsg ( msg , channelId );
4846 return StatusCode .SUCCESS ;
4947 }
5048
@@ -53,7 +51,7 @@ public StatusCode sendMsg(@NotBlank String msgJson, @NotBlank String channelId)
5351 */
5452 @ PostMapping ("/push" )
5553 public StatusCode pushMsg (@ RequestBody MsgModel msg , String channelId ) { // source channel
56- MsgCenter .getInstance ().push (msg , channelId );
54+ MsgCenterImpl .getInstance ().push (msg , channelId );
5755 return StatusCode .SUCCESS ;
5856 }
5957
0 commit comments