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; + } +}