|
@@ -997,6 +997,50 @@ s.resp.get_folder_info = function(fd,msg_body,user_data)
|
|
|
)
|
|
|
end
|
|
|
|
|
|
+
|
|
|
+--根据文件ID获取文件信息
|
|
|
+s.resp.get_file_info_by_id = function(fd,msg_body,user_data)
|
|
|
+ msg_body = cjson.decode(msg_body)
|
|
|
+ if type(user_data) ~= "table" then
|
|
|
+ return tools.response(fd, 200, "token error!")
|
|
|
+ end
|
|
|
+ local user_id = user_data.user_id
|
|
|
+ -- tools.dump(msg_body)
|
|
|
+ if user_id==nil then
|
|
|
+ return tools.response(fd,100,"user_id==nil get_file_info_by_id !")
|
|
|
+ end
|
|
|
+ msg_body["user_id"] = user_id
|
|
|
+ local isok ,key = tools.checkData({"file_id"},msg_body)
|
|
|
+ if not isok then
|
|
|
+ return tools.response(fd,200,cjson.encode({code=9001,msg = string.format("缺少字段: %s.", key)}))
|
|
|
+ end
|
|
|
+ isok = skynet.call("dbmgr","lua","on_recv","get_file_info_by_id",{
|
|
|
+ file_id = msg_body.file_id,
|
|
|
+ user_id = user_id},fd
|
|
|
+ )
|
|
|
+end
|
|
|
+
|
|
|
+--获取文件列表中已删除的文件
|
|
|
+s.resp.get_not_have_file_list_by_list = function(fd,msg_body,user_data)
|
|
|
+ msg_body = cjson.decode(msg_body)
|
|
|
+ if type(user_data) ~= "table" then
|
|
|
+ return tools.response(fd, 200, "token error!")
|
|
|
+ end
|
|
|
+ local user_id = user_data.user_id
|
|
|
+ -- tools.dump(msg_body)
|
|
|
+ if user_id==nil then
|
|
|
+ return tools.response(fd,100,"user_id==nil get_not_have_file_list_by_list !")
|
|
|
+ end
|
|
|
+ msg_body["user_id"] = user_id
|
|
|
+ local isok ,key = tools.checkData({"file_id_list"},msg_body)
|
|
|
+ if not isok then
|
|
|
+ return tools.response(fd,200,cjson.encode({code=9001,msg = string.format("缺少字段: %s.", key)}))
|
|
|
+ end
|
|
|
+ isok = skynet.call("dbmgr","lua","on_recv","get_not_have_file_list_by_list",{
|
|
|
+ file_id_list = msg_body.file_id_list,
|
|
|
+ user_id = user_id},fd
|
|
|
+ )
|
|
|
+end
|
|
|
--踢掉
|
|
|
s.resp.kick = function(fd,msg_body,user_data)
|
|
|
|