chore: directory migration - gateway→server, web→client/electron
This commit is contained in:
178
client/harmony/entry/src/main/ets/model/Models.ets
Normal file
178
client/harmony/entry/src/main/ets/model/Models.ets
Normal file
@ -0,0 +1,178 @@
|
||||
/*
|
||||
* AgentMail 鸿蒙客户端 — 领域模型
|
||||
* 与 docs/API.md 字段一一对应(单一事实源)
|
||||
*/
|
||||
|
||||
/** 当前登录用户 */
|
||||
export class Me {
|
||||
user_id: string = '';
|
||||
username: string = '';
|
||||
display_name: string = '';
|
||||
role: string = '';
|
||||
}
|
||||
|
||||
/** 会话 */
|
||||
export class Session {
|
||||
session_id: string = '';
|
||||
session_alias: string = '';
|
||||
from_agent: string = '';
|
||||
subject: string = '';
|
||||
status: string = '';
|
||||
max_rounds: number = 0;
|
||||
used_rounds: number = 0;
|
||||
permission_mode: string = '';
|
||||
permission_enforcement: string = '';
|
||||
created_at: string = '';
|
||||
updated_at: string = '';
|
||||
mail_count: number = 0;
|
||||
unread_count: number = 0;
|
||||
}
|
||||
|
||||
/** 邮件摘要(收件箱/会话列表用) */
|
||||
export class MailSummary {
|
||||
mail_id: string = '';
|
||||
session_id: string = '';
|
||||
from_name: string = '';
|
||||
to_name: string = '';
|
||||
subject: string = '';
|
||||
body_preview: string = '';
|
||||
created_at: string = '';
|
||||
status: string = ''; // unread | read
|
||||
is_read: boolean = true;
|
||||
has_attachments: boolean = false;
|
||||
permission_mode: string = '';
|
||||
/** 客户端聚合字段:服务端不返回,由收件箱按来源账号填充。 */
|
||||
source_account_id: string = '';
|
||||
source_account_name: string = '';
|
||||
}
|
||||
|
||||
/** 附件元数据 */
|
||||
export class AttachmentInfo {
|
||||
attachment_id: string = '';
|
||||
filename: string = '';
|
||||
size: number = 0;
|
||||
content_type: string = '';
|
||||
}
|
||||
|
||||
/** 邮件详情 */
|
||||
export class MailDetail {
|
||||
mail_id: string = '';
|
||||
session_id: string = '';
|
||||
from_name: string = '';
|
||||
to_name: string = '';
|
||||
cc: string[] = [];
|
||||
subject: string = '';
|
||||
body: string = '';
|
||||
created_at: string = '';
|
||||
status: string = '';
|
||||
session_alias: string = '';
|
||||
from_human: boolean = false;
|
||||
to_human: boolean = false;
|
||||
is_read: boolean = true;
|
||||
attachments: AttachmentInfo[] = [];
|
||||
permission_mode: string = '';
|
||||
permission_enforcement: string = '';
|
||||
}
|
||||
|
||||
/** 对话树节点 */
|
||||
export class ThreadNode {
|
||||
mail_id: string = '';
|
||||
parent_mail_id: string = '';
|
||||
depth: number = 0;
|
||||
from_name: string = '';
|
||||
to_name: string = '';
|
||||
subject: string = '';
|
||||
body_preview: string = '';
|
||||
attachment_count: number = 0;
|
||||
detached: boolean = false;
|
||||
parent_hidden: boolean = false;
|
||||
}
|
||||
|
||||
/** 对话树响应 */
|
||||
export class ThreadResponse {
|
||||
anchor_mail_id: string = '';
|
||||
dir: string = '';
|
||||
nodes: ThreadNode[] = [];
|
||||
total: number = 0;
|
||||
hidden: number = 0;
|
||||
has_more_up: boolean = false;
|
||||
has_more_down: boolean = false;
|
||||
next_up: number = 0;
|
||||
next_down: number = 0;
|
||||
}
|
||||
|
||||
/** 联系人(= 一条三维地址) */
|
||||
export class Contact {
|
||||
session_id: string = '';
|
||||
agent_name: string = '';
|
||||
path: string = '';
|
||||
session_alias: string = '';
|
||||
address: string = '';
|
||||
status: string = '';
|
||||
mail_count: number = 0;
|
||||
unread_count: number = 0;
|
||||
last_activity: string = '';
|
||||
subject: string = '';
|
||||
max_rounds: number = 0;
|
||||
used_rounds: number = 0;
|
||||
permission_mode: string = '';
|
||||
permission_enforcement: string = '';
|
||||
last_from: string = '';
|
||||
last_preview: string = '';
|
||||
}
|
||||
|
||||
/** 权限请求 */
|
||||
export class PermissionRequest {
|
||||
mail_id: string = '';
|
||||
session_id: string = '';
|
||||
from_name: string = '';
|
||||
question: string = '';
|
||||
context: string = '';
|
||||
options: string[] = [];
|
||||
created_at: string = '';
|
||||
}
|
||||
|
||||
/** 用户密钥(token_hint 仅前 8 位) */
|
||||
export class UserKey {
|
||||
key_id: string = '';
|
||||
label: string = '';
|
||||
key_type: string = '';
|
||||
token_hint: string = '';
|
||||
status: string = '';
|
||||
created_at: string = '';
|
||||
}
|
||||
|
||||
/** 地址补全候选 */
|
||||
export class AddressSuggestion {
|
||||
value: string = '';
|
||||
kind: string = '';
|
||||
}
|
||||
|
||||
/** 发信请求体 */
|
||||
export class SendMailRequest {
|
||||
to: string = '';
|
||||
cc: string = '';
|
||||
subject: string = '';
|
||||
body: string = '';
|
||||
reply_to: string = '';
|
||||
session_alias: string = '';
|
||||
attachment_ids: string[] = [];
|
||||
max_rounds: number = 0;
|
||||
permission_mode: string = '';
|
||||
}
|
||||
|
||||
/** 发信响应(含预算) */
|
||||
export class SendMailResult {
|
||||
mail_id: string = '';
|
||||
session_id: string = '';
|
||||
session_alias: string = '';
|
||||
budget_used: number = 0;
|
||||
budget_max: number = 0;
|
||||
budget_remaining: number = 0;
|
||||
}
|
||||
|
||||
/** 登录响应 */
|
||||
export class LoginResult {
|
||||
token: string = '';
|
||||
user: Me = new Me();
|
||||
}
|
||||
13
client/harmony/entry/src/main/ets/model/RouteParams.ets
Normal file
13
client/harmony/entry/src/main/ets/model/RouteParams.ets
Normal file
@ -0,0 +1,13 @@
|
||||
/* AgentMail 页面路由参数:集中声明,避免各页重复定义或使用无类型对象字面量。 */
|
||||
|
||||
export interface MailDetailParams {
|
||||
mail_id: string;
|
||||
account_id: string;
|
||||
}
|
||||
|
||||
export interface ComposeParams {
|
||||
to: string;
|
||||
reply_to: string;
|
||||
session_alias: string;
|
||||
account_id: string;
|
||||
}
|
||||
Reference in New Issue
Block a user