perf: 邮箱支持保存和选择

This commit is contained in:
xiaojunnuo
2025-05-31 00:45:54 +08:00
parent 81282a9c88
commit f7b0b44ef6
10 changed files with 171 additions and 8 deletions
@@ -17,4 +17,25 @@ export class EmailController extends BaseController {
await this.emailService.test(userId, receiver);
return this.ok({});
}
@Post('/list', { summary: Constants.per.authOnly })
public async list() {
const userId = super.getUserId();
const res = await this.emailService.list(userId);
return this.ok(res);
}
@Post('/add', { summary: Constants.per.authOnly })
public async add(@Body('email') email) {
const userId = super.getUserId();
await this.emailService.add(userId, email);
return this.ok({});
}
@Post('/delete', { summary: Constants.per.authOnly })
public async delete(@Body('email') email) {
const userId = super.getUserId();
await this.emailService.delete(userId, email);
return this.ok({});
}
}