This commit is contained in:
sw 2015-02-06 11:22:48 +08:00
commit 3c8f851c37
2 changed files with 22 additions and 0 deletions

View File

@ -38,6 +38,22 @@ module Mobile
present :status, 0
end
desc '课程留言'
params do
requires :token, type: String
requires :course_message,type: String, desc: '留言'
end
post ':id/leave_course_message' do
cs_params = {
id: params[:id],
token: params[:token],
new_form: params.reject{|k,v| [:id,:token].include?(k)}}
cs = CommentService.new
message = cs.leave_course_message cs_params,current_user
present :data, message, with: Mobile::Entities::Jours
present :status, 0
end
desc '回复留言'
params do
requires :token, type: String

View File

@ -36,6 +36,12 @@ class CommentService
@bid.set_commit(@feedback_count)
jfm
end
#课程留言接口
def leave_course_message params,current_user
message = params[:new_form][:course_message]
feedback = Course.add_new_jour(current_user, message, params[:id])
feedback
end
#回复留言接口
def create_reply params,current_user