This commit is contained in:
董海洋
2026-05-26 09:18:48 +08:00
parent 12b582ec64
commit ff40282dc1
19 changed files with 703 additions and 8 deletions
+25
View File
@@ -0,0 +1,25 @@
const Router = require('koa-router')
const { query } = require('../config/database')
const router = new Router()
router.get('/:userId', async (ctx) => {
const userId = parseInt(ctx.params.userId)
if (!userId) {
ctx.body = { code: 400, message: '请指定用户ID' }
return
}
const logs = await query(
'SELECT * FROM points_logs WHERE user_id = ? ORDER BY created_at DESC',
[userId]
)
ctx.body = {
code: 200,
data: logs
}
})
module.exports = router.routes()