904118851 1 жил өмнө
parent
commit
5dc6666415

+ 26 - 0
service/agentmgr/init.lua

@@ -784,6 +784,32 @@ s.resp.reset_password = function(fd,msg_body,user_data)
     end
     return tools.response(fd,200,cjson.encode({code=10000,msg = "修改密码成功!"}))
 end
+
+s.resp.update_generate_video_custom = 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 update_generate_video_custom !")
+    end
+    msg_body["user_id"] = user_id
+    local isok ,key =  tools.checkData({"data"},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","update_generate_video_custom",{
+        data = msg_body.data,
+        user_id = user_id}
+    )
+
+    if not isok then
+        return tools.response(fd,200,cjson.encode({code=10001,msg = "更新失败!"}))
+    end
+    return tools.response(fd,200,cjson.encode({code=10000,msg = "更新成功!"}))
+end
 --踢掉
 s.resp.kick = function(fd,msg_body,user_data)
     

+ 17 - 0
service/dbmgr/init.lua

@@ -1393,6 +1393,23 @@ s.resp.recv_ref_file_modify_info = function(msg_body)
     return true
 end
 
+s.resp.update_generate_video_custom = function(msg_body)
+    local list = msg_body.data
+    skynet.fork(function()
+        for i = 1, #list, 1 do
+            local video_id =  list[i].video_id
+            local custom = "{}"
+            if list[i].custom~=nil and list[i].custom~="" then
+                 custom = list[i].custom
+            end
+            local sql = string.format("UPDATE generate_video_list_tab SET custom = '%s' WHERE id = %d and user_id = %d",custom,video_id,msg_body.user_id)
+            db:query(sql)
+            -- skynet.error(sql)
+         end
+    end)
+    -- skynet.error(sql)
+    return true
+end
 --接收到修改引用的文件夹信息
 s.resp.recv_ref_folder_modify_info = function(msg_body)
     local folder_id = msg_body.folder_id

+ 1 - 7
service/doc/mysql_use.sql

@@ -138,13 +138,7 @@ SELECT * FROM users;  --查询用户表的所有内容
 
 
 	--配置
-	create table video_tools_config_tab (
-		id int not null auto_increment COMMENT '唯一id',
-		config_info JSON COMMENT '资源类型配置',
-		permissions_info JSON COMMENT '权限配置',
-		group_info JSON COMMENT '组配置',
-		other_info JSON COMMENT '其他配置',
-		primary key (id));
+	
 
 
 	INSERT INTO res_list_tab (user_id, folder_id, file_type, file_name, file_info) VALUES (2, 1, 2, "absd.mp4", '{"width": 100, "height": 100, "duration": 123}'); --插入一条数据