|
@@ -6,6 +6,7 @@ import io.swagger.annotations.*;
|
|
import io.swagger.models.auth.In;
|
|
import io.swagger.models.auth.In;
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
+import org.springframework.lang.Nullable;
|
|
import org.springframework.messaging.handler.annotation.MessageMapping;
|
|
import org.springframework.messaging.handler.annotation.MessageMapping;
|
|
import org.springframework.messaging.handler.annotation.SendTo;
|
|
import org.springframework.messaging.handler.annotation.SendTo;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
@@ -14,6 +15,7 @@ import shop.alien.entity.store.LifeMessage;
|
|
import shop.alien.entity.store.vo.LifeMessageVo;
|
|
import shop.alien.entity.store.vo.LifeMessageVo;
|
|
import shop.alien.mapper.LifeMessageMapper;
|
|
import shop.alien.mapper.LifeMessageMapper;
|
|
import shop.alien.store.service.LifeMessageService;
|
|
import shop.alien.store.service.LifeMessageService;
|
|
|
|
+import shop.alien.store.task.ScheduledTask;
|
|
|
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
@@ -29,18 +31,20 @@ import java.util.List;
|
|
public class LifeMessageController {
|
|
public class LifeMessageController {
|
|
|
|
|
|
private final LifeMessageService lifeMessageService;
|
|
private final LifeMessageService lifeMessageService;
|
|
|
|
+ private final ScheduledTask scheduledTask;
|
|
|
|
|
|
@ApiOperation("消息列表")
|
|
@ApiOperation("消息列表")
|
|
@ApiOperationSupport(order = 1)
|
|
@ApiOperationSupport(order = 1)
|
|
@ApiImplicitParams({
|
|
@ApiImplicitParams({
|
|
@ApiImplicitParam(name = "receiverId", value = "当前登录人", dataType = "String", paramType = "query"),
|
|
@ApiImplicitParam(name = "receiverId", value = "当前登录人", dataType = "String", paramType = "query"),
|
|
- @ApiImplicitParam(name = "friendType", value = "聊天类型 1-聊过 2-未聊过", dataType = "Integer", paramType = "query"),
|
|
|
|
|
|
+ @ApiImplicitParam(name = "friendType", value = "聊天类型 0-搜索 1-聊过 2-未聊过", dataType = "Integer", paramType = "query"),
|
|
@ApiImplicitParam(name = "search", value = "搜索字段", dataType = "Integer", paramType = "query")})
|
|
@ApiImplicitParam(name = "search", value = "搜索字段", dataType = "Integer", paramType = "query")})
|
|
@GetMapping("/getMessageList")
|
|
@GetMapping("/getMessageList")
|
|
public R<List<LifeMessageVo>> getMessageList(@RequestParam String receiverId,
|
|
public R<List<LifeMessageVo>> getMessageList(@RequestParam String receiverId,
|
|
@RequestParam int friendType,
|
|
@RequestParam int friendType,
|
|
- @RequestParam String search) throws Exception {
|
|
|
|
|
|
+ String search) throws Exception {
|
|
log.info("LifeMessageController.getMessageList?receiverId={}, friendType={}, search={}", receiverId, friendType, search);
|
|
log.info("LifeMessageController.getMessageList?receiverId={}, friendType={}, search={}", receiverId, friendType, search);
|
|
|
|
+ scheduledTask.secondTradeRemind();
|
|
return R.data(lifeMessageService.getMessageList(receiverId, friendType, search));
|
|
return R.data(lifeMessageService.getMessageList(receiverId, friendType, search));
|
|
}
|
|
}
|
|
|
|
|
|
@@ -64,7 +68,9 @@ public class LifeMessageController {
|
|
|
|
|
|
@ApiOperation("消息详情")
|
|
@ApiOperation("消息详情")
|
|
@ApiOperationSupport(order = 4)
|
|
@ApiOperationSupport(order = 4)
|
|
- @ApiImplicitParams({@ApiImplicitParam(name = "当前登录人", value = "receiverId", dataType = "String", paramType = "query"), @ApiImplicitParam(name = "senderId", value = "聊天对方", dataType = "String", paramType = "query")})
|
|
|
|
|
|
+ @ApiImplicitParams({
|
|
|
|
+ @ApiImplicitParam(name = "当前登录人", value = "receiverId", dataType = "String", paramType = "query"),
|
|
|
|
+ @ApiImplicitParam(name = "senderId", value = "聊天对方", dataType = "String", paramType = "query")})
|
|
@GetMapping("/getMessageListByReceiverId")
|
|
@GetMapping("/getMessageListByReceiverId")
|
|
public R<List<LifeMessageVo>> getMessageListByReceiverId(@RequestParam String receiverId, @RequestParam String senderId) throws Exception {
|
|
public R<List<LifeMessageVo>> getMessageListByReceiverId(@RequestParam String receiverId, @RequestParam String senderId) throws Exception {
|
|
log.info("LifeMessageController.getMessageListByReceiverId?receiverId={}, senderId={}", receiverId, senderId);
|
|
log.info("LifeMessageController.getMessageListByReceiverId?receiverId={}, senderId={}", receiverId, senderId);
|
|
@@ -73,7 +79,9 @@ public class LifeMessageController {
|
|
|
|
|
|
@ApiOperation("消息已读")
|
|
@ApiOperation("消息已读")
|
|
@ApiOperationSupport(order = 5)
|
|
@ApiOperationSupport(order = 5)
|
|
- @ApiImplicitParams({@ApiImplicitParam(name = "receiverId", value = "当前登录人", dataType = "String", paramType = "query"), @ApiImplicitParam(name = "senderId", value = "聊天对方", dataType = "String", paramType = "query")})
|
|
|
|
|
|
+ @ApiImplicitParams({
|
|
|
|
+ @ApiImplicitParam(name = "receiverId", value = "当前登录人", dataType = "String", paramType = "query"),
|
|
|
|
+ @ApiImplicitParam(name = "senderId", value = "聊天对方", dataType = "String", paramType = "query")})
|
|
@GetMapping("/read")
|
|
@GetMapping("/read")
|
|
public R<Boolean> read(@RequestParam String receiverId, @RequestParam String senderId) throws Exception {
|
|
public R<Boolean> read(@RequestParam String receiverId, @RequestParam String senderId) throws Exception {
|
|
log.info("LifeMessageController.read?receiverId={}, senderId={}", receiverId, senderId);
|
|
log.info("LifeMessageController.read?receiverId={}, senderId={}", receiverId, senderId);
|
|
@@ -83,7 +91,9 @@ public class LifeMessageController {
|
|
|
|
|
|
@ApiOperation("删除消息")
|
|
@ApiOperation("删除消息")
|
|
@ApiOperationSupport(order = 6)
|
|
@ApiOperationSupport(order = 6)
|
|
- @ApiImplicitParams({@ApiImplicitParam(name = "senderId", value = "聊天对方", dataType = "String", paramType = "query"), @ApiImplicitParam(name = "receiverId", value = "当前登录人", dataType = "String", paramType = "query")})
|
|
|
|
|
|
+ @ApiImplicitParams({
|
|
|
|
+ @ApiImplicitParam(name = "senderId", value = "聊天对方", dataType = "String", paramType = "query"),
|
|
|
|
+ @ApiImplicitParam(name = "receiverId", value = "当前登录人", dataType = "String", paramType = "query")})
|
|
@GetMapping("/deleteMessageByPhoneId")
|
|
@GetMapping("/deleteMessageByPhoneId")
|
|
public R<Integer> deleteMessageByPhoneId(@RequestParam String senderId, @RequestParam String receiverId) throws Exception {
|
|
public R<Integer> deleteMessageByPhoneId(@RequestParam String senderId, @RequestParam String receiverId) throws Exception {
|
|
log.info("LifeMessageController.deleteMessageByPhoneId?senderId={},receiverId={}", senderId, receiverId);
|
|
log.info("LifeMessageController.deleteMessageByPhoneId?senderId={},receiverId={}", senderId, receiverId);
|