个人留言

This commit is contained in:
lizanle 2015-05-26 09:48:22 +08:00
parent 122de16180
commit 3318d11c6d
2 changed files with 18 additions and 3 deletions

View File

@ -107,7 +107,7 @@ module Mobile
present :status,0
end
desc "给用户留言或回复用户留言"
desc "回复用户留言"
params do
requires :token, type: String
requires :user_id, type: Integer,desc: '被留言的用户id'
@ -116,12 +116,23 @@ module Mobile
requires :parent_id,type:Integer,desc:'留言父id'
requires :ref_message_id,type:Integer,desc:'引用消息id'
end
post ':user_id/leave_message' do
post ':user_id/reply_message' do
us = UsersService.new
jours = us.reply_user_messages params,current_user
present :status,0
end
desc "给用户留言"
params do
requires :token, type: String
requires :user_id, type: Integer,desc:'被留言的用户id'
requires :content, type: String,desc:'留言内容'
end
post ':user_id/leave_message' do
us = UsersService.new
us.leave_message params,current_user
present :data,0
end
end
end
end

View File

@ -184,7 +184,11 @@ class UsersService
user.add_jour(nil, nil,nil,options)
end
# 给用户留言
def leave_message params,current_user
obj = User.find(params[:user_id]).add_jour(current_user, params[:content], 0)
obj
end
#关注列表