|
|
|
@ -29,14 +29,32 @@ module Mobile
|
|
|
|
|
elsif ac.act_type == "Issue"
|
|
|
|
|
ac.nil? || ac.act.nil? ? 0 : ac.act.journals.count
|
|
|
|
|
end
|
|
|
|
|
when :subject
|
|
|
|
|
if ac.act_type == "HomeworkCommon"
|
|
|
|
|
ac.act.name unless ac.nil? || ac.act.nil?
|
|
|
|
|
elsif ac.act_type == "News" || ac.act_type == "BlogComment"
|
|
|
|
|
ac.act.title unless ac.nil? || ac.act.nil?
|
|
|
|
|
elsif ac.act_type == "Message" || ac.act_type == "Issue"
|
|
|
|
|
ac.act.subject unless ac.nil? || ac.act.nil?
|
|
|
|
|
elsif ac.act_type == "JournalsForMessage"
|
|
|
|
|
ac.act.private == 0 ? "留言" : "私信"
|
|
|
|
|
end
|
|
|
|
|
when :description
|
|
|
|
|
if ac.act_type == "HomeworkCommon" || ac.act_type == "Issue" || ac.act_type == "News"
|
|
|
|
|
ac.act.description unless ac.nil? || ac.act.nil?
|
|
|
|
|
elsif ac.act_type == "Message" || ac.act_type == "BlogComment"
|
|
|
|
|
ac.act.content unless ac.nil? || ac.act.nil?
|
|
|
|
|
end
|
|
|
|
|
when :latest_update
|
|
|
|
|
time_from_now ac.updated_at unless ac.nil?
|
|
|
|
|
when :activity_praise_count
|
|
|
|
|
if ac.act_type == "HomeworkCommon" || ac.act_type == "News" || ac.act_type == "Message" || ac.act_type == "BlogComment" || ac.act_type == "JournalsForMessage" || ac.act_type == "Issue"
|
|
|
|
|
ac.nil? || ac.act.nil? ? 0 : get_activity_praise_num(ac.act)
|
|
|
|
|
end
|
|
|
|
|
when :homework_common_detail_manual
|
|
|
|
|
if ac.act_type == "HomeworkCommon"
|
|
|
|
|
ac.act.homework_detail_manual unless ac.nil? || ac.act.nil? || ac.act.homework_detail_manual.nil?
|
|
|
|
|
end
|
|
|
|
|
#when :homework_common_detail_manual
|
|
|
|
|
# if ac.act_type == "HomeworkCommon"
|
|
|
|
|
# ac.act.homework_detail_manual unless ac.nil? || ac.act.nil? || ac.act.homework_detail_manual.nil?
|
|
|
|
|
# end
|
|
|
|
|
when :course_project_name
|
|
|
|
|
if ac.container_type == "Course"
|
|
|
|
|
name = (get_course(ac.container_id)).name
|
|
|
|
@ -91,10 +109,22 @@ module Mobile
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
act_expose :homework_common_detail_manual #作业相关信息
|
|
|
|
|
expose :homework_common_detail , using: Mobile::Entities::Whomework do |a, opt| #作业相关信息
|
|
|
|
|
if a.act_type == "HomeworkCommon"
|
|
|
|
|
a.act
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
expose :issue_detail, using: Mobile::Entities::Issue do |a, opt| #缺陷信息
|
|
|
|
|
if a.act_type == "Issue"
|
|
|
|
|
a.act
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
act_expose :reply_count #回复数
|
|
|
|
|
act_expose :activity_praise_count #点赞数
|
|
|
|
|
act_expose :user_act #某个动态
|
|
|
|
|
#act_expose :user_act #某个动态
|
|
|
|
|
act_expose :subject #标题
|
|
|
|
|
act_expose :description #描述
|
|
|
|
|
act_expose :latest_update #最新更新时间
|
|
|
|
|
act_expose :course_project_name #课程/项目名字
|
|
|
|
|
act_expose :activity_type_name #课程问答区/项目缺陷等
|
|
|
|
|
end
|
|
|
|
|