|
|
@@ -2,6 +2,7 @@ package com.nb.im.controller;
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
+import cn.hutool.core.util.ObjectUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
@@ -67,6 +68,19 @@ public class ImRoomController implements BaseSaveController<ImRoomEntity,String>
|
|
|
return R.success(result);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ @ApiOperation(value = "医生聊天室置顶")
|
|
|
+ @PostMapping("/doctor/setTop/{roomId}")
|
|
|
+ public R<Boolean> setTop(@PathVariable("roomId") String roomId){
|
|
|
+ ImRoomEntity room = imRoomService.getById(roomId);
|
|
|
+ if(ObjectUtil.isNull(room)){
|
|
|
+ return R.success(true);
|
|
|
+ }else {
|
|
|
+ room.setDoctorTop(true);
|
|
|
+ return R.success(imRoomService.updateById(room));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
@ApiOperation(value = "查询并自动创建与病人看护人的聊天室",notes = "若存在,则返回聊天室信息,若不存在,则返回空")
|
|
|
@PostMapping("/look")
|
|
|
public R<ImRoomEntity> getChatRoom(@RequestBody@Validated ImRoomDTO source){
|