新增tg和第三方邮件转发

This commit is contained in:
eoao
2025-06-28 13:35:37 +08:00
parent 010e0451ab
commit 136c0496b8
25 changed files with 948 additions and 457 deletions

View File

@@ -17,7 +17,6 @@ import account from '../entity/account';
import starService from './star-service';
import dayjs from 'dayjs';
import kvConst from '../const/kv-const';
import constant from '../const/constant';
const emailService = {
@@ -514,7 +513,7 @@ const emailService = {
}
if (accountEmail) {
conditions.push(like(account.email, `${accountEmail}%`));
conditions.push(like(email.toEmail, `${accountEmail}%`));
}
if (name) {
@@ -535,16 +534,14 @@ const emailService = {
conditions.push(lt(email.emailId, emailId));
}
const query = orm(c).select({ ...email, userEmail: user.email, accountEmail: account.email })
const query = orm(c).select({ ...email, userEmail: user.email })
.from(email)
.leftJoin(user, eq(email.userId, user.userId))
.leftJoin(account, eq(email.accountId, account.accountId))
.where(and(...conditions));
const queryCount = orm(c).select({ total: count() })
.from(email)
.leftJoin(user, eq(email.userId, user.userId))
.leftJoin(account, eq(email.accountId, account.accountId))
.where(and(...countConditions));
if (timeSort) {
@@ -574,10 +571,10 @@ const emailService = {
},
async completeReceive(c, status, emailId) {
await orm(c).update(email).set({
return await orm(c).update(email).set({
isDel: isDel.NORMAL,
status: status
}).where(eq(email.emailId, emailId)).run();
}).where(eq(email.emailId, emailId)).returning().get();
}
};