|
@@ -0,0 +1,58 @@
|
|
|
|
|
+import { Injectable } from '@angular/core';
|
|
|
|
|
+
|
|
|
|
|
+export interface MatrixAccountInput {
|
|
|
|
|
+ id: string;
|
|
|
|
|
+ name: string;
|
|
|
|
|
+ persona: string;
|
|
|
|
|
+ topics: string[];
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+export interface MatrixAccountCompareReport {
|
|
|
|
|
+ accounts: MatrixAccountInput[];
|
|
|
|
|
+ overlapWarnings: string[];
|
|
|
|
|
+ differentiationSuggestions: string[];
|
|
|
|
|
+ collaborationSuggestions: string[];
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+@Injectable({ providedIn: 'root' })
|
|
|
|
|
+export class IpMatrixAccountService {
|
|
|
|
|
+ compareAccounts(accounts: MatrixAccountInput[]): MatrixAccountCompareReport {
|
|
|
|
|
+ const normalized = accounts.map((account) => ({
|
|
|
|
|
+ ...account,
|
|
|
|
|
+ topics: [...new Set((account.topics || []).map((item) => item.trim()).filter(Boolean))],
|
|
|
|
|
+ }));
|
|
|
|
|
+ return {
|
|
|
|
|
+ accounts: normalized,
|
|
|
|
|
+ overlapWarnings: this.overlapWarnings(normalized),
|
|
|
|
|
+ differentiationSuggestions: normalized.map((account) =>
|
|
|
|
|
+ `${account.name} 保留「${account.persona || '独立人设'}」边界,标题、案例和栏目要避免与其他账号重复。`
|
|
|
|
|
+ ),
|
|
|
|
|
+ collaborationSuggestions: this.collaborationSuggestions(normalized),
|
|
|
|
|
+ };
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private overlapWarnings(accounts: MatrixAccountInput[]): string[] {
|
|
|
|
|
+ const warnings: string[] = [];
|
|
|
|
|
+ for (let i = 0; i < accounts.length; i += 1) {
|
|
|
|
|
+ for (let j = i + 1; j < accounts.length; j += 1) {
|
|
|
|
|
+ const overlap = accounts[i].topics.filter((topic) => accounts[j].topics.includes(topic));
|
|
|
|
|
+ if (overlap.length) {
|
|
|
|
|
+ warnings.push(`${accounts[i].name} 与 ${accounts[j].name} 在「${overlap.join('、')}」上重复,需要拆分表达角度和承接任务。`);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return warnings;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private collaborationSuggestions(accounts: MatrixAccountInput[]): string[] {
|
|
|
|
|
+ if (accounts.length < 2) {
|
|
|
|
|
+ return ['当前只有一个账号,先稳定定位、内容支柱和更新节奏,再扩展矩阵。'];
|
|
|
|
|
+ }
|
|
|
|
|
+ const [main, ...assistants] = accounts;
|
|
|
|
|
+ const assistantNames = assistants.map((item) => item.name).join('、');
|
|
|
|
|
+ return [
|
|
|
|
|
+ `${main.name} 负责主观点、信任建立和转化承接;${assistantNames} 负责教程、案例、问题收集或垂直栏目。`,
|
|
|
|
|
+ '评论区问题先回流到主账号选题池,再分配给不同矩阵账号生成差异化脚本。',
|
|
|
|
|
+ ];
|
|
|
|
|
+ }
|
|
|
|
|
+}
|