Skip to content

Commit ab0bdfd

Browse files
committed
Merge branch 'develop' into 1.1.x
2 parents dccd874 + 207d53b commit ab0bdfd

File tree

8 files changed

+51
-26
lines changed

8 files changed

+51
-26
lines changed

app-builder/jane/plugins/aipp-plugin/src/main/java/modelengine/fit/jober/aipp/converters/impl/AppVersionToTemplateConverter.java

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,26 @@ public Class<AppTemplate> target() {
3636
public AppTemplate convert(Object appVersion) {
3737
return Optional.ofNullable(appVersion)
3838
.map(ObjectUtils::<AppVersion>cast)
39-
.map(s -> AppTemplate.builder()
40-
.id(s.getData().getId())
41-
.name(s.getData().getName())
42-
.builtType(s.getData().getAppBuiltType())
43-
.appType(s.getData().getAppType())
44-
.category(s.getData().getAppCategory())
45-
.attributes(s.getAttributes())
39+
.map(appVersionObj -> AppTemplate.builder()
40+
.id(appVersionObj.getData().getId())
41+
.name(appVersionObj.getData().getName())
42+
.builtType(appVersionObj.getData().getAppBuiltType())
43+
.appType(appVersionObj.getData().getAppType())
44+
.category(appVersionObj.getData().getAppCategory())
45+
.attributes(appVersionObj.getAttributes())
4646
.like(0)
4747
.collection(0)
4848
.usage(0)
4949
.version("1.0.0")
50-
.configId(s.getData().getConfigId())
51-
.flowGraphId(s.getData().getFlowGraphId())
52-
.createBy(s.getData().getCreateBy())
50+
.configId(appVersionObj.getData().getConfigId())
51+
.flowGraphId(appVersionObj.getData().getFlowGraphId())
52+
.createBy(appVersionObj.getData().getCreateBy())
53+
.createAt(appVersionObj.getData().getCreateAt())
54+
.updateBy(appVersionObj.getData().getUpdateBy())
55+
.updateAt(appVersionObj.getData().getUpdateAt())
56+
.config(appVersionObj.getConfig())
57+
.flowGraph(appVersionObj.getFlowGraph())
58+
.formProperties(appVersionObj.getFormProperties())
5359
.build())
5460
.orElse(null);
5561
}

app-builder/jane/plugins/aipp-plugin/src/main/java/modelengine/fit/jober/aipp/domains/appversion/AppVersion.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -771,10 +771,7 @@ public TemplateInfoDto publishTemplate(TemplateAppCreateDto createDto, Operation
771771
this.data.setAppId(newAppID);
772772

773773
// 只保留模板相关的属性.
774-
this.attributes = this.attributes.entrySet()
775-
.stream()
776-
.filter(e -> TEMPLATE_DEFAULT_ATTRIBUTE_KEYS.contains(e.getKey()))
777-
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
774+
this.attributes.keySet().retainAll(TEMPLATE_DEFAULT_ATTRIBUTE_KEYS);
778775

779776
// 创建参数设置.
780777
if (createDto != null) {
@@ -806,6 +803,7 @@ public TemplateInfoDto publishTemplate(TemplateAppCreateDto createDto, Operation
806803
graph.setUpdateAt(now);
807804

808805
AppTemplate template = this.converterFactory.convert(this, AppTemplate.class);
806+
this.templateFactory.setRepositories(template);
809807
this.templateFactory.save(template);
810808
String icon = this.getIcon();
811809
if (StringUtils.isNotBlank(icon)) {

app-builder/jane/plugins/aipp-plugin/src/main/java/modelengine/fit/jober/aipp/domains/appversion/service/impl/AppVersionServiceImpl.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,10 @@ public AppVersion createByTemplate(AppTemplate template, OperationContext contex
237237
AppVersion appVersion = this.appVersionFactory.create(new AppBuilderAppPo(), this.repository);
238238
appVersion.getData().setConfigId(template.getConfigId());
239239
appVersion.getData().setFlowGraphId(template.getFlowGraphId());
240+
appVersion.getData().setId(template.getId());
240241
appVersion.cloneVersion(TemplateUtils.toAppCreateDTO(template), DEFAULT_APP_VERSION, AppTypeEnum.APP.name(),
241242
context);
243+
appVersion.getData().setState(AppState.INACTIVE.getName());
242244
this.save(appVersion);
243245
return appVersion;
244246
}

app-builder/jane/plugins/aipp-plugin/src/main/java/modelengine/fit/jober/aipp/mapper/AppBuilderAppTypeMapper.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
package modelengine.fit.jober.aipp.mapper;
88

9+
import modelengine.fit.jober.aipp.aop.Locale;
910
import modelengine.fit.jober.aipp.po.AppBuilderAppTypePo;
1011

1112
import java.util.List;
@@ -23,6 +24,7 @@ public interface AppBuilderAppTypeMapper {
2324
* @param tenantId 表示租户唯一标识的 {@link String}。
2425
* @return 表示分类列表的 {@link List}{@code <}{@link AppBuilderAppTypePo}{@code >}。
2526
*/
27+
@Locale
2628
List<AppBuilderAppTypePo> queryAll(String tenantId);
2729

2830
/**
@@ -54,5 +56,6 @@ public interface AppBuilderAppTypeMapper {
5456
* @param tenantId 表示租户唯一标识的 {@link String}。
5557
* @return 表示应用分类信息的 {@link AppBuilderAppTypePo}。
5658
*/
59+
@Locale
5760
AppBuilderAppTypePo query(String id, String tenantId);
5861
}

app-builder/jane/plugins/aipp-plugin/src/main/java/modelengine/fit/jober/aipp/util/TemplateUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public static AppBuilderApp convertToAppBuilderApp(AppTemplate template) {
9595
.name(template.getName())
9696
.configId(template.getConfigId())
9797
.flowGraphId(template.getFlowGraphId())
98-
.type(AppTypeEnum.TEMPLATE.code())
98+
.type(AppTypeEnum.APP.code())
9999
.appType(template.getAppType())
100100
.version(INIT_VERSION)
101101
.attributes(template.getAttributes())

app-builder/jane/plugins/aipp-plugin/src/main/resources/sql/data/appbuilder_insert.sql

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -175,14 +175,14 @@ VALUES ('c6a2d574ccfb46754hb9de3ac88ef199', 'form_property_opening_content', 'zh
175175

176176
INSERT INTO aipp_system_config(config_key, config_value, config_group, config_parent) VALUES ('system', '{"template": "You ara a prompt generator, Your job is to generate prompt from the input of the user.\n\nThe Prompt must follow the style of the example below:\n\n###\ninput:\n生活助手\n\noutput:\n角色:你是一个智能生活助手。\n背景:作为一款集成多种智能功能的应用程序,你需要熟悉各种智能家居设备、日程安排、健康数据等相关知识。\n技能:智能家居控制照明、温控、安防、日程管理(提醒、安排等)、健康监测(睡眠、运行、饮食等)、信息查询、语音交互等。\n目标:为用户提供便捷。\n限制:你可以访问用户的智能家居设备、日历、健康数据等相关信息,并根据需要进行协作和响应。\n###\n\n**DO NOT GENERATE ANY OTHER CONTENT EXCEPT OF THE PROMPT TEMPLATE**\n\ninput: {{input}}"}', 'template', NULL) ON CONFLICT (config_group, config_key) DO NOTHING;
177177

178-
INSERT INTO "app_builder_app_type" VALUES ('4db152b24f94473ab683b1acbfe3c865', '通用', '31f20efc7e0848deab6a6bc10fc3021e', '2025-01-16 17:26:11.275326', '2025-01-16 17:26:11.275326') ON CONFLICT (id) DO NOTHING;
179-
INSERT INTO "app_builder_app_type" VALUES ('ad7fca4851394495a90723eb6bcd6141', '文章写作', '31f20efc7e0848deab6a6bc10fc3021e', '2025-01-16 17:26:53.880531', '2025-01-16 17:26:53.880531') ON CONFLICT (id) DO NOTHING;
180-
INSERT INTO "app_builder_app_type" VALUES ('099201eaee2346a7bffd76bbdbfb0c7e', '编程开发', '31f20efc7e0848deab6a6bc10fc3021e', '2025-01-16 17:27:02.607163', '2025-01-16 17:27:02.607163') ON CONFLICT (id) DO NOTHING;
181-
INSERT INTO "app_builder_app_type" VALUES ('19301209cff644e0bed7aede966226fa', '金融问数', '31f20efc7e0848deab6a6bc10fc3021e', '2025-01-16 17:27:15.121579', '2025-01-16 17:27:15.121579') ON CONFLICT (id) DO NOTHING;
182-
INSERT INTO "app_builder_app_type" VALUES ('dadb32e11d0f49c8b3b2b3b78f32adcb', '知识问答', '31f20efc7e0848deab6a6bc10fc3021e', '2025-01-16 17:27:24.408541', '2025-01-16 17:27:24.408541') ON CONFLICT (id) DO NOTHING;
183-
INSERT INTO "app_builder_app_type" VALUES ('bfce7a4f00ea464ca85b1bd691ffe774', '数字人', '31f20efc7e0848deab6a6bc10fc3021e', '2025-01-16 17:27:31.439755', '2025-01-16 17:27:31.439755') ON CONFLICT (id) DO NOTHING;
184-
INSERT INTO "app_builder_app_type" VALUES ('b653edb7eb5a49be91abcd2c5877c6ad', '办公效率', '31f20efc7e0848deab6a6bc10fc3021e', '2025-01-16 17:27:40.941004', '2025-01-16 17:27:40.941004') ON CONFLICT (id) DO NOTHING;
185-
INSERT INTO "app_builder_app_type" VALUES ('6cca24416a05436390e0a96712a4294e', '企业管理', '31f20efc7e0848deab6a6bc10fc3021e', '2025-01-16 17:27:50.566101', '2025-01-16 17:27:50.566101') ON CONFLICT (id) DO NOTHING;
178+
INSERT INTO "app_builder_app_type" VALUES ('4db152b24f94473ab683b1acbfe3c865', 'i18n_appBuilder_{app_type_universal}', '31f20efc7e0848deab6a6bc10fc3021e', '2025-01-16 17:26:11.275326', '2025-01-16 17:26:11.275326') ON CONFLICT (id) DO NOTHING;
179+
INSERT INTO "app_builder_app_type" VALUES ('ad7fca4851394495a90723eb6bcd6141', 'i18n_appBuilder_{article_writing}', '31f20efc7e0848deab6a6bc10fc3021e', '2025-01-16 17:26:53.880531', '2025-01-16 17:26:53.880531') ON CONFLICT (id) DO NOTHING;
180+
INSERT INTO "app_builder_app_type" VALUES ('099201eaee2346a7bffd76bbdbfb0c7e', 'i18n_appBuilder_{programming_development}', '31f20efc7e0848deab6a6bc10fc3021e', '2025-01-16 17:27:02.607163', '2025-01-16 17:27:02.607163') ON CONFLICT (id) DO NOTHING;
181+
INSERT INTO "app_builder_app_type" VALUES ('19301209cff644e0bed7aede966226fa', 'i18n_appBuilder_{financial_question}', '31f20efc7e0848deab6a6bc10fc3021e', '2025-01-16 17:27:15.121579', '2025-01-16 17:27:15.121579') ON CONFLICT (id) DO NOTHING;
182+
INSERT INTO "app_builder_app_type" VALUES ('dadb32e11d0f49c8b3b2b3b78f32adcb', 'i18n_appBuilder_{knowledge_quiz}', '31f20efc7e0848deab6a6bc10fc3021e', '2025-01-16 17:27:24.408541', '2025-01-16 17:27:24.408541') ON CONFLICT (id) DO NOTHING;
183+
INSERT INTO "app_builder_app_type" VALUES ('bfce7a4f00ea464ca85b1bd691ffe774', 'i18n_appBuilder_{digital_human}', '31f20efc7e0848deab6a6bc10fc3021e', '2025-01-16 17:27:31.439755', '2025-01-16 17:27:31.439755') ON CONFLICT (id) DO NOTHING;
184+
INSERT INTO "app_builder_app_type" VALUES ('b653edb7eb5a49be91abcd2c5877c6ad', 'i18n_appBuilder_{office_efficiency}', '31f20efc7e0848deab6a6bc10fc3021e', '2025-01-16 17:27:40.941004', '2025-01-16 17:27:40.941004') ON CONFLICT (id) DO NOTHING;
185+
INSERT INTO "app_builder_app_type" VALUES ('6cca24416a05436390e0a96712a4294e', 'i18n_appBuilder_{enterprise_management}', '31f20efc7e0848deab6a6bc10fc3021e', '2025-01-16 17:27:50.566101', '2025-01-16 17:27:50.566101') ON CONFLICT (id) DO NOTHING;
186186

187187
INSERT INTO "public"."i18n" ("id", "key", "language", "value") VALUES ('c6a2d574ccfb4687a8b9de3ac88ef1e3', 'semantic_search', 'en', 'Semantic search') ON CONFLICT (id) DO NOTHING;
188188
INSERT INTO "public"."i18n" ("id", "key", "language", "value") VALUES ('c6a2d574ccfb4687a8b9de3ac88ef1e2', 'semantic_search', 'zh', '语义检索') ON CONFLICT (id) DO NOTHING;
@@ -192,4 +192,20 @@ INSERT INTO "public"."i18n" ("id", "key", "language", "value") VALUES ('b50fdc44
192192
INSERT INTO "public"."i18n" ("id", "key", "language", "value") VALUES ('c7f2755446714877b5be0d6a167386d1', 'question_displayName', 'zh', '用户问题') ON CONFLICT (id) DO NOTHING;
193193
INSERT INTO "public"."i18n" ("id", "key", "language", "value") VALUES ('1fb34511fc3e4836908fa7b7539e840d', 'question_displayName', 'en', 'userQuestion') ON CONFLICT (id) DO NOTHING;
194194
INSERT INTO "public"."i18n" ("id", "key", "language", "value") VALUES ('8d1d888d9735436fb673bdbd3cc57316', 'form_property_multimodal', 'zh', '多模态') ON CONFLICT (id) DO NOTHING;
195-
INSERT INTO "public"."i18n" ("id", "key", "language", "value") VALUES ('380cb868c716469ab7e79ed1155957ae', 'form_property_multimodal', 'en', 'Multimodal') ON CONFLICT (id) DO NOTHING;
195+
INSERT INTO "public"."i18n" ("id", "key", "language", "value") VALUES ('380cb868c716469ab7e79ed1155957ae', 'form_property_multimodal', 'en', 'Multimodal') ON CONFLICT (id) DO NOTHING;
196+
INSERT INTO "public"."i18n" ("id", "key", "language", "value") VALUES ('efc7224a05624148a119e75e152974c6', 'app_type_universal', 'zh', '通用');
197+
INSERT INTO "public"."i18n" ("id", "key", "language", "value") VALUES ('bb81bb533c094de482ea57dc2584e191', 'app_type_universal', 'en', 'universal');
198+
INSERT INTO "public"."i18n" ("id", "key", "language", "value") VALUES ('decaa34431e54df48d61253466514387', 'article_writing', 'zh', '文章写作');
199+
INSERT INTO "public"."i18n" ("id", "key", "language", "value") VALUES ('33734c7dbc5b480f925767b32de826b5', 'article_writing', 'en', 'article writing');
200+
INSERT INTO "public"."i18n" ("id", "key", "language", "value") VALUES ('58bab8275c8b46bfb81b79a0cf6e2243', 'programming_development', 'zh', '编程开发');
201+
INSERT INTO "public"."i18n" ("id", "key", "language", "value") VALUES ('c40ceef39e814315a0428bb184477c5a', 'programming_development', 'en', 'programming development');
202+
INSERT INTO "public"."i18n" ("id", "key", "language", "value") VALUES ('cc97faeeed8843f4a6e9e8eea36e7332', 'financial_question', 'zh', '金融问数');
203+
INSERT INTO "public"."i18n" ("id", "key", "language", "value") VALUES ('e4871761953f4369b9b82a3a2e2bc51d', 'financial_question', 'en', 'financial question');
204+
INSERT INTO "public"."i18n" ("id", "key", "language", "value") VALUES ('757b848d824e4df680e072b01497f1be', 'knowledge_quiz', 'zh', '知识问答');
205+
INSERT INTO "public"."i18n" ("id", "key", "language", "value") VALUES ('60d2738e56304682ae120249d9bca1be', 'knowledge_quiz', 'en', 'knowledge quiz');
206+
INSERT INTO "public"."i18n" ("id", "key", "language", "value") VALUES ('09241915a2be47a990ef905491301469', 'digital_human', 'zh', '数字人');
207+
INSERT INTO "public"."i18n" ("id", "key", "language", "value") VALUES ('505ccb7ac74a408fbfb987700cce6cd1', 'digital_human', 'en', 'digital human');
208+
INSERT INTO "public"."i18n" ("id", "key", "language", "value") VALUES ('2e8460108df64a508fb623b2e36fbef7', 'office_efficiency', 'zh', '办公效率');
209+
INSERT INTO "public"."i18n" ("id", "key", "language", "value") VALUES ('d0e180e87521400b83d11fd15685dc68', 'office_efficiency', 'en', 'office efficiency');
210+
INSERT INTO "public"."i18n" ("id", "key", "language", "value") VALUES ('ee61116fffe149b0b3912d88144a1390', 'enterprise_management', 'zh', '企业管理');
211+
INSERT INTO "public"."i18n" ("id", "key", "language", "value") VALUES ('46857145df974a73a97e5a45eb5d2a42', 'enterprise_management', 'en', 'enterprise management');

app-builder/jane/plugins/aipp-plugin/src/test/java/modelengine/fit/jober/aipp/util/TemplateUtilsTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,6 @@ void testAppTemplateConvertToAppBuilderApp() {
5454
assertThat(app).extracting(AppBuilderApp::getId,
5555
AppBuilderApp::getVersion,
5656
AppBuilderApp::getState,
57-
AppBuilderApp::getType).containsExactly("123456789", "1.0.0", "inactive", "template");
57+
AppBuilderApp::getType).containsExactly("123456789", "1.0.0", "inactive", "app");
5858
}
5959
}

app-engine/frontend/src/pages/chatPreview/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ const ChatPreview = (props) => {
487487
idx = listRef.current.length;
488488
} else {
489489
if (!extensions.isEnableLog && !listRef.current[idx].step) {
490-
initObj.content ? null : initObj.content = listRef.current[idx].content;
490+
initObj.content = listRef.current[idx].content;
491491
}
492492
}
493493
}

0 commit comments

Comments
 (0)