org.yes.tools.generator.controller.ProjectController Maven / Gradle / Ivy
package org.yes.tools.generator.controller;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.yes.tools.core.result.CommonResult;
import org.yes.tools.generator.io.ProjectIo;
import org.yes.tools.generator.model.ProjectItemModel;
import org.yes.tools.generator.model.ProjectModel;
import java.util.List;
/**
* @author Co.
* @name ProjectController
* @date 2023/4/3 23:04
*/
@Tag(name = "项目管理")
@RestController(value = "generatorProjectController")
public class ProjectController {
@Autowired
private ProjectIo projectIo;
@Operation(summary = "获取项目列表")
@GetMapping("api/project/getList")
public CommonResult> getProjectList() {
List list = projectIo.getList();
return CommonResult.success(list);
}
@Operation(summary = "保存项目")
@PostMapping("api/project/saveProject")
public CommonResult saveProject(@RequestBody ProjectModel model) {
Boolean aBoolean = projectIo.saveProject(model);
return CommonResult.success(aBoolean);
}
@Operation(summary = "查询项目详情")
@GetMapping("api/project/getProjectDtl")
public CommonResult getProjectDtl(@RequestParam("id") String id) {
ProjectModel projectDtl = projectIo.getProjectDtl(id);
return CommonResult.success(projectDtl);
}
@Operation(summary = "修改项目")
@PostMapping("api/project/modifyProject")
public CommonResult modifyProject(@RequestBody ProjectModel model) {
Boolean aBoolean = projectIo.modifyProject(model);
return CommonResult.success(aBoolean);
}
@Operation(summary = "获取项目项列表")
@GetMapping("api/project/getItemList")
public CommonResult> getItemList(@RequestParam("id") String id) {
List itemList = projectIo.getItemList(id);
return CommonResult.success(itemList);
}
@Operation(summary = "保存项目项")
@PostMapping("api/project/saveProjectItem")
public CommonResult saveProjectItem(@RequestBody ProjectItemModel model) {
Boolean aBoolean = projectIo.saveProjectItem(model);
return CommonResult.success(aBoolean);
}
@Operation(summary = "查询项目项详情")
@GetMapping("api/project/getProjectItemDtl")
public CommonResult getProjectItemDtl(@RequestParam("id") String id) {
ProjectItemModel projectItemDtl = projectIo.getProjectItemDtl(id);
return CommonResult.success(projectItemDtl);
}
@Operation(summary = "修改项目项")
@PostMapping("api/project/modifyProjectItem")
public CommonResult modifyProjectItem(@RequestBody ProjectItemModel model) {
Boolean aBoolean = projectIo.modifyProjectItem(model);
return CommonResult.success(aBoolean);
}
}