mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-07-13 21:44:32 +08:00
add: notice message skeletal code
This commit is contained in:
@@ -21,4 +21,5 @@ json.province @user.province
|
||||
json.city @user.city
|
||||
json.custom_department @user.custom_department
|
||||
json.description @user.description
|
||||
json.(@user, :show_email, :show_department, :show_location)
|
||||
json.(@user, :show_email, :show_department, :show_location)
|
||||
json.message_unread_total 5
|
||||
@@ -0,0 +1,22 @@
|
||||
json.id message["id"]
|
||||
# json.receiver do
|
||||
# json.partial! '/users/user_simple', locals: {user: current_user}
|
||||
# end
|
||||
json.status message["status"]
|
||||
json.content message["content"]
|
||||
json.notification_url message["notification_url"]
|
||||
json.source message["source"]
|
||||
case message["type"]
|
||||
when 1
|
||||
json.type "notification"
|
||||
when 2
|
||||
json.type "atme"
|
||||
json.sender do
|
||||
sender = User.find_by_id(message["sender"])
|
||||
if sender.present?
|
||||
json.partial! '/users/user_simple', locals: {user: sender}
|
||||
else
|
||||
json.nil
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,7 @@
|
||||
json.total_count @data["records_count"]
|
||||
json.type %w(notification atme).include?(params[:type]) ? params[:type] : ""
|
||||
json.unread_notification @data["unread_notification"]
|
||||
json.unread_atme @data["unread_atme"]
|
||||
json.messages @data["records"].each do |message|
|
||||
json.partial! "message", message: message.stringify_keys
|
||||
end
|
||||
Reference in New Issue
Block a user