feat: 관리자 가입자 목록 — 가입 경로(웹 일반·구글·토스)별 인원, 레벲·각·가입일·마지막 활동 (GET /v1/admin/users)

This commit is contained in:
minaChoi committed 2026-10-29 09:57:15 +09:00
1 parent 0f22d1fa81
commit 2483dbf9ba
10 files changed
+241 -2

No files matched your search

+13
View File
@@ -155,6 +155,19 @@ function postApi(): Plugin {
res.end(JSON.stringify({ error: e instanceof Error ? e.message : String(e) }))
}
})
// 가입자: GET /api/users → GET /v1/admin/users
server.middlewares.use('/api/users', async (req, res) => {
res.setHeader('Content-Type', 'application/json; charset=utf-8')
try {
if (req.method !== 'GET') throw new Error('GET /api/users')
const t = targetOf(req)
return await relay(res, await fetch(`${t.api}/v1/admin/users?limit=2000`, { headers: headers(t) }))
} catch (e) {
server.config.logger.error(`[users-api] ${e instanceof Error ? e.message : String(e)}`)
res.statusCode = 500
res.end(JSON.stringify({ error: e instanceof Error ? e.message : String(e) }))
}
})
server.middlewares.use('/api/post', async (req, res) => {
res.setHeader('Content-Type', 'application/json; charset=utf-8')
try {