diff --git a/app/api/mobile/apis/comments.rb b/app/api/mobile/apis/comments.rb index 544ebf0ce..86132a93a 100644 --- a/app/api/mobile/apis/comments.rb +++ b/app/api/mobile/apis/comments.rb @@ -91,6 +91,7 @@ module Mobile desc '课程留言列表' params do optional :token, type: String + optional :page,type:Integer,desc:'页数' end get ':id/course_message' do cs = CommentService.new diff --git a/app/services/comment_service.rb b/app/services/comment_service.rb index a742d0eee..2464297da 100644 --- a/app/services/comment_service.rb +++ b/app/services/comment_service.rb @@ -94,7 +94,7 @@ class CommentService def course_messages params,current_user @course = ::Course.find(params[:id]) if (current_user.admin? || @course.is_public == 1 || (@course.is_public == 0 && current_user.member_of_course?(@course))) - @jours = @course.journals_for_messages.where('m_parent_id IS NULL').order('created_on DESC') + @jours = @course.journals_for_messages.where('m_parent_id IS NULL').order('created_on DESC').page(params[:page] ||= 1).per(10) else raise '403' end diff --git a/app/services/users_service.rb b/app/services/users_service.rb index 77cebe0b1..bd85e3340 100644 --- a/app/services/users_service.rb +++ b/app/services/users_service.rb @@ -292,6 +292,7 @@ class UsersService jours end + # 所有的与我相关 def reply_my_messages params,current_user jours = my_personal_messages params,current_user jours1 = my_course_messages params,current_user