初始化模版工程
This commit is contained in:
7
app/api/file/record/route.ts
Normal file
7
app/api/file/record/route.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import { oapiClient, sendResponse } from '../../oapi-client'
|
||||
|
||||
export async function POST(req: Request) {
|
||||
const body = req.body ? await req.json() : {}
|
||||
const res = await oapiClient.post('/v1/super_agent/file_upload_record/create', body)
|
||||
return sendResponse(res)
|
||||
}
|
||||
12
app/api/file/sign/route.ts
Normal file
12
app/api/file/sign/route.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { oapiClient, sendResponse } from '../../oapi-client'
|
||||
|
||||
export async function POST(req: Request) {
|
||||
const body = req.body ? await req.json() : {}
|
||||
const key = body.file_path || body.key
|
||||
const res = await oapiClient.post('v1/oss/sign_url', {
|
||||
key,
|
||||
params: body.params,
|
||||
})
|
||||
|
||||
return sendResponse(res)
|
||||
}
|
||||
8
app/api/file/upload/route.ts
Normal file
8
app/api/file/upload/route.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import { oapiClient, sendResponse } from '../../oapi-client'
|
||||
|
||||
export async function POST(req: Request) {
|
||||
const body = await req.formData()
|
||||
const res = await oapiClient.post('/v1/oapi/super_agent/chat/file_upload', body)
|
||||
|
||||
return sendResponse(res)
|
||||
}
|
||||
Reference in New Issue
Block a user