新增KV数据库存储附件

This commit is contained in:
eoao
2025-10-21 20:45:20 +08:00
parent dad4a22356
commit fdf9e95d67
18 changed files with 213 additions and 73 deletions

View File

@@ -1,8 +1,8 @@
import r2Service from '../service/r2-service';
import app from '../hono/hono';
app.get('/file/*', async (c) => {
const key = c.req.path.split('/file/')[1];
app.get('/oss/*', async (c) => {
const key = c.req.path.split('/oss/')[1];
const obj = await r2Service.getObj(c, key);
return new Response(obj.body, {
headers: {

View File

@@ -21,3 +21,9 @@ app.put('/setting/setBackground', async (c) => {
const key = await settingService.setBackground(c, await c.req.json());
return c.json(result.ok(key));
});
app.delete('/setting/deleteBackground', async (c) => {
await settingService.deleteBackground(c);
return c.json(result.ok());
});