|
|
@@ -1,7 +1,10 @@
|
|
|
package com.nb.im.controller;
|
|
|
|
|
|
+import cn.hutool.json.JSONUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
import com.nb.core.result.R;
|
|
|
+import com.nb.im.controller.vo.MsgExtendVo;
|
|
|
import com.nb.im.entity.ImMsgEntity;
|
|
|
import com.nb.im.service.LocalImMsgService;
|
|
|
import com.nb.im.service.dto.ImRoomMsgQuery;
|
|
|
@@ -35,4 +38,13 @@ public class ImRoomMsgController {
|
|
|
.lambda()
|
|
|
.eq(ImMsgEntity::getRoomId,query.getRoomId())));
|
|
|
}
|
|
|
+
|
|
|
+ @PostMapping("/edit")
|
|
|
+ @ApiOperation("修改消息扩展字段")
|
|
|
+ public R<Boolean> edit(@RequestBody@Validated MsgExtendVo vo){
|
|
|
+ return R.success(chatRoomMsgService.update(new UpdateWrapper<ImMsgEntity>()
|
|
|
+ .lambda()
|
|
|
+ .eq(ImMsgEntity::getId,vo.getId())
|
|
|
+ .set(ImMsgEntity::getExtend, JSONUtil.toJsonStr(vo.getExtend()))));
|
|
|
+ }
|
|
|
}
|