add: get user info unread total

This commit is contained in:
yystopf 2021-09-13 18:17:09 +08:00
parent 8ad087820e
commit a0b6041394
2 changed files with 3 additions and 1 deletions

View File

@ -91,6 +91,8 @@ class UsersController < ApplicationController
def get_user_info
begin
@user = current_user
result = Notice::Read::CountService.call(current_user.id)
@message_unread_total = result.nil? ? 0 : result[2]["unread_notification"]
# TODO 等消息上线再打开注释
#@tidding_count = unviewed_tiddings(current_user) if current_user.present?
rescue Exception => e

View File

@ -22,4 +22,4 @@ json.city @user.city
json.custom_department @user.custom_department
json.description @user.description
json.(@user, :show_email, :show_department, :show_location)
json.message_unread_total 5
json.message_unread_total @message_unread_total