新增邮件发送和管理员功能
This commit is contained in:
@@ -3,21 +3,42 @@ import userService from '../service/user-service';
|
||||
import result from '../model/result';
|
||||
import userContext from '../security/user-context';
|
||||
|
||||
app.get('/user/loginUserInfo', async (c) => {
|
||||
const user = await userService.loginUserInfo(c, await userContext.getUserId(c));
|
||||
return c.json(result.ok(user));
|
||||
});
|
||||
|
||||
app.put('/user/resetPassword', async (c) => {
|
||||
await userService.resetPassword(c, await c.req.json(), await userContext.getUserId(c));
|
||||
return c.json(result.ok());
|
||||
});
|
||||
|
||||
app.delete('/user/delete', async (c) => {
|
||||
await userService.delete(c, await userContext.getUserId(c));
|
||||
await userService.physicsDelete(c, c.req.query());
|
||||
return c.json(result.ok());
|
||||
})
|
||||
});
|
||||
|
||||
app.put('/user/setPwd', async (c) => {
|
||||
await userService.setPwd(c, await c.req.json());
|
||||
return c.json(result.ok());
|
||||
});
|
||||
|
||||
app.put('/user/setStatus', async (c) => {
|
||||
await userService.setStatus(c, await c.req.json());
|
||||
return c.json(result.ok());
|
||||
});
|
||||
|
||||
app.put('/user/setType', async (c) => {
|
||||
await userService.setType(c, await c.req.json());
|
||||
return c.json(result.ok());
|
||||
});
|
||||
|
||||
app.get('/user/list', async (c) => {
|
||||
const data = await userService.list(c, c.req.query(), userContext.getUserId(c));
|
||||
return c.json(result.ok(data));
|
||||
});
|
||||
|
||||
app.post('/user/add', async (c) => {
|
||||
await userService.add(c, await c.req.json());
|
||||
return c.json(result.ok());
|
||||
});
|
||||
|
||||
app.put('/user/resetSendCount', async (c) => {
|
||||
await userService.resetSendCount(c, await c.req.json());
|
||||
return c.json(result.ok());
|
||||
});
|
||||
|
||||
app.put('/user/restore', async (c) => {
|
||||
await userService.restore(c, await c.req.json());
|
||||
return c.json(result.ok());
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user