/** * 用户信息 */ export interface User { /** * id */ id: string; /** * 用户名 * @example zhaoyingbo */ userId: string; /** * open_id */ openId: string; /** * 提醒列表 */ remindList: string[]; } /** * 提醒列表 */ export interface Remind { /** * id */ id: string; /** * 所有者信息,绑定用户表的id */ owner: string; /** * 消息Id */ messageId: string; /** * 接收者类型 */ subscriberType: "open_id" | "user_id" | "union_id" | "email" | "chat_id"; /** * 接收者Id */ subscriberId: string; /** * 是否需要回复,不需要回复的也不会重复提醒 */ needReply: boolean; /** * 延迟时间 */ delayTime: number; /** * 卡片信息,用于绘制初始卡片、确认卡片、取消卡片、延迟卡片 */ cardInfo: { /** * 提醒标题,必须要有 */ title: string; /** * 插图key */ imageKey?: string; /** * 提醒内容,为空不显示 */ content?: string; /** * 确认文本,为空不显示,为需要回复卡片时,如果为空则默认为“完成” */ confirmText?: string; /** * 取消文本,为空不显示 */ cancelText?: string; /** * 延迟文本,为空不显示 */ delayText?: string; } | null; /** * 卡片模板信息 */ templateInfo: { /** * 卡片模板ID,会注入变量 * ${owner} 所有者 * ${remindTime} 提醒时间 */ pendingTemplateId: string; /** * 交互之后的卡片模板ID,如果有这个就不会用下边三个但是都会注入变量 * ${owner} 所有者 * ${remindTime} 提醒时间 * ${result} 交互结果,会读卡片按钮绑定的变量text,如果没有则是绑定的result对应的 已确认、已取消、已延迟 * ${interactTime} 交互时间 */ interactedTemplateId: string; /** * 确认之后的卡片模板ID */ confirmedTemplateId: string; /** * 取消之后的卡片模板ID */ cancelededTemplateId: string; /** * 延迟之后的卡片模板ID */ delayedTemplateId: string; } | null; /** * 提醒时间 */ remindTimes: RemindTime[]; /** * 是否启用 */ enabled: boolean; /** * 下次提醒的时间,格式为yyyy-MM-dd HH:mm */ nextRemindTime: string; /** * 下次提醒时间的中文 */ nextRemindTimeCHS: string; } /** * 提醒时间 * 为了支持多个时间点提醒,将时间存成数组 */ export interface RemindTime { /** * 重复类型 * single: 一次性 * daily: 每天 * weekly: 每周 * monthly: 每月 * yearly: 每年 * workday: 工作日 * holiday: 节假日 */ frequency: | "single" | "daily" | "weekly" | "monthly" | "yearly" | "workday" | "holiday"; /** * 提醒时间,格式为HH:mm, single类型时仅作展示用,类型为yyyy-MM-dd HH:mm */ time: string; /** * 星期几[1-7],当frequency为weekly时有效 */ daysOfWeek: number[]; /** * 每月的几号[1-31],当frequency为monthly时有效 */ daysOfMonth: number[]; /** * 每年的哪天提醒,当frequency为 yearly 时有效,格式为MM-dd */ dayOfYear: string; } /** * 提醒记录 * 记录提醒时间,回答结果等 */ export interface RemindRecord { /** * 记录Id */ id: string; /** * 关联的提醒Id */ remindId: string; /** * 发送的卡片Id */ messageId: string; /** * 提醒状态 * pending: 待确认 * delay: 已延迟 * confirmed: 已确认 * canceled: 已取消 */ status: "pending" | "delayed" | "confirmed" | "canceled"; /** * 本次提醒时间,格式为yyyy-MM-dd HH:mm */ remindTime: string; /** * 用户交互的时间,格式为yyyy-MM-dd HH:mm */ interactTime: string; /** * 用户回答的结果,类似每天 07:00 */ result: object; }