|
@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.fdkankan.tk.common.util.RoomUtil;
|
|
|
import com.fdkankan.tk.entity.RoomDanmaku;
|
|
|
import com.fdkankan.tk.httpClient.client.LiveClient;
|
|
|
+import com.fdkankan.tk.httpClient.client.RestTemplateLive;
|
|
|
import com.fdkankan.tk.mapper.IRoomDanmakuMapper;
|
|
|
import com.fdkankan.tk.response.DataCount;
|
|
|
import com.fdkankan.tk.response.UserMsgVo;
|
|
@@ -34,15 +35,13 @@ import java.util.Set;
|
|
|
public class RoomDanmakuServiceImpl extends ServiceImpl<IRoomDanmakuMapper, RoomDanmaku> implements IRoomDanmakuService {
|
|
|
|
|
|
@Autowired
|
|
|
- LiveClient liveClient;
|
|
|
- @Autowired
|
|
|
- RestTemplate restTemplate;
|
|
|
+ RestTemplateLive restTemplateLive;
|
|
|
|
|
|
@Override
|
|
|
public void saveDanMaku(String roomId,Integer roomUserId) {
|
|
|
String wxRoomId = RoomUtil.getLiveRoomId( roomId , roomUserId);
|
|
|
List<RoomDanmaku> saveList = new ArrayList<>();
|
|
|
- JSONObject jsonObject = liveClient.getDanmaku(wxRoomId);
|
|
|
+ JSONObject jsonObject = restTemplateLive.getDanmaku(wxRoomId);
|
|
|
if(jsonObject != null && jsonObject.getInteger("code") ==0){
|
|
|
JSONArray data = jsonObject.getJSONArray("data");
|
|
|
if(data.size() >0){
|
|
@@ -64,7 +63,7 @@ public class RoomDanmakuServiceImpl extends ServiceImpl<IRoomDanmakuMapper, Room
|
|
|
}
|
|
|
}
|
|
|
if(saveList.size() >0){
|
|
|
- liveClient.deleteDanmaku(wxRoomId);
|
|
|
+ restTemplateLive.deleteDanmaku(wxRoomId);
|
|
|
this.saveBatch(saveList);
|
|
|
}
|
|
|
}
|