From 071fc320417dc29c20f9ded2c2dc3b1f93e45f0b Mon Sep 17 00:00:00 2001 From: changpengfei Date: Sat, 11 Sep 2021 14:39:46 +0800 Subject: [PATCH] =?UTF-8?q?=E8=81=8A=E5=A4=A9=E8=AE=B0=E5=BD=95+=E7=BB=93?= =?UTF-8?q?=E6=9D=9F=E9=97=AE=E8=AF=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ChatGroupController.java | 2 ++ .../talkonlineweb/controller/CommonController.java | 36 ++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/CommonController.java diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/ChatGroupController.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/ChatGroupController.java index 0effa6b..6cea229 100644 --- a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/ChatGroupController.java +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/ChatGroupController.java @@ -15,6 +15,7 @@ import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -79,6 +80,7 @@ public class ChatGroupController { @PostMapping("saveMsg") public BaseResponse saveMsg(LymsMessage message) { BaseResponse baseResponse = new BaseResponse(); + message.setSendtime(new Date()); boolean f = lymsMessageService.saveOrUpdate(message); baseResponse.setErrorcode(f == true ? 0 : 1); return baseResponse; diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/CommonController.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/CommonController.java new file mode 100644 index 0000000..3b8c577 --- /dev/null +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/CommonController.java @@ -0,0 +1,36 @@ +package com.lyms.talkonlineweb.controller; + +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.fasterxml.jackson.databind.ser.Serializers; +import com.lyms.talkonlineweb.domain.LymsTkrecord; +import com.lyms.talkonlineweb.result.BaseResponse; +import com.lyms.talkonlineweb.service.LymsTkrecordService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.Collections; +import java.util.List; + +@RestController +@RequestMapping("com") +public class CommonController { + @Autowired + private LymsTkrecordService lymsTkrecordService; + + @GetMapping("endTalk") + public BaseResponse endTalk(LymsTkrecord tkrecord){ + BaseResponse baseResponse=new BaseResponse(); + tkrecord.setStat(0); + baseResponse.setErrorcode(1); + List tLst=lymsTkrecordService.list(Wrappers.query(tkrecord)); + if (tLst.size()>0){ + tkrecord=tLst.get(0); + tkrecord.setStat(1); + boolean f=lymsTkrecordService.save(tkrecord); + baseResponse.setErrorcode(f==true?0:1); + } + return baseResponse; + } +} -- 1.8.3.1