feat: add task reward economy APIs
This commit is contained in:
@@ -40,6 +40,7 @@ import { LoginCoreService } from '../../core/login_core/login_core.service';
|
||||
import { ZulipAccountsService } from '../../core/db/zulip_accounts/zulip_accounts.service';
|
||||
import { ZulipAccountsMemoryService } from '../../core/db/zulip_accounts/zulip_accounts_memory.service';
|
||||
import { AccountProfileService } from '../auth/account_profile.service';
|
||||
import { TaskService } from '../tasks/task.service';
|
||||
|
||||
// ========== 接口定义 ==========
|
||||
|
||||
@@ -262,6 +263,7 @@ export class ChatService {
|
||||
@Inject('ZulipAccountsService')
|
||||
private readonly zulipAccountsService: ZulipAccountsService | ZulipAccountsMemoryService,
|
||||
private readonly accountProfileService: AccountProfileService,
|
||||
private readonly taskService: TaskService,
|
||||
) {
|
||||
this.logger.log('ChatService初始化完成');
|
||||
}
|
||||
@@ -445,6 +447,11 @@ export class ChatService {
|
||||
.catch(e => this.logger.warn('Zulip同步失败', { error: (e as Error).message }));
|
||||
}
|
||||
|
||||
if (normalizedScope === 'global') {
|
||||
await this.taskService.recordActivity(BigInt(session.userId), 'public_message_sent')
|
||||
.catch((error: unknown) => this.logger.warn('记录公共聊天任务失败', { error: error instanceof Error ? error.message : String(error) }));
|
||||
}
|
||||
|
||||
this.logger.log('聊天消息发送完成', {
|
||||
operation: 'sendChatMessage',
|
||||
messageId,
|
||||
|
||||
Reference in New Issue
Block a user