@@ -26,6 +26,15 @@ public class WestreamMessageController { | |||
private JsonResult getList(WestreamMessageQuery query) { | |||
return westreamMessageService.getList(query); | |||
} | |||
/** | |||
* 查询用户对应未读信息数量 | |||
* | |||
* @return | |||
*/ | |||
@GetMapping("/list") | |||
private JsonResult sum(WestreamMessageQuery query) { | |||
return westreamMessageService.sum(query); | |||
} | |||
/** | |||
* 查看信息详情 |
@@ -17,4 +17,6 @@ public interface IWestreamMessageService extends IService<ThWestreamMessage> { | |||
JsonResult read(WestreamMessageQuery query); | |||
JsonResult deail(WestreamMessageQuery query); | |||
JsonResult sum(WestreamMessageQuery query); | |||
} |
@@ -92,6 +92,25 @@ public class ThWestreamMessageServiceImpl extends ServiceImpl<ThWestreamMessageM | |||
return JsonResult.success(); | |||
} | |||
/** | |||
* 查询用户对应未读信息数量 | |||
* | |||
* @param query | |||
* @return | |||
*/ | |||
@Override | |||
public JsonResult sum(WestreamMessageQuery query) { | |||
//查询出所有未读的 | |||
List<ThWestreamMessage> list = this.list(Wrappers.<ThWestreamMessage>lambdaQuery() | |||
.eq(ThWestreamMessage::getTenantId, query.getTenantId()) | |||
.eq(ThWestreamMessage::getOpenid, query.getOpenId()) | |||
.eq(ThWestreamMessage::getStatus, 1) | |||
.eq(BaseEntity::getMark, 1)); | |||
return JsonResult.success(list.size()); | |||
} | |||
} | |||