|
@@ -24,6 +24,7 @@ import com.free.config.CustomizationException;
|
|
|
import com.free.config.ExceptionEnum;
|
|
|
import com.free.config.ResponseFormat;
|
|
|
import com.free.dto.ChatRecordCreateDTO;
|
|
|
+import com.free.dto.ChatRecordToReadDTO;
|
|
|
import com.free.entity.ChatRecord;
|
|
|
import com.free.entity.TransferApply;
|
|
|
import com.free.mq.MqService;
|
|
@@ -45,6 +46,16 @@ public class ChatRecordController {
|
|
|
@Autowired
|
|
|
private MqService mqService;
|
|
|
|
|
|
+ @ApiOperation("对话已读")
|
|
|
+ @PostMapping("/read")
|
|
|
+ public Object readMsg(@RequestBody ChatRecordToReadDTO body) {
|
|
|
+ ChatRecord updateData = new ChatRecord();
|
|
|
+ updateData.setIs_read(service.chatRecordReadSign);
|
|
|
+ QueryWrapper qw = new QueryWrapper<>();
|
|
|
+ qw.eq("apply_id", body.getApply_id());
|
|
|
+ return ResponseFormat.success();
|
|
|
+ }
|
|
|
+
|
|
|
/** 创建数据 */
|
|
|
@PassToken
|
|
|
@ApiOperation("创建数据")
|
|
@@ -90,21 +101,6 @@ public class ChatRecordController {
|
|
|
// return ResponseFormat.success();
|
|
|
}
|
|
|
|
|
|
- /** 修改数据, 转人工对话不修改 */
|
|
|
- @ApiOperation("修改数据")
|
|
|
- // @PostMapping("/{id}")
|
|
|
- public Object update(@PathVariable String id, @RequestBody ChatRecord data) {
|
|
|
- QueryWrapper qw = new QueryWrapper<>();
|
|
|
- qw.eq("id", id);
|
|
|
- Long num = this.service.count(qw);
|
|
|
- if (num <= 0) {
|
|
|
- throw new CustomizationException(ExceptionEnum.NOT_FOUND);
|
|
|
- }
|
|
|
- data.setId(id);
|
|
|
- this.service.updateById(data);
|
|
|
- Object newData = this.service.getById(id);
|
|
|
- return ResponseFormat.success(newData);
|
|
|
- }
|
|
|
|
|
|
/** 列表查询 */
|
|
|
@PassToken
|
|
@@ -156,17 +152,4 @@ public class ChatRecordController {
|
|
|
return ResponseFormat.success(newData);
|
|
|
}
|
|
|
|
|
|
- /** 根据id删除数据 , 无删除 */
|
|
|
- @ApiOperation("删除数据")
|
|
|
- // @DeleteMapping("/{id}")
|
|
|
- public Object delete(@PathVariable String id) {
|
|
|
- QueryWrapper qw = new QueryWrapper<>();
|
|
|
- qw.eq("id", id);
|
|
|
- Long num = service.count(qw);
|
|
|
- if (num <= 0) {
|
|
|
- throw new CustomizationException(ExceptionEnum.NOT_FOUND);
|
|
|
- }
|
|
|
- service.removeById(id);
|
|
|
- return ResponseFormat.success();
|
|
|
- }
|
|
|
}
|