refactor: add cache logic

This commit is contained in:
JuanZoran
2023-03-12 21:33:00 +08:00
parent bc8c673ee0
commit f86ff7b615
9 changed files with 153 additions and 182 deletions

View File

@@ -1,6 +1,7 @@
local M = {
uri = 'https://fanyi-api.baidu.com/api/trans/vip/translate',
salt = tostring(math.random(bit.lshift(1, 15))),
name = 'baidu',
}
local Trans = require('Trans')

View File

@@ -1,4 +1,7 @@
local M = { no_wait = true, }
local M = {
no_wait = true,
name = 'offline',
}
local db = require 'sqlite.db'
vim.api.nvim_create_autocmd('VimLeavePre', {