use of com.albedo.java.modules.sys.domain.dto.GenSchemeDto in project albedo by somowhere.
the class SchemeResource method genCode.
@LogOperate(value = "方案生成代码")
@PutMapping(value = "/gen-code")
@PreAuthorize("@pms.hasPermission('gen_scheme_code')")
public Result genCode(@Valid @RequestBody GenCodeDto genCodeDto) {
SchemeDto genSchemeDto = schemeService.getOneDto(genCodeDto.getId());
ArgumentAssert.notNull(genSchemeDto, "无法获取代码生成方案信息");
genSchemeDto.setReplaceFile(genCodeDto.getReplaceFile());
schemeService.generateCode(genSchemeDto);
return Result.buildOk("生成", genSchemeDto.getName(), "代码成功");
}
use of com.albedo.java.modules.sys.domain.dto.GenSchemeDto in project albedo by somowhere.
the class SchemeResource method genMenu.
@LogOperate(value = "生成方案编辑")
@PostMapping("/gen-menu")
@PreAuthorize("@pms.hasPermission('gen_scheme_menu')")
public Result genMenu(@Valid @RequestBody SchemeGenDto schemeGenDto) {
SchemeDto schemeDto = schemeService.getOneDto(schemeGenDto.getId());
TableDto tableDto = schemeDto.getTableDto();
if (tableDto == null) {
tableDto = tableService.getOneDto(schemeDto.getTableId());
}
String url = StringUtil.toAppendStr(StringUtil.SLASH, StringUtil.lowerCase(schemeDto.getModuleName()), (StringUtil.isNotBlank(schemeDto.getSubModuleName()) ? StringUtil.SLASH + StringUtil.lowerCase(schemeDto.getSubModuleName()) : ""), StringUtil.SLASH, StringUtil.toRevertCamelCase(StringUtil.lowerFirst(tableDto.getClassName()), CharUtil.DASHED), StringUtil.SLASH);
menuService.saveByGenScheme(new GenSchemeDto(schemeDto.getName(), schemeGenDto.getParentMenuId(), url, tableDto.getClassName()));
return Result.buildOk("生成", schemeDto.getName(), "菜单成功");
}
Aggregations