-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #48 from besscroft/dev
feat: 新增备份数据功能
- Loading branch information
Showing
2 changed files
with
69 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import sql from '~/config/db' | ||
|
||
export default defineEventHandler(async (event) => { | ||
const data = await sql` | ||
SELECT | ||
* | ||
FROM | ||
public.kamera_image | ||
WHERE | ||
del = 0 | ||
ORDER BY sort DESC, create_time DESC, update_time DESC | ||
` | ||
|
||
if (!data) { | ||
return Response.json({ code: 500, message: '没有数据!', data: null}) | ||
} | ||
|
||
return Response.json({ code: 200, message: 'success', data: data}) | ||
}) |
00892ed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
kamera – ./
kamera-besscrofts-projects.vercel.app
kamera.heming.dev
kamera-iota.vercel.app
kamera-git-main-besscrofts-projects.vercel.app