Skip to content

Commit

Permalink
improve ConfigController.java
Browse files Browse the repository at this point in the history
  • Loading branch information
zzzk1 committed Jan 10, 2024
1 parent 7e84d58 commit f7ea7a0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import org.apache.streampark.common.util.HadoopConfigUtils;
import org.apache.streampark.console.base.domain.RestRequest;
import org.apache.streampark.console.base.domain.RestResponse;
import org.apache.streampark.console.core.entity.Application;
import org.apache.streampark.console.core.entity.ApplicationConfig;
import org.apache.streampark.console.core.service.ApplicationConfigService;

Expand Down Expand Up @@ -72,8 +71,8 @@ public RestResponse list(ApplicationConfig config, RestRequest request) {

@Operation(summary = "List application config histories")
@PostMapping("history")
public RestResponse history(Application application) {
List<ApplicationConfig> history = applicationConfigService.list(application);
public RestResponse history(Long appId) {
List<ApplicationConfig> history = applicationConfigService.list(appId);
return RestResponse.success(history);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,10 @@ public interface ApplicationConfigService extends IService<ApplicationConfig> {
/**
* Retrieves the history of application configurations for a given application.
*
* @param appParam The application for which to retrieve the history.
* @param appId The application for which to retrieve the history.
* @return The list of application configurations representing the history.
*/
List<ApplicationConfig> list(Application appParam);
List<ApplicationConfig> list(Long appId);

/**
* Reads a template from a file or a database.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,14 +211,14 @@ public IPage<ApplicationConfig> getPage(ApplicationConfig config, RestRequest re
}

@Override
public List<ApplicationConfig> list(Application appParam) {
public List<ApplicationConfig> list(Long appId) {
LambdaQueryWrapper<ApplicationConfig> queryWrapper =
new LambdaQueryWrapper<ApplicationConfig>()
.eq(ApplicationConfig::getAppId, appParam.getId())
.eq(ApplicationConfig::getAppId, appId)
.orderByDesc(ApplicationConfig::getVersion);

List<ApplicationConfig> configList = this.baseMapper.selectList(queryWrapper);
fillEffectiveField(appParam.getId(), configList);
fillEffectiveField(appId, configList);
return configList;
}

Expand Down

0 comments on commit f7ea7a0

Please sign in to comment.