Add executable business blueprint workflow

This commit is contained in:
王鹏
2026-05-24 13:29:42 +08:00
parent ecdc015c2f
commit 6682a44a43
40 changed files with 4756 additions and 113 deletions

View File

@@ -17,10 +17,12 @@ import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.generator.domain.front.FrontProject;
import com.ruoyi.generator.domain.front.dto.DatabaseDesignResponse;
import com.ruoyi.generator.domain.front.dto.FrontProjectCreateRequest;
import com.ruoyi.generator.domain.front.dto.FrontProjectUpdateRequest;
import com.ruoyi.generator.domain.front.dto.GenerateAppBlueprintRequest;
import com.ruoyi.generator.domain.front.dto.GenerateBusinessBlueprintRequest;
import com.ruoyi.generator.domain.front.dto.GenerateDatabaseRequest;
import com.ruoyi.generator.domain.front.dto.PreviewFileRequest;
import com.ruoyi.generator.service.front.IAiGenerateService;
@@ -52,6 +54,12 @@ public class FrontProjectController extends BaseController
return AjaxResult.success(frontProjectService.listProjects(userId));
}
@GetMapping("/options/modules")
public AjaxResult modules()
{
return AjaxResult.success(frontProjectService.listAvailableModules());
}
@GetMapping("/{projectId}")
public AjaxResult get(@PathVariable Long projectId)
{
@@ -101,12 +109,23 @@ public class FrontProjectController extends BaseController
return success(aiGenerateService.generateAppBlueprint(userId, projectId, request));
}
@PostMapping("/{projectId}/generate-business-blueprint")
public AjaxResult generateBusinessBlueprint(@PathVariable Long projectId, @RequestBody GenerateBusinessBlueprintRequest request)
{
Long userId = SecurityUtils.getUserId();
return success(aiGenerateService.generateBusinessBlueprint(userId, projectId, request));
}
@PostMapping("/{projectId}/preview")
public AjaxResult preview(@PathVariable Long projectId)
{
Long userId = SecurityUtils.getUserId();
FrontProject project = frontProjectService.getProject(userId, projectId);
frontProjectPreviewService.getStructure(userId, projectId, "backend");
frontProjectPreviewService.getStructure(userId, projectId, "frontend");
if (!"0".equals(project.getFrontendEnabled()))
{
frontProjectPreviewService.getStructure(userId, projectId, "frontend");
}
frontProjectPreviewService.getStructure(userId, projectId, "admin_frontend");
return toAjax(frontProjectPreviewService.markPreviewReady(userId, projectId));
}