feat: my new message status

main
wangqing 8 months ago
parent 8c93ed5446
commit 55de561948

@ -13,6 +13,7 @@ import java.util.function.Function;
import java.util.stream.Collectors;
import com.github.houbb.sensitive.word.bs.SensitiveWordBs;
import com.luoo.user.dao.UserMessageDao;
import com.luoo.user.dto.TotalCommentVo;
import com.luoo.user.pojo.*;
import com.luoo.user.service.*;
@ -102,6 +103,9 @@ public class MyController extends BaseController {
@Autowired
private RedisTemplate redisTemplate;
@Autowired
private UserMessageDao userMessageDao;
@ApiOperation(value = "1.获取个人信息", notes = "游客无法获取个人信息")
@GetMapping("/userInfo")
@GlobalInterceptor(checkAppUserLogin = true)
@ -356,7 +360,12 @@ public class MyController extends BaseController {
userRespDTO.setThumbUpCount(totalCommentVo.getTotalThumbup());
userRespDTO.setCommentReplyCount(totalCommentVo.getTotalComment());
}
UserMessage userMessage = userMessageDao.findTopByUserIdOrderBySendTimeDesc(user.getId());
userRespDTO.setHaveNewMessage(false);
if (null!=userMessage) {
int read = userMessage.getHaveRead();
userRespDTO.setHaveNewMessage(read==0?true:false);
}
return userRespDTO;
}

@ -17,5 +17,7 @@ public interface UserMessageDao extends MongoRepository<UserMessage,String> {
UserMessage findTopByUserIdAndTypeOrderBySendTimeDesc(String userId,int type);
UserMessage findTopByUserIdOrderBySendTimeDesc(String userId);
}

@ -41,4 +41,6 @@ public class UserRespDTO implements Serializable {
private int relation=1;
@ApiModelProperty(value = "IP 归属地,精确到省份", example = "北京")
private String ipLocation;
@ApiModelProperty(value = "是否有新的未读消息true为有false为无")
private boolean haveNewMessage;
}

Loading…
Cancel
Save