添加课程留言接口
This commit is contained in:
parent
0dfa428377
commit
b1903dba11
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue