From 6a42ba7e43e1c3f50b5e9b5c6f4e389fbabb3c0d Mon Sep 17 00:00:00 2001 From: narawat Date: Wed, 25 Feb 2026 07:29:42 +0700 Subject: [PATCH] update --- AI_prompt.txt | 4 +++- src/NATSBridge.jl | 12 ++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/AI_prompt.txt b/AI_prompt.txt index 6a0f3f3..38e74a4 100644 --- a/AI_prompt.txt +++ b/AI_prompt.txt @@ -12,4 +12,6 @@ Role: Principal Systems Architect & Lead Software Engineer.Objective: Implement -Create a walkthrough for Julia service-A service sending a mix-content chat message to Julia service-B. the chat message must includes \ No newline at end of file +Create a walkthrough for Julia service-A service sending a mix-content chat message to Julia service-B. the chat message must includes + +I update architecture.md and NATSBridge.jl. Use them as ground truth and update implementation.md accordingly. Also look for any inconsistency. \ No newline at end of file diff --git a/src/NATSBridge.jl b/src/NATSBridge.jl index ed9ddd4..03044fe 100644 --- a/src/NATSBridge.jl +++ b/src/NATSBridge.jl @@ -914,7 +914,7 @@ retrieves an upload ID and token, then uploads the file data as multipart form d # Arguments: - `file_server_url::String` - Base URL of the plik server (e.g., `"http://localhost:8080"`) - - `filename::String` - Name of the file being uploaded + - `dataname::String` - Name of the file being uploaded - `data::Vector{UInt8}` - Raw byte data of the file content # Return: @@ -929,17 +929,17 @@ retrieves an upload ID and token, then uploads the file data as multipart form d using HTTP, JSON fileserver_url = "http://localhost:8080" - filename = "test.txt" + dataname = "test.txt" data = Vector{UInt8}("hello world") # Upload to local plik server - result = plik_oneshot_upload(file_server_url, filename, data) + result = plik_oneshot_upload(file_server_url, dataname, data) # Access the result as a Dict # result["status"], result["uploadid"], result["fileid"], result["url"] ``` """ -function plik_oneshot_upload(file_server_url::String, filename::String, data::Vector{UInt8}) +function plik_oneshot_upload(file_server_url::String, dataname::String, data::Vector{UInt8}) # ----------------------------------------- get upload id ---------------------------------------- # # Equivalent curl command: curl -X POST -d '{ "OneShot" : true }' http://localhost:8080/upload @@ -953,7 +953,7 @@ function plik_oneshot_upload(file_server_url::String, filename::String, data::Ve # ------------------------------------------ upload file ----------------------------------------- # # Equivalent curl command: curl -X POST --header "X-UploadToken: UPLOAD_TOKEN" -F "file=@PATH_TO_FILE" http://localhost:8080/file/UPLOAD_ID - file_multipart = HTTP.Multipart(filename, IOBuffer(data), "application/octet-stream") # Plik won't accept raw bytes upload + file_multipart = HTTP.Multipart(dataname, IOBuffer(data), "application/octet-stream") # Plik won't accept raw bytes upload url_upload = "$file_server_url/file/$uploadid" headers = ["X-UploadToken" => uploadtoken] @@ -973,7 +973,7 @@ function plik_oneshot_upload(file_server_url::String, filename::String, data::Ve fileid = response_json["id"] # url of the uploaded data e.g. "http://192.168.1.20:8080/file/3F62E/4AgGT/test.zip" - url = "$file_server_url/file/$uploadid/$fileid/$filename" + url = "$file_server_url/file/$uploadid/$fileid/$dataname" return Dict("status" => http_response.status, "uploadid" => uploadid, "fileid" => fileid, "url" => url) end