Skip to content

Feature/app version #1389

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Application Record API Endpoints
  • Loading branch information
dragonpoo committed Dec 10, 2024
commit e971684d3b0f48c13d04ea2e07ad1e30b0db4f7f
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ private NewUrl() {
public static final String CUSTOM_AUTH = PREFIX + "/auth";
public static final String INVITATION_URL = PREFIX + "/invitation";
public static final String APPLICATION_URL = PREFIX + "/applications";
public static final String APPLICATION_RECORD_URL = PREFIX + "/application-records";

public static final String APPLICATION_HISTORY_URL = PREFIX + "/application/history-snapshots";
public static final String QUERY_URL = PREFIX + "/query";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package org.lowcoder.api.application;

import lombok.RequiredArgsConstructor;
import org.lowcoder.api.framework.view.ResponseView;
import org.lowcoder.api.application.ApplicationRecordApiService;
import org.lowcoder.api.application.view.ApplicationRecordMetaView;
import org.lowcoder.domain.application.model.ApplicationCombineId;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Mono;

import java.util.List;
import java.util.Map;

@RequiredArgsConstructor
@RestController
public class ApplicationRecordController implements ApplicationRecordEndpoints
{
private final ApplicationRecordApiService applicationRecordApiService;

@Override
public Mono<Void> delete(@PathVariable String applicationRecordId) {
return applicationRecordApiService.delete(applicationRecordId);
}

@Override
public Mono<ResponseView<List<ApplicationRecordMetaView>>> getByApplicationId(@RequestParam(name = "applicationId") String applicationId) {
return applicationRecordApiService.getByApplicationId(applicationId)
.map(ResponseView::success);
}

@Override
public Mono<ResponseView<Map<String, Object>>> dslById(@RequestParam(name = "applicationId") String applicationId,
@RequestParam(name = "applicationRecordId") String applicationRecordId) {
ApplicationCombineId applicationCombineId = new ApplicationCombineId(applicationId, applicationRecordId);
return applicationRecordApiService.getRecordDSLFromApplicationCombineId(applicationCombineId)
.map(ResponseView::success);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
package org.lowcoder.api.application;

import io.swagger.v3.oas.annotations.Operation;
import org.lowcoder.api.framework.view.ResponseView;
import org.lowcoder.api.application.view.ApplicationRecordMetaView;
import org.springframework.web.bind.annotation.*;
import reactor.core.publisher.Mono;

import java.util.List;
import java.util.Map;

import static org.lowcoder.infra.constant.NewUrl.APPLICATION_RECORD_URL;

@RestController
@RequestMapping(value = APPLICATION_RECORD_URL)
public interface ApplicationRecordEndpoints
{
public static final String TAG_APPLICATION_RECORDS = "Application Record APIs";

@Operation(
tags = TAG_APPLICATION_RECORDS,
operationId = "deleteApplicationRecord",
summary = "Delete Application Record",
description = "Permanently remove a specific Application Record from Lowcoder using its unique record ID."
)
@DeleteMapping("/{ApplicationRecordId}")
public Mono<Void> delete(@PathVariable String ApplicationRecordId);

@Operation(
tags = TAG_APPLICATION_RECORDS,
operationId = "getApplicationRecord",
summary = "Get Application Record",
description = "Retrieve a specific Application Record within Lowcoder using the associated application ID."
)
@GetMapping("/listByApplicationId")
public Mono<ResponseView<List<ApplicationRecordMetaView>>> getByApplicationId(@RequestParam(name = "ApplicationId") String ApplicationId);

@Operation(
tags = TAG_APPLICATION_RECORDS,
operationId = "listApplicationRecords",
summary = "Get Application Records",
description = "Retrieve a list of Application Records, which store information related to executed queries within Lowcoder and the current Organization / Workspace by the impersonated User"
)
@GetMapping
public Mono<ResponseView<Map<String, Object>>> dslById(@RequestParam(name = "ApplicationId") String ApplicationId,
@RequestParam(name = "ApplicationRecordId") String ApplicationRecordId);

}