Browse Source

Merge branch 'develop' of http://192.168.11.14:51037/gitadmin/tuoheng_qmhh into develop

tags/V1.8.0^2
wanghaoran 1 year ago
parent
commit
54f55b9653
3 changed files with 36 additions and 0 deletions
  1. +9
    -0
      tuoheng-api/src/main/java/com/tuoheng/api/controller/WestreamMessageController.java
  2. +2
    -0
      tuoheng-api/src/main/java/com/tuoheng/api/service/IWestreamMessageService.java
  3. +25
    -0
      tuoheng-api/src/main/java/com/tuoheng/api/service/impl/ThWestreamMessageServiceImpl.java

+ 9
- 0
tuoheng-api/src/main/java/com/tuoheng/api/controller/WestreamMessageController.java View File

@@ -26,6 +26,15 @@ public class WestreamMessageController {
private JsonResult getList(WestreamMessageQuery query) {
return westreamMessageService.getList(query);
}
/**
* 查询用户对应未读信息数量
*
* @return
*/
@GetMapping("/sum")
private JsonResult sum(WestreamMessageQuery query) {
return westreamMessageService.sum(query);
}

/**
* 查看信息详情

+ 2
- 0
tuoheng-api/src/main/java/com/tuoheng/api/service/IWestreamMessageService.java View File

@@ -17,4 +17,6 @@ public interface IWestreamMessageService extends IService<ThWestreamMessage> {
JsonResult read(WestreamMessageQuery query);

JsonResult deail(WestreamMessageQuery query);

JsonResult sum(WestreamMessageQuery query);
}

+ 25
- 0
tuoheng-api/src/main/java/com/tuoheng/api/service/impl/ThWestreamMessageServiceImpl.java View File

@@ -92,6 +92,31 @@ public class ThWestreamMessageServiceImpl extends ServiceImpl<ThWestreamMessageM

return JsonResult.success();
}

/**
* 查询用户对应未读信息数量
*
* @param query
* @return
*/
@Override
public JsonResult sum(WestreamMessageQuery query) {

if (StringUtils.isEmpty(query.getOpenId())) {
return JsonResult.error("openid为空");
}
if (StringUtils.isNull(query.getTenantId())) {
return JsonResult.error("TenantId为空");
}
//查询出所有未读的
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());

}
}



Loading…
Cancel
Save