test: freeze wechat surface contract
This commit is contained in:
@@ -0,0 +1,75 @@
|
||||
package com.hyzq.boss;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public final class WechatSurfaceMapper {
|
||||
private static final List<String> ROOT_ME_MENU_TITLES = Arrays.asList(
|
||||
"账号与安全",
|
||||
"AI 账号",
|
||||
"设置",
|
||||
"技能",
|
||||
"关于"
|
||||
);
|
||||
|
||||
private static final List<String> PROJECT_QUICK_ACTIONS = Arrays.asList(
|
||||
"项目目标",
|
||||
"版本记录"
|
||||
);
|
||||
|
||||
private WechatSurfaceMapper() {
|
||||
}
|
||||
|
||||
public static ConversationRow toConversationRow(
|
||||
String title,
|
||||
String preview,
|
||||
String timeLabel,
|
||||
int unreadCount
|
||||
) {
|
||||
return new ConversationRow(title, preview, timeLabel, unreadCount);
|
||||
}
|
||||
|
||||
public static DeviceRow toDeviceRow(String title, boolean online, String account) {
|
||||
return new DeviceRow(title, buildSubtitle(online, account));
|
||||
}
|
||||
|
||||
public static String[] rootMeMenuTitles() {
|
||||
return ROOT_ME_MENU_TITLES.toArray(new String[0]);
|
||||
}
|
||||
|
||||
public static String[] projectQuickActions() {
|
||||
return PROJECT_QUICK_ACTIONS.toArray(new String[0]);
|
||||
}
|
||||
|
||||
private static String buildSubtitle(boolean online, String account) {
|
||||
String status = online ? "在线" : "离线";
|
||||
if (account == null || account.isEmpty()) {
|
||||
return status;
|
||||
}
|
||||
return status + " · 账号 " + account;
|
||||
}
|
||||
|
||||
public static final class ConversationRow {
|
||||
public final String title;
|
||||
public final String preview;
|
||||
public final String timeLabel;
|
||||
public final int unreadCount;
|
||||
|
||||
public ConversationRow(String title, String preview, String timeLabel, int unreadCount) {
|
||||
this.title = title;
|
||||
this.preview = preview;
|
||||
this.timeLabel = timeLabel;
|
||||
this.unreadCount = unreadCount;
|
||||
}
|
||||
}
|
||||
|
||||
public static final class DeviceRow {
|
||||
public final String title;
|
||||
public final String subtitle;
|
||||
|
||||
public DeviceRow(String title, String subtitle) {
|
||||
this.title = title;
|
||||
this.subtitle = subtitle;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user