2025-03-16 13:09:50 +08:00
|
|
|
package com.ai.da.controller;
|
|
|
|
|
|
2025-06-30 15:11:31 +08:00
|
|
|
import com.ai.da.common.config.MyTaskScheduler;
|
2025-03-16 13:09:50 +08:00
|
|
|
import com.ai.da.common.response.PageBaseResponse;
|
|
|
|
|
import com.ai.da.common.response.Response;
|
2025-03-30 15:56:03 +08:00
|
|
|
import com.ai.da.model.dto.*;
|
2025-03-16 13:09:50 +08:00
|
|
|
import com.ai.da.model.vo.*;
|
2025-06-30 15:11:31 +08:00
|
|
|
import com.ai.da.service.ProjectService;
|
2025-03-16 13:09:50 +08:00
|
|
|
import com.ai.da.service.UserLikeGroupService;
|
|
|
|
|
import com.ai.da.service.WorkspaceService;
|
|
|
|
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
2025-03-30 15:56:03 +08:00
|
|
|
import io.minio.errors.MinioException;
|
2025-03-16 13:09:50 +08:00
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
2025-03-30 15:56:03 +08:00
|
|
|
import org.springframework.web.bind.annotation.*;
|
2025-03-16 13:09:50 +08:00
|
|
|
|
2025-11-25 16:46:05 +08:00
|
|
|
import jakarta.annotation.Resource;
|
|
|
|
|
import jakarta.servlet.http.HttpServletResponse;
|
|
|
|
|
import jakarta.validation.Valid;
|
2025-03-30 15:56:03 +08:00
|
|
|
import java.io.IOException;
|
2025-03-16 13:09:50 +08:00
|
|
|
|
|
|
|
|
@Api(tags = "Project模块")
|
|
|
|
|
@Slf4j
|
|
|
|
|
@RestController
|
|
|
|
|
@RequestMapping("/api/project")
|
|
|
|
|
public class ProjectController {
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private WorkspaceService workspaceService;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private UserLikeGroupService userLikeGroupService;
|
|
|
|
|
|
2025-06-30 15:11:31 +08:00
|
|
|
@Resource
|
|
|
|
|
private ProjectService projectService;
|
|
|
|
|
|
2025-03-16 13:09:50 +08:00
|
|
|
@PostMapping("/saveOrUpdate")
|
|
|
|
|
@ApiOperationSupport(order = 1)
|
|
|
|
|
@ApiOperation(value = "新增或编辑", notes = "传入project")
|
2025-03-19 10:51:15 +08:00
|
|
|
public Response<SaveOrUpdateProjectVO> saveOrUpdateProject(@Valid @RequestBody ProjectDTO projectDTO) {
|
2025-03-16 13:09:50 +08:00
|
|
|
return Response.success(workspaceService.saveOrUpdateProject(projectDTO));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@PostMapping("/page")
|
|
|
|
|
@ApiOperationSupport(order = 2)
|
|
|
|
|
@ApiOperation(value = "分页查询", notes = "传入project")
|
|
|
|
|
public Response<PageBaseResponse<ProjectVO>> page(@Valid @RequestBody ProjectQueryDTO projectQueryDTO) {
|
|
|
|
|
return Response.success(PageBaseResponse.success(userLikeGroupService.getPage(projectQueryDTO)));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// @PostMapping("/detail")
|
|
|
|
|
// @ApiOperationSupport(order = 3)
|
|
|
|
|
// @ApiOperation(value = "详情", notes = "传入project")
|
|
|
|
|
// public Response saveOrUpdateProject(@Valid @RequestBody ProjectDTO projectDTO) {
|
|
|
|
|
// return Response.success(workspaceService.saveOrUpdateProject(projectDTO));
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
@PostMapping("/choose")
|
|
|
|
|
@ApiOperationSupport(order = 4)
|
|
|
|
|
@ApiOperation(value = "选择", notes = "传入project")
|
|
|
|
|
public Response<ProjectChooseVO> choose(@Valid @RequestBody ProjectDTO projectDTO) {
|
|
|
|
|
return Response.success(userLikeGroupService.choose(projectDTO));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@PostMapping("/getModuleContent")
|
|
|
|
|
@ApiOperationSupport(order = 5)
|
|
|
|
|
@ApiOperation(value = "获取模块内容", notes = "传入project")
|
|
|
|
|
public Response<ModuleChooseVO> getModuleContent(@Valid @RequestBody ProjectDTO projectDTO) {
|
|
|
|
|
return Response.success(userLikeGroupService.getModuleContent(projectDTO));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@PostMapping("/saveModuleContent")
|
|
|
|
|
@ApiOperationSupport(order = 6)
|
|
|
|
|
@ApiOperation(value = "存储模块内容", notes = "传入project")
|
|
|
|
|
public Response<ModuleChooseVO> saveModuleContent(@Valid @RequestBody ModuleSaveDTO moduleSaveDTO) {
|
|
|
|
|
return Response.success(userLikeGroupService.saveModuleContent(moduleSaveDTO));
|
|
|
|
|
}
|
|
|
|
|
//
|
|
|
|
|
// @PostMapping("/delete")
|
|
|
|
|
// @ApiOperationSupport(order = 5)
|
|
|
|
|
// @ApiOperation(value = "删除", notes = "传入project")
|
|
|
|
|
// public Response saveOrUpdateProject(@Valid @RequestBody ProjectDTO projectDTO) {
|
|
|
|
|
// return Response.success(workspaceService.saveOrUpdateProject(projectDTO));
|
|
|
|
|
// }
|
2025-03-18 13:43:59 +08:00
|
|
|
|
|
|
|
|
@PostMapping("/getMannequinDetail")
|
|
|
|
|
@ApiOperationSupport(order = 7)
|
|
|
|
|
@ApiOperation(value = "获取模特详情", notes = "传入mannequinId")
|
2025-03-25 10:51:16 +08:00
|
|
|
public Response<QueryLibraryPageVO> getMannequinDetail(@Valid @RequestBody MannequinDTO mannequinDTO) {
|
2025-03-18 13:43:59 +08:00
|
|
|
return Response.success(userLikeGroupService.getMannequinDetail(mannequinDTO));
|
|
|
|
|
}
|
2025-03-30 15:56:03 +08:00
|
|
|
|
|
|
|
|
@PostMapping("/threeDPage")
|
|
|
|
|
@ApiOperationSupport(order = 8)
|
|
|
|
|
@ApiOperation(value = "获取3Dpage", notes = "传入ThreeDLayoutQueryDTO")
|
|
|
|
|
public Response<PageBaseResponse<ThreeDLayoutVO>> threeDPage(@Valid @RequestBody ThreeDLayoutQueryDTO threeDLayoutQueryDTO) {
|
|
|
|
|
return Response.success(PageBaseResponse.success(userLikeGroupService.getThreeDLayoutPage(threeDLayoutQueryDTO)));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@PostMapping("/getLayoutDetail")
|
|
|
|
|
@ApiOperationSupport(order = 9)
|
|
|
|
|
@ApiOperation(value = "获取3D详情", notes = "传入project")
|
|
|
|
|
public Response<ThreeDVO> getLayoutDetail(@RequestParam(value = "threeDSimpleId") Long threeDSimpleId) {
|
|
|
|
|
return Response.success(userLikeGroupService.getLayoutDetail(threeDSimpleId));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@PostMapping("/getThreeDSize")
|
2025-03-30 23:31:00 +08:00
|
|
|
|
2025-03-30 15:56:03 +08:00
|
|
|
@ApiOperationSupport(order = 10)
|
|
|
|
|
@ApiOperation(value = "获取尺码", notes = "传入project")
|
|
|
|
|
public Response<ThreeDSizeVO> getThreeDSize(@RequestParam(value = "threeDSimpleId") Long threeDSimpleId) {
|
|
|
|
|
return Response.success(userLikeGroupService.getThreeDSize(threeDSimpleId));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@GetMapping("/getThreeDGlb")
|
|
|
|
|
@ApiOperationSupport(order = 11)
|
|
|
|
|
@ApiOperation(value = "获取GLB", notes = "传入project")
|
|
|
|
|
public void getThreeDGlb(@RequestParam(value = "threeDSimpleId") Long threeDSimpleId, HttpServletResponse response) throws MinioException, IOException {
|
|
|
|
|
userLikeGroupService.getThreeDGlb(threeDSimpleId, response);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@GetMapping("/downloadZip")
|
|
|
|
|
@ApiOperationSupport(order = 11)
|
|
|
|
|
@ApiOperation(value = "下载", notes = "传入project")
|
2025-04-08 11:09:28 +08:00
|
|
|
public Response<String> downloadZip(@RequestParam(value = "threeDSimpleId") Long threeDSimpleId, @RequestParam(value = "sizeType") String sizeType, @RequestParam(value = "size") String size, HttpServletResponse response) throws MinioException, IOException {
|
|
|
|
|
return Response.success(userLikeGroupService.downloadZip(threeDSimpleId, sizeType, size, response));
|
2025-03-30 15:56:03 +08:00
|
|
|
}
|
2025-03-31 15:02:44 +08:00
|
|
|
|
|
|
|
|
@PostMapping("/delete")
|
|
|
|
|
@ApiOperationSupport(order = 12)
|
|
|
|
|
@ApiOperation(value = "删除", notes = "传入project")
|
|
|
|
|
public Response<Boolean> delete(@RequestParam("projectId") Long projectId) {
|
|
|
|
|
return Response.success(userLikeGroupService.delete(projectId));
|
|
|
|
|
}
|
2025-06-30 15:11:31 +08:00
|
|
|
|
|
|
|
|
|
2025-09-02 20:09:37 +08:00
|
|
|
@Resource
|
2025-06-30 15:11:31 +08:00
|
|
|
private MyTaskScheduler myTaskScheduler;
|
|
|
|
|
|
2025-09-02 20:09:37 +08:00
|
|
|
/*@GetMapping("/dataMigration")
|
2025-06-30 15:11:31 +08:00
|
|
|
public String dataMigration(){
|
|
|
|
|
myTaskScheduler.projectDataCreate();
|
|
|
|
|
return "success";
|
|
|
|
|
}*/
|
|
|
|
|
|
|
|
|
|
@GetMapping("/getNextSequence")
|
|
|
|
|
public Response<Integer> getNextSequence(){
|
2025-07-02 16:16:15 +08:00
|
|
|
return Response.success(projectService.getOrCreateSequence());
|
2025-06-30 15:11:31 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2025-03-16 13:09:50 +08:00
|
|
|
}
|