feat: 新增追问模式和iOS本地化,重构后端输出模型
This commit is contained in:
@@ -60,6 +60,7 @@ class DivinationRunAggregate {
|
||||
required this.advice,
|
||||
required this.keywords,
|
||||
required this.answer,
|
||||
this.status = DivinationRunStatus.success,
|
||||
});
|
||||
|
||||
final DerivedDivinationData derived;
|
||||
@@ -70,6 +71,7 @@ class DivinationRunAggregate {
|
||||
final List<String> advice;
|
||||
final List<String> keywords;
|
||||
final String answer;
|
||||
final DivinationRunStatus status;
|
||||
|
||||
DivinationResultData toViewData(DivinationParams params) {
|
||||
return DivinationResultData(
|
||||
@@ -84,9 +86,9 @@ class DivinationRunAggregate {
|
||||
signType: signLevel,
|
||||
keywords: keywords.join('、'),
|
||||
focusPoints: focusPoints,
|
||||
conclusion: _asBullet(conclusion),
|
||||
conclusion: conclusion.join('\n'),
|
||||
analysis: answer,
|
||||
suggestion: _asBullet(advice),
|
||||
suggestion: advice.join('\n'),
|
||||
ganzhi: GanzhiData(
|
||||
yearGanZhi: derived.ganzhi.yearGanZhi,
|
||||
monthGanZhi: derived.ganzhi.monthGanZhi,
|
||||
@@ -108,19 +110,9 @@ class DivinationRunAggregate {
|
||||
targetYaoLines: derived.targetYaoInfoList
|
||||
.map((line) => line.toViewModel())
|
||||
.toList(growable: false),
|
||||
status: status,
|
||||
);
|
||||
}
|
||||
|
||||
String _asBullet(List<String> lines) {
|
||||
if (lines.isEmpty) {
|
||||
return '';
|
||||
}
|
||||
return List<String>.generate(
|
||||
lines.length,
|
||||
(i) => '${i + 1}. ${lines[i]}',
|
||||
growable: false,
|
||||
).join('\n');
|
||||
}
|
||||
}
|
||||
|
||||
class DerivedDivinationData {
|
||||
|
||||
Reference in New Issue
Block a user