refactor: File upload (#5542)

* chore: rename service

* refactor: upload

* chore: save upload meta data

* chore: add sql test

* chore: uploader

* chore: fix upload

* chore: cache file and remove after finish

* chore: retry upload

* chore: pause when netowork unreachable

* chore: add event test

* chore: add test

* chore: clippy

* chore: update client-api commit id

* chore: fix flutter test
This commit is contained in:
Nathan.fooo
2024-06-20 07:44:57 +08:00
committed by GitHub
parent fdaca36b87
commit b64da2c02f
61 changed files with 2687 additions and 643 deletions

View File

@ -0,0 +1,2 @@
-- This file should undo anything in `up.sql`
drop table upload_file_table;

View File

@ -0,0 +1,20 @@
-- Your SQL goes here
CREATE TABLE upload_file_table (
workspace_id TEXT NOT NULL,
file_id TEXT NOT NULL,
parent_dir TEXT NOT NULL,
local_file_path TEXT NOT NULL,
content_type TEXT NOT NULL,
chunk_size INTEGER NOT NULL,
num_chunk INTEGER NOT NULL,
upload_id TEXT NOT NULL DEFAULT '',
created_at BIGINT NOT NULL,
PRIMARY KEY (workspace_id, parent_dir, file_id)
);
CREATE TABLE upload_file_part (
upload_id TEXT NOT NULL,
e_tag TEXT NOT NULL,
part_num INTEGER NOT NULL,
PRIMARY KEY (upload_id, e_tag)
);