Skip to content

[app-builder] 多版本和结构优化#210

Merged
CodeCasterX merged 1 commit intoModelEngine-Group:developfrom
wuayee:appbuilder-enhancement-multi-version-wzc
Jun 5, 2025
Merged

[app-builder] 多版本和结构优化#210
CodeCasterX merged 1 commit intoModelEngine-Group:developfrom
wuayee:appbuilder-enhancement-multi-version-wzc

Conversation

@wuayee
Copy link
Copy Markdown
Contributor

@wuayee wuayee commented May 29, 2025

  1. 修改应用多版本内部逻辑
  2. 重构部分代码,采用领域开发模式

@wuayee wuayee requested review from a team and XinLi-cyber and removed request for a team May 29, 2025 01:44
@CodeCasterX CodeCasterX self-assigned this May 29, 2025
@CodeCasterX CodeCasterX added in: builder Issues in app-builder modules type: enhancement A general enhancement labels May 29, 2025
@CodeCasterX CodeCasterX added this to Nova May 29, 2025
@CodeCasterX CodeCasterX added this to the 1.1.0 milestone May 29, 2025
@wuayee wuayee force-pushed the appbuilder-enhancement-multi-version-wzc branch 5 times, most recently from 0606e24 to e832097 Compare May 29, 2025 12:42
/**
* 集合是否为空.
*
* @return true/false.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
return的注释无意义

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修改

private List<String> excludeNames;

private String appSuiteId;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
去除无用注释

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修改

private final AppVersionService appVersionService;

/**
* AippFlowController
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
注释无意义

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修改

List<AppBuilderConfigProperty> toAddConfigProperties = properties.stream()
.filter(pd -> StringUtils.isBlank(pd.getId()) || !formPropertyIds.contains(pd.getId()))
.map(propertyDto -> {
AppBuilderFormProperty formProperty = AppBuilderFormProperty.builder()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
建议抽成方法

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修改

.map(AppBuilderFormProperty::getId)
.collect(Collectors.toSet());
List<AppBuilderConfigProperty> toAddConfigProperties = properties.stream()
.filter(pd -> StringUtils.isBlank(pd.getId()) || !formPropertyIds.contains(pd.getId()))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
判断条件较复杂,建议抽取为变量或方法

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修改

*/
public class AppVersion {
private static final Logger LOGGER = Logger.get(AppVersion.class);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
去除无用空行,。整个类都排查下。

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修改

.putQueryAttribute(ATTR_AIPP_TYPE_KEY, AippTypeEnum.NORMAL.type())
.putQueryAttribute(ATTR_META_STATUS_KEY, AippMetaStatusEnum.ACTIVE.getCode())
.build(), context.getOperationContext());
if (!resultSet.isEmpty()) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
建议用collectionUtils,保持风格一致

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resultSet 是对象,不是集合类型,无法使用collectionUtils

* @param context 操作上下文
*/
public void updateFlows(OperationContext context) {
if (this.isUpdated()) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
建议改为卫语句

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修改

this.data.setAppType(createDto.getAppType());
this.setDescription(createDto.getDescription());
String icon = this.getIcon();
if (StringUtils.isNotBlank(icon) && StringUtils.equals(icon, createDto.getIcon())) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
1、改为卫语句
2、判断条件抽取为变量或方法

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. 下面还有其他代码,无法改成卫语句
  2. 已修改

}
}

public void cloneVersion(AppVersion cloneApp) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
public方法缺少注释

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修改

* 查询meta实例。
*
* @param versionId 表示实例所属meta唯一标识的 {@link String}。
* @param filter 表示meta实例过滤器的 {@link MetaInstanceFilter}。
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
参数还再,不应该删除该参数注释

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修改

import modelengine.fit.jober.aipp.entity.ChatSession;

/**
* 应用执行接口.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
中英文注释对应的标点符号需要注意下,中文用句号

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修改

@wuayee wuayee force-pushed the appbuilder-enhancement-multi-version-wzc branch 2 times, most recently from 883f725 to c6fe69e Compare June 4, 2025 06:43
if (context.isApp()) {
return this.appService.publishApp(appData);
}
if (context.isWaterFlow()) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
建议改为卫语句

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修改

private final AppBuilderConfigPropertyRepository configPropertyRepository;
private final AppTaskService appTaskService;
private final AppVersionFactory appVersionFactory;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
删除无用空行

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修改

private Object value;

public MemoryConfig(List<Map<String, Object>> memoryConfigs) {
if (!CollectionUtils.isEmpty(memoryConfigs)) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
建议改为卫语句

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修改

private Boolean enableMemory;
private Object value;

public MemoryConfig(List<Map<String, Object>> memoryConfigs) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
有特殊逻辑的构造函数,建议加上注释

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修改

* @return {@link AppLog} 对象.
*/
public AppLog create(AippInstLog logData) {
if (FORM.name().equals(logData.getLogType())) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
建议用ObjectUtils 保持风格一致

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修改

private List<AppLog> logs;
private List<AppLog> allLogs;

private final TaskInstanceEntity<?> entity;
Copy link
Copy Markdown
Contributor

@XinLi-cyber XinLi-cyber Jun 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

调整下变量顺序

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修改

@CodeCasterX CodeCasterX changed the title [appBuilder] 多版本和结构优化 [app-builder] 多版本和结构优化 Jun 4, 2025
@XinLi-cyber XinLi-cyber force-pushed the appbuilder-enhancement-multi-version-wzc branch from 12edda9 to 96dca45 Compare June 4, 2025 07:32
@wuayee wuayee force-pushed the appbuilder-enhancement-multi-version-wzc branch 2 times, most recently from 5c2626f to 6b8c129 Compare June 5, 2025 01:56
@wuayee wuayee force-pushed the appbuilder-enhancement-multi-version-wzc branch from 6b8c129 to 8ddbefa Compare June 5, 2025 02:38
@CodeCasterX CodeCasterX merged commit ce70c04 into ModelEngine-Group:develop Jun 5, 2025
1 check failed
@github-project-automation github-project-automation bot moved this to Done in Nova Jun 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in: builder Issues in app-builder modules type: enhancement A general enhancement

Projects

Status: Done

4 participants