update task struct
This commit is contained in:
+1
-1
@@ -11,7 +11,7 @@ local file_dir = ngx.var.tmp_file_dir
|
||||
ngx.req.read_body()
|
||||
local req_body = cjson.decode(ngx.req.get_body_data())
|
||||
ngx.log(ngx.INFO, 'REQ_BODY -> ', ngx.req.get_body_data())
|
||||
local data = req_body["data"]["images"]
|
||||
local data = req_body["payload"]["images"]
|
||||
local combined = file_dir .. "/" .. uuid.generate_v4() .. ".jpeg";
|
||||
local len = table.getn(data)
|
||||
if len == 0 then
|
||||
|
||||
@@ -100,7 +100,7 @@ local function convert()
|
||||
local req_body = cjson.decode(ngx.req.get_body_data())
|
||||
ngx.log(ngx.INFO, 'REQ_BODY -> ', ngx.req.get_body_data())
|
||||
|
||||
local input_audio_file = get_wx_media(req_body["data"]["media_id"]);
|
||||
local input_audio_file = get_wx_media(req_body["payload"]["media_id"]);
|
||||
local converted_audio_file = file_dir .. "/" .. uuid.generate_v4() .. ".mp3";
|
||||
|
||||
ngx.log(ngx.INFO, "Input audio file -> ", input_audio_file);
|
||||
|
||||
+1
-1
@@ -173,7 +173,7 @@ while true do
|
||||
ngx.log(ngx.INFO, 'Authorization -> ', authHeader)
|
||||
ngx.log(ngx.INFO, 'HtySudoerToken -> ', sudoerToken)
|
||||
|
||||
local body_text = cjson.encode({ task_type = TaskTypes.UPLOAD_PICTURE, data = { images = files } })
|
||||
local body_text = cjson.encode({ task_type = TaskTypes.UPLOAD_PICTURE, payload = { images = files } })
|
||||
|
||||
ngx.log(ngx.INFO, 'UPLOAD_PICTURE *body_text* ->', body_text)
|
||||
local res, err = httpc:request_uri(
|
||||
|
||||
@@ -23,7 +23,7 @@ local function create_task()
|
||||
ngx.log(ngx.INFO, 'HtySudoerToken -> ', sudoerToken)
|
||||
ngx.log(ngx.INFO, 'HtyHost -> ', htyHost)
|
||||
|
||||
local body_text = cjson.encode({ task_type = TaskTypes.CONVERT_AUDIO_FILE, data = { media_id = media_id } })
|
||||
local body_text = cjson.encode({ task_type = TaskTypes.CONVERT_AUDIO_FILE, payload = { media_id = media_id } })
|
||||
|
||||
ngx.log(ngx.INFO, 'AUDIO_CONVERT *body_text* ->', body_text)
|
||||
local res, err = httpc:request_uri(
|
||||
|
||||
Reference in New Issue
Block a user