|
|
|
@ -16,10 +16,14 @@ module Mobile
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
case f
|
|
|
|
|
when :blog_praise_count
|
|
|
|
|
when :praise_count
|
|
|
|
|
get_activity_praise_num(u)
|
|
|
|
|
when :lasted_comment
|
|
|
|
|
time_from_now(u.created_at)
|
|
|
|
|
when :act_type
|
|
|
|
|
'BlogComment'
|
|
|
|
|
when :act_id
|
|
|
|
|
u.id
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
@ -32,6 +36,8 @@ module Mobile
|
|
|
|
|
c.author
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
blog_comment_expose :act_type
|
|
|
|
|
blog_comment_expose :act_id
|
|
|
|
|
blog_comment_expose :blog_id
|
|
|
|
|
blog_comment_expose :title
|
|
|
|
|
blog_comment_expose :content
|
|
|
|
@ -39,13 +45,13 @@ module Mobile
|
|
|
|
|
blog_comment_expose :created_at
|
|
|
|
|
blog_comment_expose :lasted_comment
|
|
|
|
|
blog_comment_expose :id
|
|
|
|
|
blog_comment_expose :blog_praise_count
|
|
|
|
|
blog_comment_expose :praise_count
|
|
|
|
|
expose :blog_comment_children, using:Mobile::Entities::BlogComment do |c,opt|
|
|
|
|
|
if c.is_a? (::BlogComment)
|
|
|
|
|
c.children.reverse
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
expose :has_praise , if: lambda { |instance, options| options[:user] } do |instance, options|
|
|
|
|
|
expose :has_praise, if: lambda { |instance, options| options[:user] } do |instance, options|
|
|
|
|
|
has_praise = false
|
|
|
|
|
current_user = options[:user]
|
|
|
|
|
obj = PraiseTread.where("praise_tread_object_id=? and praise_tread_object_type=? and user_id=?",instance.id,instance.class.to_s,current_user.id)
|
|
|
|
|