mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-17 18:25:56 +08:00
add: user common info cache service
This commit is contained in:
16
app/views/users/_cache_simple_user.json.jbuilder
Normal file
16
app/views/users/_cache_simple_user.json.jbuilder
Normal file
@@ -0,0 +1,16 @@
|
||||
user = $redis_cache.hgetall("v2-owner-common:#{name}-#{email}")
|
||||
if user.blank?
|
||||
json.id nil
|
||||
json.type nil
|
||||
json.login name
|
||||
json.name name
|
||||
json.email email
|
||||
json.image_url User::Avatar.get_letter_avatar_url(name)
|
||||
else
|
||||
json.id user["id"]
|
||||
json.type user["type"]
|
||||
json.login user["login"]
|
||||
json.name user["name"]
|
||||
json.email user["email"]
|
||||
json.image_url user["avatar_url"]
|
||||
end
|
||||
Reference in New Issue
Block a user